/* Google Sans (SIL OFL 1.1), subset and bundled so the page works offline; see fonts/README.md. */
@font-face { font-family: "Google Sans"; src: url("fonts/GoogleSans.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Google Sans"; src: url("fonts/GoogleSans-Italic.woff2") format("woff2");
  font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --bg-card: #ffffff;
  --ink: #14181f;
  --text: #1d232c;
  --text-soft: #586272;
  --line: #e2e7ee;
  --accent: #1a73e8;          /* the blue of "4RT" in the paper figures */
  --accent-ink: #0f57b8;
  --accent-soft: #e8f0fe;
  --warm: #ea7814;            /* the paper's second colour: the object reference, the target view */
  --rank1: #b9d4fa; --rank2: #dbe8fc; --rank3: #f0f5fd;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
  --radius: 14px;
  /* controls: one height per size, one track colour, one ring */
  --ctl: 36px; --ctl-sm: 30px;
  --track: #e9edf3;
  --line-strong: #cfd7e2;
  --ring: 0 0 0 3px rgba(26, 115, 232, .28);
  --ease: .16s cubic-bezier(.2, .7, .3, 1);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
button { font: inherit; }
:is(a, button, input, [tabindex]):focus { outline: none; }
:is(a, button, [tabindex]):focus-visible { box-shadow: var(--ring); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 800px; }
section { padding: 72px 0; }
section.soft { background: var(--bg-soft); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; color: var(--ink); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -.02em; margin-bottom: .35em; }
h3 { font-size: 1.15rem; margin: 2.2em 0 .6em; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .7em; }
.lead { color: var(--text-soft); font-size: 1.08rem; margin: 0 0 1.6em; max-width: 780px; }
.caption { color: var(--text-soft); font-size: .92rem; margin: .9em 0 0; }
.caption b { color: var(--text); }
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.fig { background: #fff; border-radius: var(--radius); padding: 14px; border: 1px solid var(--line); }
.fig video { display: block; width: 100%; }
.fig img { width: 100%; }
.c-accent { color: var(--accent); font-weight: 600; }
.c-warm { color: var(--warm); font-weight: 600; }

/* ---------- top bar ---------- */
/* The white tint fades in with the scroll (--nav-tint, page.js), so over the hero's blue glow the bar
   takes the glow's colour instead of lying on it as a whiter band. */
nav.top { position: sticky; top: 0; z-index: 20; background: rgb(255 255 255 / calc(.86 * var(--nav-tint, 1)));
  backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px); }
nav.top .wrap { display: flex; align-items: center; gap: 24px; height: 52px; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--ink); letter-spacing: -.01em; flex: none; }
.brand:hover { text-decoration: none; }
.brand i, .name i { font-style: normal; color: var(--accent); }
nav.top .links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; align-self: stretch; }
nav.top .links::-webkit-scrollbar { display: none; }
/* A link is as tall as the bar.  Active, only its colour changes.  Hovered, it gets no pill: a faint blue halo lies behind the word,
   brightest at its centre and gone before the link's edges, so the word looks lit instead of boxed. */
nav.top .links a { flex: none; display: flex; align-items: center; position: relative; isolation: isolate;
  color: var(--text-soft); font-size: .9rem; font-weight: 500; padding: 0 11px; transition: color .18s ease; }
nav.top .links a::after { content: ""; position: absolute; inset: 5px 0; z-index: -1; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse closest-side at 50% 50%, rgba(26, 115, 232, .17) 0%, rgba(26, 115, 232, .1) 35%, rgba(26, 115, 232, .035) 68%, rgba(26, 115, 232, 0) 100%);
  transition: opacity .18s ease; }
nav.top .links a:hover { color: var(--ink); text-decoration: none; }
nav.top .links a:hover::after { opacity: .55; }
nav.top .links a.on { color: var(--accent-ink); }

