/* ==========================================================================
   Design tokens. Light theme by default; dark theme via prefers-color-scheme
   (see the block right below). The hero, the video wall and the method
   section are always dark (.section-dark re-scopes the same tokens).
   ========================================================================== */

:root {
    color-scheme: light dark;

    /* Princeton orange & black */
    --accent: #e77500;
    --accent-text: #b35900;   /* darker orange for small text on white */
    --accent-soft: #fff3e6;
    --accent-glow: rgba(231, 117, 0, 0.45);

    --ink: #121212;
    --ink-2: #3a3a3a;
    --ink-muted: #6b6b6b;

    --bg: #ffffff;
    --surface: #ffffff;       /* cards, chart cards, traces */
    --tint: #faf8f5;          /* alternating section background */
    --code-bg: #eeece9;
    --rule: #e7e5e4;
    --rule-soft: #f1efed;
    --rule-strong: #a8a29e;
    --seg-bg: #e7e5e4;        /* segmented-control track */
    --seg-active: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.82);

    --shadow: 0 1px 2px rgba(18, 18, 18, 0.06), 0 10px 24px -14px rgba(18, 18, 18, 0.35);
    --shadow-lg: 0 2px 4px rgba(18, 18, 18, 0.06), 0 22px 44px -18px rgba(18, 18, 18, 0.45);

    /* Method pipeline colors */
    --teacher: #0ea5e9;
    --student: #ec4899;
    --deploy: #10b981;

    /* Chart series (main.js references these by name) */
    --s-omni: #9a9a9a;
    --s-navila: #d4d4d4;
    --s-asd: #e77500;
    --s-asd35: #121212;
    --s-ablate: #a8a29e;
    --s-track: #f3f1ee;

    --radius: 14px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --nav-h: 56px;
    --gutter: clamp(16px, 3vw, 48px);
}

@media (prefers-color-scheme: dark) {
    :root {
        --accent-text: #ff9a3c;
        --accent-soft: rgba(231, 117, 0, 0.14);

        --ink: #f5f5f4;
        --ink-2: #d6d3d1;
        --ink-muted: #a3a09d;

        --bg: #0c0c0d;
        --surface: #151517;
        --tint: #111113;
        --code-bg: #1b1b1e;
        --rule: #2a2a2e;
        --rule-soft: #1f1f23;
        --rule-strong: #57534e;
        --seg-bg: #232327;
        --seg-active: #3a3a40;
        --nav-bg: rgba(12, 12, 13, 0.78);

        --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 24px -14px rgba(0, 0, 0, 0.8);
        --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 22px 44px -18px rgba(0, 0, 0, 0.9);

        --s-omni: #9a9a9a;
        --s-navila: #57575c;
        --s-asd35: #f5f5f4;
        --s-ablate: #77736f;
        --s-track: #222226;
    }
}

/* ---------- Base ---------- */

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink-2);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
code { font-family: 'JetBrains Mono', monospace; font-size: 0.9em; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Anchor targets land below the sticky nav. */
[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* Wide layout: media and grids use most of the viewport; running text keeps
   its own max-width (see .section-sub, .tldr, .highlights). */
.wrap {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.wrap-wide { max-width: 1760px; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 12px;
    z-index: 100;
    padding: 8px 14px;
    font-weight: 600;
    color: #111;
    background: var(--accent);
    border-radius: 8px;
}

.skip-link:focus { left: 12px; }

/* Shared entrance keyframes (hero on load, cards on scroll).
   Uses the individual `translate` property so hover `transform`s still work. */
@keyframes rise {
    from { opacity: 0; translate: 0 24px; }
    to   { opacity: 1; translate: 0 0; }
}

/* ---------- Sticky nav ---------- */

.topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--rule);
    transform: translateY(-105%);
    transition: transform 0.3s var(--ease);
}

/* Shown by main.js once the hero is scrolled past; always shown while focused. */
.topnav.is-visible,
.topnav:focus-within { transform: none; }

.topnav-inner {
    max-width: 1480px;
    height: var(--nav-h);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    gap: 20px;
}

.topnav-brand {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--ink);
}

.topnav-brand:hover { text-decoration: none; }

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(231, 117, 0, 0.2), 0 0 14px var(--accent-glow);
}

.topnav-links {
    list-style: none;
    margin-left: auto;
    display: flex;
    gap: 2px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.topnav-links::-webkit-scrollbar { display: none; }

.topnav-links a {
    display: block;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--ink-muted);
    border-radius: 999px;
    transition: color 0.15s ease, background 0.15s ease;
}

