/* ============================================================
   Weijue Bu — Academic Homepage
   Direction: Anthropic-style warm paper. Cream canvas, coral
   accent, serif display type, soft rounded cards. Background:
   a line-art robot arm sketch (ink lines, coral gripper).
   ============================================================ */

:root {
    --paper: #f0eee6;
    --panel: #faf9f5;
    --panel-2: #f5f3ec;
    --ink: #141413;
    --ink-2: #5e5d59;
    --ink-3: #91908a;
    --line: #e3e1d7;
    --line-strong: #cfccc0;
    --coral: #d97757;
    --coral-deep: #c25e3e;
    --coral-dim: rgba(217, 119, 87, .1);
    --sage: #5e8c61;
    --violet: #8b7bb8;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
    --font-kai: "Kaiti SC", "STKaiti", "KaiTi", "KaiTi_GB2312", "FandolKai", "AR PL UKai CN", var(--font-serif);
    --shadow-card: 0 1px 2px rgba(20, 20, 19, .04), 0 8px 28px rgba(20, 20, 19, .05);
    --shadow-lift: 0 2px 6px rgba(20, 20, 19, .05), 0 20px 48px rgba(20, 20, 19, .1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink);
    background:
        radial-gradient(1000px 480px at 90% -10%, rgba(217, 119, 87, .06), transparent 60%),
        radial-gradient(800px 420px at -10% 35%, rgba(94, 140, 97, .05), transparent 55%),
        var(--paper);
    /* guard against horizontal scroll from the full-bleed ticker */
    overflow-x: hidden;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.topbar, main, .footer { position: relative; z-index: 1; }

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding-left: 28px;
    padding-right: 28px;
}

::selection { background: rgba(217, 119, 87, .25); }

a {
    color: var(--coral-deep);
    text-decoration: none;
    text-underline-offset: 3px;
}
a:hover { color: var(--coral); text-decoration: underline; }

a:focus-visible, .link-chip:focus-visible {
    outline: 2px solid var(--coral);
    outline-offset: 3px;
    border-radius: 4px;
}

h1, h2, h3 {
    font-family: var(--font-serif);
    color: var(--ink);
    margin: 0;
}

/* ---------------- Top bar ---------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(240, 238, 230, .82);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
}

.brand {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: .01em;
    color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--coral-deep); }
.brand .cursor { color: var(--coral); }

.topnav {
    display: flex;
    gap: 26px;
    align-items: center;
}

.topnav a {
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-2);
    position: relative;
    padding: 4px 0;
}
.topnav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1.5px;
    background: var(--coral);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s ease;
}
.topnav a:hover { color: var(--coral-deep); text-decoration: none; }
.topnav a:hover::after { transform: scaleX(1); }

/* theme toggle sits inside .topnav on every page:
   bordered icon chip; sun/moon morph on theme change */
.theme-toggle {
    position: relative;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink-2);
    cursor: pointer;
    overflow: hidden;
    transition: border-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.theme-toggle:hover {
    border-color: var(--coral);
    color: var(--coral-deep);
    box-shadow: 0 6px 20px rgba(217, 119, 87, .18);
}

.theme-toggle svg {
    position: absolute;
    transition: transform .5s cubic-bezier(.6, -.3, .3, 1.4), opacity .3s ease;
}

/* light mode: moon shows (click → dark); dark mode: sun shows */
.theme-toggle .icon-sun { transform: rotate(-90deg) scale(.3); opacity: 0; }
.theme-toggle .icon-moon { transform: rotate(0) scale(1); opacity: 1; }
html[data-theme="dark"] .theme-toggle .icon-sun { transform: rotate(0) scale(1); opacity: 1; }
html[data-theme="dark"] .theme-toggle .icon-moon { transform: rotate(90deg) scale(.3); opacity: 0; }

/* circular reveal driven by startViewTransition (unsupported → instant).
   Soft feathered edge: a registered --reveal-r custom property is animated
   from JS; the mask keeps a 140px transparent falloff so the boundary
   sweeps smoothly instead of cutting. */
@property --reveal-r {
    syntax: '<length>';
    inherits: false;
    initial-value: 0px;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) {
    z-index: 2147483646;
    -webkit-mask-image: radial-gradient(circle at var(--tx, 50%) var(--ty, 50%), black calc(var(--reveal-r, 0px) - 180px), transparent var(--reveal-r, 0px));
    mask-image: radial-gradient(circle at var(--tx, 50%) var(--ty, 50%), black calc(var(--reveal-r, 0px) - 180px), transparent var(--reveal-r, 0px));
}

