/* ==========================================================================
   Jingdong Zhang — homepage theme (index.html)
   Dark ink background, ivory text, antique-gold accents, Garamond typography.
   ========================================================================== */

:root {
    --bg: #0e1215;
    --ink: #ebe6da;
    --ink-soft: #beb8ab;
    --ink-mute: #8d887e;
    --line: rgba(235, 230, 218, 0.10);
    --line-strong: rgba(235, 230, 218, 0.22);
    --gold: #c9a96a;
    --gold-bright: #e4cb94;
    --gold-dim: rgba(201, 169, 106, 0.14);
    --on-gold: #17130b;

    --f-display: 'Cormorant Garamond', 'Cormorant', Garamond, 'Times New Roman', serif;
    --f-body: 'EB Garamond', Garamond, Georgia, 'Times New Roman', serif;
    --f-cn: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
    --f-brush: 'Ma Shan Zheng', 'Noto Serif SC', serif;

    --ease: cubic-bezier(.22, .61, .36, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);

    --sidebar-w: 330px;
    --topbar-h: 58px;
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }

html {
    background: var(--bg);
    scrollbar-color: #2b3238 var(--bg);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 19px;
    line-height: 1.7;
    font-kerning: normal;
    font-variant-ligatures: common-ligatures;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}

/* faint film grain over the whole page */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: .045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--gold); color: var(--on-gold); }

img { display: block; max-width: 100%; }

p { margin: 0 0 1.1em; }

b, strong { font-weight: 600; color: var(--ink); }

h1, h2, h3, h4, h5 { margin: 0; font-weight: 500; }

.cn-name { font-family: var(--f-cn); font-weight: 300; }

/* Links — hairline underline that draws in from the left */
a {
    color: var(--ink);
    text-decoration: none;
    background-image: linear-gradient(var(--gold), var(--gold));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% 1px;
    transition: color .45s var(--ease), background-size .55s var(--ease);
}
a:hover, a:focus-visible {
    color: var(--gold-bright);
    background-size: 100% 1px;
}
a:focus-visible { outline: 1px dashed var(--gold); outline-offset: 4px; }

/* ------------------------------------------------------------------ cover */

.cover {
    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 540px;
    overflow: hidden;
    background: var(--bg);
    isolation: isolate;
}

.cover__media {
    position: absolute;
    inset: 0;
    will-change: transform, opacity;
}

.cover__img {
    position: absolute;
    inset: 0;
    background: #1b2126 url("../../homepage_assets/cover_2560.jpg") center 42% / cover no-repeat;
    opacity: 0;
    transform: scale(1.12);
    will-change: transform, opacity;
    transition:
        opacity 2.2s var(--ease),
        transform 9s var(--ease-out);
}
@media (max-width: 900px) {
    .cover__img { background-image: url("../../homepage_assets/cover_1280.jpg"); }
}
.cover.is-ready .cover__img {
    opacity: 1;
    transform: scale(1.03);
}

.cover__shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(8, 11, 13, .08), rgba(8, 11, 13, .08)),
        linear-gradient(to bottom, rgba(8, 11, 13, .50) 0%, rgba(8, 11, 13, 0) 24%),
        radial-gradient(120% 90% at 50% 45%, rgba(8, 11, 13, 0) 45%, rgba(8, 11, 13, .45) 100%),
        linear-gradient(to bottom,
            rgba(14, 18, 21, 0) 42%,
            rgba(14, 18, 21, .38) 60%,
            rgba(14, 18, 21, .78) 78%,
            rgba(14, 18, 21, .96) 92%,
            var(--bg) 100%);
}

.cover__inner {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 20vh;
    bottom: 20svh;
    padding: 0 24px;
    text-align: center;
    will-change: transform, opacity;
}
.cover__inner::before {        /* soft dark halo so the type reads over bright snow */
    content: '';
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 50%;
    width: min(1100px, 110vw);
    height: 150%;
    translate: -50% -50%;
    background: radial-gradient(closest-side, rgba(8, 11, 13, .5), rgba(8, 11, 13, .22) 55%, rgba(8, 11, 13, 0));
    pointer-events: none;
}

.cover [data-anim] {
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity 1.6s var(--ease-out) var(--d, 0s),
        transform 1.6s var(--ease-out) var(--d, 0s);
}
.cover.is-ready [data-anim] { opacity: 1; transform: none; }

