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

:root {
    --bg:           #F7F3EE;
    --bg-tinted:    #F0EBE3;
    --text:         #1A1917;
    --text-mid:     #5C5753;
    --text-soft:    #8C8480;
    --accent:       #9B7B5A;
    --border:       #DDD5C8;
    --tag-bg:       #EDE8E2;

    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans:  'Inter', system-ui, -apple-system, sans-serif;

    --container:   1100px;
    --section-v:   100px;
    --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 15px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ===== LOADER ===== */
.loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.5s ease 0.15s;
}

.loader.done {
    opacity: 0;
}

.loader-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 1px;
    width: 0%;
    background: var(--accent);
    transition: width 0.55s var(--ease-out);
}

/* ===== NAVIGATION ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 52px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease,
                background 0.3s ease, border-color 0.3s ease;
    pointer-events: none;
    border-bottom: 1px solid transparent;
}

.nav.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.nav.scrolled {
    background: rgba(247, 243, 238, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: var(--border);
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 400;
    letter-spacing: 0.14em;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

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

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-soft);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* ===== CONTAINER ===== */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 52px;
}

/* ===== HERO ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 52px 80px;
    max-width: var(--container);
    margin: 0 auto;
    position: relative;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 72px;
    align-items: center;
    width: 100%;
    max-width: 900px;
}

.hero-text {
    min-width: 0;
}

/* --- text reveal machinery --- */
.line-wrap {
    display: block;
    overflow: hidden;
}

.line-inner {
    display: block;
    transform: translateY(110%);
    opacity: 0;
}

@keyframes lineReveal {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hero-animate .line-inner {
    animation: lineReveal 1s var(--ease-out) forwards;
}

.delay-0 { animation-delay: 0.05s; }
.delay-1 { animation-delay: 0.18s; }
.delay-2 { animation-delay: 0.42s; }
.delay-3 { animation-delay: 0.66s; }
.delay-4 { animation-delay: 0.84s; }
.delay-5 { animation-delay: 1.02s; }

/* --- hero typography --- */
.hero-eyebrow {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 32px;
}

.hero-name {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: clamp(54px, 7.5vw, 100px);
    line-height: 1.0;
    letter-spacing: -0.01em;
    margin-bottom: 0;
}

.hero-zh {
    font-family: var(--font-serif);
    font-size: clamp(26px, 3.2vw, 46px);
    font-weight: 300;
    font-style: italic;
    color: var(--text-soft);
    letter-spacing: 0.08em;
    margin-top: 10px;
}

.hero-sub {
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--text-mid);
    margin-top: 44px;
    margin-bottom: 10px;
}

.hero-affil {
    font-size: 13px;
    color: var(--text-soft);
    font-weight: 300;
    letter-spacing: 0.02em;
}

.hero-quote {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.hero-quote .line-inner {
    font-family: var(--font-serif);
    font-size: clamp(14px, 1.5vw, 17px);
    font-style: italic;
    font-weight: 300;
    color: var(--text-mid);
    letter-spacing: 0.01em;
    line-height: 1.6;
}

/* --- photo --- */
.hero-photo {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 1s var(--ease-out) 0.9s,
                transform 1s var(--ease-out) 0.9s;
}

.hero-animate .hero-photo {
    opacity: 1;
    transform: translateY(0);
}

.hero-photo img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center top;
    display: block;
    filter: grayscale(12%) contrast(1.02);
}

/* ===== SECTIONS ===== */
.section {
    padding: var(--section-v) 0;
}

.section-tinted {
    background: var(--bg-tinted);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 60px;
}

.section-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--text-soft);
    white-space: nowrap;
}

.section-rule {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ===== SCROLL REVEAL ===== */
.fade-section {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease-out),
                transform 0.9s var(--ease-out);
}

.fade-section.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ===== ABOUT ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 72px;
    align-items: start;
}

.about-bio p {
    margin-bottom: 18px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.85;
}

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

.interests-heading {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 18px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--text-mid);
    background: var(--tag-bg);
    border: 1px solid var(--border);
    padding: 5px 13px;
    border-radius: 2px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    cursor: default;
}

.tag:hover {
    color: var(--text);
    border-color: var(--accent);
    background: var(--bg);
}

/* ===== AFFILIATIONS ===== */
.logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.logo-card {
    border: 1px solid var(--border);
    padding: 28px 16px 22px;
    text-align: center;
    transition: border-color 0.25s, background 0.25s;
    cursor: default;
}

.logo-card:hover {
    border-color: var(--accent);
    background: var(--bg);
}

.logo-abbr {
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--text-mid);
    margin-bottom: 10px;
    transition: color 0.25s;
}

.logo-card:hover .logo-abbr {
    color: var(--text);
}

.logo-name {
    font-size: 10px;
    letter-spacing: 0.04em;
    color: var(--text-soft);
    line-height: 1.5;
}