.topnav-links a:hover { color: var(--ink); background: var(--seg-bg); text-decoration: none; }
.topnav-links a[aria-current="true"] { color: var(--accent-text); background: var(--accent-soft); }

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

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 116px 0 44px;
    text-align: center;
    color: #e7e5e4;
    background: #0b0b0c;
}

.hero-bg {
    position: absolute;
    inset: -24px;             /* hide the soft edge the blur leaves */
    z-index: -3;
}

.hero-bg-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    filter: blur(4px) brightness(0.55) saturate(1.15);
    transform: scale(1.05);
}

/* Readability overlay: vignette + orange glow, fading to solid at the bottom
   so the hero runs seamlessly into the (dark) video wall. */
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 55% 55% at 85% 0%, rgba(231, 117, 0, 0.32), transparent 70%),
        radial-gradient(ellipse 45% 50% at 5% 100%, rgba(231, 117, 0, 0.14), transparent 70%),
        radial-gradient(ellipse 80% 70% at 50% 42%, rgba(11, 11, 12, 0.3), rgba(11, 11, 12, 0.82) 75%),
        linear-gradient(180deg, rgba(11, 11, 12, 0.55) 0%, rgba(11, 11, 12, 0.2) 45%, #0b0b0c 100%);
}

/* Faint dot grid on top of the clip. */
.hero-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 80%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 80%);
}

.hero-content > * { animation: rise 0.9s var(--ease) both; }
.hero-content > :nth-child(2) { animation-delay: 0.08s; }
.hero-content > :nth-child(3) { animation-delay: 0.18s; }
.hero-content > :nth-child(4) { animation-delay: 0.24s; }
.hero-content > :nth-child(5) { animation-delay: 0.32s; }

.venue {
    display: inline-block;
    margin-bottom: 22px;
    padding: 8px 22px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #ffb35c;
    background: rgba(231, 117, 0, 0.12);
    border: 1px solid rgba(231, 117, 0, 0.55);
    border-radius: 999px;
    box-shadow: 0 0 24px -6px var(--accent-glow);
}