.cover__caption {
    margin: 0;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: .44em;
    padding-left: .44em;          /* balance the trailing letter-spacing */
    text-transform: uppercase;
    color: #eedcb0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .55), 0 2px 18px rgba(0, 0, 0, .7);
}

.cover__name {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(3.1rem, 8vw, 7rem);
    line-height: 1;
    letter-spacing: .045em;
    color: #f4efe4;
    text-shadow: 0 2px 40px rgba(0, 0, 0, .45);
}
/* letters gather towards the centre with transforms only (spans built in site.js) */
.cover__name .ch {
    display: inline-block;
    transform: translate3d(var(--dx, 0), 0, 0);
    transition: transform 2.6s var(--ease-out) calc(var(--d, 0s) + .05s);
}
.cover.is-ready .cover__name .ch { transform: none; }

.cover__cn {
    margin: 2rem 0 0;
    font-family: var(--f-brush);
    font-size: clamp(2.1rem, 3.5vw, 3rem);
    line-height: 1;
    letter-spacing: .42em;
    padding-left: .42em; /* balance the trailing letter-spacing */
    color: #f6f1e7;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 2px 22px rgba(0, 0, 0, .5);
}

.cover__rule {
    display: block;
    width: 140px;
    height: 1px;
    margin: 2rem auto 1.4rem;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
}
.cover .cover__rule[data-anim] { transform: scaleX(0); }
.cover.is-ready .cover__rule[data-anim] { transform: scaleX(1); }

.footer__mark {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin: 0 .95em;
    vertical-align: .28em;
    background: var(--gold);
    transform: rotate(45deg);
}

/* the wrapper carries the scroll-driven fade; the link keeps its own entrance transition */
.cover__hint-wrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4.5vh;
    display: flex;
    justify-content: center;
    will-change: opacity;
}
.cover__hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: none;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .7rem;
    letter-spacing: .38em;
    padding-left: .38em;
    text-transform: uppercase;
    color: var(--ink-mute);
}
.cover__hint i {
    position: relative;
    width: 1px;
    height: 46px;
    background: var(--line-strong);
    overflow: hidden;
}
.cover__hint i::after {
    content: '';
    position: absolute;
    left: 0;
    top: -40%;
    width: 1px;
    height: 40%;
    background: var(--gold-bright);
    animation: hint-drop 2.4s var(--ease) infinite;
}
.cover__hint:hover { color: var(--gold-bright); background: none; }
@keyframes hint-drop {
    0%   { top: -40%; }
    70%  { top: 100%; }
    100% { top: 100%; }
}

/* ------------------------------------------------------------------ star-trail backdrop */

.cover { z-index: 2; }