/* ---------------- Shared bits ---------------- */

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--coral-deep);
    margin: 0 0 14px;
}

.tick {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--coral);
    flex: none;
}

.sec { padding: 64px 0 72px; }

.sec-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
}

.sec-head h2 {
    position: relative;
    font-size: clamp(1.65rem, 3.2vw, 2.15rem);
    font-weight: 600;
    letter-spacing: -.01em;
}

/* thin coral accent straddling the section hairline */
.sec-head h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -19px;
    width: 52px;
    height: 3px;
    border-radius: 2px;
    background: var(--coral);
}

.sec-index {
    font-family: var(--font-mono);
    font-size: .7rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink-3);
    white-space: nowrap;
}

/* ---------------- Hero ---------------- */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: 60px;
    align-items: center;
    padding: 88px 0 76px;
    position: relative;
    overflow: visible;
}

.affiliation-marks {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 18px;
}

.affiliation-marks a { display: inline-flex; align-items: center; max-width: 100%; }
.affiliation-marks img { display: block; max-width: 100%; height: auto; }
.affiliation-marks .teai-mark { width: min(368px, 100%); }
.affiliation-marks .teai-mark-dark { display: none; }
html[data-theme="dark"] .affiliation-marks .teai-mark-light { display: none; }
html[data-theme="dark"] .affiliation-marks .teai-mark-dark { display: block; }

.name {
    font-family: var(--font-kai);
    font-size: clamp(3.2rem, 7.5vw, 5.2rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: .02em;
}

.name-en {
    font-family: var(--font-mono);
    font-size: .88rem;
    font-weight: 500;
    letter-spacing: .42em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin: 14px 0 12px;
}

.bio-lead {
    font-size: 1.08rem;
    line-height: 1.75;
    margin: 0 0 14px;
}

.bio-sub {
    font-size: .98rem;
    line-height: 1.75;
    color: var(--ink-2);
    margin: 0 0 26px;
}

.bio-lead b, .bio-sub b { color: var(--ink); font-weight: 600; }

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
}

.facts li {
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-2);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px;
}

.facts .fact-hot {
    color: var(--coral-deep);
    border-color: rgba(217, 119, 87, .45);
    background: var(--coral-dim);
}

.links { display: flex; flex-wrap: wrap; gap: 12px; }

.link-chip {
    font-family: var(--font-mono);
    font-size: .76rem;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 10px 16px;
    background: var(--panel);
    position: relative;
    overflow: hidden;
    transition: border-color .25s ease, color .25s ease, box-shadow .25s ease;
    cursor: pointer;
}
.link-chip:hover {
    border-color: var(--coral);
    color: var(--coral-deep);
    box-shadow: 0 6px 20px rgba(217, 119, 87, .18);
    text-decoration: none;
}

/* sheen sweep on hover (shared by .link-chip and .pub-links a) */
.link-chip::after, .pub-links a::after {
    content: "";
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: -70%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: skewX(-16deg);
    transition: left .6s ease;
    pointer-events: none;
}
.link-chip:hover::after, .pub-links a:hover::after { left: 130%; }

/* ---------------- Hero HUD (watermark · role line · metrics) ---------------- */

.hero-text, .hero .feed {
    position: relative;
    z-index: 1;
}

/* giant outline word behind the hero, cropped at the hero's right edge */
.hero-watermark {
    position: absolute;
    top: 26px;
    left: 0;
    right: 0;
    z-index: 0;
    overflow: hidden;
    line-height: 1;
    text-align: right;
    pointer-events: none;
    user-select: none;
}

.hero-watermark span {
    display: inline-block;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: clamp(8rem, 16vw, 15rem);
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(217, 119, 87, .1);
    margin-right: -.22em;
}

.role-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0 0 26px;
}

.role-prompt { color: var(--coral-deep); font-weight: 600; margin-right: 4px; }

/* inline so the caret always hugs the typed text; the role-line is its
   own block paragraph, so width changes never reflow neighbours */
#typer { display: inline; }