/* ---------- hero ---------- */
header.hero { padding: 72px 0 56px; text-align: center;
  background: radial-gradient(1100px 420px at 50% -80px, #eaf2ff 0%, rgba(234, 242, 255, 0) 70%); }
.hero h1 { font-size: clamp(2.8rem, 7vw, 4.6rem); letter-spacing: -.035em; font-weight: 700; }
.hero .subtitle { font-size: clamp(1.25rem, 3vw, 1.9rem); color: var(--ink); margin-top: .2em; font-weight: 500; letter-spacing: -.01em; }
.hero .pitch { max-width: 720px; margin: 1.1em auto 0; color: var(--text-soft); font-size: 1.08rem; }
.authors { margin-top: 1.2em; font-size: 1.02rem; }
.authors sup { color: var(--text-soft); }
.affil { color: var(--text-soft); font-size: .92rem; margin-top: .2em; }
.buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
/* One button: filled (the main action) or .ghost (everything else), in two sizes. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: .95rem; line-height: 1; border: 1px solid var(--accent);
  cursor: pointer; white-space: nowrap; flex: none;
  transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease), transform var(--ease); }
.btn:hover { text-decoration: none; background: var(--accent-ink); border-color: var(--accent-ink); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: #bcd3f8; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.small { height: var(--ctl-sm); padding: 0 13px; font-size: .85rem; font-weight: 500; gap: 6px; }
.btn.small svg { width: 14px; height: 14px; }
/* Round icon buttons: filled for play / pause, plain for the lightbox's arrows and close. */
.icon-btn { flex: none; width: var(--ctl); height: var(--ctl); border-radius: 50%; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease), transform var(--ease); }
.icon-btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.plain { width: 40px; height: 40px; background: #fff; color: var(--ink); border-color: var(--line-strong); }
.icon-btn.plain:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: #bcd3f8; }
.icon-btn.plain svg { width: 18px; height: 18px; }
.icon-btn:disabled, .icon-btn.off { opacity: .3; cursor: default; }
.icon-btn.off:hover { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.icon-btn.off:active { transform: none; }

/* Sliders: a thin track filled up to the thumb (--p, kept by the script at the end of page.js). */
input[type=range] { -webkit-appearance: none; appearance: none; height: 20px; margin: 0; background: transparent; cursor: pointer; --p: 0%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--p), var(--track) var(--p)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(16, 24, 40, .2); transition: transform var(--ease), box-shadow var(--ease); }
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.15); }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: var(--ring); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 999px; background: var(--track); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--accent); }
input[type=range]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--accent);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .2); }
input[type=range]:focus-visible::-moz-range-thumb { box-shadow: var(--ring); }
/* The time beside or under a slider. */
.tlabel, .vtime { font-size: .8rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }

/* The teaser spans the window (up to 1440px), outside the text column; its caption stays in the column. */
.hero-fig { margin: 44px 0 0; padding: 0 clamp(10px, 2vw, 36px); text-align: left; }
.hero-fig video { display: block; width: 100%; max-width: 1440px; margin: 0 auto; aspect-ratio: 2800 / 634; }
.hero-fig .caption { max-width: 1160px; margin: 16px auto 0; padding: 0 20px; }

/* ---------- three claims ---------- */
.claims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 36px; }
.claim { padding: 22px 22px 20px; }
.claim .k { font-size: .78rem; font-weight: 700; color: var(--accent); letter-spacing: .08em; }
.claim h4 { font-size: 1.12rem; margin: 6px 0 8px; }
.claim p { margin: 0; color: var(--text-soft); font-size: .95rem; }
/* each card leads to the section it summarises */
a.claim { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.claim:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
a.claim h4 { color: var(--ink); }
/* The abstract leads the section and the cards follow, set apart from it by as much
   room as the section keeps above and below. */
#abstract { padding: 60px 0 64px; }
#abstract .claims { margin-top: 52px; }
.abstract { margin: 0 auto; }
.abstract .eyebrow { margin-bottom: 12px; }
.abstract p { margin: 0; font-size: 1.04rem; }

/* ---------- video frames ---------- */
.panel-labels { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; text-align: center;
  font-size: .85rem; font-weight: 600; color: var(--text-soft); margin-bottom: 8px; }
.video-frame { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.video-frame video { width: 100%; }
/* Switching clips by a sideways drag slides the neighbour in (page.js, slider): the
   frame clips the two, and the stand-in lies over the video until the new one has loaded. */
.video-frame, .slide-box { position: relative; overflow: hidden; }
.slide-box { border-radius: 8px; }
.slide-ghost { position: absolute; top: 0; left: 0; z-index: 2; pointer-events: none; transform-origin: 0 0; will-change: transform; }
img.slide-ghost { width: 100%; max-width: none; background: #fff; border-radius: inherit; }
#main-video { cursor: pointer; }
/* Sideways drags switch clips (page.js, swipeable); vertical ones still scroll the page. */
#main-video, #cmp-video { touch-action: pan-y; user-select: none; -webkit-user-drag: none; }
.stack { display: grid; gap: 22px; }
.stack > * { min-width: 0; }      /* or a wide figure inside widens the column instead of scrolling */

/* ---------- segmented controls ----------
   The view tabs and the viewer's switches are the same control in two sizes:
   a soft track, and a filled blue thumb under the choice that is on. */
.seg, .tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--track); max-width: 100%; }
.seg button, .tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: transparent;
  color: var(--text-soft); font-weight: 500; font-size: .85rem; line-height: 1; height: calc(var(--ctl-sm) - 6px); padding: 0 13px;
  border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease); }
