:root {
  --bg: #f7f5f0;
  --paper: #fff;
  --ink: #1c1b18;
  --body: #3a3833;
  --muted: #6d685e;
  --line: #e2ddd2;
  --line-strong: #cfc8ba;
  --accent: #22605a;
  --accent-dark: #174a45;
  --accent-pale: #eef3f1;
  --source: #a14a2f;
  --slate: #4b5d7e;
  font-family: "STIX Two Text", "Times New Roman", Times, serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: absolute; top: -80px; left: 12px; z-index: 20; padding: 12px; background: var(--paper); }
.skip:focus { top: 8px; }
.label, .eyebrow, nav a, .badge, .prompt-cell p span {
  text-transform: uppercase;
  letter-spacing: .14em;
}

/* Top bar */
.topbar { max-width: 1200px; height: 68px; margin: auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.brand img { width: 24px; height: 24px; }
nav { display: flex; gap: 32px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
nav a { transition: color .15s; }
nav a:hover { color: var(--accent); }

main { max-width: 1200px; margin: auto; padding: 0 32px; }

/* Hero */
.hero { padding: 92px 0 76px; text-align: center; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 30px; font-size: 12px; font-weight: 600; color: var(--accent); }
h1 { max-width: 980px; margin: 0 auto; font-size: clamp(24px, 2.9vw, 34px); font-weight: 400; line-height: 1.3; letter-spacing: -.005em; color: var(--body); }
h1 span { display: block; margin-bottom: 22px; font-size: clamp(60px, 7.4vw, 92px); font-weight: 600; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.authors { margin: 26px 0 0; font-size: 17px; font-style: italic; color: var(--muted); }
.hero-line { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 34px 0 34px; font-size: 22px; font-style: italic; color: var(--ink); }
.hero-line::before, .hero-line::after { content: ""; width: 44px; height: 1px; background: var(--line-strong); }
.hero-actions { display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap; gap: 12px; }
.primary-link, .resource-link { display: inline-flex; align-items: center; gap: 14px; padding: 12px 22px; border: 1px solid var(--ink); border-radius: 2px; font-size: 16px; transition: background .15s, color .15s, border-color .15s; }
.primary-link { background: var(--ink); color: var(--bg); }
.primary-link:hover { background: var(--accent); border-color: var(--accent); }
.resource-link { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.resource-link:hover { border-color: var(--ink); background: var(--paper); }
.benchmark-downloads { margin: 22px auto 0; font-size: 15px; line-height: 1.8; color: var(--muted); }
.benchmark-downloads a { margin: 0 3px; color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Sections */
.section { padding: 64px 0; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: baseline; gap: 16px; margin-bottom: 28px; }
.section-number { font-size: 18px; font-style: italic; color: var(--accent); font-variant-numeric: lining-nums; }
h2 { margin: 0; font-size: 34px; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
.tldr > p, .abstract > p { max-width: 860px; margin: 0; text-align: left; }
.tldr > p { padding: 2px 0 2px 26px; border-left: 2px solid var(--accent); font-size: 23px; line-height: 1.65; color: var(--ink); }
.abstract > p { font-size: 21px; line-height: 1.8; color: var(--body); text-align: justify; hyphens: auto; }
.section-intro { max-width: 860px; margin: -8px 0 40px; font-size: 20px; line-height: 1.6; font-style: italic; color: var(--muted); }

/* Method figure */
.overview { margin: 0; padding: 32px 32px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; }
.overview a { display: block; }
.overview img { display: block; width: 100%; height: auto; }
.overview figcaption { max-width: 900px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 17px; line-height: 1.65; color: var(--body); }
.overview figcaption strong { font-weight: 600; color: var(--ink); }
.overview figcaption span { display: block; margin-top: 6px; font-size: 15px; font-style: italic; color: var(--muted); }

/* Demo toolbar */
.demo-toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; margin-top: -12px; padding: 14px 0; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.dataset-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0; }
.dataset-heading h3 { margin: 0; font-size: 23px; font-weight: 500; color: var(--ink); }
.dataset-heading span { font-size: 16px; font-style: italic; color: var(--muted); }
.demo-controls { display: flex; align-items: center; gap: 18px; }
.loop-toggle { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.loop-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.scroll-buttons { display: flex; gap: 6px; }
.scroll-buttons button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--paper); font-size: 17px; line-height: 1; transition: background .15s, border-color .15s, color .15s, opacity .15s; }
.scroll-buttons button:hover:enabled { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.dataset-description { max-width: 900px; margin: 16px 0 22px; font-size: 17px; line-height: 1.65; color: var(--muted); }

/* Comparison rows: each row scrolls on its own */
.comparison { --cell: 264px; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; }
.sample-row { padding: 20px 0 16px; }
.sample-row + .sample-row { border-top: 1px solid var(--line); }
.sample-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 14px; padding: 0 18px; }
.row-frame { position: relative; }
.row-frame::before, .row-frame::after { content: ""; position: absolute; top: 0; bottom: 10px; z-index: 1; width: 56px; pointer-events: none; transition: opacity .2s; }
.row-frame::before { left: 0; background: linear-gradient(to left, rgba(255,255,255,0), #fff 85%); }
.row-frame::after { right: 0; background: linear-gradient(to right, rgba(255,255,255,0), #fff 85%); }
.row-frame.at-start::before, .row-frame.at-end::after { opacity: 0; }
.row-scroll { overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-left: 18px; padding-bottom: 10px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.row-track { display: grid; grid-auto-flow: column; grid-auto-columns: var(--cell); gap: 14px; width: max-content; padding: 0 18px; }
.sample-head .scroll-buttons button { width: 34px; height: 34px; font-size: 15px; }
.prompt-cell { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.sample-number { margin-right: 4px; font-size: 18px; font-style: italic; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.prompt-cell p { display: flex; align-items: baseline; gap: 10px; margin: 0; padding: 7px 14px 6px; border: 1px solid; border-radius: 2px; }
.prompt-cell p span { font-size: 10.5px; font-weight: 600; }
.prompt-cell p strong { font-size: 18px; font-style: italic; line-height: 1.3; }
.prompt-cell .source-prompt { color: var(--source); background: #fbf4f0; border-color: #e7cdc2; }
.source-prompt strong { font-weight: 400; color: #6e3624; }
.prompt-cell .target-prompt { color: var(--accent); background: var(--accent-pale); border-color: #b9cfca; }
.target-prompt strong { font-weight: 600; color: var(--accent-dark); }
.prompt-arrow { position: relative; flex: none; width: 38px; height: 1.5px; margin-right: 4px; background: var(--muted); font-size: 0; }
.prompt-arrow::after { content: ""; position: absolute; right: 0; top: 50%; width: 8px; height: 8px; border-top: 1.5px solid var(--muted); border-right: 1.5px solid var(--muted); transform: translateY(-50%) rotate(45deg); transform-origin: center; }

.media-card { min-width: 0; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; scroll-snap-align: start; transition: box-shadow .15s, border-color .15s; }
.media-card.ours { border-color: #b9cfca; box-shadow: inset 0 2px 0 var(--accent); }
.media-card.playing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 6px 18px -8px rgba(28,27,24,.35); }
.media-label { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 12px 14px 11px; }
.media-label > div { min-width: 0; }
.media-label h4 { margin: 0 0 2px; font-size: 17px; font-weight: 600; line-height: 1.25; color: var(--ink); }
.media-label p { margin: 0; font-size: 15px; font-style: italic; color: var(--muted); }
.ours .media-label h4 { color: var(--accent); }
.badge { order: -1; flex: none; padding: 3px 6px 2px; border: 1px solid currentColor; border-radius: 2px; font-size: 10.5px; font-weight: 600; line-height: 1.4; white-space: nowrap; color: var(--muted); }
.ours .badge { background: var(--accent); border-color: var(--accent); color: #fff; }
.badge.tag-inference-time { color: var(--source); }
.badge.tag-training-based { color: var(--slate); }
.media-card video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #111; }
.media-error { margin: 0; padding: 9px 14px; font-size: 14px; color: #a23b30; }

.protocol-note { max-width: 900px; margin: 28px 0 0; font-size: 16px; line-height: 1.7; font-style: italic; color: var(--muted); }

/* Footer */
footer { max-width: 1200px; margin: auto; padding: 30px 32px 44px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
footer .brand { font-size: 17px; }
footer p, footer > a:last-child { margin: 0; font-size: 14px; color: var(--muted); }
footer > a:last-child:hover { color: var(--accent); }

@media (min-width: 1500px) {
  main, .topbar, footer { max-width: 1260px; }
}

@media (max-width: 760px) {
  main { padding: 0 20px; }
  .topbar { height: 60px; padding: 0 20px; }
  nav { gap: 18px; font-size: 11px; }
  .brand { font-size: 18px; }
  .hero { padding: 58px 0 48px; }
  .eyebrow { font-size: 10.5px; }
  .wide-break { display: none; }
  h1 { font-size: 23px; }
  h1 span { font-size: 60px; }
  .hero-line { font-size: 19px; gap: 12px; }
  .hero-line::before, .hero-line::after { width: 20px; }
  .section { padding: 44px 0; }
  h2 { font-size: 28px; }
  .tldr > p { padding-left: 16px; font-size: 20px; }
  .abstract > p { font-size: 19px; line-height: 1.75; text-align: left; }
  .section-intro { font-size: 18px; margin-bottom: 30px; }
  .overview { padding: 14px 12px; }
  .overview figcaption { font-size: 16px; }
  .demo-toolbar { padding: 10px 0; }
  .dataset-heading h3 { font-size: 20px; }
  .dataset-heading span { font-size: 14px; }
  .loop-toggle { font-size: 14px; }
  .scroll-buttons button { width: 36px; height: 36px; }
  .dataset-description { font-size: 16px; }
  .comparison { --cell: min(216px, calc(100vw - 60px)); }
  .sample-row { padding: 14px 0 10px; }
  .sample-head { padding: 0 9px; gap: 8px 12px; margin-bottom: 10px; }
  .sample-head { position: relative; }
  .sample-head .scroll-buttons { position: absolute; top: -6px; right: 9px; }
  .sample-head .scroll-buttons button { width: 30px; height: 30px; font-size: 14px; }
  .row-scroll { scroll-padding-left: 9px; }
  .row-track { gap: 9px; padding: 0 9px; }
  .row-frame::before, .row-frame::after { width: 32px; }
  .prompt-cell { gap: 6px 8px; }
  .sample-number { flex-basis: 100%; font-size: 14px; }
  .prompt-cell p { gap: 6px; padding: 5px 8px 4px; }
  .prompt-cell p span { font-size: 9px; }
  .prompt-cell p strong { font-size: 14px; }
  .prompt-arrow { width: 20px; margin-right: 2px; }
  .prompt-arrow::after { width: 6px; height: 6px; }
  .media-label { gap: 5px; padding: 8px 10px; }
  .media-label h4 { font-size: 14px; }
  .media-label p { font-size: 12px; }
  .badge { font-size: 9.5px; padding: 2px 5px 1px; }
  .protocol-note { font-size: 15px; }
  footer { flex-wrap: wrap; padding: 26px 20px 36px; }
  footer p { order: 3; flex-basis: 100%; }
}

@media (max-width: 420px) {
  h1 { font-size: 21px; }
  h1 span { font-size: 52px; }
  .hero-actions { gap: 10px; }
  .hero-actions .primary-link { flex-basis: 100%; justify-content: center; }
  .resource-link { flex: 1; justify-content: center; padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
