/* FOSIL project page.
   Single light theme: white ground, near-black ink, neutral hairlines and one
   red accent that marks what is new at test time. Google Sans for headings,
   Noto Sans for text, JetBrains Mono only for code and BibTeX. */

:root {
  --ground: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f4;
  --line: #e6e6e6;
  --line-strong: #c9c9c9;
  --ink: #111111;
  --ink-2: #444444;
  --ink-3: #737373;
  --accent: #e23b2c;
  --accent-tint: #fdecea;
  --keep: #2f6b3a;
  --cell-0: #f6f1e7;
  --cell-1: #f1dfcd;
  --cell-2: #e7bb9c;
  --cell-3: #d68d62;
  --cell-4: #b95a33;
  --on-dark-cell: #ffffff;
  --focus: #111111;
  --radius: 4px;
  --content-width: 1160px;
  --page-gutter: 80px;
  --font-display: "Google Sans", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-prose: var(--font-body);
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --heading-weight: 600;
  --heading-spacing: 0;
  --title-size: 48px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  padding-left: 248px;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "kern" 1, "liga" 1;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
img, video { display: block; max-width: 100%; height: auto; }
b, strong { font-weight: 600; }
code { font-family: var(--font-mono); font-size: 0.92em; }

.wrap { width: 100%; }
.wrap > * { width: min(var(--content-width), 100% - var(--page-gutter)); margin-inline: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-spacing);
  font-optical-sizing: auto;
  text-wrap: wrap;
  margin: 0;
  color: var(--ink);
}
h1 { font-size: clamp(30px, 4vw, var(--title-size)); line-height: 1.16; }
h2 { font-size: clamp(26px, 3vw, 30px); line-height: 1.25; }
h3 { font-size: 22px; line-height: 1.3; }

/* ---- section sidebar */
.sidebar {
  position: fixed; inset: 24px auto 24px 24px; z-index: 20;
  width: 224px; padding: 26px 18px;
  overflow-y: auto;
  background: var(--ground);
  border: none;
  border-right: 1px solid var(--line);
  border-radius: 0;
}
.brand { display: block; font-family: var(--font-display); font-weight: var(--heading-weight); font-size: 22px; line-height: 1.2; }
.brand:hover { text-decoration: none; }
.sidebar-header { padding: 0 8px 24px; }
.nav-group { padding-block: 12px; }
.nav-group:last-child { padding-bottom: 0; }
.nav-label {
  margin: 0 8px 10px;
  font-size: 11px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}
.section-nav a {
  display: block; padding: 8px 10px; margin-block: 2px;
  border-left: 2px solid transparent; border-radius: 0;
  color: var(--ink-2); font-size: 14px; line-height: 1.4;
  transition: color .15s ease, background .15s ease;
}
.section-nav a:hover { color: var(--ink); text-decoration: underline; }
.section-nav a[aria-current="location"] {
  color: var(--ink); background: transparent; border-left-color: var(--ink);
}
.nav-subgroup { margin: 6px 0 0 12px; padding-left: 8px; border-left: 1px solid var(--line); }
.nav-subgroup a { font-size: 13px; }
.section-nav .nav-topic { font-size: 15px; font-weight: 500; color: var(--ink); }
.nav-toggle { display: none; }
main[id], section[id], figure[id] { scroll-margin-top: 32px; }