.sky {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    /* visible in the side margins, fading out over the sidebar + text column (stops set from JS) */
    --sky-l1: 0px;
    --sky-l2: 0px;
    --sky-r2: 100%;
    --sky-r1: 100%;
    -webkit-mask-image: linear-gradient(to right,
        #000 0, #000 var(--sky-l1), transparent var(--sky-l2),
        transparent var(--sky-r2), #000 var(--sky-r1), #000 100%);
            mask-image: linear-gradient(to right,
        #000 0, #000 var(--sky-l1), transparent var(--sky-l2),
        transparent var(--sky-r2), #000 var(--sky-r1), #000 100%);
}
.sky canvas {
    position: absolute;
    will-change: transform;
}

/* ------------------------------------------------------------------ layout */

.page {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    column-gap: clamp(48px, 6vw, 110px);
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 clamp(24px, 4vw, 64px);
}

/* ------------------------------------------------------------------ sidebar */

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    align-items: center;
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar__inner {
    width: 100%;
    padding: 56px 0 48px;
    border-right: 1px solid var(--line);
    padding-right: 36px;
}

/* ------------------------------------------------------------------ recessed wells
   Portrait, logos and publication figures are set *into* the page rather than
   framed on top of it: a gilded inlay edge, a dark lower layer, and inner shadows
   that are heavier under the top rim (lit from above). The shading lives on
   ::after above the picture, so on hover the picture zooms beneath a fixed rim.
   No CSS filters touch the animated thumbnails; the slight darkening is a flat overlay. */

.portrait,
.inst__logo,
.pub__thumb {
    position: relative;
    display: block;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(201, 169, 106, .55);
    border-radius: 4px;
    background: #0a0d10;
    box-shadow:
        0 1px 0 rgba(255, 240, 210, .07),      /* lit lower lip of the cut */
        0 -1px 0 rgba(0, 0, 0, .55);           /* shaded upper lip */
    transition: border-color .8s var(--ease-out), box-shadow .8s var(--ease-out);
}
.portrait::after,
.inst__logo::after,
.pub__thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    background: rgba(10, 13, 16, .14);            /* keep whites a touch darker */
    box-shadow:
        inset 0 8px 14px -5px rgba(0, 0, 0, .78), /* deep shadow under the top rim */
        inset 0 0 22px 2px rgba(0, 0, 0, .42),    /* all-round recess */
        inset 0 -1px 0 rgba(255, 240, 210, .10);  /* faint catch-light on the bottom rim */
    transition: background-color .8s var(--ease-out), box-shadow .8s var(--ease-out);
}
.portrait img,
.inst__logo img,
.pub__media {
    position: relative;
    z-index: 1;
    transform: scale(1.001);
    transition: transform 1.4s var(--ease-out), opacity .8s var(--ease-out);
}
/* Publications zoom this wrapper. Keep animated thumbnails as images (WebP/GIF):
   a scaled <video> jitters during the zoom in Chrome/Safari. No permanent
   will-change here — a pre-promoted layer can come back unpainted after a
   back/forward-cache restore. */
.pub__media { display: block; }
.portrait:hover,
.inst__logo:hover,
.pub__thumb:hover {
    border-color: rgba(228, 203, 148, .92);
    box-shadow:
        0 1px 0 rgba(255, 240, 210, .09),
        0 -1px 0 rgba(0, 0, 0, .55),
        0 0 0 3px rgba(201, 169, 106, .07);
}
.portrait:hover::after,
.inst__logo:hover::after,
.pub__thumb:hover::after { background-color: rgba(10, 13, 16, .05); }
.portrait:hover img,
.pub__thumb:hover .pub__media { transform: scale(1.045); }

.portrait {
    width: 164px;
    margin: 2px 0 28px 1px;
}
.portrait img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.sb-name {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: 2.3rem;
    line-height: 1.05;
    letter-spacing: .01em;
    color: #f4efe4;
}
.sb-cn {
    margin: .55rem 0 1.3rem;
    font-weight: 500;
    font-size: 1.45rem;
    line-height: 1.2;
    letter-spacing: .32em;
    color: #d8d1c3;
}

.sb-contact {
    font-size: .92rem;
    line-height: 1.75;
    color: var(--ink-soft);
    margin-bottom: 1.2rem;
}
.sb-contact i {
    width: 1.3em;
    margin-right: .35em;
    color: var(--gold);
    font-size: .85em;
    text-align: center;
}

.sb-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    margin-bottom: 2.1rem;
}

/* Pill button — gold fill slides in from the left.
   The fill is the element's own background painted under the border (border-box),
   so fill and border share one outer edge: no hairline seam at any zoom level. */
.pill {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: .34em .95em .36em;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background-image: linear-gradient(var(--gold), var(--gold));
    background-repeat: no-repeat;
    background-origin: border-box;
    background-clip: border-box;
    background-position: 0 0;
    background-size: 0% 100%;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .9rem;
    letter-spacing: .05em;
    line-height: 1.4;
    color: var(--ink-soft);
    transition:
        background-size .6s var(--ease),
        color .5s var(--ease),
        border-color .5s var(--ease),
        transform .5s var(--ease),
        box-shadow .5s var(--ease);
}
.pill i { font-size: .85em; color: var(--gold); transition: color .5s var(--ease); }

/* Icon-only round variant (sidebar profile links): gold blooms out from the centre.
   The fill overshoots the circle and is clipped by the element's own rounded edge,
   so there is no seam between fill and border. */
.pill--icon {
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    gap: 0;
    border-radius: 50%;
    background-image: radial-gradient(circle closest-side, var(--gold) 0 99%, transparent 100%);
    background-position: 50% 50%;
    background-size: 0% 0%;
}
.pill--icon i { font-size: 1.22rem; line-height: 1; }
.pill--icon:hover,
.pill--icon:focus-visible { background-size: 160% 160%; }
.pill:hover, .pill:focus-visible {
    color: var(--on-gold);
    border-color: var(--gold);
    background-size: 100% 100%;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -14px rgba(201, 169, 106, .8);
}
.pill:hover i, .pill:focus-visible i { color: var(--on-gold); }

