/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: #5a1a1a;
    background: linear-gradient(135deg, #fefefe 0%, #fef7f7 100%);
    overflow-x: hidden;
    transition: all 0.3s ease;
    -webkit-text-size-adjust: 100%; /* prevent iOS auto-zoom */
    text-size-adjust: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    line-height: 1.2;
    color: #991b1b;
}

/* Google-level Typography System - 3:2:1 Ratio */
h1.hero-title { 
    font-size: clamp(2.5rem, 3vw, 3.8rem);
    line-height: 1.2;
    margin-bottom: 1rem;
}
.hero-tagline { 
    font-size: clamp(1.1rem, 1.5vw, 1.5rem);
    line-height: 1.5;
    margin-bottom: 2rem;
}
.intro-title, .section-title { 
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    line-height: 1.3;
    margin-bottom: 1rem;
}
.contact-main-title { 
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
    line-height: 1.3;
    margin-bottom: 1rem;
}
.contact-main-text { 
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    line-height: 1.5;
}

/* Google-level Card Typography System */
.interest-card h3 {
    font-size: clamp(1.2rem, 1.5vw, 1.5rem);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.interest-card p {
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.5;
}

/* Prevent text clipping in all cards */
.interest-card, .course-item, .conference-item {
    word-wrap: break-word;
    hyphens: auto;
    overflow-wrap: break-word;
}

/* Container */
/* Google-level Design System - Proportional Scaling */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Respect iPhone safe areas */
.navbar { padding-top: max(env(safe-area-inset-top), 0px); }
.site-footer { padding-bottom: max(env(safe-area-inset-bottom), 2rem); }

/* Page Sections */
.page-section {
    min-height: 100vh;
    padding: 6rem 0 4rem;
    display: flex;
    align-items: center;
    position: relative;
}

/* Seamless transitions between sections */
.page-section:not(:last-child) {
    border-bottom: none;
}

/* Smooth background transitions */
#home {
    background: linear-gradient(135deg, #fefefe 0%, #fef7f7 100%);
}

#education {
    background: linear-gradient(135deg, #fef7f7 0%, #fefefe 100%);
}

#experience {
    background: linear-gradient(135deg, #fefefe 0%, #fef7f7 100%);
}

#posts {
    background: linear-gradient(135deg, #fef7f7 0%, #fefefe 100%);
}

/* ========================================
   LARGE SCREEN LAYOUT LOCK (iMac/MacBook/iPad)
   ======================================== */
@media (min-width: 768px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 24px;
    }

    /* Hero section - Full viewport height, no scroll required */
    .hero {
        min-height: 100vh;              /* Full screen height */
        display: flex !important;
        justify-content: space-between; /* Text left, photo right */
        align-items: center;            /* Vertical centering */
        gap: 2rem;                     /* Balanced spacing */
        grid-template-columns: none !important;
        padding: 2rem;                 /* Safe edge spacing */
        box-sizing: border-box;
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 4vw, 3.5rem);  /* Responsive scaling */
        line-height: 1.2;
        font-weight: 700;
        color: #b91c1c;
        margin-bottom: 0.5rem;         /* Tighter spacing */
    }
    
    .hero-tagline {
        font-size: clamp(1.2rem, 2vw, 1.5rem);  /* Responsive scaling */
        line-height: 1.4;
        font-weight: 500;
        color: #b91c1c;
        margin-bottom: 0.75rem;        /* Tighter spacing */
    }
    
    .hero-intro {
        font-size: clamp(1rem, 1.5vw, 1.2rem);  /* Responsive scaling */
        line-height: 1.6;
        color: #374151;
        margin-bottom: 1.5rem;         /* Keep spacing tight */
    }
    
    .hero-photo {
        width: clamp(220px, 25vw, 360px);  /* Scale with screen */
        border-radius: 12px;
        box-shadow: 0 6px 16px rgba(0,0,0,0.12);
        flex-shrink: 0;
    }

    /* Research interests - Lock 3 columns */
    .section-title {
        font-size: 28px;
        font-weight: 700;
        color: #991b1b;
        text-align: center;
        margin-bottom: 32px;
    }
    
    .interests-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
        justify-items: center;
    }
    
    .card {
        width: 300px;
        padding: 24px;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        text-align: center;
    }
    
    .card-icon {
        font-size: 40px;
        margin-bottom: 16px;
    }
    
    .card-title {
        font-size: 20px;
        font-weight: 600;
        color: #991b1b;
        margin-bottom: 12px;
    }
    
    .card-body {
        font-size: 16px;
        line-height: 1.6;
        color: #374151;
    }
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #991b1b;
}

/* Side Drawer Layout */
.side-drawer-container {
    display: flex;
    min-height: 70vh;
    max-width: 1400px;
    margin: 0 auto;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    background-color: #fefefe;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.left-panel {
    width: 20%;
    min-width: 220px;
    background-color: #f9f9f9;
    border-right: 1px solid #e5e5e5;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 2rem;
}

.page-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #991b1b;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

/* Category/Year Lists */
.category-list,
.year-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item,
.year-item {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: #991b1b;
    border: 1px solid transparent;
}

.category-item:hover,
.year-item:hover {
    background-color: #fef2f2;
    border-color: #dc2626;
}

.category-item.active,
.year-item.active {
    background-color: #dc2626;
    color: white;
}

.category-name,
.year-name {
    font-size: 1rem;
}

.category-icon,
.year-icon {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    font-family: monospace;
}

