@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #ffffff;
    --bg-alt: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #334155; /* Darkened from #475569 for better legibility */
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.3);
    --secondary: #4f46e5;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(0, 0, 0, 0.05);
    --timeline-line: #e2e8f0;

    /* Font Scale */
    --fs-hero: 3rem;
    --fs-h2: 1.75rem;
    --fs-h3: 1.1rem;
    --fs-body: 0.95rem;
    --fs-sm: 0.875rem;
    --fs-xs: 0.75rem;
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-alt: #0b1120;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1; /* Lightened from #94a3b8 for better legibility */
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --secondary: #6366f1;
    --nav-bg: rgba(15, 23, 42, 0.75);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --timeline-line: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* Base mesh gradient background for premium feel */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, var(--primary-glow) 0%, transparent 40%),
                radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 30%);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

h1, h2, h3, h4 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--secondary);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    z-index: 1000;
}

.nav-content {
    max-width: 1100px; /* Increased from 950px to provide more room for the long menu */
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 1px;
    white-space: nowrap;
    margin-right: 3rem; /* Minimum fixed gap */
}

.nav-links {
    display: flex;
    gap: 1.25rem; /* Slightly reduced gap to fit more items */
    list-style: none;
    margin-left: auto; /* Pushes the menu to the right */
    margin-right: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: var(--fs-sm);
}

.nav-links a:hover {
    color: var(--text-main);
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

#theme-toggle:hover {
    background: var(--card-border);
}

#mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
    padding: 0.5rem;
    margin-left: 0.5rem;
}

/* Sections */
section {
    padding: 0.75rem 0; /* extreme-dense padding */
}

.section-title {
    font-size: var(--fs-h2);
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 0.5rem;
}

/* Hero */
#hero {
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 1rem;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.profile-pic-container {
    flex-shrink: 0;
}

.profile-pic {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 4px solid var(--card-bg);
}

.hero-title {
    font-size: var(--fs-hero);
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* About */
.about-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-main);
}

.about-text p {
    margin-bottom: 1.25rem;
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* Timeline / Experience */
.timeline {
    position: relative;
    margin-left: 1rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background: var(--timeline-line);
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-main);
}

.org-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: white;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.timeline-content {
    flex-grow: 1;
}

.timeline-content h3 {
    font-size: var(--fs-h3);
    margin-bottom: 0.25rem;
}

.timeline-org {
    color: var(--primary);
    font-weight: 500;
    font-size: var(--fs-body);
    margin-bottom: 0.25rem;
}

.timeline-date {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.timeline-content p {
    font-size: var(--fs-body);
    color: var(--text-muted);
}

/* Dense Lists (Publications/Patents) */
.dense-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dense-item {
    padding: 0.85rem 1rem;
    margin: 0 -1rem;
    border-bottom: 1px solid var(--card-border);
    transition: all 0.2s ease;
    border-radius: 8px;
}

.dense-item:hover {
    background-color: var(--bg-alt);
    transform: translateX(4px);
}

.dense-item:last-child {
    border-bottom: none;
}

.dense-title {
    font-size: var(--fs-h3);
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.15rem;
    display: inline;
}

.dense-title-row {
    margin-bottom: 0.25rem;
}

.dense-authors {
    font-size: var(--fs-body);
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.dense-authors strong {
    font-weight: 700;
}

.dense-venue {
    font-size: var(--fs-sm);
    font-style: italic;
    color: var(--text-muted);
}

.venue-tag {
    display: inline;
    font-style: normal;
    font-weight: 700;
    color: var(--primary);
    background: var(--bg-alt);
    border: 1px solid var(--card-border);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: var(--fs-xs);
    letter-spacing: 0.02em;
    margin-right: 0.5rem;
    text-transform: uppercase;
}

.dense-stats {
    display: block;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-style: normal;
    margin-top: 0.15rem;
}

.dense-links {
    display: inline;
    font-size: var(--fs-sm);
    margin-left: 0.5rem;
}

.dense-links a {
    margin-right: 0.25rem;
    display: inline;
    font-weight: 500;
}

.dense-links a:hover {
    background: var(--primary-glow);
}

/* Simple Lists */
.simple-list {
    list-style-type: disc;
    padding-left: 1.5rem;
    font-size: 0.95rem;
}

.simple-list li {
    margin-bottom: 0.5rem;
}

.honors-list li {
    margin-bottom: 0.85rem;
}

/* Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
/* Back to Top Button */
#back-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    font-size: 1.25rem;
    border: none;
    outline: none;
    background-color: var(--primary);
    color: white;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s, background-color 0.2s;
}

#back-to-top:hover {
    background-color: var(--secondary);
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    .nav-content {
        padding: 0 1rem;
    }
    #mobile-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--nav-bg);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--card-border);
        padding: 1rem 0;
        gap: 0;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    .nav-links a {
        display: block;
        padding: 1rem 0;
        font-size: 1rem;
    }
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .social-links {
        justify-content: center;
    }
    #back-to-top {
        bottom: 20px;
        right: 20px;
        padding: 0.5rem 0.75rem;
    }
    .mentoring-grid {
        grid-template-columns: 1fr;
    }
}

/* Extracted Inline Styles */
.experience-lead {
    margin-bottom: 0.75rem;
}

.experience-details {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    padding-left: 1.2rem;
}

.note-text {
    font-size: 0.9em;
    color: var(--text-muted);
}

.mentoring-intro {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.mentoring-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .mentoring-grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
}

.mentoring-category {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.25rem;
}

.mentoring-list {
    list-style: none;
    padding-left: 0;
}

.mentoring-list li {
    margin-bottom: 0.5rem;
}

