:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f0efec;
    --color-text: #1a1a1a;
    --color-text-highlight: #1E3388;
    --color-text-muted: #5a5a5a;
    --color-accent: #FFCAB3;
    --color-accent-hover: #1d4ed8;
    /* --color-highlight: #fef3c7; */
    --color-highlight: #B3D6FF;
    --color-border: #e5e5e5;
    --color-card: #ffffff;
    /* --color-nav-bg: rgba(250, 249, 247, 0.9); */
    --color-nav-bg: #f0efec;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
    --font-name: 'Roboto', sans-serif;
    --font-serif: 'Source Serif 4', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 1050px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --color-bg: #0f0f0f;
    --color-bg-alt: #1a1a1a;
    --color-text: #e5e5e5;
    --color-text-muted: #a0a0a0;
    --color-accent: #60a5fa;
    --color-accent-hover: #93c5fd;
    --color-highlight: #422006;
    --color-border: #2a2a2a;
    --color-card: #141414;
    --color-nav-bg: rgba(15, 15, 15, 0.9);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: var(--color-nav-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

nav .nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-family: var(--font-name);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

nav .nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

nav .nav-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    transition: color var(--transition);
}

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

.theme-toggle {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 40px; height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--color-text);
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

.theme-toggle .fa-sun { display: none; }
[data-theme="dark"] .theme-toggle .fa-sun { display: block; }
[data-theme="dark"] .theme-toggle .fa-moon { display: none; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text);
    cursor: pointer;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 6rem 2rem 4rem;
}

.hero-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-family: var(--font-name);
    font-size: 3.0rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

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

.hero-content .subtitle a {
    color: var(--color-accent);
    text-decoration: none;
}

.hero-content .intro {
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.research-areas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.research-tag {
    background: var(--color-highlight);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #000000;
}

.research-tag.primary {
    background: var(--color-accent);
    /* color: white; */
    /* color: black; */
}

.hiring-notice {
    background: linear-gradient(135deg, #F8E2E2 0%, #F8E2E2 100%);
    border: 1px solid #B85450;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

[data-theme="dark"] .hiring-notice {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border-color: #059669;
    color: #d1fae5;
}

.hiring-notice strong { color: #000000; }
[data-theme="dark"] .hiring-notice strong { color: #34d399; }

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

/* .social-links a {
    width: 50px; height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 1.1rem;
    transition: all var(--transition);
} */

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: white;
    color: var(--color-text);
    text-decoration: none;
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.social-links a:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: black;
    transform: translateY(-2px);
}

.social-links a svg,
.social-links a i {
    width: 20px;
    height: 20px;
    font-size: 20px;
}


.cv-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-text);
    color: var(--color-bg);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
}

.cv-button:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
}

/* Photo */
.hero-image { position: relative; }

.photo-container {
    width: 100%;
    aspect-ratio: 4/5;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-bg-alt);
    border: 2px dashed var(--color-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.photo-container img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
}

.photo-container.has-image { border: none; }
.photo-container.has-image .photo-placeholder { display: none; }

.photo-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.photo-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.photo-placeholder p { font-size: 0.85rem; }
.photo-placeholder code {
    background: var(--color-card);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

.hero-image::before {
    content: '';
    position: relative;
    /* top: -10px; right: -10px; bottom: 10px; left: 10px;
    /* border: 2px solid var(--color-accent);
    border-radius: 12px; */
    z-index: 1;
}

/* Sections */
section { padding: 2rem 2rem; }
/* section:nth-child(even) { background: var(--color-bg-alt); } */

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-sans);
    font-size: 2rem;
    font-weight: 850;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 3px solid var(--color-border);
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    
    /* background: var(--color-border); */
}

/* News */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 500px;
    overflow-y: scroll;
    padding-right: 0.5rem;
}

/* Custom scrollbar for news list */
.news-list::-webkit-scrollbar {
    width: 6px;
}

.news-list::-webkit-scrollbar-track {
    background: var(--color-bg-alt);
    border-radius: 3px;
}

.news-list::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

.news-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* Firefox scrollbar */
.news-list {
    scrollbar-width: thin;
    scrollbar-color:  var(--color-bg-alt);
}

.news-item {
    display: flex;
    gap: 1.0rem;
    padding: 0.5rem 0;
    /* border-bottom: 1px solid var(--color-border); */
}

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

.news-date {
    min-width: 100px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-highlight);
}

.news-content { flex: 1; font-size: 1rem; }
.news-content a { color: var(--color-text-highlight); text-decoration: none; }
.news-content a:hover { text-decoration: underline; }

.badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

