/* Project page styles */
:root {
  --ink: #0f172a; --ink2: #334155; --muted: #64748b; --line: #e2e8f0; --soft: #f8fafc; --accent: #ea580c; --accent-soft: #fff1e8;
  --ok: #16a34a; --pure: #4b95d1; --n2m: #e0a033; --ours: #23947a;
  --radius: 16px; --max: 1120px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: #fff; color: var(--ink); font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }

/* sticky section bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.82); backdrop-filter: saturate(1.4) blur(10px);
          border-bottom: 1px solid transparent; transition: border-color .25s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { font-weight: 800; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; font-size: 18px; }
.topbar nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.topbar nav a:hover { color: var(--ink); background: var(--soft); }

/* hero */
.hero { position: relative; padding: 64px 0 30px; text-align: center; overflow: hidden; }
.venue { display: inline-block; margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
         font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { margin: 14px auto 0; max-width: 980px; font-size: clamp(30px, 5vw, 54px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
.tagline { margin: 14px auto 0; max-width: 640px; font-size: clamp(18px, 2.4vw, 22px); color: var(--ink2); font-weight: 500; text-wrap: balance; }
.authors { margin: 14px 0 0; font-size: 16px; color: var(--muted); }
.links { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; border-radius: 999px; font-size: 15px; font-weight: 600;
       background: var(--ink); color: #fff; text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn.is-off { background: #eef2f6; color: #9aa6b4; cursor: not-allowed; }

/* sections */
.section { padding: 72px 0; }
.section.alt { background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0; text-align: center; font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.section h2 { margin: 10px 0 0; text-align: center; font-size: clamp(30px, 4.4vw, 44px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
.lede { max-width: 700px; margin: 14px auto 0; text-align: center; font-size: 18px; color: var(--ink2); text-wrap: pretty; }
.block { margin-top: 36px; }
video { display: block; width: 100%; height: auto; background: #000; }
.frame { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 10px 30px rgba(15,23,42,.08); }
.teaser { border: 1px solid var(--line); background: #fff; }
.teaser video { background: #fff; }

/* stat strip */
.stats { margin: 26px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 900px; }
.stat { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: center; }
.stat b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.stat b.g { color: var(--ours); }

/* abstract */
.abstract { margin-top: 22px; font-size: 17.5px; line-height: 1.75; color: var(--ink2); text-align: justify; hyphens: auto; }
.abstract strong { color: var(--ink); }

/* labels on videos */
.tag { position: absolute; left: 12px; bottom: 12px; padding: 6px 14px; border-radius: 10px; background: rgba(15,23,42,.72);
       backdrop-filter: blur(4px); color: #fff; font-size: 16px; font-weight: 600; z-index: 2; }

/* method 2 x 2 */
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 32px; }
.step h3 { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.step h3 i { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff;
             font-style: normal; font-size: 16px; font-weight: 700; flex: none; }
.step p { margin: 8px 0 14px 48px; color: var(--ink2); font-size: 16px; line-height: 1.55; min-height: 3.1em; }
.step .frame { border: 1px solid var(--line); }

/* results chart */
.chart-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 22px 22px 14px; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: 14px; color: var(--ink2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.legend i.ref { width: 22px; height: 0; border-top: 2px dashed #64748b; border-radius: 0; vertical-align: 4px; }
.charts { margin-top: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 18px; }
.charts svg { width: 100%; height: auto; display: block; overflow: visible; }
.charts .t { font: 600 15px var(--sans); fill: var(--ink); }
.charts .ax { font: 500 11.5px var(--sans); fill: var(--muted); }
.charts .xl { font: 600 12px var(--sans); fill: var(--ink2); }
.charts .val { font: 700 14px var(--sans); fill: var(--ink); }
.charts .refl { font: 500 11px var(--sans); fill: var(--muted); }
.charts .bar { cursor: default; transition: opacity .15s; }
.charts svg:hover .bar:not(:hover) { opacity: .55; }
.note { margin: 10px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.tip { position: fixed; z-index: 40; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: var(--ink); color: #fff;
       font-size: 13px; font-weight: 500; white-space: nowrap; opacity: 0; transform: translate(-50%, calc(-100% - 10px)); transition: opacity .12s; }
.tip.on { opacity: 1; }
.tip b { font-variant-numeric: tabular-nums; }

/* one example per task: two small on the left, one large on the right */
.cmp { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; align-items: start; }
.cmp .side { display: grid; gap: 14px; }
.clip video { transition: filter .35s ease; }
.clip.ended.fail video { filter: grayscale(1) brightness(.55) contrast(.9); }
.verdict { position: absolute; z-index: 3; opacity: 0; white-space: nowrap; pointer-events: none; color: #fff; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
           transition: opacity .35s ease, transform .35s ease; }
.verdict.bad { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.92); padding: 10px 20px; border-radius: 14px; font-size: clamp(15px, 2.2vw, 24px);
               background: rgba(15,23,42,.55); border: 1.5px solid rgba(255,255,255,.6); backdrop-filter: blur(2px); }
.verdict.ok { right: 12px; bottom: 12px; padding: 7px 14px; border-radius: 999px; font-size: 14px; background: var(--ok); box-shadow: 0 6px 18px rgba(22,163,74,.35); }
.clip.ended .verdict { opacity: 1; }
.clip.ended .verdict.bad { transform: translate(-50%, -50%) scale(1); }
.tabs { margin: 24px auto 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 880px; }
.tabs button { font: inherit; font-size: 15px; font-weight: 600; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer;
               background: #fff; color: var(--ink); transition: background .2s, color .2s, border-color .2s; }
.tabs button:hover { border-color: #cbd5e1; background: #f1f5f9; }
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs button:focus-visible { outline: 3px solid rgba(234,88,12,.35); outline-offset: 2px; }

footer { padding: 36px 0 48px; text-align: center; color: var(--muted); font-size: 14px; }

@media (max-width: 860px) {
  .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .section { padding: 48px 0; }
  .steps { grid-template-columns: 1fr; }
  .step p { min-height: 0; }
  .stats { grid-template-columns: 1fr; }
  .cmp { grid-template-columns: 1fr; }
  .cmp .side { grid-template-columns: 1fr 1fr; order: 2; }
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tag { font-size: 13px; padding: 4px 10px; }
  .topbar nav a { padding: 6px 8px; font-size: 13px; }
  .abstract { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .clip video, .verdict { transition: none; } }

/* v4: captions, phase tags, results summary */
.caption { max-width: 760px; margin: 18px auto 0; text-align: center; font-size: 16px; color: var(--ink2); text-wrap: pretty; }
.step h3 .ph { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-style: normal;
               font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.step h3 .ph.dep { background: #e6f4f1; color: var(--ours); }
.summary { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: stretch; }
.avg-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 18px 22px 12px; }
.card-t { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--ink); }
#avg svg { width: 100%; height: auto; display: block; overflow: visible; }
#avg .ax { font: 500 11.5px var(--sans); fill: var(--muted); }
#avg .xl { font: 600 13px var(--sans); fill: var(--ink2); }
#avg .val { font: 800 15px var(--sans); fill: var(--ink); }
#avg .bar { cursor: default; }
.kpis { display: grid; grid-template-rows: repeat(3, 1fr); gap: 10px; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.kpi b { flex: none; min-width: 84px; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--ours); font-variant-numeric: tabular-nums; }
.kpi span { font-size: 15px; color: var(--ink2); line-height: 1.35; }
@media (max-width: 760px) {
  .summary { grid-template-columns: 1fr; }
  .step h3 .ph { display: none; }
}
.charts svg.go { cursor: pointer; border-radius: 10px; transition: background .15s; }
.charts svg.go:hover, .charts svg.go:focus-visible { background: #f8fafc; outline: none; }
@media (min-width: 761px) { .step p { min-height: 4.65em; } }

/* v5: wider overview video (breaks out of the text column), more air between the four method videos */
.teaser { width: min(1320px, calc(100vw - 32px)); position: relative; left: 50%; transform: translateX(-50%); }
@media (min-width: 761px) { .steps { gap: 56px 72px; } }

/* v6: the four method videos a little smaller (narrower grid, wider gutter between the two columns) */
@media (min-width: 761px) { .steps { max-width: 1000px; margin-left: auto; margin-right: auto; gap: 56px 96px; } }

.affil { margin: 8px auto 0; max-width: 640px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.authors sup, .affil sup { font-size: 0.7em; }
.bibtex { margin: 22px 0 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow-x: auto;
          font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.6; color: var(--ink2); }