.venue-short { font-weight: 800; color: #ffd19a; }
.venue-full {
    margin-left: 0.9em;
    padding-left: 0.9em;
    border-left: 1px solid rgba(231, 117, 0, 0.55);
    font-weight: 600;
    letter-spacing: 0.08em;
}

@media (max-width: 640px) {
    .venue { font-size: 0.9rem; padding: 7px 16px; }
    .venue-full { display: block; margin: 4px 0 0; padding: 0; border: 0; font-size: 0.8em; }
}

.title {
    max-width: 1180px;
    margin: 0 auto;
    font-size: clamp(2.1rem, 5.2vw, 4.4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: #ffffff;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.45);
}

/* Slow orange shimmer across the method name. */
.title-accent {
    background: linear-gradient(90deg, #ffc27a 0%, var(--accent) 30%, #ff9a3c 55%, #ffc27a 80%, var(--accent) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 26px rgba(231, 117, 0, 0.4));
    animation: shimmer 8s ease-in-out infinite alternate;
}

@keyframes shimmer { to { background-position: 100% 0; } }

.authors {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 20px;
    font-size: 1.1rem;
    color: #f5f5f4;
}

.authors a { color: #f5f5f4; border-bottom: 1px solid rgba(231, 117, 0, 0.7); }
.authors a:hover { color: #ffb35c; text-decoration: none; }
.authors sup { color: #a8a29e; }
.authors-2 { margin-top: 6px; }
.affil-notes { margin-top: 2px; font-size: 0.88rem; }

.affil {
    margin-top: 8px;
    font-size: 0.95rem;
    color: #b8b3ae;
}

.links {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.7);
}

/* Dark text on orange: ~6:1 contrast (white would be ~3:1). */
.btn-accent {
    color: #111;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 10px 30px -12px var(--accent-glow);
}

.btn-accent:hover { background: #ff8a1a; border-color: #ff8a1a; box-shadow: 0 14px 34px -12px var(--accent-glow); }

/* ---------- Dark sections (video wall, method) ---------- */

.section-dark {
    --ink: #f5f5f4;
    --ink-2: #d6d3d1;
    --ink-muted: #a8a29e;
    --accent-text: #ffa94d;
    --accent-soft: rgba(231, 117, 0, 0.16);
    --surface: rgba(255, 255, 255, 0.045);
    --rule: rgba(255, 255, 255, 0.11);
    --rule-soft: rgba(255, 255, 255, 0.06);
    --seg-bg: rgba(255, 255, 255, 0.08);
    --seg-active: rgba(255, 255, 255, 0.2);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 24px -14px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 22px 44px -18px rgba(0, 0, 0, 0.9);
    position: relative;
    isolation: isolate;
    color: var(--ink-2);
    background: #0b0b0c;
}

/* Orange glows + dot grid behind dark sections. */
.section-dark::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 40% 35% at 0% 20%, rgba(231, 117, 0, 0.13), transparent 70%),
        radial-gradient(ellipse 40% 40% at 100% 85%, rgba(231, 117, 0, 0.12), transparent 70%),
        radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 24px 24px;
}

/* ---------- Video wall ---------- */

.wall-section { padding-top: 24px; }

.wall-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
}

.wall {
    position: relative;
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

/* Hidden anchor targets for old #indoor/#outdoor/#multistage links (absolutely
   positioned so they don't take grid cells). */
.wall-anchor { position: absolute; top: 0; left: 0; width: 1px; height: 1px; }

/* Portrait clips flank the 2x3 landscape block, each spanning both rows. */
.wall .wall-left  { grid-column: 1; grid-row: 1 / span 2; }
.wall .wall-right { grid-column: 5; grid-row: 1 / span 2; }

.wall .portrait video {
    position: absolute;      /* fill the two-row cell without driving row height */
    inset: 0;
    height: 100%;
    aspect-ratio: auto;
}

.wall .video-item {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 40px -24px rgba(0, 0, 0, 0.9);
    transition: transform 0.25s var(--ease), box-shadow 0.25s ease, opacity 0.35s ease, filter 0.35s ease;
}

.wall .video-item:hover {
    box-shadow: 0 0 0 1px rgba(231, 117, 0, 0.65), 0 22px 50px -22px rgba(231, 117, 0, 0.55);
}

/* Filter buttons dim the other clips (they keep playing). */
.wall[data-filter="indoor"]     .video-item:not([data-kind="indoor"]),
.wall[data-filter="outdoor"]    .video-item:not([data-kind="outdoor"]),
.wall[data-filter="multistage"] .video-item:not([data-kind="multistage"]) {
    opacity: 0.18;
    filter: grayscale(0.85);
}

.wall-note {
    margin: 18px auto 0;
    max-width: 820px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--ink-muted);
}

/* Composite figures: column widths = image aspect ratios -> equal heights. */
.composites {
    margin-top: 44px;
    display: grid;
    grid-template-columns: 2.920fr 4.065fr;
    gap: 18px;
    align-items: start;
}

@media (max-width: 1000px) {
    .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .wall .wall-left  { grid-column: 1; grid-row: 1 / span 2; }
    .wall .wall-right { grid-column: 2; grid-row: 3 / span 2; }
    .composites { grid-template-columns: 1fr; }
}

/* ---------- Overview (explainer, TL;DR, stats, highlights) ---------- */

.explainer {
    max-width: 1280px;
    margin: 0 auto;
    overflow: hidden;
    background: #000;
    border-radius: 18px;
    box-shadow: 0 0 0 1px rgba(231, 117, 0, 0.25), 0 34px 80px -34px rgba(231, 117, 0, 0.45), 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}

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

.tldr {
    max-width: 1080px;
    margin: 36px auto 0;
    padding: 4px 0 4px 22px;
    text-align: left;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.6;
    color: var(--ink-2);
    border-left: 4px solid var(--accent);
}

.tldr b { color: var(--ink); }

.stats {
    list-style: none;
    max-width: 1280px;
    margin: 40px auto 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

/* Glassy card with a faint orange gradient border (padding-box/border-box trick). */
.stat,
.hl-card,
.chart-card {
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, rgba(231, 117, 0, 0.6), var(--rule) 35%, var(--rule) 65%, rgba(231, 117, 0, 0.3)) border-box;
    border: 1px solid transparent;
}

.stat {
    position: relative;
    overflow: hidden;
    padding: 20px 20px 18px;
    border-radius: var(--radius);
}

.stat::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(231, 117, 0, 0.18), transparent 70%);
    pointer-events: none;
}

.stat-num {
    display: block;
    font-size: clamp(2rem, 3.8vw, 3rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    color: var(--accent-text);
}

.stat-label {
    display: block;
    margin-top: 6px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--ink-muted);
}

.highlights {
    max-width: 1280px;
    margin: 84px auto 0;
    text-align: left;
}

.hl-grid {
    list-style: none;
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.hl-card {
    display: flex;
    gap: 16px;
    padding: 24px;
    font-size: 0.99rem;
    line-height: 1.65;
    color: var(--ink-2);
    border-radius: var(--radius);
    transition: transform 0.25s var(--ease), box-shadow 0.25s ease;
}

.hl-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), 0 18px 40px -26px var(--accent-glow);
}