.seg button:hover, .tabs button:hover { color: var(--ink); }
.seg button.on, .tabs button.on { background: var(--accent); color: #fff; font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 87, 184, .35), 0 2px 8px rgba(26, 115, 232, .28); }
.seg button.on:hover, .tabs button.on:hover { color: #fff; }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.seg button:focus-visible, .tabs button:focus-visible { box-shadow: var(--ring); }
.tabs { padding: 4px; margin: 2px 0 20px; }
.tabs button { height: var(--ctl); padding: 0 20px; font-size: .95rem; font-weight: 600; }
.tabs button svg { width: 18px; height: 18px; flex: none; }
@media (max-width: 520px) { .tabs button { padding: 0 12px; font-size: .88rem; } .tabs button svg { display: none; } }
.ctl { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.ctl > span.lab { color: var(--text-soft); font-weight: 500; }
.ctl input[type=range] { width: 120px; }

/* ---------- comparison ---------- */
.cmp { padding: 16px; }
#cmp-video { width: 100%; border-radius: 8px; background: #fff; cursor: pointer; }
.cmp-note { margin: 14px 4px 2px; font-size: .96rem; min-height: 1.6em; }
.cmp-note b { color: var(--ink); }

/* The enlarged view looks as it does on the site's other paper pages (.pub-lightbox, _layout.scss):
   the page shows through a light frosted glass, the controls are light glass too, and it fades in and out. */
.lightbox { position: fixed; inset: 0; z-index: 50; display: flex;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255, 255, 255, .55), transparent 60%),
    radial-gradient(ellipse at 85% 100%, rgba(232, 240, 254, .6), transparent 55%),
    rgba(255, 255, 255, .5);
  backdrop-filter: blur(10px) saturate(180%) brightness(1.04); -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.04);
  align-items: center; justify-content: center; gap: 10px; padding: 16px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .4s cubic-bezier(.2, 0, 0, 1), visibility 0s .4s; }
.lightbox.on { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.lb-grid:empty { display: none; }      /* emptied on closing, while the glass fades */
.lightbox .icon-btn.plain { color: var(--text); background: rgba(255, 255, 255, .72); border-color: transparent;
  box-shadow: 0 4px 14px rgba(26, 115, 232, .14), inset 0 1px 0 rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px) saturate(180%); -webkit-backdrop-filter: blur(12px) saturate(180%); }
.lightbox .icon-btn.plain:hover { background: rgba(255, 255, 255, .95); color: var(--text); border-color: transparent; }
.lightbox .icon-btn.off, .lightbox .icon-btn.off:hover { opacity: .4; background: rgba(255, 255, 255, .72); }
.lightbox figure { margin: 0; min-width: 0; }
/* .lb-view is a frame over the whole window; .lb-grid is the white pane holding the
   comparison, which the wheel scales and dragging moves inside it (see place()). */
.lb-view { position: relative; width: calc(100vw - 140px); height: calc(100vh - 96px); overflow: hidden; border-radius: var(--radius);
  cursor: default; touch-action: none; user-select: none; }
.lb-view:not(.zoomed) .lb-grid video { cursor: pointer; }
.lb-view.flying { overflow: visible; }      /* the pane on its way from or to the video on the page (fly(), page.js) */
.lb-view.zoomed { cursor: grab; }
.lb-view.zoomed:active { cursor: grabbing; }
/* As wide as the frame, or narrower where both rows would not fit its height
   (the grid is about 0.27 times as tall as it is wide). */
.lb-grid { position: absolute; top: 0; left: 0; width: min(100%, calc((100vh - 96px) / .27)); padding: 14px; background: #fff; border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(26, 115, 232, .2), 0 2px 8px rgba(26, 115, 232, .08);
  transform-origin: 0 0; will-change: transform; }
.lb-grid video, .lb-grid > img { display: block; width: 100%; border-radius: 4px; }
/* The headings of Flow4RT's video grow with it, as lettering inside a video would:
   0.85rem over a 1120px video on the page, kept at that proportion of the pane. */