/* Table of contents with scroll-spy */
.toc { display: flex; flex-direction: column; gap: 2px; }
.toc a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 0;
    background: none;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--ink-mute);
    transition: color .45s var(--ease);
}
.toc a i {
    display: block;
    width: 18px;
    height: 1px;
    background: currentColor;
    opacity: .6;
    transition: width .55s var(--ease), background-color .45s var(--ease), opacity .45s var(--ease);
}
.toc a span { transition: transform .55s var(--ease); }
.toc a:hover { color: var(--ink); }
.toc a:hover i { width: 34px; opacity: 1; }
.toc a.is-active { color: var(--gold-bright); }
.toc a.is-active i { width: 52px; opacity: 1; background: var(--gold); }

/* ------------------------------------------------------------------ content */

.content {
    max-width: 820px;
    padding: 15vh 0 0;
}

.section { padding-top: 13vh; }
.section--intro { padding-top: 0; }

.section__head {
    display: flex;
    align-items: baseline;
    gap: 18px;
    margin-bottom: 44px;
}
.section__title {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(2.1rem, 3.3vw, 2.9rem);
    line-height: 1.1;
    letter-spacing: .005em;
    color: #f4efe4;
}
.section__rule {
    flex: 1;
    align-self: center;
    height: 1px;
    min-width: 40px;
    background: linear-gradient(to right, var(--line-strong), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.8s var(--ease-out) .25s;
}
.section__head.is-visible .section__rule,
html:not(.js) .section__rule { transform: scaleX(1); }

/* Intro */
.bio-lead {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(1.45rem, 2.1vw, 1.75rem);
    line-height: 1.5;
    color: #f1ece1;
    margin-bottom: 1.2em;
}
.section--intro p { color: var(--ink-soft); }
.section--intro .bio-lead { color: #e4ded1; }
.section--intro p a { color: var(--ink); }
.section--intro .bio-lead a { color: #f6f1e6; }

/* Links inside running text keep a faint rule; hover draws the gold one over it */
.section--intro p a,
.pub__venue a {
    background-image:
        linear-gradient(var(--gold), var(--gold)),
        linear-gradient(rgba(235, 230, 218, .28), rgba(235, 230, 218, .28));
    background-size: 0% 1px, 100% 1px;
    background-position: 0 100%, 0 100%;
}
.section--intro p a:hover,
.pub__venue a:hover { background-size: 100% 1px, 100% 1px; }
.pub__venue a {
    background-image:
        linear-gradient(var(--gold-bright), var(--gold-bright)),
        linear-gradient(rgba(201, 169, 106, .35), rgba(201, 169, 106, .35));
}

.interests {
    margin-top: 2.2rem;
    padding: 1.4rem 1.7rem 1.3rem;
    border: 1px solid var(--line);
    border-left: 2px solid var(--gold);
    background: linear-gradient(100deg, var(--gold-dim), rgba(201, 169, 106, 0) 70%);
    border-radius: 2px;
}
.interests__label {
    margin: 0 0 .5rem;
    font-family: var(--f-display);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--ink-soft);
}
.interests ul { list-style: none; margin: 0; padding: 0; }
.interests li {
    position: relative;
    padding-left: 1.5rem;
    font-family: var(--f-display);
    font-weight: 500;
    font-size: 1.28rem;
    line-height: 1.7;
    color: var(--ink);
}
.interests li { padding-bottom: .35rem; }
.interests li b { font-weight: 600; color: #f4efe4; }
.interests li span {
    display: block;              /* description sits under its title */
    margin-top: .1rem;
    font-family: var(--f-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink-soft);
}
.interests li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: .78em;
    width: 6px;
    height: 6px;
    border: 1px solid var(--gold);
    transform: rotate(45deg);
}

/* News */
.news {
    position: relative;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.news::after {                 /* fade hint at the bottom of the scroll box */
    content: '';
    position: absolute;
    left: 0;
    right: 12px;
    bottom: 0;
    height: 56px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(14, 18, 21, 0), var(--bg));
    transition: opacity .4s var(--ease);
}
.news.is-end::after { opacity: 0; }
.news__list {
    list-style: none;
    margin: 0;
    padding: 6px 12px 6px 0;
    max-height: 372px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 169, 106, .45) transparent;
    overscroll-behavior: contain;
}
.news__list::-webkit-scrollbar { width: 5px; }
.news__list::-webkit-scrollbar-thumb { background: rgba(201, 169, 106, .45); border-radius: 3px; }
.news__list li {
    position: relative;
    display: grid;
    grid-template-columns: 7.2rem minmax(0, 1fr);
    gap: 18px;
    padding: 10px 14px 10px 16px;
    font-size: 1.02rem;
    line-height: 1.55;
    color: var(--ink-soft);
    transition: background-color .45s var(--ease), color .45s var(--ease);
}
.news__list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 2px;
    background: var(--gold);
    transform: scaleY(0);
    transition: transform .5s var(--ease);
}
.news__list li:hover { background: rgba(235, 230, 218, .035); color: var(--ink); }
.news__list li:hover::before { transform: scaleY(1); }
.news__list li > b {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .98rem;
    letter-spacing: .06em;
    font-variant-numeric: lining-nums tabular-nums;
    color: var(--ink-mute);
    white-space: nowrap;
}
.news__list li.news-hl > b { color: var(--gold-bright); }
.news__list li.news-hl span > b { color: var(--gold-bright); }