@media (max-width: 1099px) {
  body { padding-left: 0; }
  .sidebar {
    position: sticky; inset: 0 0 auto; width: 100%; padding: 0 24px;
    overflow: visible; border: none; border-bottom: 1px solid var(--line); border-radius: 0;
    background: var(--ground);
  }
  .sidebar-header { min-height: 64px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .brand { font-size: 19px; }
  .nav-toggle {
    display: flex; align-items: center; gap: 12px; padding: 10px 0 10px 10px;
    border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 14px; cursor: pointer;
  }
  .nav-toggle span { font-size: 20px; line-height: 1; }
  .nav-toggle[aria-expanded="true"] span { transform: rotate(45deg); }
  .section-nav {
    display: none; position: absolute; inset: 100% 0 auto;
    max-height: calc(100dvh - 80px); overflow-y: auto; padding: 0 24px 20px;
    background: var(--ground); border-bottom: 1px solid var(--line);
  }
  .sidebar.is-open .section-nav { display: block; }
  .section-nav a { padding-block: 12px; }
  main[id], section[id], figure[id] { scroll-margin-top: 88px; }
}

/* ---- hero */
.hero { padding-block: 64px 44px; display: grid; gap: 24px; }
.eyebrow { margin: 0 0 22px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.thesis {
  font-family: var(--font-prose);
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: none;
  margin: 28px 0 0;
}
.authors { margin: 0; font-size: 17px; color: var(--ink); display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
.authors .aff { color: var(--ink-3); font-size: 15px; }
.one-demo { margin: 0; font: 400 clamp(20px, 1.8vw, 23px)/1.5 var(--font-display); color: var(--ink); text-wrap: pretty; }
.one-demo strong { font-weight: 600; }
.resource-links { display: flex; flex-wrap: wrap; gap: 10px; }
.resource-button { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 11px 18px; border: 0; border-radius: 999px; background: #252525; color: #fff; font: 500 15px/1.4 var(--font-display); }
.resource-button svg { width: 17px; height: 17px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.resource-status { color: #d2d2d2; font-size: 12px; font-weight: 400; }
@media (max-width: 560px) {
  .resource-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .resource-button { flex-wrap: wrap; justify-content: center; gap: 5px; padding: 10px 6px; border-radius: 12px; font-size: 14px; }
  .resource-status { width: 100%; text-align: center; font-size: 11px; }
  .resource-button svg { width: 15px; height: 15px; }
}

.links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.resource-pending { font-size: 15px; color: var(--ink-3); margin-right: 8px; }
.approach { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 3px 14px rgb(27 27 27 / 4%); }
.approach h2 { font-size: clamp(22px, 2.6vw, 25px); }
.approach > p { color: var(--ink-2); margin: 16px 0 0; }
.method-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; list-style: none; counter-reset: method; padding: 0; margin: 28px 0; }
.method-steps li { counter-increment: method; border-top: 1px solid var(--line-strong); padding-top: 16px; }
.method-steps li::before { content: "0" counter(method); display: block; color: var(--accent); font: 13px var(--font-display); margin-bottom: 10px; }
.method-steps strong { display: block; font-size: 17px; font-weight: 500; margin-bottom: 6px; }
.method-steps span { display: block; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.approach .method-why { font-size: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink);
  font-size: 15px; font-weight: 500; line-height: 1;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { text-decoration: none; background: var(--surface-2); border-color: var(--ink-3); }
.btn.primary { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---- sections */
.section { padding-block: 60px; border-top: 1px solid var(--line); }
.intro-reel { margin: 0 auto 56px; }
.intro-reel .frame { position: relative; }
.intro-reel video { width: 100%; border-radius: 10px; }
#teaser { margin-bottom: 48px; }

/* Wide screens: the title, intro reel and overview figure sit centred in the window
   with the sidebar hidden; the sidebar fades in below the figure. */
@media (min-width: 1100px) {
  .sidebar { transition: opacity .3s ease, transform .3s ease, visibility .3s; }
  body.sidebar-hidden .sidebar { opacity: 0; visibility: hidden; transform: translateX(-12px); }
  .hero, .intro-reel, #teaser { position: relative; left: -124px; }
  #teaser { width: min(1440px, 100vw - 64px); margin-left: calc((100% - min(1440px, 100vw - 64px)) / 2); }
}
@media (min-width: 1100px) and (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* Interactive overview: the paper figure, with each photo panel playing its video on hover.
   A pretext behavior also plays the held-out task panels built on it. */
.tz-canvas { position: relative; }
.tz-canvas img { width: 100%; height: auto; }
.tz-spot, .tz-object { position: absolute; z-index: 2; display: block; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.tz-object { z-index: 3; }
.tz-media { position: absolute; z-index: 1; overflow: hidden; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.tz-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s ease; }
.tz-media video.is-shown { opacity: 1; }
.tz-media.is-on { opacity: 1; }
.tz-object::after { content: ""; position: absolute; left: -6px; top: 8%; bottom: 8%; width: 3px; border-radius: 2px; background: var(--ink); opacity: 0; transition: opacity .25s ease; }
.tz-object.is-current::after { opacity: 1; }
#teaser figcaption { margin-top: 14px; }
@media (prefers-reduced-motion: reduce) { .tz-media, .tz-media video, .tz-object::after { transition: none; } }
.abstract-section { margin-bottom: 60px; }
.abstract-section h2 { margin-bottom: 20px; }
/* the abstract spans the full content width, matching the teaser figure above it */
.abstract-section .prose p { font-size: 17px; }
.paper-figure { margin-top: 28px; }
.paper-figure img { width: 100%; height: auto; }
.pretext-figure { margin-block: 40px 28px; }
.pretext-grid { position: relative; }
.pretext-spot {
  position: absolute; width: 33.333%; display: flex; align-items: flex-start; justify-content: center;
  border-radius: 10px; outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .15s, background-color .15s;
}
.pretext-spot:nth-of-type(1), .pretext-spot:nth-of-type(4) { left: 0; }
.pretext-spot:nth-of-type(2), .pretext-spot:nth-of-type(5) { left: 33.333%; }
.pretext-spot:nth-of-type(3), .pretext-spot:nth-of-type(6) { left: 66.667%; }
/* tile rows in pretext-behaviors.png, below its title */
.pretext-spot:nth-of-type(-n+3) { top: 8.5%; height: 46%; }
.pretext-spot:nth-of-type(n+4) { top: 54.5%; height: 45%; }
.pretext-spot span {
  margin-top: 8px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: rgb(27 27 27 / 78%); color: #fff; opacity: 0; transition: opacity .15s;
}
.pretext-spot:hover, .pretext-spot:focus-visible { outline-color: var(--accent); background: rgb(200 101 61 / 5%); text-decoration: none; }
.pretext-spot:hover span, .pretext-spot:focus-visible span { opacity: 1; }
@media (hover: none) { .pretext-spot span { opacity: .9; } }
#analysis > .result-subsection { margin-top: 48px; }
.refinement-results { max-width: 600px; margin-inline: auto; margin-bottom: 32px; }
.task-heading { margin: 0 0 16px; font-size: 21px; font-weight: 500; line-height: 1.35; }
.task-heading { margin-top: 48px; }
.summary-table td { color: var(--ink); }
.results-table .ours { background: transparent; }
.results-table .ours th { padding-left: 12px; }
.results-table .ours td { color: var(--ink); font-weight: 600; }
.results-table small { display: block; color: var(--ink-2); font-size: 12px; font-weight: 400; }
.detailed-results { min-width: 960px; font-size: 14px; }
.detailed-results td { color: var(--ink-2); }
.detailed-results th, .detailed-results td { padding: 12px 10px; }
.detailed-results thead th { text-align: center; }
.table-scroll:focus-visible { outline-offset: 5px; }
@media (max-width: 800px) {
  .method-steps { grid-template-columns: 1fr; }
}
.section > h2 { margin-bottom: 20px; }
.section-intro { margin: 0 0 18px; color: var(--ink-2); font-size: 17px; }
.section-intro + .result-subsection { margin-top: 48px; }
.reading-note { margin: 24px 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.reading-note + .result-subsection { margin-top: 48px; }
.data-link { text-decoration: underline; text-underline-offset: 3px; }
.result-scope { margin-top: 48px; }
.result-kicker { margin: 0 0 12px; color: var(--accent); font-size: 13px; letter-spacing: .04em; }
.result-intro { margin: 0 0 20px; color: var(--ink-2); font-size: 17px; }
.figure-guide { margin: 24px 0; padding-left: 16px; border-left: 2px solid var(--line-strong); font-size: 15px; color: var(--ink-2); }
.result-takeaway { margin: 24px 0 0; color: var(--ink-2); font-size: 17px; }
.result-takeaway strong { color: var(--ink); }
.table-scroll { max-width: 100%; overflow-x: auto; }
.results-table { width: 100%; border-collapse: collapse; font-size: 16px; font-variant-numeric: tabular-nums; }
.results-table caption { text-align: left; font-size: 14px; color: var(--ink-2); padding: 12px 0 16px; }
.results-table th, .results-table td { padding: 16px 12px; border-bottom: 1px solid var(--line); text-align: right; }
.results-table thead th { font-size: 13px; font-weight: 500; line-height: 1.4; border-top: 1px solid var(--line-strong); border-bottom-color: var(--line-strong); }
.results-table th:first-child { text-align: left; padding-left: 0; }
.results-table tbody th { font-weight: 500; min-width: 220px; }
.results-table tbody th span { display: block; color: var(--ink-2); font-size: 13px; font-weight: 400; margin-top: 3px; }
.results-table td { color: #2f6b3a; }
.results-table .baseline-value { color: #ad5428; }
.study-details { margin-top: 24px; border-top: 1px solid var(--line); padding: 14px 0; }
.study-details summary { cursor: pointer; font-size: 15px; font-weight: 500; }
.study-details p { font-size: 15px; color: var(--ink-2); margin: 16px 0 0; }
.study-details .table-scroll { margin-top: 24px; }
.compact-table tbody th { min-width: 120px; }
.compact-table td { color: var(--ink-2); }
.teaser.teaser-placeholder { aspect-ratio: auto; padding: 56px 24px; text-align: center; box-shadow: none; }
.teaser-placeholder p { font-size: 22px; margin: 0 0 8px; }
.teaser-placeholder a { font-size: 15px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 4px; }
.result-subsection + .result-subsection { margin-top: 48px; padding-top: 36px; border-top: 1px solid var(--line); }
.result-subsection > h3, .section > h3 { margin-bottom: 20px; font-size: clamp(22px, 2.6vw, 25px); }
.lede {
  font-size: 18.5px; line-height: 1.6; color: var(--ink-2);
  margin: 0 0 48px;
}
.prose { width: 100%; max-width: none; }
.prose p { margin: 0 0 1.3em; font-family: var(--font-prose); font-size: 17px; line-height: 1.65; color: var(--ink-2); }
.prose p:last-child { margin-bottom: 0; }

figure { margin: 0; }
figcaption { margin-top: 18px; font-size: 15px; line-height: 1.55; color: var(--ink-3); }
figcaption b { color: var(--ink); font-weight: 500; }
.frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.frame img, .frame video { width: 100%; }
.frame img { padding: 20px; }
.frame.bare { background: transparent; border: none; border-radius: 0; }
.frame.bare img { padding: 0; margin-inline: auto; max-width: 860px; }
.frame:has(video), .frame.teaser, .rollout-placeholder, .card .frame, .spatial-panel video {
  border-radius: 0;
  box-shadow: none;
}
.teaser { aspect-ratio: 16 / 9; background: var(--surface-2); }
.teaser video { height: 100%; object-fit: cover; }
.slot-empty {
  width: 100%; height: 100%; min-height: 160px;
  display: grid; place-content: center; text-align: center; gap: 4px;
  color: var(--ink-3); font-size: 14.5px; line-height: 1.5; padding: 24px;
}
.slot-empty code { color: var(--ink-2); }
.stack { display: grid; gap: 72px; }

/* ---- rollout grid */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.chip {
  font: inherit; font-size: 14px; font-weight: 500;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2);
  cursor: pointer;
}
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px 28px; }
.card { display: grid; gap: 14px; align-content: start; }
.card .frame { aspect-ratio: 16 / 9; background: var(--surface-2); }
.card video { height: 100%; object-fit: cover; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 12.5px; font-weight: 500; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
}
.tag.steps { background: var(--accent-tint); color: var(--accent); }
.cap { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-3); }
.cap b { color: var(--ink); font-weight: 500; }
.hidden { display: none; }
.grid-empty { margin: 8px 0 0; color: var(--ink-3); font-size: 15px; }
.filters:empty { display: none; }

.rollout-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; color: var(--ink-3); font-size: 14px;
}
.rollout-placeholder svg { width: 40px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1; }

/* ---- raw vs refined pairs */
.pairs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 56px 40px; }
.pair .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pair .side { display: grid; gap: 10px; }
.pair .frame { aspect-ratio: 1 / 1; background: var(--surface-2); }
.pair video { display: block; width: 100%; height: 100%; object-fit: cover; }
.pair figcaption { margin-top: 16px; max-width: none; }
.pair.wide .frame { aspect-ratio: 16 / 9; }
.tag.ok { background: #e3efe3; color: #2f6b3a; }
.tag.fail { background: var(--accent-tint); color: var(--accent); }
.refinement-example { margin-top: 36px; padding: 0; border: none; background: var(--surface); }
.refinement-example + .refinement-example { margin-top: 48px; }
.refinement-example > h4 { font-size: 19px; font-weight: 500; margin: 0 0 20px; }
.refinement-pair .side { align-content: start; min-width: 0; }
.comparison-label { margin: 0; font-size: 15px; font-weight: 500; }
.original-demo { color: #ad5428; }
.refined-demo { color: #2f6b3a; }
.comparison-count { margin: 0; font-size: 14px; }
.comparison-count span { color: var(--ink-2); }
.more-rollouts[open] > .pair { margin-top: 24px; }

.video-annotated { position: relative; align-self: start; }
.video-speed { position: absolute; right: 14px; bottom: 12px; color: #fff; font-size: 15px; font-weight: 500; line-height: 1.4; text-shadow: 0 1px 4px rgb(0 0 0 / 70%); pointer-events: none; }
.video-annotated:hover .video-speed, .video-annotated:focus-within .video-speed { bottom: 52px; }

@media (max-width: 560px) {
  .approach { padding: 18px; }
  .method-steps { grid-template-columns: 1fr; gap: 20px; }
  .refinement-pair .two { grid-template-columns: 1fr; gap: 24px; }
  .results-table { min-width: 590px; }
  .compact-table { min-width: 440px; }
}

/* ---- bibtex */
pre.bib {
  margin: 0; padding: 18px 0;
  background: var(--surface); border: none; border-radius: 0;
  font-family: var(--font-mono); font-size: 14px; line-height: 1.6; color: var(--ink-2);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.copy-row { display: flex; align-items: center; gap: 16px; margin-top: 18px; font-size: 14.5px; color: var(--ink-3); }

/* ---- footer */
footer {
  border-top: 1px solid var(--line);
  padding-block: 40px 64px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  font-size: 14px; color: var(--ink-3);
}
footer a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 0.18em; }

/* ---- mobile */
@media (max-width: 760px) {
  :root { --page-gutter: 32px; }
  body { font-size: 16px; }
  .hero { padding-block: 64px 48px; gap: 32px; }
  .section { padding-block: 64px; }
  .pairs { gap: 40px; }
  .stack { gap: 48px; }
  .frame img { padding: 10px; }
  .grid { gap: 32px 20px; }
}



/* ---- consistent reading and video labels */
.section-intro, .result-intro, .reading-note { max-width: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* Tables size to their content regardless of width; fixed layout makes them honor the 1px box. */
table.visually-hidden { table-layout: fixed; }

/* ---- task instructions next to the corresponding recordings */
.task-instruction { margin: 16px 0 20px; color: var(--ink-2); font-size: 16px; line-height: 1.6; }
.task-instruction strong { color: var(--ink); font-weight: 500; }
.study-details .task-instruction { margin: 20px 0; }


/* ---- text spans the content width (or its grid column, beside a figure) */
.prose p, .section-intro, .result-intro { color: var(--ink); line-height: 1.7; }
#bibtex { padding-bottom: 96px; }

/* ---- real-world result panels with animated bars */
.rw-results { margin: 0 auto 64px; }
.rw-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rw-panel { position: relative; padding: 26px 12px 10px; border: 1.5px solid var(--rw-frame); border-radius: 16px; background: #fff; }
.rw-env { --rw-frame: #d1d1d1; --rw-badge: #d1d1d1; }
.rw-comp { --rw-frame: #c4d9ee; --rw-badge: #dceaf7; }
.rw-skill { --rw-frame: #ecd5b1; --rw-badge: #ecd5b1; }
.rw-badge {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); margin: 0; white-space: nowrap;
  padding: 3px 14px; border-radius: 6px; background: var(--rw-badge); box-shadow: 0 1px 2px rgb(27 27 27 / 18%);
  font-size: 15px; font-weight: 500; color: var(--ink);
}
.rw-panel img { display: block; width: 100%; height: auto; aspect-ratio: 968 / 738; object-fit: contain; }
.chart-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 2px; font-size: 13px; color: var(--ink-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-swatch { width: 18px; height: 11px; border: 1px solid var(--ink-3); background: #c4cbd0; }
.chart-swatch-hatch { background: repeating-linear-gradient(135deg, #fff 0 2px, var(--ink-3) 2px 3px); }
.rw-chart svg, .bar-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 0.6; }
.chart-axis { stroke: var(--ink-3); stroke-width: 0.8; }
.chart-divider { stroke: var(--line-strong); stroke-width: 0.8; }
.chart-tick { font: 10px var(--font-body); fill: var(--ink-3); }
.chart-label { font: 10.5px var(--font-body); fill: var(--ink-2); }
.chart-super { font: 500 11px var(--font-body); fill: var(--ink); }
.chart-value { font: 500 11px var(--font-body); fill: var(--ink); font-variant-numeric: tabular-nums; }
.chart-whisker line { stroke: var(--ink-2); stroke-width: 1; transition: opacity .2s; }
.chart-bar.is-hover rect:first-child { filter: brightness(0.92); }
.chart-bar.is-link { cursor: pointer; }
.chart-bar.is-link.is-hover rect:first-child { stroke: var(--ink); stroke-width: 1; }
.chart-bar.is-link rect[tabindex]:focus-visible { outline: none; stroke: var(--accent); stroke-width: 2; }
.chart-tooltip {
  position: fixed; z-index: 50; pointer-events: none; padding: 5px 9px; border-radius: 6px;
  background: var(--ink); color: #fff; font-size: 13px; white-space: nowrap;
}
.chart-tooltip-cta { display: block; margin-top: 2px; font-size: 12px; color: #f2c9b6; }
.bar-chart { max-width: 640px; margin-inline: auto; }

/* photo regions that link to rollout videos */
.rw-photo { position: relative; }
.rw-hotspot {
  position: absolute; left: 0; right: 0; height: 50%; display: flex; align-items: flex-end; justify-content: center;
  border-radius: 10px; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .15s, background-color .15s;
}
.rw-hotspot-top { top: 0; }
.rw-hotspot-bottom { bottom: 0; }
.rw-hotspot span {
  margin-bottom: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: rgb(27 27 27 / 78%); color: #fff; opacity: .0; transition: opacity .15s;
}
.rw-hotspot:hover, .rw-hotspot:focus-visible { outline-color: var(--accent); background: rgb(200 101 61 / 5%); text-decoration: none; }
.rw-hotspot:hover span, .rw-hotspot:focus-visible span { opacity: 1; }
@media (hover: none) { .rw-hotspot span { opacity: .9; } }
.video-target-flash { animation: video-target-flash 1.8s ease-out; border-radius: 8px; }
@keyframes video-target-flash { 0%, 30% { box-shadow: 0 0 0 4px rgb(200 101 61 / 45%); } 100% { box-shadow: 0 0 0 4px rgb(200 101 61 / 0%); } }

/* the archived refinement clips are 256 px: two small cases side by side */
.refinement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; row-gap: 10px; margin-top: 16px; }
.refinement-case { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 10px; }
.refinement-case .task-instruction { margin: 0; align-self: end; }
.refinement-case .refinement-pair { margin: 0; }
@media (max-width: 760px) { .refinement-grid { grid-template-columns: minmax(0, 1fr); max-width: 520px; } }
@media (max-width: 860px) {
  .rw-panels { grid-template-columns: minmax(0, 1fr); gap: 28px; max-width: 480px; margin-inline: auto; }
}

/* ---- simulation story: text steps on the left drive a sticky stage on the right */
.story { --ease: cubic-bezier(.2, .7, .2, 1); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); column-gap: 56px; margin-top: 8px; }
.story-steps { grid-column: 1; grid-row: 1; padding-block: 18vh 30vh; }
.story-stage { grid-column: 2; grid-row: 1; align-self: start; position: sticky; top: max(24px, calc(50vh - 250px)); height: 500px; }
.story-step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; opacity: .28; transition: opacity .5s var(--ease); }
.story-step.is-active { opacity: 1; }
.story-step h3 { margin: 0 0 12px; font-size: 24px; line-height: 1.25; }
.story-step p { margin: 0 0 14px; color: var(--ink-2); font-size: 16.5px; line-height: 1.6; }
.story-step strong { color: var(--ink); }
.story-kicker { margin: 0 0 8px !important; font-size: 13px !important; letter-spacing: .1em; text-transform: uppercase; color: var(--accent) !important; }
.story-scene {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  opacity: 0; transform: translateY(40px) scale(.97); pointer-events: none;
  transition: opacity .6s var(--ease), transform .9s var(--ease);
}
.story-scene.is-past { transform: translateY(-40px) scale(.97); }
.story-scene.is-active { opacity: 1; transform: none; pointer-events: auto; transition-delay: .12s; }
.story:not(.is-live) .story-stage { position: static; height: auto; }
.story:not(.is-live) .story-scene { position: static; opacity: 1; transform: none; }
.story:not(.is-live) .story-step { opacity: 1; min-height: 0; margin-bottom: 32px; }
.story-fallback { width: 100%; height: auto; }
.story-svg { display: block; width: 100%; height: auto; max-height: 100%; overflow: visible; font-family: var(--font-body); }

/* scene 1: LIBERO-10 heatmap */
.sh { --row: 54px; --label: 104px; --groups: 150px; font-variant-numeric: tabular-nums; }
.sh-cols, .sh-row { display: grid; grid-template-columns: var(--label) repeat(4, minmax(0, 1fr)); column-gap: 4px; width: calc(100% - var(--groups)); }
.sh-cols { margin-bottom: 8px; font-size: 14px; color: var(--ink-3); text-align: center; }
.sh-axis { text-align: right; padding-right: 12px; font-style: italic; font-size: 13px; }
.sh-body { position: relative; height: calc(5.4 * var(--row)); }
.sh-row {
  position: absolute; left: 0; top: calc(var(--slot) * var(--row)); height: calc(var(--row) - 4px); align-items: stretch;
  transition: top .9s var(--ease), opacity .6s var(--ease);
}
.sh-label { align-self: center; text-align: right; padding-right: 12px; font-size: 16px; color: var(--ink); white-space: nowrap; }
.sh-cell { display: grid; place-items: center; border-radius: 3px; background: var(--c); font-size: 15px; color: var(--ink); transition: box-shadow .5s var(--ease), transform .5s var(--ease); }
.sh-cell b { font-weight: 400; }
.sh-cell.is-dark { color: #fff; }
.sh-group {
  position: absolute; right: 0; width: calc(var(--groups) - 18px); top: calc(var(--slot) * var(--row)); height: calc(var(--span) * var(--row) - 4px);
  display: flex; align-items: center; padding-left: 12px; border-left: 2px solid var(--line-strong);
  font-size: 14px; line-height: 1.35; color: var(--ink-2); transition: opacity .6s var(--ease), color .4s, border-color .4s;
}
.sh-group-pair { opacity: 0; }
.sh-legend { display: grid; grid-template-columns: auto 160px; grid-template-rows: auto auto; column-gap: 10px; align-items: center; justify-content: start; margin: 18px 0 0 var(--label); font-size: 12px; color: var(--ink-3); }
.sh-legend > span:first-child { grid-row: 1; }
.sh-legend i { grid-row: 1; height: 10px; border-radius: 2px; }
.sh-legend span:nth-child(3), .sh-legend span:nth-child(4) { grid-column: 2; grid-row: 2; }
.sh-legend span:nth-child(4) { justify-self: end; }
[data-state="pretrained"] .sh-row:not(.is-pre) { opacity: .22; }
[data-state="pretrained"] .sh-row.is-pre .sh-cell:is([data-k="1"], [data-k="2"]) { box-shadow: 0 0 0 2.5px var(--accent); }
[data-state="pretrained"] .sh-group-pre { color: var(--accent); border-color: var(--accent); font-weight: 500; }
[data-state="pretrained"] .sh-group-none { opacity: .4; }
[data-state="pair"] .sh-row:not(.is-pi):not(.is-vl) { opacity: 0; }
[data-state="pair"] .sh-row.is-vl { top: calc(var(--pair-slot) * var(--row)); }
[data-state="pair"] .sh-cell[data-k="1"] { box-shadow: 0 0 0 2.5px var(--accent); }
[data-state="pair"] .sh-group:not(.sh-group-pair) { opacity: 0; }
[data-state="pair"] .sh-group-pair { opacity: 1; color: var(--ink); border-color: var(--accent); }

/* scene 2: an update splits into directions; only the strongest is kept */
.dz text { font-size: 13px; fill: var(--ink-2); }
.dz .dz-cap { font-size: 13px; fill: var(--ink-3); }
.dz .dz-name1 { fill: var(--accent); font-weight: 500; }
.dz .dz-op { font: 300 30px var(--font-display); fill: var(--ink-3); }
.dz .dz-model { font-size: 16px; fill: var(--ink); }
.dz .dz-value { font: 500 22px var(--font-display); fill: var(--ink-2); }
.dz .dz-value.is-pi { fill: var(--ink); }
.dz .dz-keepnote { font-size: 13px; fill: var(--accent); font-weight: 500; }
.dz-frame { fill: #fff; stroke: var(--line-strong); }
.dz-sigma { fill: var(--ink-3); }
.dz-keep .dz-sigma { fill: var(--accent); }
.dz-keep .dz-frame { transition: stroke .4s, stroke-width .4s; }
.dz-arrow { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .4s var(--ease); }
.dz-track { fill: var(--surface-2); stroke: var(--line); }
.dz-bar { fill: #8a8a8a; transform-box: fill-box; transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease); }
.dz-bar.is-pi { fill: var(--accent); }
.dz-full { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 4 3; }
.dz-whole, .dz-eq, .dz-card, .dz-op, .dz-keepnote, .dz-test, .dz-value { opacity: 0; transition: opacity .6s var(--ease), transform .7s var(--ease); }
.dz-card { transform: translateX(-24px); }
.is-active .dz-whole { opacity: 1; transition-delay: .15s; }
.is-active .dz-eq { opacity: 1; transition-delay: .6s; }
.is-active .dz-card, .is-active .dz-op { opacity: 1; transform: none; transition-delay: calc(.7s + var(--k) * .25s); }
/* then everything but the strongest direction fades, and the test runs */
.is-active .dz-drop { opacity: .14; transition: opacity .6s var(--ease) 1.9s, transform .7s var(--ease) calc(.7s + var(--k) * .25s); }
.is-active .dz-keep .dz-frame { stroke: var(--accent); stroke-width: 2.5; transition-delay: 1.9s; }
.is-active .dz-keepnote { opacity: 1; transition-delay: 2.1s; }
.is-active .dz-arrow { stroke-dashoffset: 0; transition-delay: 2.3s; }
.is-active .dz-test { opacity: 1; transition-delay: 2.4s; }
.is-active .dz-bar { transform: none; transition-delay: 2.6s; }
.is-active .dz-value { opacity: 1; transition-delay: 3.3s; }

/* scene 3: retained gain vs rank */
.rs text { font-size: 13px; fill: var(--ink-3); }
.rs .rs-axis { font-size: 14px; fill: var(--ink-2); }
.rs-grid line { stroke: var(--line); }
.rs-ninety line { stroke: var(--ink-3); stroke-dasharray: 2 4; }
.rs-legend text { font-size: 14px; fill: var(--ink-2); }
.rs-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke: var(--ink); }
.rs-line.is-pi { stroke: var(--accent); }
.rs-line.is-vl { stroke: #8a8a8a; }
.rs-line.is-dashed { stroke-dasharray: 7 5; }
.rs-line.is-key { stroke: var(--ink-2); stroke-width: 2; }
.rs-series.is-pi .rs-dot { fill: var(--accent); }
.rs-series.is-vl .rs-dot { fill: #8a8a8a; }
.rs-dot { stroke: #fff; stroke-width: 1.5; }
.rs .rs-k1 { font: 500 15px var(--font-display); }
.rs-series.is-pi .rs-k1 { fill: var(--accent); }
.rs-series.is-vl .rs-k1 { fill: #6f6f6f; }
.rs-series { clip-path: inset(-10px 100% -10px -60px); transition: clip-path 1.3s var(--ease); }
.is-active .rs-series { clip-path: inset(-10px -10px -10px -60px); transition-delay: calc(.25s + var(--i) * .18s); }
.rs-ninety { opacity: 0; transition: opacity .6s; }
.is-active .rs-ninety { opacity: 1; transition-delay: 1.4s; }

/* scene 4: where the update acts */
.ls text { font-size: 13px; fill: var(--ink-2); }
.ls .ls-title { font: 500 20px var(--font-display); fill: var(--ink); }
.ls .ls-name { font: 500 16px var(--font-display); fill: var(--ink); }
.ls .ls-pct { fill: var(--ink-3); font-weight: 400; }
.ls .ls-io { font-style: italic; font-size: 14px; }
.ls .ls-num { font-size: 10px; fill: var(--ink-2); }
.ls .ls-num.is-dark { fill: #fff; }
.ls-panel { fill: #f6f6f6; stroke: var(--line-strong); }
.ls-base { fill: #fff; stroke: #b9b9b9; stroke-width: .8; }
.ls-attn line { stroke: #cfcfcf; stroke-width: 1; }
.ls-flow line, .ls-flow path { stroke: #444; stroke-width: 1.3; }
.ls-bracket path { fill: none; stroke: var(--accent); stroke-width: 2; }
.ls .ls-bracket text { fill: var(--accent); font-weight: 500; font-size: 14px; }
.ls .ls-bracket .ls-big { font: 500 22px var(--font-display); }
.ls-legend text { font-size: 12px; fill: var(--ink-3); }
.ls-fill { opacity: 0; transition: opacity .5s var(--ease); }
.is-active .ls-fill { opacity: 1; transition-delay: calc(.25s + var(--i) * 55ms); }
.ls-block.is-early .ls-base { transition: stroke .4s; }
.is-active .ls-block.is-early .ls-base { stroke: var(--accent); stroke-width: 1.6; transition-delay: 1.5s; }
.ls-bracket { opacity: 0; transform: translateX(8px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.is-active .ls-bracket { opacity: 1; transform: none; transition-delay: 1.5s; }

@media (max-width: 860px) {
  .story { display: block; }
  .story-stage { position: sticky; top: 56px; z-index: 2; height: min(54vh, 430px); background: var(--ground); border-bottom: 1px solid var(--line); }
  .story-steps { padding-block: 4vh 40vh; }
  .story-step { min-height: 62vh; justify-content: flex-start; padding-top: 10vh; }
  .story-step h3 { font-size: 20px; }
  .sh { --row: 40px; --label: 84px; --groups: 96px; }
  .sh-label { font-size: 13px; padding-right: 8px; }
  .sh-cell { font-size: 12px; }
  .sh-group { font-size: 11.5px; padding-left: 8px; width: calc(var(--groups) - 8px); }
  .sh-axis { font-size: 11px; padding-right: 8px; }
  .dz text, .dz .dz-cap, .dz .dz-keepnote { font-size: 17px; }
  .dz .dz-model { font-size: 19px; }
  .dz .dz-value { font-size: 24px; }
  .rs text, .rs .rs-axis { font-size: 19px; }
  .rs .rs-legend text { font-size: 15px; }
  .rs .rs-k1 { font-size: 20px; }
  .ls text, .ls-legend text { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .story-scene, .story-scene.is-past { transform: none; transition: opacity .2s; }
  .story *, .story *::before { transition-duration: .01s !important; transition-delay: 0s !important; }
}

/* ---- demonstration refinement animation */
.rf-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 40px; align-items: center; margin: 0 0 36px; }
.rf-row .result-intro:last-child { margin-bottom: 0; }
.rf-figure { margin: 0; }
.rf svg { display: block; width: 100%; height: auto; overflow: visible; }
.rf text { font: 14px var(--font-body); fill: var(--ink-2); }
.rf .rf-frame { fill: var(--surface, #fafafa); stroke: var(--line); }
.rf .rf-fade { opacity: 0; transition: opacity .5s ease; }
.rf .rf-fade.is-on { opacity: 1; }
.rf .rf-demo { fill: none; stroke: #5f8a6b; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 0 7; }
.rf .rf-lab-demo { fill: #5f8a6b; font-weight: 500; }
.rf .rf-pol { transition: opacity .6s ease; }
.rf .rf-pol.is-ghost { opacity: .4; }
.rf .rf-pol-line { fill: none; stroke: #7f9cbc; stroke-width: 2.5; stroke-dasharray: 8 6; }
.rf .rf-pol-dot { fill: #7f9cbc; }
.rf .rf-lab-pol { fill: #5d7a9a; font-weight: 500; }
.rf .rf-ref-line { fill: none; stroke: #e6cf79; stroke-width: 6; stroke-linecap: round; }
.rf .rf-ref-dot { fill: #fff6d6; stroke: #c9a227; stroke-width: 2; }
.rf .rf-lab-ref { font: 500 17px var(--font-display); fill: #9c7c12; }
.rf .rf-miss { stroke: #5f8a6b; stroke-width: 1.8; stroke-dasharray: 4 4; }
.rf .rf-lab-miss { fill: #5f8a6b; }
.rf .rf-start { fill: var(--ink); }
.rf .rf-lab-start { font-size: 17px; fill: var(--ink); font-style: italic; }
.rf .rf-wp-ring { fill: #fff; stroke: #5f8a6b; stroke-width: 3; }
.rf .rf-wp-core { fill: #5f8a6b; }
.rf .rf-wp { transform-box: fill-box; transform-origin: center; transform: scale(.4); transition: opacity .4s ease, transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.rf .rf-wp.is-on { transform: none; }
.rf .rf-lab-wp { font-size: 17px; font-style: italic; fill: #5f8a6b; font-weight: 500; }
@media (max-width: 860px) {
  .rf-row { grid-template-columns: 1fr; gap: 20px; }
  .rf-figure { max-width: 440px; width: 100%; margin-inline: auto; }
}
}
@media (prefers-reduced-motion: reduce) {
  .rf .rf-fade, .rf .rf-wp, .rf .rf-pol { transition: none; }
}

/* hover preview card: floats above (or below) the hovered photo or bar */
.rollout-card {
  position: fixed; z-index: 60; width: min(480px, calc(100vw - 24px)); padding: 8px 8px 9px; border-radius: 12px; pointer-events: none;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 14px 40px rgb(0 0 0 / 22%);
  opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s;
}
.rollout-card.is-below { transform: translateY(-4px); }
.rollout-card.is-on { opacity: 1; transform: none; }
.rollout-card-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #111; }
.rollout-card-frame video { width: 100%; height: 100%; object-fit: cover; }
.rollout-card-frame .video-speed { right: 8px; bottom: 6px; font-size: 12px; }
.rollout-card-title { margin: 7px 2px 0; font-size: 13.5px; font-weight: 500; line-height: 1.35; color: var(--ink); }
.rollout-card-note { margin: 1px 2px 0; font-size: 12px; line-height: 1.35; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .rollout-card { transition: none; transform: none; } }

/* rollout popup */
.rollout-modal {
  width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 22px 26px 18px;
  border: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 70px rgb(0 0 0 / 28%); overflow: auto;
}
.rollout-modal::backdrop { background: rgb(20 18 16 / 62%); }
.rollout-modal[open] { animation: rollout-modal-in .2s ease-out; }
@keyframes rollout-modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .rollout-modal[open] { animation: none; } }
.rollout-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.rollout-modal-head h3 { margin: 0; font-size: 22px; font-weight: var(--heading-weight); letter-spacing: var(--heading-spacing); }
.rollout-modal-close {
  flex: none; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink-2); font-size: 22px; line-height: 1; cursor: pointer;
}
.rollout-modal-close:hover { background: var(--surface-2); color: var(--ink); }
.rollout-modal-tabs { margin-top: 14px; }
.rollout-modal-tabs[hidden] { display: none; }
.rollout-modal-instruction { margin: 12px 0 0; }
.rollout-modal-instruction:empty { display: none; }
.rollout-modal-clips { display: grid; grid-template-columns: repeat(var(--clip-count, 2), minmax(0, 1fr)); gap: 18px; margin-top: 16px; }
.rollout-modal-clips figure { margin: 0; }
.rollout-modal-clips h4 { margin: 0 0 8px; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.rollout-modal-clips .frame { position: relative; }
.rollout-modal-clips video { display: block; width: 100%; max-height: 72vh; object-fit: contain; border-radius: 10px; background: #111; }
.rollout-modal-foot { margin: 14px 0 0; font-size: 14px; color: var(--ink-3); text-align: right; }
.rollout-modal-foot a { color: var(--accent); }
@media (max-width: 700px) {
  .rollout-modal { padding: 16px; }
  .rollout-modal-clips { grid-template-columns: 1fr; }
}

/* ---- restyle: neutral frames, numbered section rules, mono labels */
h1 { font-weight: 600; letter-spacing: 0; }
.brand { font-weight: 700; letter-spacing: 0; }
.nav-label { font-family: var(--font-display); letter-spacing: .06em; }
.section { border-top: none; padding-block: 72px 24px; }
main { counter-reset: section; }
.section > h2, .abstract-section > h2 {
  counter-increment: section; display: flex; align-items: baseline; gap: 14px;
}
.section > h2::before, .abstract-section > h2::before {
  content: counter(section, decimal-leading-zero);
  font: 500 13px/1 var(--font-display); letter-spacing: 0; color: var(--accent);
}
.section > h2::after, .abstract-section > h2::after {
  content: ""; flex: 1; align-self: center; min-width: 24px; border-top: 1px solid var(--line-strong);
}
.intro-reel video { border-radius: var(--radius); }
.rw-panel { border: 1px solid var(--line-strong); border-radius: var(--radius); }
.rw-badge {
  padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 2px; background: #fff; box-shadow: none;
  font: 500 12px/1.5 var(--font-display); letter-spacing: .04em; text-transform: uppercase;
}
.pretext-spot, .rw-hotspot { border-radius: var(--radius); }
.pretext-spot:hover, .pretext-spot:focus-visible, .rw-hotspot:hover, .rw-hotspot:focus-visible {
  outline-color: var(--ink); background: rgb(17 17 17 / 4%);
}
.chart-tooltip { border-radius: 3px; }
.chart-tooltip-cta { color: #ffb4ad; }
@keyframes video-target-flash { 0%, 30% { box-shadow: 0 0 0 4px rgb(17 17 17 / 30%); } 100% { box-shadow: 0 0 0 4px rgb(17 17 17 / 0%); } }
.rollout-card { border-radius: 6px; }
.rollout-card-frame, .rollout-modal-clips video { border-radius: 2px; }
.rollout-modal::backdrop { background: rgb(10 10 10 / 62%); }
.method-steps li { border-top-color: var(--ink); }

/* ---- generalization gap: held-out task, closest pretext, what is new */
.gap-class { margin-top: 56px; }
.gap-class-head { padding-top: 16px; border-top: 2px solid var(--ink); }
.gap-class-head h3 { font-size: clamp(22px, 2.6vw, 26px); }
.gap-class-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 16px; }
.gap-class-head .gap-budget { color: var(--ink-3); font-size: 14px; }
.gap-tasks { margin: 18px 0 24px; font-size: 16px; line-height: 1.8; }
.gap-tasks button {
  padding: 0; border: 0; background: none; color: var(--ink-3); font: inherit; cursor: pointer;
}
.gap-tasks button + button::before { content: "\00b7"; margin: 0 12px; color: var(--ink-3); font-weight: 400; }
.gap-tasks button:hover { color: var(--ink); }
.gap-tasks button[aria-pressed="true"] { color: var(--ink); font-weight: 600; cursor: default; }
.gap-task[hidden], .gap-clip[hidden] { display: none; }
.gap-tasks { margin-bottom: 8px; }
/* Horizontal track: the current pane is centred and lifted, its neighbours
   peek in at the sides, smaller and faded. */
.gap-track {
  position: relative; display: flex; align-items: flex-start; gap: 18px;
  margin-inline: -12px; padding: 14px 0 34px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; outline: none;
}
.gap-track::-webkit-scrollbar { display: none; }
/* Spacers let the first and last panes reach the centre: 14% + gap + 72% pane. */
.gap-track::before, .gap-track::after { content: ""; flex: 0 0 calc(14% - 18px); }
.gap-track:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 14px; }
.gap-track.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.gap-track > .gap-task {
  flex: 0 0 72%; scroll-snap-align: center; padding: 22px 24px 24px;
  border-radius: 14px; background: var(--surface);
  transform: scale(.93); opacity: .38; cursor: pointer;
  transition: transform .35s ease, opacity .35s ease, box-shadow .35s ease;
}
.gap-track > .gap-task > * { pointer-events: none; }
.gap-track > .gap-task:hover:not(.is-current) { opacity: .6; }
.gap-track > .gap-task.is-current {
  transform: none; opacity: 1; cursor: auto;
  box-shadow: 0 0 0 1px var(--line), 0 22px 44px -20px rgb(0 0 0 / 38%);
}
.gap-track > .gap-task.is-current > * { pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .gap-track > .gap-task { transition: none; } }
@media (max-width: 760px) {
  .gap-track { gap: 10px; }
  .gap-track::before, .gap-track::after { flex-basis: calc(6% - 10px); }
  .gap-track > .gap-task { flex-basis: 88%; padding: 16px; }
}
.gap-task-title { margin: 0; font: 600 21px/1.35 var(--font-display); }
.gap-diff { margin: 8px 0 0; color: var(--ink-2); font-size: 16px; }
.gap-diff del { color: var(--ink-3); text-decoration-thickness: 1.5px; }
.gap-diff ins {
  padding: 1px 6px; border-radius: 2px; background: var(--accent-tint); color: var(--accent);
  font-weight: 600; text-decoration: none;
}
.gap-chip { padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 14px; font-weight: 500; }
.gap-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; }
.gap-grid { margin-top: 22px; align-items: start; }
.gap-label {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font: 500 11.5px/1.4 var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.gap-label span {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 50%;
  font-size: 10.5px; letter-spacing: 0;
}
.gap-task .task-instruction { margin: 0 0 12px; font-size: 15px; }
.gap-task .frame { border: none; border-radius: 0; background: #111; }
.gap-task video { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #111; }
.gap-toggle { display: inline-flex; gap: 4px; margin-bottom: 10px; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.gap-toggle button {
  padding: 6px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2);
  font: 500 13px/1.2 var(--font-body); cursor: pointer;
}
.gap-toggle button:hover { color: var(--ink); }
.gap-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.gap-pretext { display: grid; gap: 14px; }
.gap-pretext .gap-label { margin-bottom: -4px; }
.gap-pretext h5 { margin: 0 0 6px; font-size: 14px; font-weight: 500; color: var(--ink); }
.gap-pretext .gap-demo { padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.gap-pretext .gap-demo h5 { color: var(--accent); }
.gap-pretext .gap-demo h5::before { content: "Test time \2014  "; color: var(--ink-3); font-weight: 400; }
@media (max-width: 860px) {
  .gap-grid { grid-template-columns: minmax(0, 1fr); }
  .gap-pretext { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gap-pretext .gap-label { grid-column: 1 / -1; }
  .gap-pretext .gap-demo { padding-top: 0; border-top: 0; }
}
@media (max-width: 560px) {
  .gap-pretext { grid-template-columns: minmax(0, 1fr); }
}