.lb-grid { container-type: inline-size; }
.lb-grid .panel-labels { font-size: 1.21cqw; gap: .7cqw; margin-bottom: .7cqw; }
/* play / pause, position, and the time underneath */
.vbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 520px) minmax(0, 1fr); align-items: center; gap: 4px 12px; margin-top: 10px; }
.vbar .vbtn { grid-column: 2; grid-row: 1; }
/* Enlarge: at the right end of the line, flush with the video's right edge. */
.vbar .btn { grid-column: 4; grid-row: 1; justify-self: end; }
.vbar input[type=range] { grid-column: 3; grid-row: 1; width: 100%; }
.vbar .vtime { grid-column: 1 / -1; grid-row: 2; text-align: center; }
.lightbox .vbar { display: none; margin-top: 8px; }
.lightbox.video .vbar { display: grid; }
.lightbox { --track: rgba(29, 35, 44, .14); }
.lightbox.video .lb-view { height: calc(100vh - 160px); }
.lightbox figcaption { color: var(--ink); text-align: center; margin-top: 8px; line-height: 1.35; }
.lightbox figcaption b { display: block; font-weight: 600; }
.lightbox figcaption span { font-size: .8rem; color: var(--text-soft); }
.lb-close { position: absolute; top: 14px; right: 14px; }
@media (max-width: 700px) {
  .lb-view { width: calc(100vw - 32px); }
  .lb-prev, .lb-next { position: absolute; bottom: 14px; }
  .lb-prev { left: 14px; } .lb-next { right: 14px; }
}

