/* ========== CSS VARIABLES ========== */
:root {
    --color-bg: #ffffff;
    --color-fg: #111827;
    --color-primary: #4f46e5;
    --color-primary-light: #e0e7ff;
    --color-secondary: #6366f1;
    --color-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-card-bg: #ffffff;
    --color-header-bg: #f8fafc;
    --color-footer-bg: #f3f4f6;
    --color-section-alt: #f9fafb;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --max-width: 1100px;
    --radius: 0.5rem;
    --spacing-section: 4rem;
}

.dark {
    --color-bg: #111827;
    --color-fg: #f9fafb;
    --color-primary: #818cf8;
    --color-primary-light: #1e1b4b;
    --color-secondary: #a5b4fc;
    --color-muted: #9ca3af;
    --color-border: #374151;
    --color-card-bg: #1f2937;
    --color-header-bg: #1f2937;
    --color-footer-bg: #1f2937;
    --color-section-alt: #1a202c;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--color-fg);
    background-color: var(--color-bg);
    transition: background-color 0.3s, color 0.3s;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-secondary);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-fg);
}

h1 { font-size: 2.4rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.6rem; margin-bottom: 1.2rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }

p {
    margin-bottom: 1rem;
    color: var(--color-fg);
}

/* ========== LAYOUT ========== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: var(--spacing-section) 0;
}

.section-alt {
    background-color: var(--color-section-alt);
}

/* ========== NAVBAR ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--color-header-bg);
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.3s;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-fg);
    text-decoration: none;
}

.nav-brand:hover {
    text-decoration: none;
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-links a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--color-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius);
    transition: color 0.2s, background-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-primary);
    background-color: var(--color-primary-light);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-fg);
    cursor: pointer;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--color-muted);
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: color 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
}

.theme-toggle:hover {
    color: var(--color-primary);
    background-color: var(--color-primary-light);
}

/* ========== HERO / BIO ========== */
.hero {
    padding: 3rem 0 2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

.hero-photo-col {
    text-align: center;
}

.hero-photo {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--color-border);
}

.hero-name {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.hero-role {
    font-size: 1.15rem;
    color: var(--color-muted);
    margin-bottom: 0.3rem;
}

.hero-org {
    font-size: 1rem;
    color: var(--color-muted);
    margin-bottom: 1rem;
}

.hero-org a {
    color: var(--color-primary);
}

.hero-social {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.hero-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--color-muted);
    background-color: var(--color-section-alt);
    font-size: 1.1rem;
    transition: all 0.2s;
    text-decoration: none;
}

.hero-social a:hover {
    color: #fff;
    background-color: var(--color-primary);
    text-decoration: none;
}

.hero-bio {
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    color: #fff;
    text-decoration: none;
}

/* ========== INTERESTS & EDUCATION (below hero) ========== */
.bio-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.bio-details h2 {
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
    margin-bottom: 1rem;
}

.interests-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.interests-list li {
    padding: 0.35rem 0.9rem;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.education-list {
    list-style: none;
}

.education-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.education-icon {
    font-size: 1.2rem;
    color: var(--color-primary);
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.education-item h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.education-item p {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 0;
}

/* ========== EXPERIENCE SECTION ========== */
.experience-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.experience-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 0.4rem;
}

.experience-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.experience-content .institute {
    font-size: 0.95rem;
    color: var(--color-primary);
    font-weight: 500;
    margin-bottom: 0.15rem;
}

.experience-content .date {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 0.5rem;
}

.experience-content p {
    font-size: 0.95rem;
    color: var(--color-fg);
    line-height: 1.6;
}

/* ========== PUBLICATION CARDS ========== */
.pub-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.pub-card {
    padding: 1.5rem;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: box-shadow 0.2s, transform 0.2s;
}

.pub-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.pub-card .pub-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-fg);
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.pub-card .pub-authors {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin-bottom: 0.3rem;
}

.pub-card .pub-venue {
    font-size: 0.85rem;
    color: var(--color-muted);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.pub-card .pub-abstract {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--color-fg);
    margin-bottom: 1rem;
}

.pub-card .pub-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.pub-card .pub-tags span {
    padding: 0.2rem 0.65rem;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.pub-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pub-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s;
    background-color: var(--color-primary);
    color: #fff;
}

.pub-link-btn:hover {
    opacity: 0.9;
    color: #fff;
    text-decoration: none;
}

.pub-link-btn.outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.pub-link-btn.outline:hover {
    background-color: var(--color-primary);
    color: #fff;
}

/* ========== RESEARCH TIMELINE ========== */
.research-card {
    padding: 1.5rem;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s;
}

.research-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.research-card .date {
    font-size: 0.8rem;
    color: var(--color-muted);
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.research-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.research-card .subtitle {
    font-size: 0.9rem;
    color: var(--color-primary);
    font-weight: 500;
    margin-bottom: 0.6rem;
}

.research-card p {
    font-size: 0.92rem;
    line-height: 1.6;
}

/* ========== PAGE HEADER ========== */
.page-header {
    padding: 3rem 0 1.5rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
}

.page-header p {
    color: var(--color-muted);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0.5rem auto 0;
}

/* ========== FOOTER ========== */
.footer {
    background-color: var(--color-footer-bg);
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    margin-top: var(--spacing-section);
    transition: background-color 0.3s;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer p {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin: 0;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social a {
    color: var(--color-muted);
    font-size: 1.1rem;
    transition: color 0.2s;
    text-decoration: none;
}

.footer-social a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

/* ========== BACK TO TOP ========== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-secondary);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-photo-col {
        order: -1;
    }

    .hero-social {
        justify-content: center;
    }

    .bio-details {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--color-header-bg);
        border-bottom: 1px solid var(--color-border);
        padding: 1rem;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .footer .container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    .hero-name { font-size: 2rem; }
    section { padding: 2.5rem 0; }
}
