/* Self-contained styles: system fonts only, no external resources. Palette matches the paper's figures. */
:root {
  --ink: #1a2429;
  --muted: #56666d;
  --line: #e3e8ea;
  --panel: #f5f7f8;
  --accent: #2fa983;
  --accent-ink: #1f7c60;
  --prompt: #d1394b;
  --radius: 14px;
  --maxw: 1080px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }

/* ---------------- header ---------------- */
.hero { max-width: var(--maxw); margin: 0 auto; padding: 72px 24px 24px; text-align: center; }
.eyebrow {
  display: inline-block; margin: 0 0 18px; padding: 4px 12px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; letter-spacing: 0.02em;
}
h1 { margin: 0; font-size: clamp(30px, 4.6vw, 48px); line-height: 1.15; font-weight: 750; letter-spacing: -0.01em; }
h1 .accent { color: var(--accent-ink); }
.authors { margin: 16px 0 0; color: var(--muted); font-size: 18px; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.pills a {
  padding: 8px 18px; border-radius: 999px; background: var(--ink); color: #fff;
  font-weight: 600; font-size: 15px; text-decoration: none; transition: transform .12s ease, background .12s ease;
}
.pills a:hover { background: #2c3a40; transform: translateY(-1px); }

/* ---------------- sections ---------------- */
main { padding-bottom: 32px; }
.block { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px; }
.block.narrow { max-width: 820px; }
h2 { margin: 0 0 10px; font-size: 28px; font-weight: 720; text-align: center; letter-spacing: -0.005em; }
h3 { margin: 14px 0 4px; font-size: 18px; }
p { margin: 0; }
.lead { max-width: 780px; margin: 0 auto 22px; text-align: center; color: var(--muted); }
.abstract { text-align: justify; hyphens: auto; }
.tldr { max-width: 760px; margin: 22px auto 0; text-align: center; font-size: 19px; }
.prompt-word { color: var(--prompt); font-weight: 650; }

/* ---------------- video slots ---------------- */
.clip {
  position: relative; margin: 0; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
}
.clip video, .clip img { display: block; width: 100%; height: 100%; object-fit: cover; }
.clip video { object-fit: contain; background: #000; }
.clip-hero { box-shadow: 0 18px 50px -24px rgba(26, 36, 41, .45); }
.clip .tag {
  position: absolute; left: 16px; top: 14px; z-index: 2; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); font-size: 13px; font-weight: 600; pointer-events: none;
}
.clip.has-video .tag { display: none; }
.clip.pending img { filter: saturate(.85) brightness(.8); }
.clip.pending::after {
  content: "Video coming soon"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 7px 16px; border-radius: 999px; background: rgba(255, 255, 255, .93); font-size: 14px; font-weight: 600;
  white-space: nowrap;
}
.clip.pending.no-poster { background: linear-gradient(135deg, #eef2f3, #f8fafa); }

/* ---------------- method stages ---------------- */
.stages { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 18px; }
.stages button {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .12s ease, border-color .12s ease;
}
.stages button[data-stage="all"] { padding-left: 14px; }
.stages button:hover { border-color: #c9d2d6; }
.stages button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.stages .num {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 12px;
}
.stages button[aria-selected="true"] .num { background: #fff; color: var(--ink); }
.stage-view { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.stage-view.wide { grid-template-columns: 1fr; }
.stage-img { margin: 0; text-align: center; }
.stage-img img { max-height: 520px; width: auto; border-radius: 10px; box-shadow: 0 10px 30px -18px rgba(0,0,0,.35); }
.stage-view.wide .stage-img img { max-height: none; width: 100%; }
.stage-text h3 { margin-top: 0; font-size: 21px; }
.stage-text p + p { margin-top: 10px; }
.stage-text .where { color: var(--muted); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* ---------------- wide demo clip ---------------- */
.clip-wide { background: #f1f3f5; border: 1px solid var(--line); cursor: pointer; }
.clip-wide video { background: #f1f3f5; }

/* ---------------- scrubber ---------------- */
.scrub { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 26px; align-items: center; }
.scrub-view { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 4 / 3; background: var(--panel); }
.scrub-view video { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--panel); cursor: pointer; }
.scrub-view .speed { position: absolute; right: 12px; bottom: 10px; padding: 2px 9px; border-radius: 999px;
  background: rgba(255,255,255,.9); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.status { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 4px 11px; border-radius: 999px; background: rgba(255,255,255,.94); font-size: 13.5px; font-weight: 650;
  box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.chip.contact { color: var(--prompt); }
.chip.prompt { background: var(--prompt); color: #fff; }
.chip.sel { background: var(--accent); color: #fff; }
.scrub-plot { width: 100%; height: auto; display: block; }
.controls { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.controls button { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--ink); color: #fff;
  font-size: 15px; cursor: pointer; flex: none; }
.controls input { flex: 1; accent-color: var(--ink); }
.time { width: 64px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 0; padding: 0; list-style: none;
  color: var(--muted); font-size: 14px; }
.legend .sw { display: inline-block; width: 14px; height: 10px; margin-right: 6px; border-radius: 2px; vertical-align: 0; }
.sw.contact { background: rgba(209, 57, 75, .35); }
.sw.prompt { background: var(--prompt); }
.sw.sel { background: var(--accent); }
.note { margin-top: 10px; color: var(--muted); font-size: 13.5px; }

/* ---------------- results ---------------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 26px; }
.card p { color: var(--muted); font-size: 15.5px; }

/* ---------------- footer ---------------- */
footer { border-top: 1px solid var(--line); padding: 26px 24px 40px; text-align: center; color: var(--muted); font-size: 14px; }

@media (max-width: 820px) {
  body { font-size: 16px; }
  .hero { padding-top: 48px; }
  .grid, .stage-view, .scrub { grid-template-columns: 1fr; }
}

/* plot labels (scrubber) */
.scrub-plot text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 11.5px; fill: #56666d; }
.scrub-plot .ax { font-size: 12.5px; font-weight: 650; fill: #1a2429; }
.scrub-plot .tick { font-size: 11px; }
.scrub-plot .band { font-size: 12px; font-weight: 650; fill: #1f7c60; }
.scrub-plot .mark { font-size: 11px; font-weight: 600; fill: #d1394b; }
.scrub-plot { cursor: ew-resize; touch-action: none; }

/* results: looping clips keep their native aspect inside a neutral frame */
.card .clip { background: #11181b; cursor: pointer; }
.card .clip video { object-fit: contain; background: #11181b; }
