/* ==========================================================================
   EvGaze project page
   Print-like academic layout: Times for content, a neutral sans for UI chrome.
   Light paper ground; black only where event data is shown.
   ========================================================================== */

:root {
  --bg: #fafaf7;
  --paper: #ffffff;
  --ink: #121417;
  --ink-2: #2b3036;
  --muted: #5f6670;
  --faint: #8a919a;
  --line: #e4e3dd;
  --line-2: #d6d5cf;

  --night: #08090b;
  --night-2: #121418;
  --night-ink: #eef1f4;
  --night-muted: #9aa3ad;
  --night-line: rgb(255 255 255 / 12%);

  --on: #e5484d;
  --off: #3f74ff;
  --accent: #2f5fe8;
  --accent-soft: #edf2fe;

  --serif: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman", "STIX Two Text", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --wrap: min(1120px, calc(100% - 64px));
  --narrow: min(780px, calc(100% - 64px));
  --nav-h: 60px;
  --radius: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--serif); font-size: 1.125rem; line-height: 1.6;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p, h1, h2, h3, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
sup { font-size: 0.66em; line-height: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: var(--wrap); margin-inline: auto; }
.narrow { width: var(--narrow); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 0.5rem 0.9rem; border-radius: 6px; font-family: var(--sans); }
.skip:focus { left: 8px; }

/* ---------- reading progress ---------- */
.readbar { position: fixed; inset: 0 0 auto; height: 2px; z-index: 60; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: rgb(250 250 247 / 86%); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { width: var(--wrap); height: 100%; margin-inline: auto; display: flex; align-items: center; gap: 1.5rem; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.4rem; letter-spacing: -0.005em; text-decoration: none; color: var(--accent); font-style: italic; }
.brand-ev { color: var(--ink); }
.nav-links { display: flex; gap: 0.2rem; margin-left: auto; font-family: var(--sans); }
.nav-links a { padding: 0.4rem 0.7rem; border-radius: 6px; font-size: 0.9rem; color: var(--muted); text-decoration: none; transition: color 160ms ease, background-color 160ms ease; }
.nav-links a:hover { color: var(--ink); background: rgb(18 20 23 / 5%); }
.nav-links a[aria-current="true"] { color: var(--ink); }
.nav-paper { font-family: var(--sans); font-size: 0.9rem; font-weight: 600; text-decoration: none; padding: 0.42rem 0.95rem; border-radius: 7px; background: var(--ink); color: #fff; }
.nav-paper:hover { background: #2a2f36; }

/* ---------- title block ---------- */
.hero { padding: clamp(3.5rem, 7vw, 5.5rem) 0 clamp(3.5rem, 6vw, 5rem); background: var(--bg); }
.hero-inner { text-align: center; }
.venue { display: inline-flex; align-items: center; gap: 0.75rem; font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.venue-name { font-family: var(--serif); font-size: 1.15rem; letter-spacing: 0; text-transform: none; font-weight: 700; color: var(--accent); }
.venue-name i { color: var(--ink); }
.venue-sep { width: 22px; height: 1px; background: var(--line-2); }
h1 {
  margin-top: 1.1rem;
  font-family: var(--serif); font-weight: 700; font-size: clamp(2.8rem, 6.4vw, 4.6rem);
  line-height: 1.02; letter-spacing: -0.012em; color: var(--ink);
}
.subtitle { margin-top: 0.55rem; font-size: clamp(1.35rem, 2.6vw, 1.95rem); line-height: 1.25; color: var(--ink-2); }
.authors { margin: 2rem auto 0; max-width: 860px; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.35rem; font-size: 1.22rem; color: var(--ink); }
.authors sup { color: var(--accent); margin-left: 1px; }
.affils { margin-top: 0.85rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.15rem 1.4rem; font-size: 1.02rem; color: var(--muted); }
.affils sup { margin-right: 2px; }
.contrib { margin-top: 0.5rem; font-size: 0.95rem; color: var(--faint); }

.links { margin-top: 1.9rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; font-family: var(--sans); }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.62rem 1.05rem; border-radius: 8px;
  font-size: 0.95rem; font-weight: 600; text-decoration: none; line-height: 1;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line-2);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms var(--ease);
}
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn[href]:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn-solid { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-solid[href]:hover { background: #2a2f36; border-color: #2a2f36; }
.btn.is-soon { color: var(--faint); border-style: dashed; cursor: default; }
.btn small { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }

/* ---------- video ---------- */
.video-wrap { margin-top: clamp(2.8rem, 5vw, 3.8rem); }
.video-slot {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 12px; background: var(--night);
  box-shadow: 0 1px 0 rgb(0 0 0 / 4%), 0 30px 70px -38px rgb(18 20 23 / 55%);
}
.video-slot video, .video-slot iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--night); }
.video-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--night-muted); font-family: var(--sans); }
.tldr { margin: 1.8rem auto 0; max-width: 820px; text-align: center; font-size: 1.32rem; line-height: 1.5; color: var(--ink-2); font-style: italic; }
.tldr b { font-style: normal; color: var(--accent); }

