/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0f0a;
    --bg-alt: #0e140f;
    --surface: #151e17;
    --border: #1e2a20;
    --text: #e2e8e3;
    --text-muted: #889888;
    --accent: #7a9e7e;
    --accent-dim: rgba(122, 158, 126, 0.12);
    --accent-glow: rgba(122, 158, 126, 0.2);
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-serif: 'Lora', Georgia, serif;
    --max-w: 1140px;
    --nav-h: 64px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
    border-bottom: 1px solid transparent;
}
a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    transition: box-shadow 0.3s;
}
.navbar.scrolled {
    box-shadow: 0 2px 24px rgba(0,0,0,0.4);
}

.nav-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
    list-style: none;
    display: flex;
    gap: 28px;
}
.nav-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: 0.3s;
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 24px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.4;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-tagline {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: 16px;
}

.hero-name {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.hero-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 36px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn {
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid transparent;
}
.btn-primary {
    background: var(--accent);
    color: var(--bg);
}
.btn-primary:hover {
    background: #92b896;
    color: var(--bg);
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.hero-scroll {
    position: absolute;
    bottom: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--text-muted), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ===== Sections ===== */
.section {
    padding: 100px 24px;
}
.section-alt {
    background: var(--bg-alt);
}
.container {
    max-width: var(--max-w);
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 48px;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* ===== Portrait & Photo ===== */
.about-portrait-row {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 0;
}
.portrait-wrapper {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.about-intro p {
    color: var(--text-muted);
    font-size: 1.02rem;
    margin-bottom: 16px;
    line-height: 1.75;
}

/* Cycling panoramic section */
.cycling-pano-section {
    padding: 32px 24px;
    background: var(--bg);
    display: flex;
    justify-content: center;
}

/* Cycling panoramic strip */
.cycling-pano {
    max-width: 560px;
    border-radius: 10px;
    overflow: hidden;
    margin: 24px auto;
}
.cycling-pano img {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(0.75) saturate(0.85);
}

/* ===== About ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
}
.about-education h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 20px;
}
.edu-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.edu-degree {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
}
.edu-meta {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== TSM Feature ===== */
.tsm-feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 36px;
    margin-bottom: 32px;
    transition: border-color 0.3s;
}
.tsm-feature:hover {
    border-color: rgba(122, 158, 126, 0.3);
}
.tsm-header {
    margin-bottom: 20px;
}
.tsm-header h3 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.tsm-role {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}
.tsm-body p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 16px;
}
.tsm-body p:last-child {
    margin-bottom: 0;
}

/* ===== Experience Duo ===== */
.experience-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.exp-col {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px;
    transition: border-color 0.3s;
}
.exp-col:hover {
    border-color: rgba(122, 158, 126, 0.3);
}
.exp-col-header {
    margin-bottom: 4px;
}
.exp-col-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.exp-col-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.exp-col-org {
    font-size: 0.88rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 12px;
}
.exp-col-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
    padding-left: 32px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    margin-bottom: 48px;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
    position: absolute;
    left: -32px;
    top: 8px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    z-index: 1;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}
.timeline-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}
.timeline-date {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}
.timeline-org {
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 12px;
    font-weight: 500;
}
.timeline-content ul {
    list-style: none;
    padding: 0;
}
.timeline-content li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 8px;
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.timeline-content li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
}

/* ===== Grants ===== */
.grants-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.grant-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.grant-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 24px var(--accent-dim);
}
.grant-year {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}
.grant-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 600;
}
.grant-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== Research Columns ===== */
.research-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 28px;
    align-items: start;
}
.research-col {
    min-width: 0;
}

/* ===== Research Subsections ===== */
.research-subsection {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid var(--border);
}
.research-sub-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 32px;
    letter-spacing: -0.01em;
}
.pres-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* ===== Working Projects ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 24px var(--accent-dim);
}
.project-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.project-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
}
.project-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.project-methods span {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.03em;
}

/* ===== Publications ===== */
.pub-category {
    margin-bottom: 48px;
}
.pub-category:last-child { margin-bottom: 0; }

.pub-category-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 20px;
    font-weight: 600;
}

.pub-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.pub-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    transition: border-color 0.3s;
}
.pub-item:hover {
    border-color: rgba(122, 158, 126, 0.3);
}

.pub-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.pub-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 4px;
}
.pub-venue {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== Presentations ===== */
.pres-category {
    margin-bottom: 48px;
}
.pres-category:last-child { margin-bottom: 0; }

.pres-heading {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 20px;
    font-weight: 600;
}
.pres-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.pres-item {
    display: flex;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.pres-item:last-child { border-bottom: none; }

.pres-year {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 60px;
    padding-top: 2px;
}
.pres-title {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 2px;
}
.pres-meta {
    font-size: 0.83rem;
    color: var(--text-muted);
}

/* ===== Teaching ===== */
.teaching-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.teaching-item {
    display: flex;
    gap: 24px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
.teaching-item:last-child { border-bottom: none; }

.teaching-year {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 72px;
    padding-top: 2px;
}
.teaching-course {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 2px;
}
.teaching-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Service ===== */
.service-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.service-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.service-icon {
    font-size: 1.3rem;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    border-radius: 8px;
}
.service-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.service-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.service-date {
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 500;
}

/* ===== Footer ===== */
.footer {
    padding: 60px 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-name {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.footer-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}
.footer-links {
    display: flex;
    gap: 24px;
    justify-content: center;
}
.footer-links a {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.footer-links a:hover { color: var(--text); }

/* ===== Fade-in animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    .nav-links {
        position: fixed;
        top: var(--nav-h);
        left: 0; right: 0;
        background: rgba(10, 10, 15, 0.97);
        backdrop-filter: blur(16px);
        flex-direction: column;
        padding: 24px;
        gap: 20px;
        border-bottom: 1px solid var(--border);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s, opacity 0.3s;
    }
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .about-portrait-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .portrait-wrapper {
        width: 100px;
        height: 100px;
    }
    .cycling-pano {
        max-width: 100%;
    }
    .experience-duo {
        grid-template-columns: 1fr;
    }
    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .grants-grid {
        grid-template-columns: 1fr;
    }
    .research-columns {
        grid-template-columns: 1fr;
    }
    .pres-columns {
        grid-template-columns: 1fr;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .hero-name {
        font-size: clamp(2.2rem, 10vw, 3.5rem);
    }
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    .section {
        padding: 64px 20px;
    }
    .timeline {
        padding-left: 28px;
    }
    .timeline-header {
        flex-direction: column;
        gap: 2px;
    }
    .pres-item {
        flex-direction: column;
        gap: 4px;
    }
    .pres-year {
        min-width: auto;
    }
    .teaching-item {
        flex-direction: column;
        gap: 4px;
    }
    .teaching-year {
        min-width: auto;
    }
}
