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

:root {
    --bg: #0a0a0a;
    --bg-alt: #111;
    --text: #e8e8e8;
    --text-muted: #888;
    --accent: #66bb6a;
    --accent-dim: rgba(102, 187, 106, 0.12);
    --border: #222;
    --card: #161616;
    --card-hover: #1a1a1a;
    --nav-bg: rgba(10, 10, 10, 0.85);
}

html.light {
    --bg: #fafafa;
    --bg-alt: #f0f0f0;
    --text: #1a1a1a;
    --text-muted: #555;
    --accent: #2e7d32;
    --accent-dim: rgba(46, 125, 50, 0.1);
    --border: #ddd;
    --card: #fff;
    --card-hover: #f5f5f5;
    --nav-bg: rgba(250, 250, 250, 0.85);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
}

/* ─── Navigation ─── */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 3rem;
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-weight: 800;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--accent);
    letter-spacing: 0.08em;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: color 0.2s;
}

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

.nav-highlight {
    color: var(--accent) !important;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
}

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

html.light .icon-sun { display: none; }
html:not(.light) .icon-moon { display: none; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ─── Hero ─── */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    padding: 8rem 3rem 0;
    max-width: 1100px;
    margin: 0 auto;
}

.hero-headshot {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
    margin-bottom: 1.5rem;
}

.hero-label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.tagline {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.hero-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0;
}

.cta {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    background: var(--accent-dim);
    color: var(--accent);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.cta:hover {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.cta-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.cta-outline:hover {
    background: var(--accent-dim);
    opacity: 1;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-left: 1.5rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border);
    text-align: left;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* ─── Sections ─── */
.section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 6rem 3rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.section-alt {
    background: var(--bg-alt);
    max-width: 100%;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-alt > * {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
}

.subsection-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

/* ─── About ─── */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

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

.inline-link {
    color: var(--accent);
    text-decoration: none;
}

.inline-link:hover {
    text-decoration: underline;
}

.about-text em {
    color: var(--accent);
    font-style: normal;
}

.detail-block h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.tag-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-list li {
    padding: 0.4rem 0.9rem;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

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

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

.timeline-item {
    position: relative;
    padding-bottom: 3rem;
    padding-left: 2rem;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    margin-left: -4px;
}

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

.timeline-date {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

.timeline-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.timeline-place {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.timeline-content p:last-child {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ─── Awards ─── */
.awards-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.award {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
}

.award:last-child {
    border-bottom: none;
}

.award-year {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
    min-width: 3rem;
    font-variant-numeric: tabular-nums;
}

.award-name {
    font-size: 0.95rem;
    color: var(--text);
}

/* ─── Publications ─── */
.pub-featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.pub-featured {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
}

.pub-featured:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.pub-featured img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #111;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem;
}

.pub-featured-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.pub-featured-content .pub-venue {
    align-self: flex-start;
}

.pub-featured-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.pub-featured-content .pub-journal {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: auto;
}

.pub-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.pub {
    display: flex;
    flex-direction: column;
    padding: 1.75rem 2rem;
    background: var(--card);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

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

.pub-venue {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    margin-bottom: 0.75rem;
}

.pub h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.pub-authors {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.25rem;
}

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

.pub-journal {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.pub-press {
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 0.5rem;
    font-weight: 500;
}

.pub-link {
    display: inline-block;
    align-self: flex-end;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none !important;
    padding: 0.3rem 0.75rem;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 4px;
    transition: background 0.2s, border-color 0.2s;
}

.pub-link:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    text-decoration: none !important;
}

.pub-footer {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pub-footer a {
    color: var(--accent);
    text-decoration: none;
}

.pub-footer a:hover {
    text-decoration: underline;
}

/* ─── Talks ─── */
.talks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.talk {
    padding: 1.5rem 1.75rem;
    background: var(--card);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

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

.talk-type {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-right: 0.5rem;
}

.talk-year {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.talk h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin: 0.5rem 0 0.35rem;
    line-height: 1.4;
}

.talk p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.teaching-card {
    padding: 1.75rem;
    background: var(--card);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

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

.teaching-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.teaching-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ─── Press ─── */
.press-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.press-item {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: var(--card);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
    text-decoration: none;
}

.press-item:hover {
    border-color: var(--accent);
}

.press-outlet {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    min-width: fit-content;
    white-space: nowrap;
}

.press-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

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

.service-item h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.service-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ─── Contact ─── */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.contact-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1.25rem;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.2s, border-color 0.2s;
}

.contact-links a:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
}

/* ─── Future Research ─── */
.future-hero {
    max-width: 1100px;
    margin: 0 auto;
    padding: 8rem 3rem 2rem;
    text-align: center;
}

.future-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 1rem;
}

.future-hero .tagline {
    margin-left: auto;
    margin-right: auto;
}

.future-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.future-card {
    padding: 2rem;
    background: var(--card);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

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

.future-label {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    margin-bottom: 0.75rem;
}

.future-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.future-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ─── Virus Mode ─── */
.virus-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--card);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 100;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.virus-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.virus-toggle.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent);
}

/* ─── Footer ─── */
footer {
    text-align: center;
    padding: 2.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    nav {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 8px;
        flex-direction: column;
        padding: 0.75rem 0;
        margin-right: 1.5rem;
        min-width: 180px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    }

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

    .nav-links a {
        font-size: 0.9rem;
        padding: 0.6rem 1.25rem;
    }

    .nav-toggle {
        display: flex;
        z-index: 101;
    }

    .theme-toggle {
        margin-left: auto;
        margin-right: 0.75rem;
    }

    /* Hero */
    .hero {
        padding: 6rem 1.25rem 2rem;
        min-height: auto;
    }

    .hero-headshot {
        width: 120px;
        height: 120px;
        margin-bottom: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .hero-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    .hero-stats {
        gap: 1.25rem;
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .cta {
        padding: 0.65rem 1.25rem;
        font-size: 0.85rem;
    }

    /* Sections */
    .section {
        padding: 3rem 1.25rem;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .subsection-title {
        font-size: 1.1rem;
        margin-top: 2.5rem;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .about-text p {
        font-size: 0.95rem;
    }

    /* Timeline */
    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-item {
        padding-left: 1.25rem;
        padding-bottom: 2rem;
    }

    .timeline-content h3 {
        font-size: 1.05rem;
    }

    /* Awards */
    .award {
        flex-direction: column;
        gap: 0.25rem;
    }

    /* Publications */
    .pub-featured-grid {
        grid-template-columns: 1fr;
    }

    .pub-featured img {
        height: 140px;
    }

    .pub {
        padding: 1.25rem 1.25rem;
    }

    .pub h3 {
        font-size: 0.95rem;
    }

    .pub-authors {
        font-size: 0.8rem;
    }

    .pub-link {
        font-size: 0.7rem;
    }

    /* Talks */
    .talks-grid {
        grid-template-columns: 1fr;
    }

    .talk {
        padding: 1.25rem;
    }

    /* Teaching */
    .teaching-grid {
        grid-template-columns: 1fr;
    }

    /* Press */
    .press-grid {
        grid-template-columns: 1fr;
    }

    .press-item {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 1.25rem;
    }

    /* Service */
    .service-grid {
        grid-template-columns: 1fr;
    }

    /* Contact */
    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    /* Virus button */
    .virus-toggle {
        bottom: 1rem;
        right: 1rem;
    }
}