.hl-icon {
    flex: none;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    color: #fff;
    background: linear-gradient(135deg, #ffa94d, var(--accent));
    border-radius: 12px;
    box-shadow: 0 8px 20px -8px var(--accent-glow);
}

.hl-card b { color: var(--ink); }
.highlights .hl { color: var(--accent-text); font-weight: 500; }

/* ---------- Placeholders for missing assets ---------- */

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 28px 24px;
    border: 2px dashed #f59e0b;
    border-radius: var(--radius);
    background: repeating-linear-gradient(-45deg, #fffbeb, #fffbeb 14px, #fef3c7 14px, #fef3c7 28px);
    color: #78350f;
}

.placeholder-fill { aspect-ratio: 16 / 9; width: 100%; }

.ph-tag {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 999px;
    color: #fff;
    background: #b45309;
}

.ph-title { font-size: 1.25rem; font-weight: 700; color: #78350f; }
.ph-body { font-size: 0.95rem; line-height: 1.6; max-width: 640px; }
.ph-body code { background: rgba(255, 255, 255, 0.7); padding: 1px 6px; border-radius: 4px; }

/* ---------- Sections ---------- */

.section { padding: 96px 0; }
.section-tint { background: var(--tint); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

.eyebrow {
    margin-bottom: 10px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-text);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
    color: var(--ink);
    text-align: center;
}

/* Short glowing accent rule under each section title. */
.section-title::after {
    content: "";
    display: block;
    width: 56px;
    height: 4px;
    margin: 16px auto 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), #ffc27a);
    box-shadow: 0 0 16px var(--accent-glow);
}

.eyebrow-left, .section-title-left { text-align: left; }
.section-title-left::after { margin-left: 0; }

.section-sub {
    margin: 18px auto 0;
    max-width: 760px;
    text-align: center;
    font-size: 1.05rem;
    color: var(--ink-muted);
}

.section-sub b { color: var(--ink); }

/* ---------- Figures ---------- */

.figure { margin: 0 auto; }
.figure-wide { max-width: 1400px; margin-top: 52px; }
.figure img { width: 100%; border-radius: 10px; }

/* Line-art figures with white backgrounds sit on a white card (also in dark mode). */
.figure.paper img {
    padding: clamp(10px, 1.6vw, 22px);
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.figure figcaption {
    margin: 12px auto 0;
    max-width: 820px;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
    color: var(--ink-muted);
}

/* ---------- Segmented control (wall filter, method steps, steerability tabs) ---------- */

.seg {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    width: fit-content;
    max-width: 100%;
    background: var(--seg-bg);
    border-radius: 999px;
}

.seg-btn {
    position: relative;
    overflow: hidden;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 7px 18px;
    white-space: nowrap;
    border: 0;
    border-radius: 999px;
    color: var(--ink-2);
    background: transparent;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.seg-btn:hover { color: var(--ink); }
.seg-btn i { margin-right: 4px; opacity: 0.85; }

.seg-btn.is-active,
.seg-btn[aria-pressed="true"] {
    color: var(--ink);
    background: var(--seg-active);
    box-shadow: 0 1px 3px rgba(18, 18, 18, 0.15);
}

/* ---------- Videos ---------- */

.video-item {
    position: relative;
    overflow: hidden;
    background: #121212;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.25s var(--ease), box-shadow 0.25s ease;
}

.video-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.video-item video {
    cursor: pointer;
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 800 / 712;
    object-fit: cover;
}

.video-item video:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

/* Task label chip over each clip; clicks pass through to the video. */
.vid-cap {
    position: absolute;
    left: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    background: rgba(12, 12, 13, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.vid-kind {
    padding-right: 8px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffa94d;
    border-right: 1px solid rgba(255, 255, 255, 0.25);
}

/* Play glyph while a clip is paused by the viewer. */
.video-item.is-paused::after {
    content: "\f04b";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    display: grid;
    place-items: center;
    padding-left: 4px;
    font-size: 1.2rem;
    color: #fff;
    background: rgba(12, 12, 13, 0.6);
    border-radius: 50%;
    pointer-events: none;
}

/* ---------- Method: animated explainer ---------- */

.mx { margin-top: 44px; }

.mx-controls {
    margin-bottom: 26px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.mx-num {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-right: 6px;
    font-size: 0.72rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.mx-step[aria-pressed="true"] .mx-num { color: #111; background: var(--accent); }

/* While auto-playing, the active step button fills like a progress bar. */
.mx.is-auto .mx-step[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    background: var(--accent);
    animation: mx-fill var(--dur, 4s) linear both;
}

@keyframes mx-fill { from { width: 0; } to { width: 100%; } }

.mx-replay {
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 16px;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.mx-replay:hover { border-color: var(--accent); background: var(--accent-soft); }

.mx-stages {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr) 72px minmax(0, 1fr);
    align-items: stretch;
}

.mx-card {
    --c: var(--accent);
    --c-soft: rgba(231, 117, 0, 0.16);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 18px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: opacity 0.5s ease, transform 0.5s var(--ease), border-color 0.5s ease, box-shadow 0.5s ease;
}

.mx-teacher { --c: var(--teacher); --c-soft: rgba(14, 165, 233, 0.16); --t0: 1.5s; }
.mx-student { --c: var(--student); --c-soft: rgba(236, 72, 153, 0.16); --t0: 1s; }
.mx-deploy  { --c: var(--deploy);  --c-soft: rgba(16, 185, 129, 0.16); --t0: 1.2s; }

.mx-head { display: flex; align-items: center; gap: 12px; }

.mx-badge {
    flex: none;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--c);
    border-radius: 50%;
    box-shadow: 0 0 18px -4px var(--c);
}

.mx-head h3 { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.mx-head p { font-size: 0.82rem; color: var(--ink-muted); }

.mx-view {
    position: relative;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--rule);
    border-radius: 10px;
}

.mx-view svg { display: block; width: 100%; height: auto; }

.mx-tag {
    position: absolute;
    left: 8px;
    top: 8px;
    padding: 3px 9px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.62);
    border: 1px solid var(--c);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.mx-tag-gt { border-color: var(--accent); }

.mx-traj {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}

.mx-traj-gt { stroke: var(--accent); filter: drop-shadow(0 0 5px rgba(231, 117, 0, 0.9)); }
.mx-traj-deploy { stroke: var(--deploy); stroke-width: 4; filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.9)); }

.mx-grid path { fill: none; stroke: rgba(16, 185, 129, 0.22); stroke-width: 1; }
.mx-target .ring { fill: none; stroke: var(--deploy); stroke-width: 2; opacity: 0.75; }
.mx-target .ring-2 { opacity: 0.35; transform-box: fill-box; transform-origin: center; animation: mx-ping 1.8s ease-out infinite; }
.mx-target .dot { fill: var(--deploy); }
.mx-robot rect { fill: #e7e5e4; stroke: var(--deploy); stroke-width: 2; }
.mx-robot .lens { fill: var(--deploy); stroke: none; }

@keyframes mx-ping { from { transform: scale(0.7); opacity: 0.6; } to { transform: scale(1.5); opacity: 0; } }

.mx-model {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink);
    background: var(--c-soft);
    border: 1px solid var(--c);
    border-radius: 10px;
}

.mx-model i { color: var(--c); }

.mx-out {
    min-height: 62px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    gap: 6px;
}

.mx-tok {
    padding: 4px 9px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    color: var(--ink);
    background: var(--c-soft);
    border: 1px solid var(--c);
    border-radius: 6px;
}

.mx-tok-ce { --c: var(--accent); --c-soft: rgba(231, 117, 0, 0.18); }

.mx-loss {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.mx-loss span {
    padding: 3px 10px;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 999px;
}

.mx-loss-kl { color: #f9a8d4; border: 1px dashed var(--student); }
.mx-loss-ce { color: #ffa94d; border: 1px dashed var(--accent); }

.mx-desc { margin-top: auto; font-size: 0.9rem; line-height: 1.5; color: var(--ink-2); }

/* Arrows between cards: dashed line that "flows" while its stage is active. */
.mx-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 10px;
}

.mx-arrow-1 { --ac: var(--teacher); }
.mx-arrow-2 { --ac: var(--student); }

.mx-arrow-line {
    position: relative;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: repeating-linear-gradient(90deg, var(--ac) 0 8px, transparent 8px 16px);
}

.mx-arrow-line::after {
    content: "";
    position: absolute;
    right: -9px;
    top: -5.5px;
    border: 7px solid transparent;
    border-left-color: var(--ac);
}

.mx-arrow-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.3;
    text-align: center;
    text-transform: uppercase;
    color: var(--ink-muted);
}

@keyframes mx-dash   { to { background-position: 16px 0; } }
@keyframes mx-dash-v { to { background-position: 0 16px; } }
@keyframes mx-pulse  { 50% { box-shadow: 0 0 0 4px var(--c-soft), 0 0 28px var(--c); } }
@keyframes mx-glow   { 50% { box-shadow: 0 0 16px -2px currentColor; } }
@keyframes mx-pop {
    from { opacity: 0; translate: 0 8px; scale: 0.9; }
    to   { opacity: 1; translate: 0 0; scale: 1; }
}

/* --- Animated states (only once main.js adds .is-animated) --- */

.mx:not(.is-animated) .mx-robot { display: none; }   /* robot only exists while driving */

.mx.is-animated .mx-card { opacity: 0.38; transform: scale(0.98); }
.mx.is-animated .mx-card.is-done { opacity: 0.8; transform: none; }
.mx.is-animated .mx-card.is-active {
    opacity: 1;
    transform: none;
    border-color: var(--c);
    box-shadow: 0 0 0 1px var(--c), 0 26px 60px -26px var(--c);
}

.mx.is-animated .mx-card.is-active .mx-model { animation: mx-pulse 1.4s ease-in-out infinite; }

.mx.is-animated .mx-traj { transition: stroke-dashoffset 1.4s var(--ease) 0.3s; }
.mx.is-animated .mx-card:not(.is-active):not(.is-done) .mx-traj { stroke-dashoffset: 1; transition: none; }

.mx.is-animated .mx-tok,
.mx.is-animated .mx-loss span { opacity: 0; }

.mx.is-animated .is-active .mx-tok {
    animation: mx-pop 0.45s var(--ease) both;
    animation-delay: calc(var(--t0) + var(--i) * 0.38s);
}

.mx.is-animated .is-active .mx-loss span {
    animation: mx-pop 0.45s var(--ease) both, mx-glow 1.4s ease-in-out 3.6s infinite;
    animation-delay: 3.1s, 3.6s;
}

.mx.is-animated .is-done .mx-tok,
.mx.is-animated .is-done .mx-loss span { opacity: 1; }

.mx.is-animated .mx-robot { opacity: 0; }
.mx.is-animated .mx-deploy.is-active .mx-robot { opacity: 1; }

.mx.is-animated .mx-arrow-line { opacity: 0.25; transition: opacity 0.4s ease; }
.mx.is-animated[data-stage="2"] .mx-arrow-1 .mx-arrow-line,
.mx.is-animated[data-stage="3"] .mx-arrow-2 .mx-arrow-line {
    opacity: 1;
    animation: mx-dash 0.6s linear infinite;
}

@media (max-width: 1000px) {
    .mx-stages { grid-template-columns: minmax(0, 560px); justify-content: center; }
    .mx-arrow { flex-direction: row; height: 64px; }
    .mx-arrow-line {
        width: 3px;
        height: 30px;
        background: repeating-linear-gradient(180deg, var(--ac) 0 8px, transparent 8px 16px);
    }
    .mx-arrow-line::after {
        right: auto;
        left: 50%;
        top: auto;
        bottom: -12px;
        transform: translateX(-50%);
        border-left-color: transparent;
        border-top-color: var(--ac);
    }
    .mx.is-animated[data-stage="2"] .mx-arrow-1 .mx-arrow-line,
    .mx.is-animated[data-stage="3"] .mx-arrow-2 .mx-arrow-line { animation-name: mx-dash-v; }
}

/* Static paper figures under the explainer. */
.method-figs {
    margin-top: 56px;
    display: grid;
    grid-template-columns: 2.433fr 2.553fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .method-figs { grid-template-columns: 1fr; }
}

/* ---------- Steerability ---------- */

/* Stacked: prompt picker on top, the rollout centred below it. */
.steer {
    margin: 44px auto 0;
    max-width: 1320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.steer-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.steer-tabs .seg-btn { padding: 9px 20px; font-size: 0.98rem; }

.steer-prompts {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.steer-prompt {
    position: relative;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    text-align: left;
    padding: 14px 20px;
    border: 1.5px solid var(--rule);
    border-radius: 12px;
    color: var(--ink-2);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease), box-shadow 0.2s ease;
}

.steer-prompt::before { content: "\201C"; }
.steer-prompt::after { content: "\201D"; }

.steer-prompt:hover { border-color: #f3b670; transform: translateY(-2px); }

.steer-prompt.is-active {
    color: var(--accent-text);
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 -3px 0 var(--accent), 0 0 0 4px rgba(231, 117, 0, 0.12), 0 12px 28px -16px var(--accent-glow);
    transform: translateY(-2px);
}

.steer-stage {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Clips are 8:9 portrait: size by height so the picker above and the whole
   frame fit on screen together. Two stacked videos crossfade via .is-on. */
.steer-screen {
    position: relative;
    height: clamp(360px, calc(100vh - 240px), 700px);
    height: clamp(360px, calc(100svh - 240px), 700px);
    max-width: 100%;
    aspect-ratio: 8 / 9;
    overflow: hidden;
    background: #0b0b0c;
    border-radius: 20px;
    box-shadow: 0 0 0 1px rgba(231, 117, 0, 0.4), 0 30px 80px -34px rgba(231, 117, 0, 0.6), 0 30px 60px -30px rgba(0, 0, 0, 0.55);
}

.steer-vid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.steer-vid.is-on { opacity: 1; }
.steer-vid:not(.is-on) { pointer-events: none; }

/* Active prompt overlaid on the stage. */
.steer-cap {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 14px;
    padding: 9px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    color: #fff;
    background: rgba(12, 12, 13, 0.62);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.steer-cap:empty { display: none; }

.steer-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.14);
    pointer-events: none;
}

.steer-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ffc27a);
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 0.25s linear;
}

.steer-stage .placeholder { width: min(540px, 100%); aspect-ratio: 8 / 9; }

/* Color / direction / object composites side by side, stacked on phones. */
.steer-strip {
    display: grid;
    grid-template-columns: 496fr 742fr 743fr;
    gap: 14px;
    align-items: start;
}

@media (max-width: 640px) {
    .steer-strip { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 860px) {
    .steer { gap: 24px; }
    .steer-screen { height: auto; width: 100%; max-width: 520px; margin: 0 auto; }
}

/* ---------- Reasoning ---------- */

.reasoning-grid {
    margin-top: 40px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.reasoning-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.25s var(--ease), box-shadow 0.25s ease, border-color 0.25s ease;
}

.reasoning-card:hover { transform: translateY(-4px); border-color: rgba(231, 117, 0, 0.45); box-shadow: var(--shadow-lg); }

.reasoning-card img { width: 100%; height: auto; display: block; }

.trace {
    padding: 18px 20px;
    background: var(--surface);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--ink-2);
}

.trace p { margin: 0 0 6px; }
.trace p:last-child { margin-bottom: 0; }
.trace b { color: var(--ink); }
.trace em { font-style: normal; color: var(--accent-text); }
.trace .traj { color: var(--ink-muted); overflow-wrap: anywhere; }

.trace .caret {
    display: inline-block;
    width: 0.55em;
    height: 1.05em;
    margin-left: 1px;
    vertical-align: -0.15em;
    background: var(--accent);
    animation: caret-blink 0.9s steps(1) infinite;
}

@keyframes caret-blink { 50% { opacity: 0; } }

@media (max-width: 820px) {
    .reasoning-grid { grid-template-columns: 1fr; }
}

/* ---------- Charts ---------- */

.legend {
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    font-size: 0.9rem;
    color: var(--ink-2);
}

.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-swatch { width: 14px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(128, 128, 128, 0.25); }

.chart-card {
    margin-top: 20px;
    padding: 24px 24px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.chart-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}

.chart { margin-top: 10px; position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }

/* SVG text scales with the chart, so on narrow screens keep a minimum
   drawing width and let the card scroll sideways instead. */
@media (max-width: 640px) {
    .chart { overflow-x: auto; }
    .chart svg { min-width: 600px; }
}

.chart text { font-family: 'Inter', sans-serif; }
.chart .axis-label { font-size: 13px; fill: var(--ink-muted); }
.chart .cat-label { font-size: 14px; font-weight: 600; fill: var(--ink); }
.chart .val-label { font-size: 12px; font-weight: 600; fill: var(--ink-2); transition: opacity 0.4s ease 0.55s; }
.chart .grid-line { stroke: var(--rule-soft); stroke-width: 1; }
.chart .base-line { stroke: var(--rule-strong); stroke-width: 1; }
.chart .track { fill: var(--s-track); }
.chart .group-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; fill: var(--ink-muted); }
.chart .section-label { font-size: 15px; font-weight: 700; fill: var(--ink); }
.chart .sep-line { stroke: var(--rule); stroke-dasharray: 3 4; }

/* Bars grow in from the baseline when the chart scrolls into view
   (main.js adds .is-pending, then removes it; per-bar delays are inline). */
.chart .bar {
    transform-box: fill-box;
    transition: transform 0.9s var(--ease), opacity 0.15s ease;
}

.chart .bar:hover { opacity: 0.8; }
.chart .bar-v { transform-origin: 50% 100%; }
.chart .bar-h { transform-origin: 0 50%; }
.chart.is-pending .bar-v { transform: scaleY(0); }
.chart.is-pending .bar-h { transform: scaleX(0); }
.chart.is-pending .val-label { opacity: 0; }

.chart-tip {
    position: absolute;
    pointer-events: none;
    padding: 6px 10px;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #fff;
    background: rgba(18, 18, 18, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    white-space: nowrap;
    transform: translate(-50%, calc(-100% - 10px));
    opacity: 0;
    transition: opacity 0.1s ease;
    z-index: 60;
}

.chart-tip.is-on { opacity: 1; }

/* ---------- Collapsibles ---------- */

details {
    margin-top: 20px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}

details > summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 20px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 10px;
}

details > summary:hover { color: var(--accent-text); }
details > summary::-webkit-details-marker { display: none; }

details > summary::before {
    content: "\25B8";
    color: var(--ink-muted);
    transition: transform 0.15s ease;
}

details[open] > summary::before { transform: rotate(90deg); }

details > :not(summary) { margin-left: 20px; margin-right: 20px; }
details > :last-child { margin-bottom: 20px; }

details h4 {
    margin-top: 18px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
}

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; margin-top: 8px; }

table.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
}

table.results-table.narrow { max-width: 520px; }

.results-table th,
.results-table td {
    padding: 7px 8px;
    text-align: center;
    border-bottom: 1px solid var(--rule-soft);
    white-space: nowrap;
}

.results-table thead th {
    font-weight: 600;
    color: var(--ink);
    border-bottom: 1.5px solid var(--rule-strong);
}

.results-table thead tr.group-head th {
    font-size: 0.78rem;
    color: var(--ink-muted);
    border-bottom: 1px solid var(--rule);
}

.results-table .rowname { text-align: left; }
.results-table .avg { border-left: 1px solid var(--rule); font-weight: 600; }
.results-table tbody tr:hover { background: var(--tint); }
.results-table tr.ours,
.results-table tbody tr.ours:hover { background: var(--accent-soft); }
.results-table tr.ours td { font-weight: 600; color: var(--ink); }

/* ---------- BibTeX ---------- */

.bibtex {
    position: relative;
    max-width: 900px;
    margin: 32px auto 0;
}

.bibtex pre {
    padding: 20px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--ink);
    background: var(--code-bg);
    border: 1px solid var(--rule);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font: inherit;
    font-size: 0.8rem;
    padding: 4px 10px;
    color: var(--ink-2);
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: 6px;
    cursor: pointer;
}

.copy-btn:hover { color: var(--ink); border-color: var(--ink-muted); }

.footer {
    padding: 28px 0 48px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--ink-muted);
    border-top: 1px solid var(--rule);
}

/* ---------- Scroll reveal (classes added by main.js; never without JS) ---------- */

.reveal { opacity: 0; }
.reveal.is-in { animation: rise 0.7s var(--ease) both; animation-delay: var(--reveal-delay, 0ms); }

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

@media (max-width: 820px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hl-grid { grid-template-columns: 1fr; }

    /* Nav links scroll sideways; fade the right edge to hint at more. */
    .topnav-links {
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
        padding-right: 20px;
    }
}

@media (max-width: 640px) {
    .topnav-inner { gap: 12px; }
    .topnav-links a { padding: 6px 10px; font-size: 0.86rem; }
    .hero { padding: 88px 0 32px; }
    .section { padding: 64px 0; }
    .wall-section { padding-top: 16px; }
    .highlights { margin-top: 60px; }
    .hl-card { padding: 18px; gap: 14px; }
    .stat { padding: 14px 14px 12px; }
    .vid-cap { left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 3px 9px; font-size: 0.74rem; }
    .vid-kind { display: none; }
    .wall-filter .seg-btn i { display: none; }   /* keep the four filters on one line */
    .placeholder-fill { aspect-ratio: auto; min-height: 220px; }
    .seg-btn { padding: 7px 13px; font-size: 0.88rem; }
    .steer-tabs .seg-btn { padding: 8px 14px; font-size: 0.9rem; }
    .steer-prompts { flex-direction: column; align-self: stretch; }
    .steer-prompt { font-size: 0.9rem; padding: 13px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .reveal { opacity: 1; }
}