/* "On the job market" — the one item meant to catch the eye: permanent gilded bar,
   warm wash, a light sweep every few seconds, a pulsing beacon and shimmering lead.
   Sweep and beacon animate transform/opacity only. */
.news__list li.news-hot {
    margin: 4px 0 10px;
    padding: 14px 16px 14px 18px;
    overflow: hidden;
    border-radius: 4px;
    color: var(--ink);
    background: linear-gradient(100deg, rgba(201, 169, 106, .17), rgba(201, 169, 106, .05) 55%, rgba(201, 169, 106, 0));
    box-shadow: inset 0 0 0 1px rgba(201, 169, 106, .38);
}
.news__list li.news-hot:hover { background: linear-gradient(100deg, rgba(201, 169, 106, .22), rgba(201, 169, 106, .07) 55%, rgba(201, 169, 106, 0)); }
.news__list li.news-hot::before { top: 10px; bottom: 10px; transform: scaleY(1); }
.news__list li.news-hot::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 236, 196, .16) 50%, transparent 65%);
    transform: translateX(-100%);
    animation: news-sweep 5.5s var(--ease) 1.2s infinite;
}
.news__list li.news-hot > b { color: var(--gold-bright); }
.news__list li.news-hot span > b { color: #f6f1e6; }
.news-hot__lead {
    background: linear-gradient(90deg, var(--gold-bright) 0%, #fff3d4 22%, var(--gold-bright) 44%, var(--gold-bright) 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent !important;
    animation: news-shimmer 4s linear infinite;
}
.news-hot__pulse {
    position: relative;
    display: inline-block;
    width: 7px;
    height: 7px;
    margin: 0 .6em 0 .1em;
    vertical-align: .14em;
    border-radius: 50%;
    background: var(--gold-bright);
    box-shadow: 0 0 10px rgba(228, 203, 148, .7);
}
.news-hot__pulse::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid var(--gold-bright);
    animation: news-pulse 2.2s cubic-bezier(.2, .6, .35, 1) infinite;
}
@keyframes news-sweep { 0% { transform: translateX(-100%); } 42%, 100% { transform: translateX(100%); } }
@keyframes news-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes news-pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }

/* Education / Internship */
.inst {
    display: grid;
    grid-template-columns: 188px minmax(0, 1fr);
    align-items: center;
    gap: 36px;
    padding: 26px 0;
    border-top: 1px solid var(--line);
}
.inst:last-child { border-bottom: 1px solid var(--line); }

/* Institution logos sit in the same recessed well (rules above) as ivory
   single-colour marks built from each logo's alpha — the brand colours
   (black / maroon text) would vanish on the dark well otherwise. */
.inst__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 92px;
    padding: 16px 22px;
    background: linear-gradient(180deg, #0a0d10 0%, #10151a 100%);
}
/* it is a link: keep the global underline rule from resizing the well's gradient */
.inst__logo,
.inst__logo:hover,
.inst__logo:focus-visible { background-size: 100% 100%; }
.inst__logo img {
    max-height: 54px;
    width: auto;
    object-fit: contain;
    opacity: .8;
    filter: brightness(0) invert(.9) sepia(.22);
}
.inst__logo img.logo-sized {
    width: var(--lw);
    max-width: 100%;
    max-height: none;
    height: auto;
}
.inst__logo:hover img {
    opacity: 1;
    transform: scale(1.06);
}

.inst__name {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 1.55rem;
    line-height: 1.2;
    color: #f4efe4;
    margin-bottom: .25rem;
}
.inst__dept { margin: 0; font-style: italic; color: var(--ink-mute); }
.inst__role { margin: 0; color: var(--ink-soft); }
.inst__date {
    display: inline-block;
    margin-top: .45rem;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    font-variant-numeric: lining-nums;
    color: var(--gold);
}