.caret {
    display: inline-block;
    width: .6em;
    height: 1.1em;
    margin-left: 4px;
    background: var(--coral);
    vertical-align: -.18em;
    animation: caret-blink 1.05s linear infinite;
}
@keyframes caret-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.metrics {
    list-style: none;
    margin: 34px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    /* span the full hero width from inside the text column:
       column = (wrap - gap) * 1.15/2  =>  full = column * 2/1.15 + gap */
    width: calc(100% * 2 / 1.15 + 60px);
}

.metrics li {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 18px 18px 4px;
}
.metrics li:first-child { padding-left: 0; }
.metrics li + li { border-left: 1px solid var(--line); }

.metric-num {
    font-family: var(--font-serif);
    font-size: 2.05rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.metric-label {
    font-family: var(--font-mono);
    font-size: .64rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* ---------------- Signal ticker ---------------- */

.ticker {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow: hidden;
    padding: 9px 0;
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
    background: rgba(250, 249, 245, .55);
}

.ticker-track {
    display: inline-flex;
    white-space: nowrap;
    will-change: transform;
    animation: ticker-scroll 28s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }

.ticker-track span {
    flex: none;
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-2);
    padding: 0 1.6em;
}

/* optional hook: wrap a separator in <b> to render it coral */
.ticker-track span b { color: var(--coral); font-weight: inherit; }

@keyframes ticker-scroll {
    to { transform: translateX(-50%); }
}

/* ---------------- Media frames (video & figures) ---------------- */

.feed {
    margin: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    position: relative;
}

.feed-screen { position: relative; }

/* viewfinder corner brackets on the video itself */
.feed-screen::before {
    content: "";
    position: absolute;
    inset: 10px;
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.9)) top left / 16px 2px,
        linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.9)) top left / 2px 16px,
        linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.9)) top right / 16px 2px,
        linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.9)) top right / 2px 16px,
        linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.9)) bottom left / 16px 2px,
        linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.9)) bottom left / 2px 16px,
        linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.9)) bottom right / 16px 2px,
        linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.9)) bottom right / 2px 16px;
    background-repeat: no-repeat;
    opacity: .8;
}

/* HUD crosshair reticle at the frame center */
.feed-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, .55), rgba(255, 255, 255, .55)) center / 20px 1px no-repeat,
        linear-gradient(rgba(255, 255, 255, .55), rgba(255, 255, 255, .55)) center / 1px 20px no-repeat;
}

/* slow scanline sweeping the whole CAM card */
.feed::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background-image: linear-gradient(180deg,
        transparent 0%,
        rgba(255, 255, 255, .22) 45%,
        rgba(255, 255, 255, .42) 50%,
        rgba(255, 255, 255, .22) 55%,
        transparent 100%);
    background-size: 100% 90px;
    background-repeat: no-repeat;
    opacity: .5;
    animation: scan-sweep 5.2s linear infinite;
}
@keyframes scan-sweep {
    0% { background-position: 0 -100px; }
    100% { background-position: 0 calc(100% + 100px); }
}

.feed-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: .66rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-2);
    background: var(--panel-2);
    border-bottom: 1px solid var(--line);
    padding: 8px 14px;
}

.rec {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--coral-deep);
    white-space: nowrap;
}
.rec i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--coral);
    animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .25; }
}

.feed video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #000;
}

.feed figcaption {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: .64rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-3);
    background: var(--panel-2);
    border-top: 1px solid var(--line);
    padding: 7px 14px;
}

/* ---------------- News ---------------- */

.news-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.news-list li {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 20px;
    align-items: baseline;
    padding: 15px 12px;
    border-bottom: 1px dashed var(--line-strong);
    border-left: 2px solid transparent;
    border-radius: 4px;
    transition: border-color .25s ease, background .25s ease;
}

.news-list li:hover {
    border-left-color: var(--coral);
    background: rgba(250, 249, 245, .85);
}

.news-list time {
    font-family: var(--font-mono);
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .06em;
    color: var(--coral-deep);
}

.news-list p { margin: 0; font-size: .96rem; }
.news-list i { color: var(--ink-2); }

/* ---------------- Publications ---------------- */

.pub {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 30px;
    padding: 26px;
    margin-bottom: 26px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    transition: transform .35s ease, box-shadow .35s ease;
}

.pub:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
}

/* JS pointer-tilt cards: transform is driven from home.js, so the
   static hover lift above is neutralized and the shadow lift stays */
.pub[data-tilt] {
    position: relative;
    will-change: transform;
    transform-style: preserve-3d;
}

