:root {
  --bg: #f7f8fc;
  --bg-alt: #eef1f8;
  --card: #ffffff;
  --ink: #141824;
  --ink-2: #4a5268;
  --muted: #7a8299;
  --line: #e2e6f0;
  --accent: #0b72d9;
  --accent-2: #7b4dff;
  --warm: #f0582a;
  --ours: #0b72d9;
  --hero-1: #0a0f24;
  --hero-2: #141b3d;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 24, 36, .04), 0 8px 28px rgba(20, 24, 36, .07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1120; --bg-alt: #111629; --card: #161c33; --ink: #e9ecf6; --ink-2: #b7bed3; --muted: #8790aa;
    --line: #262e4a; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
sup { font-size: .62em; }

/* ---------------- hero ---------------- */
.hero { position: relative; overflow: hidden; color: #fff; text-align: center;
  background: radial-gradient(1200px 600px at 20% 10%, #1d2a6b 0%, transparent 60%),
              radial-gradient(900px 500px at 85% 30%, #3a1d6b 0%, transparent 60%),
              linear-gradient(160deg, var(--hero-1), var(--hero-2));
  padding: 96px max(16px, env(safe-area-inset-left)) 72px; min-height: 86vh; display: flex; align-items: center; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.hero-glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(90px); opacity: .35; animation: float 14s ease-in-out infinite; }
.hero-glow.g1 { background: #2f7bff; top: -160px; left: -120px; }
.hero-glow.g2 { background: #a259ff; bottom: -200px; right: -120px; animation-delay: -6s; }
@keyframes float { 0%,100% { transform: translate(0,0) } 50% { transform: translate(40px, 30px) } }
.hero-inner { position: relative; max-width: 1080px; margin: 0 auto; z-index: 2; }
.badge { display: inline-block; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(6px); margin-bottom: 22px; }
.hero h1 { font-size: clamp(30px, 5vw, 58px); line-height: 1.1; margin: 0 0 26px; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.grad { background: linear-gradient(90deg, #5ab0ff, #b28bff 55%, #ff8a65); -webkit-background-clip: text; background-clip: text; color: transparent; }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; font-size: 19px; font-weight: 600; }
.authors a { color: #fff; border-bottom: 1px solid rgba(255,255,255,.25); transition: color .15s, border-color .15s; }
.authors a:hover { color: #9cc8ff; border-color: #9cc8ff; }
.affils { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin-top: 8px; color: #b9c3e6; font-size: 15px; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 15px; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(8px); transition: transform .15s, background .2s, border-color .2s; }
.btn:hover { transform: translateY(-2px); background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.45); }
.btn svg { width: 18px; height: 18px; }
.btn .emoji { font-size: 17px; line-height: 1; }
.btn-accent { background: linear-gradient(90deg, #2f7bff, #8a4dff); border-color: transparent; box-shadow: 0 8px 24px rgba(80, 90, 255, .35); }
.btn-accent:hover { background: linear-gradient(90deg, #3d87ff, #9a5fff); }
.btn.disabled { opacity: .45; pointer-events: none; }
.btn.big { padding: 15px 28px; font-size: 17px; }
.scroll-hint { margin-top: 56px; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: #8f9bc6; animation: bob 2.2s ease-in-out infinite; }
.scroll-hint::after { content: ""; display: block; width: 1px; height: 34px; margin: 10px auto 0; background: linear-gradient(#8f9bc6, transparent); }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(6px) } }

/* ---------------- layout ---------------- */
.section { padding: 80px max(16px, env(safe-area-inset-left)) 80px max(16px, env(safe-area-inset-right)); }
.section.alt { background: var(--bg-alt); }
.container { max-width: 1180px; margin: 0 auto; }
.container.wide { max-width: 1180px; }
.container.narrow { max-width: 860px; }
.section-title { display: flex; align-items: baseline; gap: 14px; font-size: clamp(26px, 3.2vw, 36px); margin: 0 0 30px; letter-spacing: -.01em; }
.section-title span { font: 600 14px/1 "JetBrains Mono", monospace; color: var(--accent-2); padding: 6px 10px; border-radius: 8px; background: rgba(123,77,255,.1); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.lead { color: var(--ink-2); max-width: 820px; margin: -10px 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.two > * { min-width: 0; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }
.fig { margin: 0; padding: 16px; }
.fig img { border-radius: 10px; width: 100%; }
.fig figcaption { color: var(--ink-2); font-size: 14.5px; margin-top: 12px; }
@media (prefers-color-scheme: dark) { .fig img { background: #fff; } }

/* teaser */
.tldr { font-size: 18px; line-height: 1.7; margin-bottom: 28px; color: var(--ink-2); }
.tldr b { color: var(--ink); }
.tag { display: inline-block; font: 700 12px/1 Inter; letter-spacing: .1em; color: #fff; background: linear-gradient(90deg, #2f7bff, #8a4dff);
  padding: 6px 10px; border-radius: 6px; margin-right: 8px; vertical-align: 2px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 26px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { text-align: center; padding: 20px 10px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.stat .num { font-size: 38px; font-weight: 800; letter-spacing: -.02em; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .lbl { font-size: 13.5px; color: var(--muted); }

/* video */
.video-embed { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.video-embed iframe, .video-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.yt-placeholder { position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  background: linear-gradient(135deg, #0f1530, #24164a); color: #fff; font-size: 18px; }

/* abstract */
.abstract { font: 400 18.5px/1.75 "Source Serif 4", Georgia, serif; color: var(--ink-2); text-align: justify; hyphens: auto; }

/* method */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 24px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 22px; position: relative; }
.step h3 { margin: 6px 0 6px; font-size: 18px; }
.step p { margin: 0; color: var(--ink-2); font-size: 15px; }
.step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: #9aa3bd; }
.step.hl { border-color: rgba(11,114,217,.45); box-shadow: 0 10px 30px rgba(11,114,217,.15); }
.step.hl .step-n { background: linear-gradient(90deg, #2f7bff, #8a4dff); }
.eq { padding: 22px 26px; margin-top: 24px; }
.eq-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.eq-row:last-of-type { border-bottom: 0; }
.eq-lbl { width: 190px; font-weight: 600; font-size: 14px; color: var(--muted); }
.math { font-size: 17px; min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 4px 0; scrollbar-width: none; }
.math .katex { font-size: 1.12em; }

/* comparisons */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font: 600 14px Inter; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.case { position: relative; border-radius: 12px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: #000; aspect-ratio: 16/9;
  transition: transform .15s, border-color .15s, box-shadow .2s; }
.case img { width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: opacity .2s, transform .4s; }
.case:hover img { opacity: 1; transform: scale(1.04); }
.case:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.case.active { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(11,114,217,.18); }
.case .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 7px; color: #fff; font-size: 12.5px; font-weight: 600;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.case .cap small { display: block; font-weight: 500; opacity: .8; }
.case[hidden] { display: none; }
.more-wrap { text-align: center; margin: 20px 0 26px; }
.btn-more { border: 1px dashed var(--accent); color: var(--accent); background: transparent; border-radius: 999px; padding: 10px 22px; font: 600 15px Inter; cursor: pointer; }
.btn-more:hover { background: rgba(11,114,217,.08); }
.viewer { padding: 20px; scroll-margin-top: 20px; }
.viewer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.viewer-title { font-size: 20px; font-weight: 700; }
.viewer-sub { color: var(--muted); font-size: 14px; }
.mode-toggle { display: inline-flex; background: var(--bg-alt); border-radius: 999px; padding: 4px; border: 1px solid var(--line); }
.mode-toggle button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font: 600 13.5px Inter; color: var(--ink-2); cursor: pointer; }
.mode-toggle button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.method-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; align-items: center; }
.method-bar .lbl { font-weight: 600; font-size: 14px; color: var(--muted); margin-right: 4px; }
.mbtn { border: 1px solid var(--line); background: var(--bg-alt); color: var(--ink); border-radius: 10px; padding: 8px 14px; font: 600 14px Inter; cursor: pointer; transition: all .15s; }
.mbtn small { display: block; font: 500 11px Inter; color: var(--muted); }
.mbtn:hover { border-color: var(--warm); }
.mbtn.active { background: var(--warm); border-color: var(--warm); color: #fff; }
.mbtn.active small { color: rgba(255,255,255,.85); }
.mbtn:disabled { opacity: .35; cursor: not-allowed; }
.pane-row { display: grid; gap: 10px; }
.pane-row.top { grid-template-columns: repeat(3, 1fr); margin-bottom: 10px; }
.pane-row.main { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .pane-row.top { grid-template-columns: 1fr 1fr; } .pane-row.main { grid-template-columns: 1fr; } }
.pane { position: relative; background: #05070d; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; }
.pane video, .swipe-wrap video { width: 100%; height: 100%; object-fit: contain; display: block; }
.pane-lbl { position: absolute; top: 8px; left: 8px; z-index: 3; font: 600 12.5px Inter; color: #fff; background: rgba(0,0,0,.55); padding: 4px 9px; border-radius: 6px; backdrop-filter: blur(4px); }
.pane-lbl.ours { background: var(--ours); }
.psnr { font-weight: 500; opacity: .9; margin-left: 4px; }
.cbar { position: absolute; right: 8px; bottom: 8px; z-index: 3; display: flex; align-items: center; gap: 6px; font: 600 10.5px Inter; color: #fff; text-shadow: 0 1px 2px #000; }
.cbar i { width: 70px; height: 7px; border-radius: 4px; background: linear-gradient(90deg, #30123b, #4686fb, #1ae4b6, #a2fc3c, #fabb39, #e4460a, #7a0403); }
.swipe-wrap { position: relative; border-radius: 10px; overflow: hidden; background: #05070d; aspect-ratio: 16/9; cursor: ew-resize; user-select: none; touch-action: none; }
.swipe-top { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.swipe-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: #fff; z-index: 4; box-shadow: 0 0 10px rgba(0,0,0,.5); }
.swipe-handle span { position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.swipe-handle span::before { content: "\2039 \203A"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 18px Inter; color: #333; }
.pane-lbl.sl { left: 10px; } .pane-lbl.sr { left: auto; right: 10px; }
.controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.ctl { border: 1px solid var(--line); background: var(--bg-alt); color: var(--ink); border-radius: 8px; padding: 6px 12px; font: 600 14px Inter; cursor: pointer; }
#seek { flex: 1; accent-color: var(--accent); }
.loading-veil { position: absolute; inset: 0; display: grid; place-items: center; color: #cfd6ee; font-size: 13px; z-index: 2; }

/* robustness */
.rob { padding: 20px; }
.rob h3 { margin: 0 0 4px; }
.rob > p.small { min-height: 3.3em; margin: 0 0 4px; }   /* same height in both cards so the selectors and videos line up */
.seg { display: inline-flex; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin: 10px 0 14px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font: 600 14px Inter; color: var(--ink-2); cursor: pointer; }
.seg button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair .pane { aspect-ratio: 1 / 1; }
.btn-load { margin-top: 12px; border: 0; border-radius: 999px; padding: 9px 18px; font: 600 14px Inter; color: #fff; cursor: pointer;
  background: linear-gradient(90deg, #2f7bff, #8a4dff); }
.btn-load.done { display: none; }

/* results / quote */
.quote { display: grid; place-items: center; padding: 34px; text-align: center;
  background: linear-gradient(135deg, rgba(47,123,255,.08), rgba(138,77,255,.1)); }
.quote p { font: italic 400 26px/1.45 "Source Serif 4", Georgia, serif; margin: 0; color: var(--ink); }

/* uncertainty */
.text { padding: 24px; }
.text h3 { margin: 0 0 6px; font-size: 18px; }
.text p { color: var(--ink-2); margin: 0 0 18px; }
#method .two { align-items: stretch; }
#method .two > .fig { display: flex; flex-direction: column; }
#method .two > .fig img { flex: 1 1 auto; object-fit: contain; min-height: 0; }
/* labels below the video (these videos carry their own burnt-in text in the top-left corner) */
.avs-grid .pane, .rob .pair .pane { aspect-ratio: auto; background: none; overflow: visible; display: flex; flex-direction: column-reverse; gap: 6px; }
.avs-grid .pane, .rob .pair .pane { min-width: 0; }
.avs-grid .pane video, .rob .pair .pane video { width: 100%; height: auto; min-width: 0; }
.avs-grid .pane video { aspect-ratio: 4/3; border-radius: 10px; background: #05070d; }
.rob .pair .pane video { aspect-ratio: 1/1; border-radius: 10px; background: #05070d; }
.avs-grid .pane-lbl, .rob .pair .pane-lbl { position: static; align-self: flex-start; backdrop-filter: none; font-size: 12.5px; }
.avs-grid .pane-lbl:not(.ours), .rob .pair .pane-lbl:not(.ours) { background: var(--bg-alt); color: var(--ink-2); border: 1px solid var(--line); }   /* both cards equally tall */
.tbl-wrap { overflow-x: auto; margin-top: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tbl caption { text-align: left; font-size: 13px; color: var(--muted); padding-bottom: 6px; }
.tbl th, .tbl td { padding: 5px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.tbl th:first-child, .tbl td:first-child { text-align: left; white-space: nowrap; }
.tbl thead th { font-weight: 600; color: var(--ink-2); }
.tbl tr.hl td { background: rgba(11,114,217,.08); font-weight: 700; }
.tbl-note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.inline-fig { width: 66%; display: block; border-radius: 10px; margin: -6px auto 14px; background: #fff; }
.avs { padding: 20px; margin-top: 24px; }
.avs h3 { margin: 0 0 4px; }
.math-line { font: italic 400 19px/1.4 "Source Serif 4", Georgia, serif; text-align: center; margin: -6px 0 14px;
  padding: 8px; background: var(--bg-alt); border-radius: 8px; color: var(--ink); }
.avs-text { color: var(--ink-2); font-size: 15px; margin: 6px 0 6px; }
.avs .muted.small { margin: 0 0 4px; }
.avs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
@media (max-width: 860px) { .avs-grid { grid-template-columns: 1fr 1fr; } }
.avs-grid .pane { aspect-ratio: 4/3; }

/* ---------------- sticky section nav ---------------- */
.topnav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; gap: 18px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: rgba(10, 15, 36, .8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08); transform: translateY(-110%); transition: transform .3s ease; }
.topnav.show { transform: none; }
.topnav a { color: #c9d2f2; font: 600 13.5px Inter, sans-serif; white-space: nowrap; }
.topnav a:hover, .topnav a.on { color: #fff; }
.topnav a.on { box-shadow: inset 0 -2px 0 #8a4dff; }
.topnav .brand { font-weight: 800; font-size: 16px; background: linear-gradient(90deg, #5ab0ff, #b28bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tn-links { display: flex; gap: 16px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; padding: 4px 0; }
.tn-links::-webkit-scrollbar { display: none; }
.tn-ext { display: flex; gap: 12px; }
@media (max-width: 640px) { .tn-ext { display: none; } }
.section { scroll-margin-top: 54px; }

/* ---------------- results reel ---------------- */
.reel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 10px; }
@media (max-width: 760px) { .reel { grid-template-columns: 1fr; } }
.reel figure { margin: 0; position: relative; border-radius: 14px; overflow: hidden; background: #05070d; aspect-ratio: 16/9; box-shadow: var(--shadow); }
.reel video { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 9px; color: #fff; font-size: 13px;
  background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.reel figure::before { content: "Ours"; position: absolute; top: 10px; left: 10px; z-index: 2; font: 700 12px Inter, sans-serif; color: #fff;
  background: var(--ours); padding: 3px 8px; border-radius: 6px; }
.reel-note { color: var(--muted); font-size: 14px; margin: 0 0 26px; }

/* ---------------- per-case aspect ratio in the comparison viewer ---------------- */
.stage .pane { aspect-ratio: var(--ar, 16/9); }
.stage .swipe-wrap { aspect-ratio: var(--ar, 16/9); }
.stage.sq .pane-row.top { grid-template-columns: repeat(3, minmax(0, 300px)); justify-content: center; }
.stage.sq .pane-row.main { grid-template-columns: repeat(2, minmax(0, 470px)); justify-content: center; }
.stage.sq .swipe-wrap { max-width: 600px; margin: 0 auto; }
.stage.pt .pane-row.top { grid-template-columns: repeat(3, minmax(0, 230px)); justify-content: center; }
.stage.pt .pane-row.main { grid-template-columns: repeat(2, minmax(0, 360px)); justify-content: center; }
.stage.pt .swipe-wrap { max-width: 420px; margin: 0 auto; }
@media (max-width: 760px) {
  .stage.sq .pane-row.top, .stage.pt .pane-row.top, .stage.sq .pane-row.main, .stage.pt .pane-row.main { grid-template-columns: 1fr 1fr; }
}

/* demo */
.demo-sec { background: linear-gradient(135deg, #0f1530, #26164f); color: #fff; }
.demo-card { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.demo-card h2 { font-size: 34px; margin: 0 0 8px; }
.demo-card p { color: #c3cbea; max-width: 640px; margin: 0; }

/* bibtex */
.bib { position: relative; padding: 0; overflow: hidden; }
.bib pre { margin: 0; padding: 22px 24px; overflow-x: auto; font: 13.5px/1.6 "JetBrains Mono", monospace; color: var(--ink-2); }
.copy { position: absolute; top: 12px; right: 12px; border: 1px solid var(--line); background: var(--bg-alt); color: var(--ink); border-radius: 8px; padding: 5px 12px; font: 600 13px Inter; cursor: pointer; }

.footer { text-align: center; padding: 30px 16px 40px; color: var(--muted); font-size: 13px; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } .hero-glow, .scroll-hint { animation: none; } }


/* ================= compact comparison viewer (2026-11-27) ================= */
.cmp { padding: 16px 18px 12px; }
.cmp-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cmp-top .filters { margin: 0; }
.case-strip { display: flex; align-items: center; gap: 10px; margin: 12px 0 10px; }
.case-strip .cases { display: flex; gap: 10px; overflow-x: auto; flex: 1; min-width: 0; padding: 3px 2px 6px; scrollbar-width: thin; }
.case-strip .case { flex: 0 0 148px; aspect-ratio: 16/9; border-radius: 10px; }
.case-strip .case .cap { font-size: 11.5px; padding: 14px 8px 5px; }
.case-strip .case .cap small { display: none; }
.case-strip .btn-more { flex: 0 0 auto; padding: 8px 14px; font-size: 13.5px; }
.case-strip .btn-more[hidden] { display: none; }
.cmp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 18px; flex-wrap: wrap; margin-bottom: 10px;
  border-top: 1px solid var(--line); padding-top: 10px; }
.cmp-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cmp-title .viewer-title { font-size: 17px; }
.cmp-title .viewer-sub { font-size: 13px; }
.cmp-head .method-bar { margin: 0; }
.cmp-head .method-bar .lbl { display: none; }
.mbtn { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.mbtn small { font-size: 10px; }
.stage .band { display: flex; justify-content: center; align-items: flex-start; gap: 10px; }
.stage .band .stack { display: flex; flex-direction: column; gap: 10px; }
.stage .band .pair { display: flex; gap: 10px; }
.stage .band .pair[hidden], .stage .band .swipe-wrap[hidden] { display: none; }
.stage .band .pane { aspect-ratio: var(--ar, 16/9); width: auto; flex: 0 0 auto; }
.stage .band .pane.big { height: var(--h, 240px); }
.stage .band .pane.sm { height: var(--hs, 115px); }
.stage .band .swipe-wrap { height: var(--h, 240px); width: var(--sw, 860px); max-width: 100%; aspect-ratio: auto; flex: 0 0 auto; margin: 0; }
.stage .band.narrow { flex-wrap: wrap; }
.stage .band.narrow .stack { flex-direction: row; }
.stage .band.narrow .pair { flex-wrap: nowrap; }
.pane-lbl.method { background: var(--warm); }
.stage .pane-lbl { font-size: 11.5px; padding: 3px 7px; top: 6px; left: 6px; }
.stage .pane-lbl.sr { left: auto; right: 6px; }
.stage .band .swipe-wrap { width: var(--sww, 860px); height: var(--swh, 240px); }
.stage .cbar { font-size: 9.5px; }
.stage .cbar i { width: 52px; }
.stage .controls { margin-top: 8px; }
.cmp-note { margin: 6px 0 0; font-size: 12.5px; }
#compare .lead { margin-bottom: 16px; }
.pill { font: 600 13px Inter, sans-serif; font-style: normal; color: var(--accent); background: rgba(11,114,217,.1);
  padding: 4px 10px; border-radius: 999px; vertical-align: middle; letter-spacing: 0; }

/* results quote banner */
.quote-band { margin-top: 20px; border-radius: var(--radius); padding: 22px 28px; text-align: center;
  background: linear-gradient(90deg, rgba(47,123,255,.10), rgba(138,77,255,.12)); border: 1px solid rgba(123,77,255,.18); }
.quote-band p { margin: 0; font: italic 400 23px/1.45 "Source Serif 4", Georgia, serif; color: var(--ink); text-wrap: balance; }
.math-line .katex { font-size: 1.05em; }
.text .katex { font-size: 1.02em; }
/* teaser and method figures: keep large figures from getting taller than the screen */
.fig img { max-height: 78vh; object-fit: contain; }

.container > .fig + .fig, .container > .fig + .two, .container > .two + .fig { margin-top: 22px; }

/* phones: one swipeable row of dataset chips */
@media (max-width: 720px) {
  .cmp-top .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
  .cmp-top .filters::-webkit-scrollbar { display: none; }
  .cmp-top .chip { flex: 0 0 auto; }
  .case-strip .case { flex-basis: 132px; }
}

/* uncertainty: the right card is a column, its table sits at the bottom so it lines up with the end of the left card */

/* compact uncertainty block: fits one screen */
.two.unc { align-items: stretch; margin-top: 0; }
.two.unc > .card { height: auto; }
.two.unc .text { padding: 18px 22px; }
.two.unc .text h3 { font-size: 16.5px; margin: 0 0 4px; }
.two.unc .text h3 + p { margin-top: 0; }
.two.unc .text p { font-size: 14.5px; margin: 0 0 8px; }
.two.unc .text h3:not(:first-child) { margin-top: 14px; }
.two.unc .math-line { margin: 2px 0 8px; padding: 6px; font-size: 16px; }
.two.unc .fig { padding: 12px; display: block; }
.two.unc .fig img { max-height: 300px; width: auto; max-width: 100%; margin: 0 auto; }
.two.unc .fig figcaption { margin-top: 6px; font-size: 13.5px; }
.two.unc .tbl { margin-top: 8px; font-size: 12.5px; }
.two.unc .tbl th, .two.unc .tbl td { padding: 3px 6px; }
#uncertainty .avs { margin-top: 16px; }

/* results: the two charts side by side, images aligned at the top, captions aligned below */
.two.res { margin-top: 0; align-items: stretch; }
.two.res .fig { display: flex; flex-direction: column; padding: 14px; }
.two.res .fig img { width: 100%; height: auto; }
.two.res .fig figcaption { font-size: 13.5px; }

.epi-plot { display: block; width: 100%; margin: 2px 0 6px; border-radius: 8px; background: #fff; }
.two.unc .text h3:not(:first-child) { clear: both; }
@media (max-width: 860px) { .epi-plot { float: none; width: 100%; margin: 0 0 8px; } }

/* method: calmer proportions */
#method .steps { gap: 14px; margin-bottom: 18px; }
#method .step { padding: 14px 16px; }
#method .step h3 { font-size: 15.5px; margin: 4px 0 2px; }
#method .step p { font-size: 13.5px; line-height: 1.55; }
#method .step-n { width: 24px; height: 24px; font-size: 13px; }
#method > .container > .fig { padding: 14px 18px; }
#method > .container > .fig img { max-height: 330px; width: auto; max-width: 100%; margin: 0 auto; }
#method > .container > .fig figcaption { font-size: 13.5px; text-align: center; }
#method .eq { padding: 12px 20px; margin-top: 18px; }
#method .eq-row { padding: 4px 0; }
#method .eq-lbl { width: 170px; font-size: 13px; }
#method .math { font-size: 15px; }
#method .eq .muted.small { margin: 6px 0 0; font-size: 12.5px; }
#method .two { margin-top: 18px; }
#method .two > .fig { padding: 14px; }
#method .two > .fig img { height: 270px; width: 100%; object-fit: contain; flex: 0 0 auto; }
#method .two > .fig figcaption { font-size: 13px; }

@media (prefers-color-scheme: dark) { .epi-plot, .fig img { background: #fff; } }
.two.unc .fig img { max-height: none; width: 100%; }
.two.unc .tbl th, .two.unc .tbl td { padding: 5px 6px; }

.tbl tr.sep td { border-top: 1.5px solid var(--ink-2); color: var(--muted); font-style: italic; }

/* active view selection: views slider */
.avs-ctl { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; font: 600 14px Inter, sans-serif; color: var(--ink-2); }
.avs-ctl input[type=range] { flex: 1; max-width: 420px; accent-color: var(--accent); }
.avs-ctl output { min-width: 2ch; font-variant-numeric: tabular-nums; color: var(--ink); font-size: 16px; }