/* Publications */
.pub {
    display: grid;
    grid-template-columns: 31% minmax(0, 1fr);
    align-items: center;
    gap: 36px;
    padding: 34px 0;
    border-top: 1px solid var(--line);
}
.pub:last-child { border-bottom: 1px solid var(--line); }

/* .pub__thumb appearance comes from the recessed-well rules above.
   Every figure sits in the same 3:2 frame: it is scaled to fit (never cropped) and the
   spare edges are filled with a colour matching the figure — white by default (which
   also keeps transparent PNG figures readable), black for dark figures; figures whose
   edges are busy are cropped to fill instead. */
.pub__media { aspect-ratio: 3 / 2; }
.pub__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}
.pub__media--black img { background: #000; }
.pub__media--cover img { object-fit: cover; }

.pub__title {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 1.42rem;
    line-height: 1.28;
    color: #f4efe4;
    margin-bottom: .55rem;
}
.pub__authors {
    font-size: .98rem;
    line-height: 1.6;
    color: var(--ink-mute);
}
.pub__authors a { color: var(--ink-soft); }
.pub__authors a:hover { color: var(--gold-bright); }
.pub__authors b { color: #f4efe4; font-weight: 600; }
span.pub__thumb { cursor: default; }   /* a figure without a link yet */

.pub__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 8px;
    margin: .85rem 0 .9rem;
}
.pub__venue {
    margin-right: 10px;
    font-family: var(--f-display);
    font-style: italic;
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--gold-bright);
}
.pub__venue a { color: var(--gold-bright); }
.pub__venue a:hover { color: #f6e3b8; }

/* Link chip — gold fill rises from the bottom (same seamless border-box technique as .pill) */
.chip {
    display: inline-block;
    padding: .12em .8em .16em;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background-image: linear-gradient(var(--gold), var(--gold));
    background-repeat: no-repeat;
    background-origin: border-box;
    background-clip: border-box;
    background-position: 0 100%;
    background-size: 100% 0%;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .74rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    transition:
        background-size .5s var(--ease),
        color .45s var(--ease),
        border-color .45s var(--ease),
        transform .45s var(--ease);
}
.chip:hover, .chip:focus-visible {
    color: var(--on-gold);
    border-color: var(--gold);
    background-size: 100% 100%;
    transform: translateY(-1px);
}

.pub__abstract {
    margin: 0;
    font-size: .95rem;
    line-height: 1.65;
    color: var(--ink-mute);
    text-align: justify;
    hyphens: auto;
}
.pub__abstract b { color: var(--ink-soft); }

/* Research experience / awards */
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li {
    position: relative;
    padding: 14px 0 14px 30px;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    line-height: 1.6;
}
.ledger li:last-child { border-bottom: 1px solid var(--line); }
.ledger li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 1.55em;
    width: 7px;
    height: 7px;
    border: 1px solid var(--gold);
    transform: rotate(45deg);
    transition: background-color .45s var(--ease), transform .6s var(--ease);
}
.ledger li:hover::before { background: var(--gold); transform: rotate(225deg); }
.ledger li > b {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 1.12rem;
    font-variant-numeric: lining-nums;
    color: var(--gold-bright);
}
.ledger__sub { font-style: italic; color: var(--ink-mute); }

/* Service & teaching */
.service {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 22px;
}
.service__card {
    position: relative;
    isolation: isolate;
    padding: 26px 28px 20px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: linear-gradient(160deg, rgba(235, 230, 218, .035), rgba(235, 230, 218, 0) 60%);
    transition: box-shadow 1.1s var(--ease-out);
}
/* gilded edge: a gradient ring (brightest at the top-left, dissolving along the sides)
   that fades in over the hairline instead of the whole border switching colour */
.service__card::before,
.service__card::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 1.1s var(--ease-out);
}
.service__card::before {
    inset: -1px;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(228, 203, 148, .75) 0%,
        rgba(201, 169, 106, .28) 32%,
        rgba(201, 169, 106, .06) 62%,
        rgba(201, 169, 106, .22) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.service__card::after {
    inset: 0;
    z-index: -1;
    background: radial-gradient(120% 80% at 0% 0%, rgba(201, 169, 106, .085), rgba(201, 169, 106, 0) 60%);
}
.service__card:hover { box-shadow: 0 24px 44px -30px rgba(0, 0, 0, .9); }
.service__card:hover::before,
.service__card:hover::after { opacity: 1; }
.service__title {
    margin-bottom: .8rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--line);
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 1.3rem;
    color: #f4efe4;
}
.service ul { list-style: none; margin: 0; padding: 0; }
.service li { padding: 4px 0; font-size: 1rem; color: var(--ink-soft); }
.service__venues { margin: 0; font-size: 1.02rem; line-height: 1.85; letter-spacing: .02em; color: var(--ink-soft); }