.pub[data-tilt]:hover {
    transform: none;
    box-shadow: var(--shadow-lift);
}

/* soft coral glow following the pointer (--mx / --my set from JS) */
.pub[data-tilt]::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
        rgba(217, 119, 87, .13), transparent 65%);
    opacity: 0;
    transition: opacity .35s ease;
    pointer-events: none;
}
.pub[data-tilt]:hover::before { opacity: 1; }

.feed-card { display: flex; flex-direction: column; }

.feed-card .feed-screen { flex: 1; }

.feed-card .feed-screen video {
    aspect-ratio: auto;
    height: 100%;
    min-height: 220px;
}

.pub-fig {
    margin: 0;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 10px 6px;
    display: flex;
    flex-direction: column;
}

.pub-fig img {
    display: block;
    width: 100%;
    flex: 1;
    min-height: 220px;
    object-fit: cover;
    object-position: top center;
    border-radius: 6px;
    background: #fff;
    transition: transform .5s ease;
}

.pub:hover .pub-fig img { transform: scale(1.02); }

.pub-fig figcaption {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: .64rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding-top: 9px;
}

.pub-body h3 {
    font-size: 1.32rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -.01em;
    margin-bottom: 10px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.chip {
    font-family: var(--font-mono);
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 4px 11px;
    color: #fff;
    background: var(--coral);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
}

.chip-eccv { background: var(--coral); }
.chip-tcc { background: var(--sage); }
.chip-icme { background: var(--violet); }
.chip-cofirst { background: var(--ink); color: var(--paper); }
.chip-cup { background: var(--ink); color: var(--paper); }
.chip-review {
    background: transparent;
    color: var(--coral-deep);
    border: 1px dashed rgba(217, 119, 87, .6);
}

.authors {
    font-size: .9rem;
    color: var(--ink-2);
    margin: 0 0 12px;
}
.authors b { color: var(--ink); font-weight: 600; }

.eq-note {
    display: block;
    font-family: var(--font-mono);
    font-size: .68rem;
    letter-spacing: .06em;
    color: var(--ink-3);
    margin-top: 3px;
}

.abstract {
    font-size: .93rem;
    line-height: 1.72;
    color: var(--ink-2);
    margin: 0 0 16px;
}
.abstract b { color: var(--ink); font-weight: 600; }
.abstract i { color: var(--ink); }

.pub-links { display: flex; flex-wrap: wrap; gap: 10px; }

.pub-links a {
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--coral-deep);
    border: 1px solid rgba(217, 119, 87, .5);
    border-radius: 8px;
    padding: 7px 13px;
    position: relative;
    overflow: hidden;
    transition: background .25s ease, color .25s ease;
}
.pub-links a:hover {
    background: var(--coral);
    border-color: var(--coral);
    color: #fff;
    text-decoration: none;
}

.pub-full { grid-template-columns: 1fr; }

/* ---------------- Blog ---------------- */

.blog-more { margin-top: 24px; }

/* ---------------- Awards ---------------- */

.awards-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 56px;
}

.awards-list li {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 18px;
    align-items: baseline;
    padding: 14px 4px;
    border-bottom: 1px dashed var(--line-strong);
}

.awards-list time {
    font-family: var(--font-mono);
    font-size: .76rem;
    font-weight: 500;
    letter-spacing: .06em;
    color: var(--coral-deep);
}

.awards-list p { margin: 0; font-size: .94rem; }
.awards-list b { font-weight: 600; }

/* ---------------- Footer ---------------- */

.footer {
    border-top: 1px solid var(--line);
    padding: 26px 0 34px;
    margin-top: 20px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.visitor-badge {
    height: 18px;
    opacity: .85;
    display: block;
    border-radius: 3px;
}

/* ---------------- Toast ---------------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 12px);
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .06em;
    padding: 11px 18px;
    border-radius: 8px;
    box-shadow: var(--shadow-lift);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
    z-index: 100;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------------- Dark theme ---------------- */

/* toggled by the [ Dark ] topnav button (persisted in localStorage);
   components read the shared palette vars, so redefining them reskins
   the whole page — only hard-coded light tints need explicit overrides */
html[data-theme="dark"] {
    --paper: #191817;
    --panel: #22211e;
    --panel-2: #2a2926;
    --ink: #eceae3;
    --ink-2: #b3b1a9;
    --ink-3: #85837c;
    --line: #363431;
    --line-strong: #464340;
    --coral-dim: rgba(217, 119, 87, .16);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .35), 0 20px 48px rgba(0, 0, 0, .5);
}

