:root {
  --ink: #1f2328;
  --ink2: #3d434b;
  --muted: #6b7280;
  --faint: #9aa0a8;
  --line: #e6e8ec;
  --soft: #f6f7f9;
  --bg: #ffffff;
  --blue: #0072b2;
  --orange: #d55e00;
  --grey: #8a8f98;
  --ours: #222222;
  --radius: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 880px; margin-left: auto; margin-right: auto; padding: 0 20px; }
.wrap.wide { max-width: 1120px; }
.narrow { max-width: 840px; margin-left: auto; margin-right: auto; }
section { margin-top: 80px; margin-bottom: 80px; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; }
h2 { font-size: 28px; font-weight: 650; margin: 4px 0 14px; }
h3 { font-size: 22px; font-weight: 650; margin: 0 0 8px; }
h4 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
p { margin: 0 0 14px; color: var(--ink2); }
a { color: var(--blue); }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0; }
.c-bl { color: var(--blue); } .c-or { color: var(--orange); }

/* ---------- header ---------- */
.hero { text-align: center; padding-top: 72px; margin-bottom: 36px; }
.kicker { font-size: 15px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--orange); margin: 0 0 14px; }
.hero h1 { font-size: clamp(30px, 4.6vw, 46px); font-weight: 700; margin: 0 auto 18px; max-width: 820px; }
.authors { font-size: 18px; color: var(--ink2); margin: 0 0 2px; }
.venue { font-size: 15px; color: var(--muted); margin: 0 0 22px; }
.buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 9px 20px; border-radius: 999px; background: var(--ink); color: #fff;
  text-decoration: none; font-weight: 600; font-size: 15px;
}
.btn:hover { background: #000; }
.btn.disabled { background: var(--soft); color: var(--faint); border: 1px solid var(--line); cursor: default; }

/* ---------- video ---------- */
#video { margin-top: 28px; }
.video-frame { border-radius: var(--radius); overflow: hidden; background: #f3f4f6; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 30px rgba(0,0,0,.06); }
.video-frame video { display: block; width: 100%; height: auto; }

/* ---------- tl;dr + stats ---------- */
.tldr { font-size: 20px; line-height: 1.6; color: var(--ink); }
.tldr b { font-weight: 650; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.stat { background: var(--soft); border-radius: var(--radius); padding: 18px 18px 16px; }
.stat-num { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.stat-num span { font-size: 17px; font-weight: 600; color: var(--muted); }
.stat-num span.c-or, .stat-num span.c-bl { font-size: 26px; font-weight: 700; }
.stat-num span.c-or { color: var(--orange); } .stat-num span.c-bl { color: var(--blue); }
.stat-txt { font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 6px; }
.abstract { text-align: justify; hyphens: auto; }

/* ---------- panels and controls ---------- */
.panel { margin: 22px 0 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.panel.img { padding: 10px; }
.panel img { display: block; width: 100%; height: auto; border-radius: 6px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; }
.seg button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font: 500 14px Inter, sans-serif;
  color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.small button { padding: 5px 12px; font-size: 13.5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.bl { background: var(--blue); } .dot.or { background: var(--orange); }
.slider { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); flex: 1 1 260px; }
.slider b { color: var(--ink); font-weight: 650; min-width: 64px; }
.slider input { flex: 1; accent-color: var(--ink); }
.presets { display: flex; gap: 6px; }
.presets button {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 10px; font: 500 13px Inter, sans-serif;
  color: var(--ink2); cursor: pointer;
}
.presets button:hover { border-color: var(--faint); }
canvas { display: block; width: 100%; }
figcaption { font-size: 14.5px; color: var(--muted); margin-top: 10px; line-height: 1.55; }
#alias-read { font-size: 16px; color: var(--ink); min-height: 50px; }
#alias-read .k { font-weight: 650; }

/* ---------- comparison explorer ---------- */
.explorer { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; margin-top: 22px; align-items: start; }
.viewer { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 640px; margin-left: auto; border-radius: var(--radius); overflow: hidden; background: #111; touch-action: none; user-select: none; cursor: ew-resize; }
.viewer video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer .clip { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.viewer .gt { opacity: 0; transition: opacity .12s; }
.viewer.show-gt .gt { opacity: 1; }
.tag { position: absolute; top: 12px; padding: 4px 10px; border-radius: 8px; background: rgba(15,17,20,.72); color: #fff; font-size: 13.5px; font-weight: 600; pointer-events: none; }
.tag.left { left: 12px; color: #d6d9de; font-weight: 500; } .tag.right { right: 12px; }
.tag.gtl { left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity .12s; }
.viewer.show-gt .tag { opacity: 0; } .viewer.show-gt .tag.gtl { opacity: 1; }
.handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; }
.handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.4); }
.handle span { position: absolute; top: 50%; left: -17px; width: 34px; height: 34px; margin-top: -17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.35); }
.handle span::before, .handle span::after { content: ""; position: absolute; top: 12px; border: 5px solid transparent; }
.handle span::before { left: 4px; border-right-color: var(--ink); } .handle span::after { right: 4px; border-left-color: var(--ink); }
.viewer.show-gt .handle { opacity: 0; }
.viewer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; max-width: 640px; margin-left: auto; }
.hold { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font: 500 13.5px Inter, sans-serif; color: var(--ink); cursor: pointer; user-select: none; touch-action: none; }
.hold:active, .hold.active { background: var(--ink); color: #fff; }
.psnr { margin-left: auto; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.psnr b { color: var(--ink); }
.thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.thumb { position: relative; border: 0; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: #000; aspect-ratio: 1/1; outline: 2px solid transparent; outline-offset: 2px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .85; transition: opacity .15s; }
.thumb:hover img, .thumb.on img { opacity: 1; }
.thumb.on { outline-color: var(--ink); }
.thumb span { position: absolute; left: 6px; bottom: 6px; right: 6px; font-size: 12px; font-weight: 600; color: #fff; text-align: left; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.thumb em { position: absolute; right: 6px; top: 6px; font-style: normal; font-size: 10.5px; font-weight: 600; color: #fff; background: rgba(0,0,0,.55); padding: 1px 6px; border-radius: 6px; }
.note { font-size: 13.5px; color: var(--muted); margin-top: 12px; }

/* ---------- charts ---------- */
.charts2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.card { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.card figcaption { font-size: 13.5px; }
svg { display: block; width: 100%; height: auto; overflow: visible; }
svg text { font-family: Inter, sans-serif; fill: var(--muted); font-size: 12px; }
svg .lab { fill: var(--ink); font-weight: 600; font-size: 13px; }
svg .val { fill: var(--ink); font-weight: 600; font-size: 12.5px; }
svg .ttl { fill: var(--ink); font-weight: 600; font-size: 14px; }
.grid line { stroke: #eef0f3; }
.axis line, .axis path { stroke: #cfd3d9; }
.tip { position: fixed; z-index: 10; pointer-events: none; background: rgba(20,22,26,.92); color: #fff; font-size: 13px; line-height: 1.45; padding: 7px 10px; border-radius: 8px; opacity: 0; transition: opacity .1s; max-width: 260px; }
.tip.on { opacity: 1; }
table.results { width: 100%; border-collapse: collapse; margin-top: 22px; font-size: 15px; font-variant-numeric: tabular-nums; }
table.results th, table.results td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; }
table.results th:first-child, table.results td:first-child { text-align: left; }
table.results th { font-weight: 600; color: var(--muted); font-size: 13.5px; }
table.results tr.best td { font-weight: 650; color: var(--ink); }
table.mini { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
table.mini td { padding: 9px 0; border-bottom: 1px solid var(--line); }
table.mini td:last-child { text-align: right; font-weight: 650; color: var(--ink); white-space: nowrap; padding-left: 10px; }
table.mini tr.muted td { color: var(--muted); } table.mini tr.muted td:last-child { color: var(--muted); }

details { margin-top: 14px; font-size: 14.5px; color: var(--ink2); }
summary { cursor: pointer; font-weight: 600; color: var(--ink); }
details ul { padding-left: 20px; } details li { margin: 4px 0; }

.bib { position: relative; background: var(--soft); border-radius: var(--radius); padding: 16px 18px; }
.bib pre { margin: 0; font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink2); overflow-x: auto; }
.copy { position: absolute; top: 10px; right: 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 10px; font: 500 13px Inter, sans-serif; cursor: pointer; }
footer { margin-top: 56px; margin-bottom: 48px; font-size: 13.5px; color: var(--muted); }
footer p { color: var(--muted); }

@media (max-width: 860px) {
  .explorer { grid-template-columns: 1fr; }
  .viewer, .viewer-bar { margin-left: 0; max-width: none; }
  .thumbs { grid-template-columns: repeat(5, 1fr); }
  .thumb span { display: none; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  section { margin-top: 56px; margin-bottom: 56px; }
  h2 { font-size: 23px; }
  .tldr { font-size: 18px; }
  .stats, .cards, .charts2 { grid-template-columns: 1fr; }
  .stat-num { font-size: 24px; }
  .thumbs { grid-template-columns: repeat(4, 1fr); }
  .abstract { text-align: left; }
}

.charts2 .tcol { display: grid; gap: 6px; min-width: 0; }
.curves-legend { display: flex; gap: 18px; font-size: 14px; color: var(--muted); margin: 0; }
.curves-note { font-size: 14.5px; color: var(--ink2); margin: 10px 0 0; }
.curves-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

/* authors */
.au { white-space: nowrap; }
.au a { color: inherit; text-decoration: none; }
.au a:hover { color: #d65a00; text-decoration: underline; }
.au sup, .venue sup, .lh-aff sup, .c-venue sup, .pub-aff sup { font-size: .68em; }
.logos { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin: 0 0 14px; }
.logos img { height: 52px; width: auto; display: block; }