.category-item.active .category-icon,
.year-item.active .year-icon {
    transform: rotate(90deg);
}

/* Intro Section */
.intro-section {
    margin-bottom: 1.5rem;
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    border: none;
    text-align: center;
    width: 100%;
    max-width: 100%;
}

.intro-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    color: #7f1d1d;
    font-weight: 600;
}

.intro-text {
    font-size: 1.1rem;
    color: #4a5568;
    line-height: 1.7;
    font-weight: 400;
    max-width: 900px;
    text-indent: 2rem;
    margin: 0 auto;
    text-align: justify;
    text-justify: inter-word;
    padding: 0 1rem;
    word-spacing: normal;
    letter-spacing: normal;
    white-space: normal;
}

/* Content Panels */
.content-panel {
    flex: 1;
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.content-panel.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.content-panel.default-content {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transform: translateX(0);
}

.default-message {
    text-align: center;
    color: #6b7280;
}

.default-message h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #4a5568;
}

.content-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

/* Experience Info */
.experience-info {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e5e5;
}

.info-item {
    margin-bottom: 1rem;
}

.info-title {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-family: 'Playfair Display', serif;
}

.info-content {
    font-size: 0.85rem;
    color: #2c2c2c;
    line-height: 1.4;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #dc2626;
    font-weight: 500;
    padding: 1rem 0;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
}

.nav-link:hover,
.nav-link.active {
    color: #991b1b;
    background-color: rgba(220, 38, 38, 0.1);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #dc2626, #ef4444);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Hero Section */
.hero {
    grid-template-columns: 1fr;        /* Single column */
    gap: 1.5rem;                      /* Consistent gap */
    text-align: center;               /* Center alignment */
    place-items: center;              /* Center items */
    min-height: auto;                 /* No forced height */
    padding: 2rem 0;                  /* Proper padding */
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 50%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.hero-tagline {
    font-size: 1.25rem;
    color: #6b1e1e;
    margin-bottom: 2rem;
    font-weight: 500;
    background: linear-gradient(135deg, #7f1d1d, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-intro {
    font-size: 1.1rem;
    color: #4a5568;
    max-width: 600px;
    line-height: 1.7;
    text-align: center;
}

.walden-name {
    color: #991b1b;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    font-size: 1.3em;
    background: linear-gradient(135deg, #991b1b, #dc2626, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(153, 27, 27, 0.1);
    transition: all 0.3s ease;
}

.walden-name:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #dc2626, #ef4444, #f87171);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-email {
    color: #6b7280;
    font-size: 1rem;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Hero Contact Information */
.hero-contact-info {
    margin-top: 2rem;
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.contact-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 1.2rem;
    text-align: center;
}

.hero-contact-info .contact-email {
    color: #6b7280;
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 1rem;
}

.contact-address {
    color: #6b1e1e;
    font-size: 1rem;
    line-height: 1.6;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    text-align: center;
}

.contact-address p {
    margin: 0.3rem 0;
    font-weight: 500;
}

.contact-address p:first-child {
    font-weight: 600;
    color: #991b1b;
    font-size: 1.05rem;
}

.contact-address p:last-child {
    margin-bottom: 0;
}

.hero-image {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Google-level Hero Photo System - Proportional Scaling */
.hero-photo {
    display: block;
    margin: 0 auto;
    width: 380px;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    transition: all 0.3s ease;
    border: 3px solid #e5e7eb;
}

.hero-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.image-placeholder {
    width: 300px;
    height: auto;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 3px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.image-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(59, 130, 246, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.image-placeholder:hover::before {
    transform: translateX(100%);
}

.image-placeholder:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    transform: scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.1), 0 10px 10px -5px rgba(59, 130, 246, 0.04);
}

/* Expandable Panels */
.expandable-panels {
    display: flex;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.expandable-panel {
    flex: 1;
    min-width: 300px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fefefe;
    transition: all 0.3s ease;
}

.expandable-panel:hover {
    border-color: #4a5568;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.panel-header {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #1a1a1a;
}

.panel-header:hover {
    background-color: #f9f9f9;
}

.panel-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #1a1a1a;
}

.panel-icon {
    font-size: 1rem;
    color: #4a5568;
    transition: transform 0.3s ease;
    font-family: monospace;
}

.panel-header.expanded .panel-icon {
    transform: rotate(90deg);
}

.panel-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background-color: #f9f9f9;
}

.panel-content.expanded {
    max-height: 1000px;
    padding: 1.5rem;
}

/* Course Lists */
.course-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
    width: 100%;
    padding: 0;
    contain: layout; /* Prevent layout shifts from affecting this grid */
}

/* Ensure 3 columns on large screens for course lists */
@media (min-width: 900px) {
    .course-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Allow items to span 2 columns on 3-column grid */
    .course-item[style*="grid-column: span 2"] {
        grid-column: span 2;
    }
}

/* Ensure grid-column span works properly for single items */
.course-list:has(.course-item[style*="grid-column: span 2"]:only-child) {
    grid-template-columns: 1fr;
}

/* Fix spacing issues for single course items */
.course-list:has(.course-item:only-child) {
    padding: 0;
}

/* Specific fix for Université de Montréal single item */
#udem-content .course-list:has(.course-item:only-child) {
    min-height: auto;
    padding: 0;
    display: block;
}

#udem-content .course-list:has(.course-item:only-child) .course-item {
    width: 100%;
    margin: 0;
}

.course-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-left: 3px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    min-height: 50px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Fix vertical spacing inside course cards for compact alignment */
.course-item > *:not(:last-child) {
    margin-bottom: 0;
}

.course-item p {
    margin: 0;              /* Remove default <p> margins */
    line-height: 1.3;       /* Keep text readable but compact */
}

/* Style for course role (internship title) */
.course-role {
    font-weight: 500;       /* Slightly bold to connect with course title */
    color: #4a5568;         /* Slightly muted color */
}


/* Compact styling for course items without instructor info */
.course-item:has(.course-instructor:empty) {
    min-height: 40px;
    padding: 0.6rem 1rem;
}

.course-item:not(:has(.course-instructor:not(:empty))) {
    min-height: 40px;
    padding: 0.6rem 1rem;
}

/* Fallback for browsers that don't support :has() */
.course-item .course-instructor:empty {
    display: none;
}

.course-item:has(.course-instructor:empty) .course-name {
    margin-bottom: 0;
}

.course-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(0, 0, 0, 0.02) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

.course-item:hover::before {
    transform: translateX(100%);
}

.course-item:hover {
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left-color: #d1d5db;
}

.course-name {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #991b1b;
    line-height: 1.3;
    flex-grow: 1;
    margin: 0;
    display: block;
    background: linear-gradient(135deg, #991b1b, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.course-instructor {
    font-size: 0.75rem;
    color: #b91c1c;
    font-weight: 500;
    margin: 0;
    display: block;
    line-height: 1.2;
}

.course-instructor a {
    color: #b91c1c;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.course-instructor a:hover {
    color: #7f1d1d;
    border-bottom-color: #7f1d1d;
    transform: translateY(-1px);
}

/* Year Panels for Conferences */
.year-panels {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.year-panels .expandable-panel {
    min-width: 120px;
    flex: 0 0 auto;
}

.year-panels .panel-header {
    padding: 1rem;
    font-size: 1rem;
}

.year-panels .panel-title {
    font-size: 1rem;
    color: #4a5568;
    font-weight: 600;
}

/* Conference Lists */
.conference-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    width: 100%;
    padding: 1rem 0;
}

.conference-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    background-color: #fefefe;
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-height: 100px;
    justify-content: space-between;
}

.conference-item:hover {
    background-color: #fef7f7;
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.1);
}