.logo-img-wrap {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.logo-img-wrap img {
    max-height: 40px;
    max-width: 120px;
    width: auto;
    object-fit: contain;
    filter: grayscale(1) opacity(0.5);
    transition: filter 0.3s ease;
}

.logo-card:hover .logo-img-wrap img {
    filter: grayscale(0) opacity(1);
}

/* White logos need invert so they're visible on light background */
.logo-card--white .logo-img-wrap img {
    filter: grayscale(1) invert(0.85) opacity(0.55);
}

.logo-card--white:hover .logo-img-wrap img {
    filter: grayscale(1) invert(0.85) opacity(0.9);
}

/* ===== PUBLICATIONS ===== */
.pub-list {
    display: flex;
    flex-direction: column;
}

.pub-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 36px;
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
}

.pub-item:first-child {
    border-top: 1px solid var(--border);
}

.pub-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}

.pub-year {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 300;
    color: var(--text-soft);
}

.pub-badge {
    display: inline-block;
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 2px 7px;
    border-radius: 1px;
    width: fit-content;
}

.pub-badge-report {
    color: var(--text-soft);
    border-color: var(--border);
}

.pub-title {
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--text);
}

.pub-authors,
.pub-venue {
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 4px;
}

.pub-venue {
    font-style: italic;
}

.pub-links {
    margin-top: 16px;
}

.pub-link {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
    transition: border-color 0.2s;
}

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

/* ===== EXPERIENCE ===== */
.exp-group {
    margin-bottom: 68px;
}

.exp-group:last-child {
    margin-bottom: 0;
}

.exp-group-title {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
}

.exp-list {
    display: flex;
    flex-direction: column;
}

.exp-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 28px;
    padding: 26px 0;
    border-bottom: 1px solid var(--border);
}

.exp-item:first-child {
    border-top: 1px solid var(--border);
}

.exp-period {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-soft);
    letter-spacing: 0.02em;
    padding-top: 2px;
    line-height: 1.5;
}

.exp-role {
    font-size: 15px;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 3px;
}

.exp-org {
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 10px;
}

.exp-desc {
    font-size: 13px;
    color: var(--text-mid);
    line-height: 1.75;
}

/* ===== HOBBIES ===== */
.hobby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.hobby-card {
    border: 1px solid var(--border);
    padding: 28px 20px 22px;
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hobby-card:hover {
    border-color: var(--accent);
    background: var(--bg-tinted);
}

.hobby-name {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 400;
    color: var(--text);
    transition: color 0.25s;
}

.hobby-explore {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-soft);
    transition: color 0.25s;
}

.hobby-card:hover .hobby-explore {
    color: var(--accent);
}

/* ===== MODAL ===== */
.hobby-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hobby-modal.open {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 25, 23, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-panel {
    position: relative;
    z-index: 1;
    background: var(--bg);
    width: min(720px, 92vw);
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.35s var(--ease-out);
}

.hobby-modal.open .modal-panel {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 32px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 400;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-soft);
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    overflow-y: auto;
    padding: 32px;
    flex: 1;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.photo-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.photo-grid img:hover {
    opacity: 0.85;
}

.modal-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    color: var(--text-soft);
    font-size: 13px;
    letter-spacing: 0.08em;
}

/* ===== CONTACT ===== */
.contact-body {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.contact-email {
    font-family: var(--font-serif);
    font-size: clamp(24px, 3.2vw, 40px);
    font-weight: 300;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    display: inline-block;
    transition: border-color 0.25s, color 0.25s;
}

.contact-email:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.contact-links {
    display: flex;
    gap: 36px;
}

.contact-social {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-soft);
    text-decoration: none;
    transition: color 0.2s;
}

.contact-social:hover {
    color: var(--text);
}

/* ===== FOOTER ===== */
.footer {
    padding: 36px 0;
    border-top: 1px solid var(--border);
}

.footer .container {
    display: flex;
    justify-content: center;
}

.footer span {
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--text-soft);
}

/* ===== TRAVEL MAP ===== */
.map-wrap {
    position: relative;
    width: 100%;
    border: 1px solid var(--border);
    overflow: hidden;
}

#travel-map {
    width: 100%;
    height: auto;
    display: block;
    background: #E2EBF0;
}

.map-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 5px 12px;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--text-mid);
    opacity: 0;
    transition: opacity 0.12s;
    white-space: nowrap;
    z-index: 10;
}

.map-legend {
    display: flex;
    gap: 28px;
    margin-top: 16px;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.legend-country {
    width: 20px;
    height: 10px;
    background: rgba(155, 123, 90, 0.22);
    border: 1px solid var(--accent);
    flex-shrink: 0;
}

.legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.legend-rooted {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #5C3D20;
    box-shadow: 0 0 0 2px rgba(92, 61, 32, 0.3);
    flex-shrink: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
    :root {
        --section-v: 72px;
    }

    .container,
    .hero {
        padding-left: 28px;
        padding-right: 28px;
    }

    .nav {
        padding: 16px 28px;
    }

    .nav-links {
        gap: 22px;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-photo {
        order: -1;
    }

    .hero-photo img {
        width: 140px;
        aspect-ratio: 3 / 4;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 44px;
    }

    .pub-item {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .pub-meta {
        flex-direction: row;
        align-items: center;
        gap: 14px;
    }

    .exp-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .exp-period {
        color: var(--text-soft);
        font-size: 11px;
    }

    .logos-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .hero-scroll {
        left: 28px;
        bottom: 36px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        display: none;
    }

    .contact-links {
        flex-wrap: wrap;
        gap: 20px;
    }
}