/* ---------- key numbers ---------- */
.stats { background: var(--paper); border-block: 1px solid var(--line); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat { padding: 2.2rem 2rem 2.3rem; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; }
.stat-num { font-size: clamp(2.4rem, 4.2vw, 3.2rem); line-height: 1; font-weight: 700; color: var(--ink); font-variant-numeric: lining-nums; }
.stat-num span { font-size: 0.6em; font-weight: 400; color: var(--muted); margin-left: 0.05em; }
.stat-num .arrow { color: var(--accent); margin: 0 0.12em; }
.stat-label { margin-top: 0.7rem; max-width: 30ch; font-family: var(--sans); font-size: 0.92rem; line-height: 1.5; color: var(--muted); }

/* ---------- sections ---------- */
.sec { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.sec-tight { padding-bottom: 0; }
.sec-head { margin-bottom: 2.4rem; max-width: 900px; }
.sec-title { font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.12; font-weight: 700; letter-spacing: -0.008em; color: var(--ink); }
.sec-title.center { text-align: center; }
.sec-lead { margin-top: 0.9rem; font-size: 1.2rem; line-height: 1.55; color: var(--muted); }

/* ---------- figures ---------- */
.plate { margin-top: 2.6rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.plate:first-child { margin-top: 0; }
.zoom { position: relative; display: block; width: 100%; padding: clamp(1rem, 2.4vw, 1.8rem); border: 0; background: var(--paper); cursor: zoom-in; }
.zoom img { width: 100%; }
.zoom-label {
  position: absolute; right: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.38rem 0.65rem; border-radius: 6px; font-family: var(--sans); font-size: 0.78rem; font-weight: 600;
  color: #fff; background: rgb(18 20 23 / 78%); opacity: 0; transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms var(--ease);
}
.zoom-label svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.zoom:hover .zoom-label, .zoom:focus-visible .zoom-label { opacity: 1; transform: none; }
figcaption { padding: 1rem clamp(1rem, 2.4vw, 1.8rem) 1.3rem; border-top: 1px solid var(--line); font-size: 1.02rem; line-height: 1.55; color: var(--muted); }
figcaption b { color: var(--ink); }

/* ---------- abstract ---------- */
.abstract { margin-top: 1.8rem; font-size: 1.22rem; line-height: 1.7; color: var(--ink-2); text-align: justify; hyphens: auto; }
.abstract p + p { margin-top: 1.05rem; }
.abstract b { color: var(--ink); }

/* ---------- method ---------- */
.method { background: var(--paper); border-block: 1px solid var(--line); }
.sketch {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: clamp(1.4rem, 3vw, 2.4rem); border-radius: 14px; background: var(--night); color: var(--night-ink);
}
.scope-box { position: relative; aspect-ratio: 1; width: min(100%, 440px); margin-inline: auto; }
#scope { position: absolute; inset: 0; width: 100%; height: 100%; }
.sketch-kicker { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--night-muted); }
.sketch-text { margin-top: 0.6rem; font-size: 1.35rem; line-height: 1.45; color: var(--night-ink); }
.readout { margin-top: 1.6rem; border-top: 1px solid var(--night-line); font-family: var(--sans); font-size: 0.95rem; }
.readout > div { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--night-line); }
.readout dt { color: var(--night-muted); }
.readout dd { color: var(--night-ink); font-variant-numeric: tabular-nums; }
.readout dd b { display: inline-block; min-width: 3ch; text-align: right; font-weight: 600; }
.legend { display: inline-flex; align-items: center; gap: 0.35rem; }
.sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.sw-on { background: #ff3d63; }
.sw-off { background: var(--off); margin-left: 0.5rem; }
.steps { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--night-line); border-radius: 6px; }
.steps span { min-width: 2.8em; text-align: center; padding: 0.16rem 0.35rem; border-radius: 4px; color: #6f7883; font-size: 0.82rem; transition: background-color 240ms ease, color 240ms ease; }
.steps span.on { background: rgb(255 255 255 / 14%); color: #fff; }
.sketch-note { margin-top: 1rem; font-family: var(--sans); font-size: 0.82rem; color: var(--night-muted); }

.parts { margin-top: 3rem; display: grid; grid-template-columns: repeat(3, 1fr); }
.part { padding: 0 1.8rem; }
.part:first-child { padding-left: 0; }
.part:last-child { padding-right: 0; }
.part + .part { border-left: 1px solid var(--line); }
.part-fig { height: 150px; display: grid; place-items: center; margin-bottom: 1.3rem; }
.part-fig img { max-height: 150px; width: auto; }
.part h3 { font-size: 1.38rem; line-height: 1.25; font-weight: 700; }
.part-n { color: var(--accent); font-weight: 400; font-style: italic; margin-right: 0.15rem; }
.part p { margin-top: 0.55rem; font-size: 1.06rem; line-height: 1.6; color: var(--muted); }

.rates { width: 100%; align-content: center; gap: 0.75rem; font-family: var(--sans); }
.rate-row { display: grid; grid-template-columns: 74px 1fr 64px; align-items: center; gap: 0.6rem; width: 100%; font-size: 0.8rem; }
.rate-tag { font-weight: 600; }
.rate-tag.fast { color: #c4642a; }
.rate-tag.slow { color: #2d7a78; }
.rate-ticks { height: 22px; border-radius: 3px; }
.rate-ticks.fast { background: repeating-linear-gradient(90deg, #e7a273 0 3px, transparent 3px 8px); }
.rate-ticks.slow { background: repeating-linear-gradient(90deg, #79b3ae 0 10px, transparent 10px 27px); }
.rate-hz { color: var(--faint); text-align: right; }
.rate-out { justify-self: center; margin-top: 0.3rem; padding: 0.3rem 0.8rem; border: 1px solid var(--line-2); border-radius: 6px; font-family: var(--serif); font-size: 1.05rem; color: var(--ink-2); }

.formula { gap: 1rem; }
.eq { font-size: 1.3rem; color: var(--ink); }
.warp { display: flex; align-items: center; gap: 0.9rem; }
.cloud, .line { width: 86px; height: 50px; border: 1px solid var(--line-2); border-radius: 5px; background-color: var(--paper); }
.cloud {
  background-image:
    radial-gradient(circle, var(--on) 1.6px, transparent 2px), radial-gradient(circle, var(--off) 1.6px, transparent 2px),
    radial-gradient(circle, var(--on) 1.6px, transparent 2px), radial-gradient(circle, var(--off) 1.6px, transparent 2px);
  background-size: 22px 18px, 26px 21px, 19px 23px, 31px 16px;
  background-position: 3px 5px, 12px 2px, 7px 11px, 16px 8px;
}
.line { background-image: linear-gradient(162deg, transparent 47%, var(--on) 47%, var(--off) 53%, transparent 53%); }
.warp-arrow { color: var(--faint); font-family: var(--sans); }

/* ---------- interactive comparison (dark: event data) ---------- */
.scenes { background: var(--night); color: var(--night-ink); }
.scenes .sec-title { color: var(--night-ink); }
.scenes .sec-lead { color: var(--night-muted); }
.scene-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; font-family: var(--sans); }
.scene-tabs button {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem; text-align: left; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--night-line); background: var(--night-2); color: var(--night-muted);
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.scene-tabs button:hover { border-color: rgb(255 255 255 / 24%); color: var(--night-ink); }
.scene-tabs button[aria-selected="true"] { border-color: #fff; background: #1a1d22; color: var(--night-ink); }
.scene-tabs img { width: 64px; height: 42px; object-fit: cover; border-radius: 6px; flex: none; }
.scene-tabs span { display: grid; font-size: 0.8rem; line-height: 1.3; }
.scene-tabs b { font-size: 0.95rem; color: var(--night-ink); font-weight: 600; }

.compare-bar { display: flex; align-items: center; gap: 0.9rem; margin: 1.4rem 0 1rem; font-family: var(--sans); }
.compare-k { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--night-muted); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; border: 1px solid var(--night-line); }
.seg button { border: 0; background: transparent; cursor: pointer; padding: 0.4rem 0.85rem; border-radius: 6px; font-size: 0.88rem; font-weight: 500; color: var(--night-muted); transition: background-color 160ms ease, color 160ms ease; }
.seg button:hover { color: var(--night-ink); }
.seg button[aria-checked="true"] { background: #fff; color: var(--ink); font-weight: 600; }
.seg button[hidden] { display: none; }

.stage {
  position: relative;
  width: min(100%, calc((100svh - var(--nav-h) - 8rem) * var(--ar, 1.6)));
  margin-inline: auto; border-radius: 10px; overflow: hidden; background: #000;
  cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  box-shadow: 0 0 0 1px var(--night-line);
}
.stage.is-busy { cursor: progress; }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; pointer-events: none; -webkit-user-drag: none; }
.layer-ours { clip-path: inset(0 0 0 calc(var(--pos) * 1%)); }
.stage.is-fading .layer { opacity: 0.25; }
@media (prefers-reduced-motion: no-preference) { .layer { transition: opacity 240ms ease; } }
.tag {
  position: absolute; z-index: 2; top: 12px; padding: 0.34rem 0.62rem; border-radius: 6px;
  font-family: var(--sans); font-size: 0.8rem; font-weight: 600; line-height: 1; white-space: nowrap;
  color: #fff; background: rgb(0 0 0 / 62%); pointer-events: none; transition: opacity 200ms ease;
}
.tag-l { left: 12px; }
.tag-r { right: 12px; background: var(--accent); }
.stage[data-near="left"] .tag-l, .stage[data-near="right"] .tag-r { opacity: 0.2; }
.handle { position: absolute; z-index: 3; top: 0; bottom: 0; left: calc(var(--pos) * 1%); width: 44px; transform: translateX(-50%); pointer-events: none; }
.shaft { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); background: #fff; }
.knob {
  position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; border-radius: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; background: #fff; color: var(--ink); box-shadow: 0 2px 10px rgb(0 0 0 / 45%);
  transition: transform 200ms var(--ease);
}
.knob svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stage:hover .knob, .stage:focus-visible .knob, .stage.is-drag .knob { transform: translate(-50%, -50%) scale(1.08); }
.compare-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem 2rem; margin-top: 1rem; }
.caption { font-size: 1.08rem; line-height: 1.5; color: var(--night-ink); max-width: 70ch; }
.help { font-family: var(--sans); font-size: 0.82rem; color: var(--night-muted); white-space: nowrap; }

/* ---------- tables ---------- */
.table-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); font-family: var(--sans); overflow-x: auto; }
.table-tabs button { flex: none; border: 0; background: transparent; cursor: pointer; padding: 0.95rem 1.3rem; font-size: 0.92rem; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.table-tabs button:hover { color: var(--ink); }
.table-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.table-panel { padding: 0.6rem clamp(1rem, 2.4vw, 1.8rem) 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 1.08rem; font-variant-numeric: tabular-nums lining-nums; }
thead th { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); text-align: right; padding: 0.85rem 0.8rem; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
thead th:first-child { text-align: left; padding-left: 0; }
thead th i { font-style: normal; color: var(--faint); }
tbody th { text-align: left; font-weight: 400; padding: 0.72rem 0.8rem 0.72rem 0; white-space: nowrap; }
tbody td { text-align: right; padding: 0.72rem 0.8rem; white-space: nowrap; }
tbody tr + tr > * { border-top: 1px solid var(--line); }
tbody tr:last-child > * { border-bottom: 1.5px solid var(--ink); }
td.best { font-weight: 700; }
td.second { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
tr.ours > * { background: var(--accent-soft); }
tr.ours th { color: var(--accent); font-weight: 700; }
.rate { color: var(--faint); font-size: 0.9em; }
.table-note { padding: 0.9rem 0 1.1rem; font-size: 0.98rem; color: var(--muted); }
.table-legend { padding: 0.8rem clamp(1rem, 2.4vw, 1.8rem); border-top: 1px solid var(--line); font-family: var(--sans); font-size: 0.8rem; color: var(--faint); }
.table-legend b, .table-legend u { color: var(--ink-2); }

/* ---------- citation ---------- */
.cite { background: var(--paper); border-top: 1px solid var(--line); }
.bib { position: relative; margin-top: 1.4rem; }
.bib pre {
  margin: 0; padding: 1.3rem 1.4rem; overflow-x: auto; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.86rem; line-height: 1.65; color: var(--ink-2); white-space: pre;
}
.bib-copy {
  position: absolute; top: 0.7rem; right: 0.7rem; display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.7rem; border-radius: 6px; border: 1px solid var(--line-2); background: var(--paper); cursor: pointer;
  font-family: var(--sans); font-size: 0.8rem; font-weight: 600; color: var(--ink-2);
}
.bib-copy:hover { border-color: var(--ink); }
.bib-copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bib-copy.is-done { color: #1a7f4b; border-color: #1a7f4b; }
.copy-state { min-height: 1.2em; margin-top: 0.4rem; font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.cite-note { font-family: var(--sans); font-size: 0.85rem; color: var(--faint); }

/* ---------- footer ---------- */
.colophon { border-top: 1px solid var(--line); padding: 1.8rem 0 2.4rem; color: var(--muted); font-size: 0.98rem; }
.colophon-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 2rem; }
.colophon b { color: var(--accent); }
.colophon b i { color: var(--ink); }

/* ---------- zoom dialog ---------- */
dialog { width: min(96vw, 1680px); max-width: none; max-height: 94dvh; padding: 1rem; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 40px 120px rgb(0 0 0 / 45%); }
dialog::backdrop { background: rgb(8 9 11 / 76%); }
dialog[open] { animation: pop 240ms var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }
dialog img { width: 100%; height: auto; max-height: calc(94dvh - 2rem); object-fit: contain; }
.close-zoom { position: absolute; top: 0.7rem; right: 0.7rem; z-index: 1; width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: rgb(18 20 23 / 82%); color: #fff; }
.close-zoom svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .readbar { animation: readbar linear both; animation-timeline: scroll(root); }
  html.motion .reveal { opacity: 0; transform: translateY(18px); }
  html.motion .reveal.is-in { opacity: 1; transform: none; transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
  .hero-inner > * { animation: rise 0.8s var(--ease) both; }
  .hero-inner > :nth-child(2) { animation-delay: 0.04s; }
  .hero-inner > :nth-child(3) { animation-delay: 0.08s; }
  .hero-inner > :nth-child(4) { animation-delay: 0.12s; }
  .hero-inner > :nth-child(5) { animation-delay: 0.15s; }
  .hero-inner > :nth-child(6) { animation-delay: 0.18s; }
  .hero-inner > :nth-child(7) { animation-delay: 0.22s; }
}
@keyframes readbar { to { transform: scaleX(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .sketch { grid-template-columns: 1fr; }
  .parts { grid-template-columns: 1fr; gap: 2.2rem; }
  .part, .part:first-child, .part:last-child { padding: 0; }
  .part + .part { border-left: 0; border-top: 1px solid var(--line); padding-top: 2.2rem; }
  .scene-tabs { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: 1fr; }
  .stat, .stat:first-child { padding: 1.6rem 0; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  :root { --wrap: calc(100% - 32px); --narrow: calc(100% - 32px); --nav-h: 54px; }
  body { font-size: 1.06rem; }
  .nav-links { display: none; }
  .nav-paper { margin-left: auto; }
  .authors { font-size: 1.08rem; gap: 0.15rem 0.9rem; }
  .affils { font-size: 0.95rem; flex-direction: column; }
  .btn { padding: 0.55rem 0.85rem; font-size: 0.9rem; }
  .tldr { font-size: 1.15rem; }
  .abstract { text-align: left; font-size: 1.1rem; }
  .sketch-text { font-size: 1.15rem; }
  .compare-bar { flex-wrap: wrap; }
  .compare-foot { flex-direction: column; gap: 0.3rem; }
  .help { white-space: normal; }
  .tag { font-size: 0.72rem; top: 8px; }
  .tag-l { left: 8px; } .tag-r { right: 8px; }
  figcaption { font-size: 0.95rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