.conference-name {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #991b1b;
    line-height: 1.4;
    flex-grow: 1;
}

.conference-location {
    font-size: 0.9rem;
    color: #b91c1c;
    margin-top: auto;
}

.conference-name a {
    color: #7f1d1d;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.conference-name a:hover {
    color: #b91c1c;
    border-bottom-color: #b91c1c;
    transform: translateY(-1px);
}

/* Experience Section */
.experience-sections {
    max-width: 1000px;
    margin: 0 auto;
}

.experience-subsection {
    margin-bottom: 3rem;
}

.subsection-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.subsection-content {
    color: #2c2c2c;
    font-size: 1.1rem;
}


/* Posts Section */
#posts {
    position: relative;
    padding-bottom: 0;
    margin-bottom: 0;
}

.posts-tabs {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.tab-button {
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 500;
    color: #6b7280;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.tab-button:hover,
.tab-button.active {
    color: #1a1a1a;
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #4a5568;
    transition: width 0.3s ease;
}

.tab-button.active::after {
    width: 100%;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Photography Grid */
.photography-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.photo-item:hover {
    transform: scale(1.02);
}

.photo-placeholder {
    width: 100%;
    height: 200px;
    background-color: #f7f7f7;
    border: 2px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 1rem;
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.photo-item:hover .photo-caption {
    transform: translateY(0);
}

/* Notes Content */
.notes-content {
    max-width: 800px;
    margin: 0 auto;
}

.note-post {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e5e5;
}

.note-post:last-child {
    border-bottom: none;
}

.note-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.note-date {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.note-content {
    color: #2c2c2c;
    line-height: 1.7;
}

.note-content p {
    margin-bottom: 1rem;
}

/* Research Interests Integrated in Hero */
.research-interests {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(220, 38, 38, 0.2);
}

.research-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #7f1d1d;
    text-align: center;
    font-family: 'Playfair Display', serif;
}

/* Layout Lock - Fixed 3-Column Grid (Never Collapses) */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Always 3 columns */
    gap: 2rem;
    justify-items: center;
    align-items: start;
    max-width: 1000px;
    margin: 0 auto;
}

/* Layout Lock Card Design - Fixed Proportions */
.interest-card {
    background: linear-gradient(135deg, #ffffff 0%, #fef7f7 100%);
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    word-wrap: break-word;
    hyphens: auto;
    max-width: 320px;       /* Prevents too wide cards on large screens */
    min-width: 200px;       /* Prevents text squish on small screens */
    width: 100%;            /* Takes full grid cell width */
}

.interest-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #dc2626, #ef4444, #f87171);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.interest-card:hover::before {
    transform: scaleX(1);
}

.interest-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(220, 38, 38, 0.1), 0 10px 10px -5px rgba(220, 38, 38, 0.04);
    border-color: #dc2626;
}

.interest-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.interest-card:hover .interest-icon {
    transform: scale(1.1) rotate(5deg);
}

.interest-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #991b1b;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    background: linear-gradient(135deg, #991b1b, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.interest-card p {
    color: #7f1d1d;
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Contact Section */
.contact-main-section {
    background: linear-gradient(135deg, #fefefe 0%, #fef7f7 100%);
    margin-top: 0;
    padding-top: 4rem;
    position: relative;
}

.contact-section {
    margin-top: 2rem;
    padding: 5rem 3rem;
    background: linear-gradient(135deg, #ffffff 0%, #fef7f7 100%);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(153, 27, 27, 0.08);
    border: 1px solid #fecaca;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-info {
    margin-bottom: 3rem;
}

.contact-main-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #991b1b;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    text-align: center;
}

.contact-main-text {
    font-size: 1.4rem;
    color: #6b1e1e;
    line-height: 1.7;
    margin-bottom: 3rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1a1a1a;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

.contact-info p {
    font-size: 1.1rem;
    color: #2c2c2c;
    line-height: 1.6;
}

.contact-icons {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 1rem;
    padding: 2rem 1.5rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(153, 27, 27, 0.1);
    min-width: 140px;
}

.contact-link:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 25px rgba(153, 27, 27, 0.15);
    border-color: rgba(153, 27, 27, 0.2);
}

.contact-icon {
    font-size: 3rem;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.contact-link:hover .contact-icon {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.contact-label {
    font-size: 1.1rem;
    color: #6b1e1e;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
}

.contact-link:hover .contact-label {
    color: #991b1b;
}

/* Posts Content */
.posts-content {
    max-width: 1000px;
    margin: 0 auto;
}


/* Notes Intro and GitBook Preview */
.notes-intro {
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #4a5568;
}

.note-link {
    display: block;
    margin: 0 auto 1.5rem auto;
    padding: 0.75rem 1.5rem;
    background-color: #4a5568;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    text-align: center;
    max-width: 300px;
}

.note-link:hover {
    background-color: #2d3748;
}

.gitbook-preview {
    width: 100%;
    margin-top: 1rem;
    margin-bottom: 3rem;
}

.gitbook-preview iframe {
    width: 100%;
    height: clamp(420px, 120vw, 800px);
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gitbook-fallback {
    margin-top: 1rem;
    padding: 2rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #4a5568;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.placeholder-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.placeholder-text {
    font-size: 1rem;
    color: #4a5568;
}

/* Instagram Preview */
.instagram-preview {
    padding: 2rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #4a5568;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.instagram-preview .preview-text {
    margin-bottom: 1.5rem;
    color: #4a5568;
    font-size: 1rem;
}

/* Education Categories - Stacked Layout */
.education-categories {
    max-width: 1000px;
    margin: 0 auto;
}

.education-category {
    margin-bottom: 2rem;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fefefe;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-header {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem 2rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #991b1b;
    border-bottom: 1px solid #fecaca;
}

/* School-specific colors for education categories */
/* Education Category Headers - School Colors */
.category-header[data-target="boston-content"] {
    background: #f8fafc;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    border-left: 4px solid #cc0000; /* BU Scarlet */
}

.category-header[data-target="unc-duke-content"] {
    background: #f8fafc;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    border-left: 4px solid #74c0fc;
}

.category-header[data-target="nankai-content"] {
    background: #f8fafc;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    border-left: 4px solid #711a5f; /* Nankai purple (RGB 126,12,110) */
}

.category-header[data-target="shortterm-content"] {
    background: #f8fafc;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    border-left: 4px solid #4ade80;
}

/* Université de Montréal (Royal Blue) */
.category-header[data-target="udem-content"] {
    background: #f8fafc;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    border-left: 4px solid #0057AC; /* Royal Blue */
}

.category-header:hover {
    background-color: #fef2f2;
}

/* .category-header.active - Removed red background effect to keep original school colors */

.category-title {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
    font-family: monospace;
}

.category-header.active .category-icon {
    transform: rotate(90deg);
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background-color: #f9f9f9;
}

.category-content.expanded {
    max-height: 2000px;
    padding: 1.25rem 2rem 2rem 2rem; /* Reduced top padding, maintained sides and bottom */
}

/* University-specific styling */

/* Education Category Hover Effects - Keep School Colors */
.category-header[data-target="boston-content"]:hover {
    background: #f1f5f9;
    color: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-left-color: #cc0000; /* Keep BU Scarlet on hover */
}

.category-header[data-target="unc-duke-content"]:hover {
    background: #f1f5f9;
    color: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-left-color: #74c0fc; /* Always keep UNC blue */
}

.category-header[data-target="nankai-content"]:hover {
    background: #f1f5f9;
    color: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-left-color: #711a5f; /* Keep Nankai purple */
}

.category-header[data-target="shortterm-content"]:hover {
    background: #f1f5f9;
    color: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-left-color: #4ade80; /* Always keep Short-term green */
}

/* Keep Royal Blue on hover for UdeM */
.category-header[data-target="udem-content"]:hover {
    background: #f1f5f9;
    color: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-left-color: #0057AC;
}

/* Experience Categories - Same as Education */
.experience-categories {
    max-width: 1000px;
    margin: 0 auto;
}

.experience-category {
    margin-bottom: 2rem;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fefefe;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Experience Items */
.experience-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    width: 100%;
    padding: 1rem 0;
}

.experience-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    background-color: #fefefe;
    border-left: 4px solid #4a5568;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-height: 100px;
    justify-content: space-between;
}

.experience-item:hover {
    background-color: #f9f9f9;
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.experience-name {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #1a1a1a;
    line-height: 1.4;
    flex-grow: 1;
}

.experience-details {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: auto;
}

/* Google-level Device-Specific Scaling */

/* MacBook (1024–1439px) - Proportional scaling */
@media (max-width: 1439px) {
    .container { max-width: 1000px; }
    .hero-photo { width: 320px; }
}

/* iPad (768–1023px) - Maintain proportions */
@media (max-width: 1023px) {
    .container { max-width: 720px; }
    .hero-photo { width: 280px; }
}

/* Mobile (<768px) - Dedicated Mobile Layout */
@media (max-width: 768px) {
    .container { 
        max-width: 90vw;
        padding: 0 1rem;
    }
    
    /* Mobile Hero - Single Column Layout */
    .hero {
        min-height: auto;              /* Override viewport height on mobile */
        display: flex !important;      /* Use flex for single column layout */
        flex-direction: column;        /* Stack all elements vertically */
        gap: 2rem;
        text-align: center;            /* Center align for single column */
        place-items: center;
        padding: 2rem 0;
        align-items: center;           /* Center alignment for mobile */
    }
    
    .hero-content {
        order: 1;
        width: 100%;
        text-align: center;
    }
    
    .hero-photo {
        order: 2;
        width: 250px;
        height: auto;
        margin: 0 auto;
        object-fit: contain;
    }
    
    /* Mobile Contact Info - Under Photo */
    .hero-contact-info {
        order: 3;
        width: 100%;
        margin-top: 1rem;
        text-align: center;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .nav-container {
        padding: 0 1rem;
        gap: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    .hero {
        display: flex !important;      /* Use flex for single column layout */
        flex-direction: column;        /* Stack all elements vertically */
        gap: 1.5rem;
        text-align: center;            /* Center align for single column */
        place-items: center;
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-text {
        margin-bottom: 0;
        align-items: center;  /* Center align text in single column */
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .side-drawer-container {
        flex-direction: column;
        min-height: auto;
        margin: 0 1rem;
    }
    
    .left-panel {
        width: 100%;
        min-width: auto;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        padding: 1rem;
    }
    
    .right-panel {
        min-height: 400px;
        padding: 1.5rem;
    }
    
    .content-panel {
        position: relative;
        transform: none;
        opacity: 1;
    }
    
    .content-panel:not(.active):not(.default-content) {
        display: none;
    }
    
    .intro-section {
        padding: 0;
        margin-bottom: 2rem;
        width: 100%;
    }
    
    .intro-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    
    .intro-text {
        font-size: 1rem;
        line-height: 1.6;
        padding: 0 0.5rem;
        text-align: left;
    }
    
    .course-list,
    .conference-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .course-item,
    .conference-item {
        font-size: 1rem;
        padding: 1rem;
    }
    
    
    .notes-intro {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .gitbook-preview iframe {
        height: 600px;
    }
    
    .instagram-preview {
        padding: 1.5rem;
    }
    
    .education-categories {
        margin: 0 1rem;
    }
    
    .category-header {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .category-content.expanded {
        padding: 1.5rem;
    }
    
    .experience-categories {
        margin: 0 1rem;
    }
    
    .experience-list {
        display: flex !important;      /* Use flex for single column layout */
        flex-direction: column;        /* Stack all elements vertically */
        gap: 1rem;
    }
    
    .photography-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .contact-icons {
        gap: 2rem;
        justify-content: center;
    }
    
    .posts-tabs {
        gap: 1rem;
    }
    
    .tab-button {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    /* Mobile Research Interests - Single Column Cards */
    .interests-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 2rem 0;
        max-width: 100%;
    }
    
    .interest-card {
        padding: 1.5rem;
        min-width: auto;
        max-width: 100%;
        width: 100%;
    }
    
    .interest-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .interest-card p {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .interest-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    /* Ensure key blocks are centered on mobile */
    .hero-photo { display: block; margin: 0 auto; }
    .contact-content { display: flex; flex-direction: column; align-items: center; }
    .gitbook-preview, .notes-content, .posts-hamburger { margin-left: auto; margin-right: auto; }
    
    /* Center contact icons and other elements */
    .contact-icons {
        justify-content: center;
        align-items: center;
    }
    
    .contact-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .contact-icon,
    .contact-label {
        text-align: center;
    }
    
    /* Center all card content on mobile */
    .interest-card {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .interest-card h3,
    .interest-card p {
        text-align: center;
    }
    
    .interest-icon {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Center course and conference items */
    .course-item,
    .conference-item {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .course-name,
    .conference-name {
        text-align: center;
    }
    
    /* Center navigation and menu elements */
    .hamburger-menu {
        justify-content: center;
        align-items: center;
    }
    
    .hamburger-button {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .hamburger-icon,
    .hamburger-label {
        text-align: center;
    }
    
    /* Center category headers */
    .category-header {
        text-align: center;
        justify-content: center;
    }
    
    .category-title {
        text-align: center;
    }
}

/* Mobile - Only collapse grid on very small screens */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .nav-container {
        padding: 0 1rem;
        gap: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    .hero {
        display: flex !important;      /* Use flex for single column layout */
        flex-direction: column;        /* Stack all elements vertically */
        gap: 1.5rem;
        text-align: center;            /* Center align for single column */
        place-items: center;
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-text {
        margin-bottom: 0;
        align-items: center;  /* Center align text in single column */
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .side-drawer-container {
        flex-direction: column;
        min-height: auto;
        margin: 0 1rem;
    }
    
    .left-panel {
        width: 100%;
        min-width: auto;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        padding: 1rem;
    }
    
    .right-panel {
        min-height: 400px;
        padding: 1.5rem;
    }
    
    .content-panel {
        position: relative;
        transform: none;
        opacity: 1;
    }
    
    .content-panel:not(.active):not(.default-content) {
        display: none;
    }
    
    .intro-section {
        padding: 0;
        margin-bottom: 2rem;
        width: 100%;
    }
    
    .intro-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    
    .intro-text {
        font-size: 1rem;
        line-height: 1.6;
        padding: 0 0.5rem;
        text-align: left;
    }
    
    .course-list,
    .conference-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .course-item,
    .conference-item {
        font-size: 1rem;
        padding: 1rem;
    }
    
    
    .notes-intro {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .gitbook-preview iframe {
        height: 600px;
    }
    
    .instagram-preview {
        padding: 1.5rem;
    }
    
    .education-categories {
        margin: 0 1rem;
    }
    
    .category-header {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .category-content.expanded {
        padding: 1.5rem;
    }
    
    .experience-categories {
        margin: 0 1rem;
    }
    
    .experience-list {
        display: flex !important;      /* Use flex for single column layout */
        flex-direction: column;        /* Stack all elements vertically */
        gap: 1rem;
    }
    
    .photography-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .contact-icons {
        gap: 2rem;
        justify-content: center;
    }
    
    .posts-tabs {
        gap: 1rem;
    }
    
    .tab-button {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    /* Single column interests grid for very small mobile */
    .interests-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .interest-card {
        padding: 1.5rem;
        margin: 0;
        font-size: 1rem;
        width: 100%;
    }
    
    .interest-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .interest-card p {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* Optimize hero photo for tablet side-by-side layout */
    .hero-photo { 
        width: 250px;
        max-width: 250px;
        height: auto;
        margin: 0 auto;
    }
    .contact-content { display: flex; flex-direction: column; align-items: center; }
    .gitbook-preview, .notes-content, .posts-hamburger { margin-left: auto; margin-right: auto; }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-tagline {
        font-size: 1rem;
    }
    
    .section {
        padding: 4rem 0 2rem;
    }
    
    .hero-photo {
        max-width: 200px;
        height: auto;
        margin: 0 auto;
        object-fit: contain;
    }
    
    .image-placeholder {
        width: 250px;
        height: auto;
        aspect-ratio: 4/3;
    }
    
    /* Mobile Contact Icons - Below All Contact Text */
    .contact-icons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);  /* Two rows of two icons */
        gap: 1rem;
        margin-top: 1.5rem;  /* More space after all contact text */
        margin-bottom: 2rem; /* Space before research interests */
        width: 100%;
        justify-items: center;
        order: 4;  /* Ensure icons come after all contact text */
    }
    
    .contact-link {
        display: flex;
        flex-direction: column;
        align-items: center;  /* Center align for single column */
        text-decoration: none;
        padding: 0.5rem;
        border-radius: 8px;
        transition: all 0.3s ease;
        min-width: 60px;
        max-width: 80px;
    }
    
    .contact-link:hover {
        background-color: rgba(220, 38, 38, 0.1);
        transform: translateY(-2px);
    }
    
    .contact-icon {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .contact-label {
        font-size: 0.7rem;
        color: #6b7280;
        text-align: center;  /* Center align for single column */
        line-height: 1.2;
    }
    
    /* Mobile Hero Layout - Perfect Order: Name → Greetings → Photo → Address */
    .hero {
        display: flex !important;      /* Use flex for single column layout */
        flex-direction: column;        /* Stack all elements vertically */
        text-align: center;            /* Center align for single column */
        place-items: center;
        gap: 1.5rem;
        padding: 2rem 0;
        min-height: auto;
    }
    
    /* 1. Big Name - Wancheng Lin */
    .hero-content {
        order: 1;
        width: 100%;
        margin-bottom: 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
        font-weight: 700;
        line-height: 1.1;
        margin-bottom: 0.5rem;
        color: #991b1b;
    }
    
    /* 2. Greetings - Hero tagline */
    .hero-tagline {
        font-size: 1.1rem;
        font-weight: 400;
        line-height: 1.4;
        margin-bottom: 0;
        color: #6b7280;
    }
    
    /* 3. Photo - Centered */
    .hero-photo {
        order: 2;
        width: 180px;
        height: auto;
        object-fit: contain;
        border-radius: 12px;
        margin: 0 auto;
        box-shadow: 0 6px 16px rgba(0,0,0,0.12);
        border: 3px solid #e5e7eb;
    }
    
    /* 4. Address - Contact info under photo */
    .contact-info {
        order: 3;
        width: 100%;
        margin-top: 0;
        text-align: center;  /* Center align for single column */
        padding: 0;
        margin-bottom: 0;  /* No bottom margin, icons will follow */
    }
    
    .contact-main-title {
        font-size: 1.3rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
        color: #991b1b;
    }
    
    .contact-main-text {
        font-size: 1rem;
        line-height: 1.5;
        color: #374151;
        margin-bottom: 0;
    }
    
    /* Mobile Research Interests - Compact Three Parallel */
    .interests-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;  /* Correct gap to prevent over-spreading */
        margin: 1rem 0;
    }
    
    .interest-card {
        min-width: 100px;  /* Correct width to prevent over-spreading */
        padding: 0.5rem;  /* Correct padding */
        max-width: none;
    }
    
    .interest-card h3 {
        font-size: 0.8rem;  /* Compact size */
        margin-bottom: 0.25rem;
        white-space: nowrap;  /* Prevent title wrapping */
    }
    
    .interest-card p {
        font-size: 0.7rem;  /* Compact size */
        line-height: 1.2;
        text-align: center;  /* Center align for mobile */
    }
    
    .interest-icon {
        font-size: 1.2rem;  /* Compact size */
        margin-bottom: 0.25rem;
    }
    
    /* Mobile Navigation - Full Width Four Buttons */
    .nav-container {
        width: 100%;
        max-width: 100%;
        padding: 0;
        gap: 0;
        flex-wrap: nowrap;
        margin: 0;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.75rem 0.5rem;
        flex: 1;
        text-align: center;  /* Center align for single column */
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-link:last-child {
        border-right: none;
    }
    
    /* Mobile Full-Width Layout - All Sections Use Full Phone Width */
    .page-section {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;  /* Center align for single column */
        min-height: 100vh;
        padding: 1rem 0;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
    }
    
    .container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;  /* Center align for single column */
        width: 100%;
        max-width: 100%;
        padding: 0 1rem;
    }
    
    /* Full-width backgrounds for all sections */
    #education, #experience, #posts {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
    }
    
    /* Force full-width for all content containers */
    .side-drawer-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    .education-categories, .experience-categories {
        margin: 0 !important;
        width: 100% !important;
    }
    
    .category-header, .category-content {
        width: 100% !important;
    }
    
    .notes-intro, .gitbook-preview {
        width: 100% !important;
        margin: 0 !important;
    }
    
    .course-list,
    .conference-list {
        grid-template-columns: 1fr;  /* Single column for mobile */
    }
    
    .hero-photo {
        max-width: 150px;
        height: auto;
        margin: 0 auto;
        object-fit: contain;
    }
    
    .interest-card {
        padding: 1.25rem;
        margin: 0 0.25rem;
    }
}

/* Smooth animations */
* {
    transition: all 0.3s ease;
}

/* Focus states for accessibility */
.nav-link:focus,
.tab-button:focus,
.contact-link:focus {
    outline: 2px solid #4a5568;
    outline-offset: 2px;
}


/* Print styles */



@media print {
    .navbar {
        display: none;
    }
    
    .section {
        min-height: auto;
        page-break-inside: avoid;
    }
}










/* Footer Styles */
.site-footer {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.8) 100%);
    backdrop-filter: blur(20px);
    color: #374151;
    padding: 2rem 0 1.5rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
    text-align: center;
}

.footer-contact {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.footer-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fef2f2;
    margin-bottom: 1rem;
}

.footer-text {
    color: #6b7280;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.footer-icons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 1rem;
}

.footer-link:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.footer-icon {
    font-size: 1.2rem;
}

.footer-label {
    font-weight: 500;
    font-size: 1rem;
}

.footer-credit {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
}

.design-credit {
    color: #9ca3af;
    font-size: 1rem;
    text-align: center;
    margin: 0;
}

.design-credit .year {
    color: #dc2626;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
}

.credit-name {
    color: #374151;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
}


/* Responsive footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;  /* Center align for single column */
        gap: 2rem;
    }
    
    .footer-icons {
        justify-content: center;
    }
    
    .footer-link {
        padding: 0.5rem 0.75rem;
    }
    
    .site-footer {
        padding: 1.5rem 0 1rem;
    }
}

/* Custom Visitor Map Styles */
.visitor-map-container {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(220, 38, 38, 0.2);
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.visitor-map-header {
    font-family: 'Playfair Display', serif;
    color: #991b1b;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.visitor-map-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.visitor-map-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(220, 38, 38, 0.1);
    transition: all 0.3s ease;
    min-width: 80px;
}

.visitor-map-stats .stat-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.visitor-map-stats .stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 0.25rem;
}

.visitor-map-stats .stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
    font-weight: 500;
}

.world-map-container {
    width: 100%;
    height: 300px;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid rgba(220, 38, 38, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.world-map-container iframe,
.world-map-container div {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 8px;
}

.visitor-map-footer {
    font-size: 0.8rem;
    color: #6b7280;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .visitor-map-container {
        max-width: 95%;
        padding: 0.75rem;
    }
    
    .visitor-map-stats {
        gap: 1rem;
    }
    
    .visitor-map-stats .stat-item {
        padding: 0.5rem 0.75rem;
        min-width: 70px;
    }
    
    .visitor-map-stats .stat-number {
        font-size: 1.25rem;
    }
    
    .visitor-map-stats .stat-label {
        font-size: 0.7rem;
    }
    
    .world-map-container {
        height: 200px;
    }
    
    .visitor-map-header {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .visitor-map-stats {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .visitor-map-stats .stat-item {
        flex-direction: row;
        justify-content: space-between;
        min-width: auto;
    }
    
    .visitor-map-stats .stat-number {
        margin-bottom: 0;
        margin-right: 1rem;
    }
    
    .world-map-container {
        height: 180px;
    }
}


/* Print styles */
@media print {
    .navbar {
        display: none;
    }
    
    .section {
        min-height: auto;
        page-break-inside: avoid;
    }
}

/* Institution and Platform Name Styling */
.institution-name {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: #991b1b;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(153, 27, 27, 0.1);
}

/* Education Story Title Styling */
.education-story-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #991b1b;
    font-style: italic;
    text-decoration: underline;
    text-decoration-style: dashed;
    text-decoration-color: #dc2626;
    cursor: pointer;
    margin: 1.5rem 0 1rem 0;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
    text-align: center;
    width: 100%;
    display: block !important;
    justify-content: center !important;
}

.education-story-title:hover {
    color: #dc2626;
}

/* Alumni Name Styling - Override fun fact italic styling */
#fun-fact-typed .alumni-name,
#fun-fact-typed a.alumni-name,
.alumni-name {
    font-family: 'Playfair Display', serif !important;
    font-weight: 700 !important;
    color: #991b1b !important;
    font-style: normal !important;
    text-shadow: 0 1px 2px rgba(153, 27, 27, 0.2) !important;
    border-bottom: 1px solid rgba(153, 27, 27, 0.3) !important;
    transition: all 0.3s ease !important;
    font-size: inherit !important;
    text-decoration: none !important;
}

#fun-fact-typed .alumni-name:hover,
#fun-fact-typed a.alumni-name:hover,
.alumni-name:hover {
    color: #dc2626 !important;
    text-shadow: 0 2px 4px rgba(153, 27, 27, 0.3) !important;
    border-bottom-color: #dc2626 !important;
    text-decoration: none !important;
}

/* Style links within institution names to match */
.institution-name a,
a.institution-name {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: #991b1b;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(153, 27, 27, 0.1);
    text-decoration: none;
    font-size: inherit;
}

.institution-name a:hover,
a.institution-name:hover {
    color: #dc2626;
    text-decoration: underline;
}

.platform-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: #374151;
    background: linear-gradient(135deg, #4b5563, #6b7280);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: italic;
}

/* Elegant Fun Fact Design */
.expandable-fun-fact {
    margin-top: 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    clear: both; /* Ensure it doesn't affect grid layout */
    display: block; /* Force block display */
}

/* Removed red gradient line */

/* Redesigned Fun Fact Toggle */
.fun-fact-toggle {
    width: 100%;
    background: #fff;
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.fun-fact-toggle:hover {
    background: #fef2f2; /* soft red tint */
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.fun-fact-icon {
    font-size: 1.1rem;
    color: #dc2626;
    flex-shrink: 0;
    margin-right: 0.6rem;
}

.fun-fact-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    flex: 1;
    text-align: left;
    line-height: 1.4;
}

.fun-fact-arrow {
    font-size: 0.9rem;
    color: #dc2626;
    transition: transform 0.3s ease, color 0.3s ease;
}

.fun-fact-toggle.active .fun-fact-arrow {
    transform: rotate(180deg);
    color: #b91c1c;
}

/* Content area */
.fun-fact-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-sizing: border-box;
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
}

.fun-fact-content.active {
    max-height: 80px;
    position: relative;
}

.fun-fact-card {
    padding: 0.75rem 1rem;
    background: #fff;
    border-top: 1px solid rgba(220, 38, 38, 0.1);
    border-radius: 0 0 12px 12px;
    font-style: italic;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Mobile Fun Fact - More Space */
@media (max-width: 768px) {
    .fun-fact-content.active {
        max-height: 120px;  /* Increased from 80px */
    }
    
    .fun-fact-card {
        padding: 1rem 1.25rem;  /* Increased padding */
    }
    
    #fun-fact-typed {
        font-size: 0.9rem;  /* Slightly larger text */
        line-height: 1.5;   /* Better line spacing */
    }
}

.fun-fact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 2rem;
    right: 2rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.2), transparent);
}

#fun-fact-typed {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #4b5563;
    margin: 0;
    font-style: italic;
    white-space: pre-wrap;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Override italic for alumni names specifically */
#fun-fact-typed .alumni-name {
    font-style: normal !important;
    font-family: 'Playfair Display', serif !important;
    font-weight: 700 !important;
    color: #991b1b !important;
    text-shadow: 0 1px 2px rgba(153, 27, 27, 0.2) !important;
    border-bottom: 1px solid rgba(153, 27, 27, 0.3) !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

#fun-fact-typed .alumni-name:hover {
    color: #dc2626 !important;
    text-shadow: 0 2px 4px rgba(153, 27, 27, 0.3) !important;
    border-bottom-color: #dc2626 !important;
}

#fun-fact-typed a {
    color: #dc2626;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

#fun-fact-typed a:hover {
    color: #991b1b;
    border-bottom-color: #991b1b;
}

/* Alumni name styling - comprehensive */
#fun-fact-typed .alumni-name,
#fun-fact-typed a.alumni-name {
    font-family: 'Playfair Display', serif !important;
    font-weight: 700 !important;
    font-style: normal !important;
    color: #991b1b !important;
    text-shadow: 0 1px 2px rgba(153, 27, 27, 0.2) !important;
    border-bottom: 1px solid rgba(153, 27, 27, 0.3) !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

#fun-fact-typed .alumni-name:hover,
#fun-fact-typed a.alumni-name:hover {
    color: #dc2626 !important;
    text-shadow: 0 2px 4px rgba(153, 27, 27, 0.3) !important;
    border-bottom-color: #dc2626 !important;
    text-decoration: none !important;
}

/* Removed arrow after hyperlinks */

/* Blinking cursor effect */
.typing-cursor::after {
    content: "|";
    display: inline-block;
    margin-left: 2px;
    animation: blink 1s step-start infinite;
    color: #dc2626;
}

@keyframes blink {
    50% { opacity: 0; }
}