/* Miscellaneous — photographs */
.misc-lead {
    font-family: var(--f-display);
    font-style: italic;
    font-size: 1.35rem;
    color: var(--ink-soft);
    margin-bottom: 2.6rem;
}
.gallery { display: flex; flex-direction: column; gap: 56px; }
.gallery__item { margin: 0; }
.gallery__frame {
    overflow: hidden;
    border-radius: 3px;
    box-shadow: 0 0 0 1px var(--line), 0 30px 60px -34px rgba(0, 0, 0, .95);
}
.gallery__frame img {
    width: 100%;
    transform: scale(1.001);
    transition: transform 2.4s var(--ease-out), filter 1.2s var(--ease);
    filter: brightness(.93);
}
.gallery__item:hover .gallery__frame img { transform: scale(1.035); filter: brightness(1); }
.gallery__item figcaption {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
    font-family: var(--f-display);
    font-style: italic;
    font-size: 1.05rem;
    letter-spacing: .02em;
    color: var(--ink-mute);
}
.gallery__item figcaption::before,
.gallery__item figcaption::after {
    content: '';
    width: 28px;
    height: 1px;
    background: var(--line-strong);
    transition: width .8s var(--ease), background-color .8s var(--ease);
}
.gallery__item:hover figcaption::before,
.gallery__item:hover figcaption::after { width: 48px; background: var(--gold); }