[data-theme="dark"] .badge { background: #422006; color: #fbbf24; }
.badge.oral { background: #FFE6CC; color: #FC5329; }
[data-theme="dark"] .badge.oral { background: #14532d; color: #4ade80; }
.badge.spotlight { background: #fce7f3; color: #9d174d; }
[data-theme="dark"] .badge.spotlight { background: #500724; color: #f472b6; }
.badge.accepted { background: #dcfce7; color: #166534; }
[data-theme="dark"] .badge.accepted { background: #14532d; color: #4ade80; }
.badge.preprint { background: #CCCCCC; color: #000000; }
[data-theme="dark"] .badge.preprint { background: #500724; color: #f472b6; }
/* Publications */

.badge-publication {
    display: inline-block;
    background: var(--color-accent);
    color: #000000;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid #000000;
    font-size: 1rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

/* .badge-publication { background: #1E3388; color: #FFFFFF; } */

.pub-category { margin-bottom: 3rem; }

.pub-category h3 {
    font-family: var(--font-sans);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.25rem;
    /* border-bottom: 2px solid var(--color-text-highlight); */
    /* background: var(--color-bg-alt); */
    border-left: 4px solid var(--color-text-highlight);
    padding: 0.5rem 1rem;
    /* display: inline-block; */
}

.pub-list { display: flex; flex-direction: column; gap: 1.5rem; }

.pub-item {
    background: var(--color-card);
    padding: 1rem;
    border-radius: 8px;
    /* border: 3px solid var(--color-border); */
    transition: all var(--transition);
}

.pub-item:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .pub-item:hover {
    box-shadow: 0 4px 20px rgba(96, 165, 250, 0.15);
}

.pub-year {
    background: var(--color-accent);
    font-size: 1.05rem;
    font-weight: 1000;
    color: #000000;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.5rem;
    /* border-radius: 1px; */
}

.pub-title {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.pub-authors {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.pub-authors strong { color: var(--color-text); }

.pub-venue {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.pub-special-note {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--color-text-highlight);
    font-weight: 600;
    margin-top: -0.75rem;
    margin-bottom: 1rem;
}

.pub-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.pub-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    background: var(--color-bg-alt);
    color: var(--color-text);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition);
}

.pub-links a:hover {
    background: var(--color-accent);
    color: black;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-highlight);
    font-weight: 500;
    text-decoration: none;
}

.view-all-link:hover { text-decoration: underline; }

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

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

.timeline-item {
    position: relative;
    padding-bottom: 2.5rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 2px solid var(--color-bg);
    transform: translateX(-5px);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.timeline-role { font-weight: 600; font-size: 1.05rem; }
.timeline-date { font-size: 0.85rem; color: var(--color-text-muted); font-weight: 500; }
.timeline-org { color: var(--color-accent); font-weight: 500; margin-bottom: 0.5rem; }
.timeline-desc { color: var(--color-text-muted); font-size: 0.95rem; }

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.service-category {
    background: var(--color-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.service-category h3 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-category h3 i { color: var(--color-accent); }

.service-list { list-style: none; }

.service-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
}

.service-list li:last-child { border-bottom: none; }
.service-list .service-role { font-weight: 500; }
.service-list .service-venue { color: var(--color-text-muted); font-size: 0.85rem; }

/* Education */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.edu-card {
    background: var(--color-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: all var(--transition);
}

.edu-card:hover { border-color: var(--color-accent); }

.edu-icon {
    width: 48px; height: 48px;
    border-radius: 8px;
    background: var(--color-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.edu-info h4 { font-weight: 600; margin-bottom: 0.25rem; }
.edu-info .degree { font-size: 0.9rem; color: var(--color-text-muted); }
.edu-info .year { font-size: 0.85rem; color: var(--color-text-highlight); font-weight: 500; }

/* Awards */
.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.award-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-card);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    transition: all var(--transition);
}

.award-item:hover { border-color: var(--color-accent); }
.award-icon { font-size: 1.5rem; }
.award-info h4 { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.25rem; }
.award-info p { font-size: 0.85rem; color: var(--color-text-muted); }

/* Footer */
footer {
    background: var(--color-text);
    color: var(--color-bg);
    padding: 3rem 2rem;
    text-align: center;
}

[data-theme="dark"] footer { background: #000; }

footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

footer .footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 1.2rem;
    transition: color var(--transition);
}

footer .footer-links a:hover { color: white; }
footer p { color: rgba(255,255,255,0.5); font-size: 0.9rem; }

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }

    nav .nav-inner {
        flex-wrap: nowrap;
    }

    nav .logo {
        font-size: 0.95rem;
    }

    nav .nav-links {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--color-nav-bg);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem 2rem;
        border-bottom: 1px solid var(--color-border);
    }

    nav .nav-links.active { display: flex; }

    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image {
        order: -1;
        max-width: 250px;
        margin: 0 auto;
    }

    .hero-content h1 { font-size: 2.2rem; }
    .research-areas, .social-links { justify-content: center; }
    .news-item { flex-direction: column; gap: 0.5rem; }
    .timeline-header { flex-direction: column; }
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-content, .hero-image { animation: fadeInUp 0.6s ease forwards; }
.hero-image { animation-delay: 0.2s; }

/* Filter Tags for Publications Page */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-tag {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-card);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
}

.filter-tag:hover, .filter-tag.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: black;
}

.pub-item[data-hidden="true"] { display: none; }