html[data-theme="dark"] .topbar { background: rgba(25, 24, 23, .82); }
html[data-theme="dark"] .ticker { background: rgba(34, 33, 30, .55); }
html[data-theme="dark"] .news-list li:hover { background: rgba(34, 33, 30, .85); }

/* ---------------- Paper grain & custom cursor ---------------- */

/* faint SVG-noise tooth over the whole page — the "physical paper" feel;
   inverted to light speckle in dark mode */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: .035;
}

html[data-theme="dark"] body::before {
    filter: invert(1);
    opacity: .045;
}

/* custom cursor (JS-gated to fine pointers): instant coral dot +
   lagging reticle ring; ring expands over interactive elements */
html.fancy-cursor * { cursor: none !important; }
html.fancy-cursor input, html.fancy-cursor textarea { cursor: text !important; }

#cursor-dot, #cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease;
}

#cursor-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--coral);
    z-index: 96;
}

#cursor-ring {
    width: 30px;
    height: 30px;
    z-index: 95;
}

/* the ring itself */
#cursor-ring::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--ink-3);
    border-radius: 50%;
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}

/* reticle ticks, revealed on interactive hover */
#cursor-ring::after {
    content: "";
    position: absolute;
    inset: -7px;
    background:
        linear-gradient(var(--coral), var(--coral)) top center / 1.5px 5px no-repeat,
        linear-gradient(var(--coral), var(--coral)) bottom center / 1.5px 5px no-repeat,
        linear-gradient(var(--coral), var(--coral)) center left / 5px 1.5px no-repeat,
        linear-gradient(var(--coral), var(--coral)) center right / 5px 1.5px no-repeat;
    opacity: 0;
    transition: opacity .18s ease;
}

#cursor-ring.is-hover::before {
    transform: scale(1.5);
    border-color: var(--coral);
    background: rgba(217, 119, 87, .08);
}
#cursor-ring.is-hover::after { opacity: 1; }

#cursor-ring.is-down::before { transform: scale(.75); }

#cursor-dot.is-visible, #cursor-ring.is-visible { opacity: 1; }

/* ---------------- Reveal animation ---------------- */

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .7s ease, transform .7s ease;
}

.reveal.in {
    opacity: 1;
    transform: none;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 60px 0 52px;
    }
    .hero .feed { max-width: 560px; }
    .hero-watermark { display: none; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); width: auto; }
    .metrics li + li { border-left: none; }
    .metrics li:nth-child(even) { border-left: 1px solid var(--line); }
    .metrics li:nth-child(odd) { padding-left: 0; }
    .metrics li:nth-child(n+3) { border-top: 1px solid var(--line); }
    .pub { grid-template-columns: 1fr; gap: 20px; padding: 20px; }
    .pub-fig img { aspect-ratio: 16 / 10; min-height: 0; height: auto; }
    .feed-card .feed-screen video { aspect-ratio: 16 / 9; min-height: 0; height: auto; }
    .awards-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .wrap { padding-left: 20px; padding-right: 20px; }
    .topnav { gap: 16px; }
    .topnav a { font-size: .68rem; letter-spacing: .1em; }
    .topnav a:nth-child(3) { display: none; }
    .name { font-size: 3rem; }
    .role-line { font-size: .8rem; letter-spacing: .14em; }
    .metrics { margin-top: 26px; }
    .metrics li { padding: 14px 14px 4px; }
    .metric-num { font-size: 1.7rem; }
    .metric-label { font-size: .6rem; }
    .ticker { padding: 7px 0; }
    .ticker-track span { font-size: .62rem; letter-spacing: .16em; padding: 0 1.2em; }
    .news-list li { grid-template-columns: 1fr; gap: 2px; padding: 13px 10px; }
    .sec { padding: 48px 0 56px; }
    .sec-head { margin-bottom: 28px; }
}

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .rec i { animation: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .pub, .pub-fig img, .link-chip, .pub-links a, .news-list li { transition: none; }
    .caret, .ticker-track { animation: none; }
    .feed::after { display: none; }
    .link-chip::after, .pub-links a::after { display: none; }
    .pub[data-tilt] { will-change: auto; }
    .pub[data-tilt]::before { transition: none; }
}