/* Footer */
.footer {
    margin-top: 16vh;
    padding: 34px 0 64px;
    border-top: 1px solid var(--line);
    text-align: center;
}
.footer .footer__mark { display: block; margin: 0 auto 16px; }
.footer p {
    margin: 0;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

/* ------------------------------------------------------------------ publication -> page transition */

/* The clicked figure fades out of its slot while its copy flies; removing the class
   (on return to the page) fades it back in along the same curve. */
.pub__thumb {
    transition:
        border-color .8s var(--ease-out),
        box-shadow .8s var(--ease-out),
        opacity .45s cubic-bezier(.4, 0, .2, 1);
}
.pub__thumb.is-lifted { opacity: .001; }   /* not 0: Chrome may skip painting a fully transparent subtree */

/* JS-independent safety net, armed when the page is left: CSS animations run on the
   document timeline, which is frozen in the back/forward cache and resumes on return,
   so even if no restore handler runs, the page un-dims shortly after coming back. */
.zoom-veil.is-leaving { animation: zoom-release .5s ease-out 2.4s forwards; }
.pub__thumb.is-lifted.is-leaving { animation: zoom-return .5s ease-out 2.4s forwards; }
@keyframes zoom-release { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }
@keyframes zoom-return { from { opacity: .001; } to { opacity: 1; } }

.zoom-veil {
    position: fixed;
    inset: 0;
    z-index: 91;
    background: var(--bg);
    opacity: 0;
    pointer-events: none;
}
.zoomer.pub__thumb {
    position: fixed;
    z-index: 90;
    margin: 0;
    pointer-events: none;
    transform-origin: 50% 50%;
    will-change: transform, opacity;
    box-shadow:
        0 1px 0 rgba(255, 240, 210, .09),
        0 30px 80px -20px rgba(0, 0, 0, .9);
}

/* ------------------------------------------------------------------ reveal on scroll */

.js .reveal {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    transition:
        opacity 1.1s var(--ease-out) var(--d, 0s),
        transform 1.1s var(--ease-out) var(--d, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ mobile top bar + drawer */

.topbar, .drawer { display: none; }

@media (max-width: 1080px) {
    :root { --sidebar-w: 290px; }
    .sidebar__inner { padding-right: 28px; }
    .pub { grid-template-columns: 36% minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 900px) {
    body { font-size: 17.5px; }

    .page {
        grid-template-columns: minmax(0, 1fr);
        padding: 0 22px;
    }

    .sidebar {
        position: static;
        height: auto;
        overflow: visible;
        display: block;
    }
    .sidebar__inner {
        padding: calc(var(--topbar-h) + 34px) 0 30px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .toc { display: none; }
    .sb-links { margin-bottom: 0; }

    .content { padding-top: 44px; }
    .section { padding-top: 84px; scroll-margin-top: calc(var(--topbar-h) - 40px); }
    .section--intro { scroll-margin-top: var(--topbar-h); }

    .inst { grid-template-columns: 120px minmax(0, 1fr); gap: 20px; }
    .inst__logo { height: 70px; padding: 10px 14px; }
    .inst__logo img { max-height: 46px; }
    .inst__logo img.logo-sized { width: calc(var(--lw) * .68); max-height: none; }
    .inst__name { font-size: 1.3rem; }

    .pub { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .pub__abstract { text-align: left; }

    .news__list li { grid-template-columns: minmax(0, 1fr); gap: 0; }

    .service { grid-template-columns: minmax(0, 1fr); }

    .cover__caption { font-size: .8rem; letter-spacing: .34em; padding-left: .34em; }
    .sky { display: none; }
    .portrait { width: 150px; }

    /* top bar appears once the cover has been passed */
    .topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 60;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: var(--topbar-h);
        padding: 0 18px 0 22px;
        background: rgba(14, 18, 21, .78);
        -webkit-backdrop-filter: blur(14px) saturate(1.2);
        backdrop-filter: blur(14px) saturate(1.2);
        border-bottom: 1px solid var(--line);
        opacity: 0;
        transform: translateY(-100%);
        pointer-events: none;
        transition: opacity .5s var(--ease), transform .6s var(--ease);
    }
    body.past-cover .topbar { opacity: 1; transform: none; pointer-events: auto; }
    .topbar__name {
        background: none;
        font-family: var(--f-display);
        font-weight: 600;
        font-size: 1.25rem;
        color: #f4efe4;
    }
    .topbar__name .cn-name { margin-left: .4em; font-size: .85rem; letter-spacing: .2em; color: var(--ink-mute); }
    .topbar__menu {
        position: relative;
        width: 40px;
        height: 40px;
        border: 0;
        background: none;
        cursor: pointer;
    }
    .topbar__menu span {
        position: absolute;
        left: 10px;
        right: 10px;
        height: 1px;
        background: var(--ink);
        transition: transform .5s var(--ease), top .5s var(--ease);
    }
    .topbar__menu span:first-child { top: 16px; }
    .topbar__menu span:last-child { top: 23px; }
    body.menu-open .topbar__menu span:first-child { top: 20px; transform: rotate(45deg); }
    body.menu-open .topbar__menu span:last-child { top: 20px; transform: rotate(-45deg); }

    .drawer {
        position: fixed;
        inset: 0;
        z-index: 55;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        padding: 0 36px;
        background: rgba(11, 14, 17, .96);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        opacity: 0;
        visibility: hidden;
        transition: opacity .5s var(--ease), visibility 0s linear .5s;
    }
    body.menu-open .drawer { opacity: 1; visibility: visible; transition: opacity .5s var(--ease); }
    .drawer a {
        background: none;
        font-family: var(--f-display);
        font-weight: 500;
        font-size: 2rem;
        line-height: 1.35;
        color: var(--ink-soft);
        opacity: 0;
        transform: translateY(14px);
        transition: opacity .6s var(--ease-out), transform .6s var(--ease-out), color .4s var(--ease);
    }
    body.menu-open .drawer a { opacity: 1; transform: none; }
    body.menu-open .drawer a:nth-child(2) { transition-delay: .04s; }
    body.menu-open .drawer a:nth-child(3) { transition-delay: .08s; }
    body.menu-open .drawer a:nth-child(4) { transition-delay: .12s; }
    body.menu-open .drawer a:nth-child(5) { transition-delay: .16s; }
    body.menu-open .drawer a:nth-child(6) { transition-delay: .20s; }
    body.menu-open .drawer a:nth-child(7) { transition-delay: .24s; }
    body.menu-open .drawer a:nth-child(8) { transition-delay: .28s; }
    body.menu-open .drawer a:nth-child(9) { transition-delay: .32s; }
    .drawer a:hover, .drawer a.is-active { color: var(--gold-bright); }
}

@media (max-height: 800px) and (min-width: 901px) {
    .portrait { width: 116px; margin-bottom: 18px; }
    .sb-name { font-size: 2rem; }
    .sb-cn { margin-bottom: .9rem; }
    .sb-links { margin-bottom: 1.5rem; }
    .toc a { padding: 2px 0; }
}

/* ------------------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important;
        transition-delay: 0s !important;
        animation: none !important;
    }
    .js .reveal { opacity: 1; transform: none; }
}