/* ---------- viewer ---------- */
.viewer { display: grid; grid-template-columns: 1fr 250px; gap: 18px; }
.canvas-box { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.canvas-box canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.canvas-box canvas:active { cursor: grabbing; }
/* Plain names over the canvas.  Side by side, the baseline is on the left and Flow4RT on the right. */
.vlabel { position: absolute; top: 12px; left: 14px; font-size: .85rem; font-weight: 600; color: var(--ink); pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff; }
.vlabel.ours { color: var(--accent-ink); }
.canvas-box.cmp .vlabel.ours { left: calc(50% + 14px); }
.vdivider { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #d3dae3; pointer-events: none; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .78); color: #333; font-weight: 600; font-size: .95rem; text-align: center; padding: 0 20px; }
.overlay .spin { width: 22px; height: 22px; border: 3px solid #d3dae3; border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite; margin-right: 10px; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint { position: absolute; bottom: 8px; right: 12px; font-size: .75rem; color: #7b8594; pointer-events: none; }
.side { display: flex; flex-direction: column; gap: 12px; }
.side .thumbs { display: grid; grid-template-columns: 1fr; gap: 8px; }
.side figure { margin: 0; }
.side figure figcaption { font-size: .78rem; color: var(--text-soft); margin-bottom: 3px; }
.side .imgbox { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.side .imgbox img { width: 100%; }
.side .imgbox canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-title { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.scene-sub { color: var(--text-soft); font-size: .85rem; }
.controls { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; margin-top: 14px; }
/* On / off options as chips. */
.check { display: inline-flex; gap: 7px; align-items: center; height: var(--ctl-sm); padding: 0 13px 0 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text-soft); font-size: .85rem; font-weight: 500;
  cursor: pointer; user-select: none; transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease); }
.check:hover { color: var(--ink); }
.check input { -webkit-appearance: none; appearance: none; flex: none; width: 14px; height: 14px; margin: 0; border-radius: 50%;
  border: 1.5px solid #b3bdcb; background: #fff center / 10px no-repeat; cursor: inherit; transition: background-color var(--ease), border-color var(--ease); }
.check input:checked { border-color: var(--accent); background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.4 2.4 4.6-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.check:has(input:checked) { background: var(--accent-soft); border-color: #bcd3f8; color: var(--accent-ink); }
.check:has(input:focus-visible) { box-shadow: var(--ring); }
.check.off { opacity: .4; cursor: not-allowed; }
.timeline { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.timeline input[type=range] { flex: 1; }
.tlabel { min-width: 70px; text-align: right; }
/* The clip cards shared by the comparison, the interactive viewer and the videos. */
.scene-picker { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; margin-bottom: 8px; scrollbar-width: thin; }
.scene-btn { flex: none; width: 96px; border: 2px solid transparent; border-radius: 12px; background: none; padding: 0;
  cursor: pointer; text-align: center; color: var(--text-soft); transition: border-color var(--ease), color var(--ease), box-shadow var(--ease); }
.scene-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.scene-btn img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; }
.scene-btn span { display: block; font-size: .76rem; line-height: 1.2; margin: 4px 0 2px; }
.scene-btn small { display: block; font-size: .66rem; color: var(--text-soft); line-height: 1.1; padding-bottom: 3px; }
.scene-btn.on { border-color: var(--accent); color: var(--accent-ink); }
.scene-btn.on span { font-weight: 600; }

/* ---------- method ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 28px 0; }
.step { padding: 20px 20px 14px; display: flex; flex-direction: column; }
.step .k { font-size: .78rem; font-weight: 700; color: var(--accent); letter-spacing: .08em; }
.step h4 { margin: 5px 0 7px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--text-soft); font-size: .93rem; }
/* Each card ends with its math, pushed to the bottom so the three line up. */
.peq { margin-top: auto; padding-top: 10px; font-size: .95rem; overflow-x: auto; overflow-y: hidden; }
.peq .katex-display { margin: .4em 0 0; }

/* ---------- results ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 8px 0 30px; }
.stat { padding: 18px 16px; }
.stat b { display: block; font-size: 2.1rem; color: var(--accent); line-height: 1.1; letter-spacing: -.02em; }
.stat b small { font-size: .95rem; font-weight: 600; color: var(--text-soft); letter-spacing: 0; }
.stat span { display: block; margin-top: 6px; font-size: .86rem; color: var(--text-soft); line-height: 1.4; }
.table-card { padding: 6px 6px 2px; overflow-x: auto; }
/* A table inside a card or a column: where it is wider than its place (a phone), it scrolls sideways
   there instead of widening the page. */
.table-scroll { overflow-x: auto; }
.why > *, .eff > * { min-width: 0; }
table.res { border-collapse: collapse; width: 100%; font-size: .84rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.res th, table.res td { padding: 5px 7px; text-align: center; }
table.res thead th { color: var(--text-soft); font-weight: 600; font-size: .78rem; }
table.res thead tr.grp th { color: var(--ink); font-size: .84rem; border-bottom: 1px solid var(--line); }
table.res thead tr.sub th { font-weight: 500; }
table.res tbody th { text-align: left; font-weight: 500; position: sticky; left: 0; background: #fff; }
table.res tbody tr + tr td, table.res tbody tr + tr th { border-top: 1px solid #f0f3f7; }
table.res tr.ours th, table.res tr.ours td { font-weight: 700; border-top: 1px solid var(--line-strong); }
table.res tr.ours th { color: var(--accent-ink); }
table.res tr.ref td, table.res tr.ref th { color: var(--text-soft); }
table.res td.gap, table.res th.gap { border-left: 1px solid var(--line); }
td.r1 { background: var(--rank1); } td.r2 { background: var(--rank2); } td.r3 { background: var(--rank3); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--text-soft); margin-top: 10px; align-items: center; }
.legend i { display: inline-block; width: 22px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; border: 1px solid #dbe5f3; }
.why { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.why .card { padding: 20px; }
.why h4 { font-size: 1.05rem; margin-bottom: 6px; }
.why p { margin: 0 0 12px; color: var(--text-soft); font-size: .93rem; }
.eff { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
.eff p { color: var(--text-soft); margin: 0 0 1em; }
.eff .table-scroll + .caption { margin-top: 14px; }

footer { padding: 34px 0 56px; color: var(--text-soft); font-size: .86rem; text-align: center; border-top: 1px solid var(--line); }
footer p { margin: .3em 0; }

@media (max-width: 900px) {
  section { padding: 52px 0; }
  .viewer { grid-template-columns: 1fr; }
  .side .thumbs { grid-template-columns: 1fr 1fr; }
  .claims, .steps, .why, .eff { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .canvas-box { aspect-ratio: 4 / 3; }
  nav.top .wrap { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- additions for the page on shenhanqian.github.io ---------- */
/* The author block follows the site's paper pages: linked names, numbered institutions, the venue. */
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: .1em 1.6em; margin-top: 1.4em; font-size: 1.12rem; }
.authors a { color: var(--ink); }
.authors a:hover { color: var(--accent); text-decoration: none; }
.affil { display: flex; flex-wrap: wrap; justify-content: center; gap: .1em 1.6em; margin-top: .35em; font-size: .98rem; }
.venue { margin-top: 1em; font-size: 1.12rem; font-weight: 600; color: var(--accent); }
.hero .pitch { margin-top: 1.3em; }
/* The top bar only appears once the page has been scrolled (page.js), so it lies over the page
   instead of taking room above the hero. */
nav.top { position: fixed; left: 0; right: 0; opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease; }
nav.top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
/* The figures enlarge on a click, as on the site's other paper pages. */
video.zoomable { cursor: zoom-in; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
