:root {
  --text: #1d1d1f;
  --muted: #5f6368;
  --line: #e2e2e2;
  --soft: #f5f5f4;
  --link: #1f5aa6;
  --button: #2b2b2b;
  --column: 880px;
  --wide: 1120px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 17px/1.65 "Noto Sans", var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
img, video { display: block; width: 100%; height: auto; }
video { background: #111; }
b { font-weight: 600; }

/* Title (Nerfies / Bulma-style header) */
.title-block { max-width: var(--wide); margin: 0 auto; padding: 48px 20px 24px; text-align: center; font-family: "Google Sans", "Noto Sans", var(--sans); }
h1 { margin: 0; color: #363636; font-size: 3rem; font-weight: 600; line-height: 1.125; }
.subtitle { margin: 12px 0 0; color: #363636; font-size: clamp(1.25rem, 2.8vw, 2rem); font-weight: 600; line-height: 1.25; }
.authors { margin: 24px 0 0; font-size: 1.25rem; color: #4a4a4a; }
.author { display: inline-block; }


.emails { margin: 6px 0 0; font-size: .85rem; color: #777; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.button {
  display: inline-flex; align-items: center; gap: .5em;
  height: 2.5em; padding: 0 1.25em; border-radius: 9999px;
  background: #363636; color: #fff; text-decoration: none;
  font-size: 1rem; line-height: 1;
}
.button:hover { background: #2f2f2f; color: #fff; }
.button.disabled { opacity: .6; cursor: default; }
.button.disabled:hover { background: #363636; }
.button .icon { display: inline-flex; width: 1.1em; height: 1.1em; }
.button svg { width: 100%; height: 100%; }

/* Layout */
main { padding: 0 20px 80px; }
section, figure { max-width: var(--column); margin-left: auto; margin-right: auto; }
figure { margin-top: 0; margin-bottom: 0; }
figure.wide, .grid, .table-scroll { max-width: var(--wide); }
section { margin-top: 64px; }
h2 { margin: 0 0 20px; color: #363636; font-family: "Google Sans", "Noto Sans", var(--sans); font-size: 2rem; font-weight: 600; line-height: 1.125; text-align: center; }
h3 { margin: 44px 0 8px; color: #363636; font-family: "Google Sans", "Noto Sans", var(--sans); font-size: 1.5rem; font-weight: 600; }
p { margin: 0 0 16px; }
#abstract p { text-align: justify; hyphens: auto; }
section > figure, section > .grid, section > .table-scroll, .layers { margin-top: 24px; margin-bottom: 8px; }
figcaption, .caption, .note { margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.55; }
figure a { display: block; }
figure a img { transition: opacity .15s; }
figure a:hover img { opacity: .92; }

.grid { display: grid; gap: 28px 24px; margin-left: auto; margin-right: auto; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid figure { max-width: none; margin: 0; }

/* Looping clips */
video.loop { cursor: pointer; }
.clip-player { position: relative; min-width: 0; }
.clip-toolbar { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.clip-toolbar button, .clip-toolbar select {
  min-height: 34px; padding: 5px 10px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--muted);
  font: 13px/1.4 var(--sans); cursor: pointer;
}
.clip-toolbar button { min-width: 64px; }
.clip-toolbar select { min-width: 0; max-width: 190px; }
.clip-toolbar button:hover, .clip-toolbar select:hover { background: var(--soft); color: var(--text); }

/* Layer tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tabs button {
  font: inherit; font-size: 15px; cursor: pointer;
  padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
}
.tabs button:hover { border-color: #b8b8b8; }
.tabs button[aria-selected="true"] { background: var(--button); border-color: var(--button); color: #fff; }

/* Before/after slider */
.wipe { position: relative; overflow: hidden; user-select: none; touch-action: pan-y; }
.wipe-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split)); }
.wipe-after img { height: 100%; object-fit: cover; }
.wipe::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 4px rgba(0,0,0,.4); pointer-events: none; }
.wipe input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.wipe-label { position: absolute; top: 10px; padding: 2px 8px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; pointer-events: none; }
.wipe-label.left { left: 10px; }
.wipe-label.right { right: 10px; }

/* Table */
.table-scroll { overflow-x: auto; margin-left: auto; margin-right: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }

th, td { padding: 7px 10px; text-align: center; white-space: nowrap; }
thead tr:first-child th { border-top: 2px solid var(--text); }
thead tr:last-child th { border-bottom: 1px solid var(--text); font-weight: 500; }
thead th { font-weight: 600; }
tbody th { text-align: left; font-weight: 400; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 2px solid var(--text); }
tr.group th, tr.group td { border-top: 1px solid var(--line); }

.site-footer { margin-top: 24px; padding: 40px 20px 48px; background: #fafafa; text-align: center; color: var(--muted); font-size: 15px; }
.site-footer p { margin: 0; }
.noscript { max-width: var(--column); margin: 0 auto 40px; padding: 0 20px; color: var(--muted); }

:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .title-block { padding-top: 40px; }
  section { margin-top: 48px; }
  h2 { font-size: 1.6rem; }
  h1 { font-size: 2.4rem; }
  .authors { font-size: 1.1rem; }
  .grid.two { grid-template-columns: 1fr; }
  #abstract p { text-align: left; }
}

/* Featured results band */
section.band { max-width: none; margin: 56px -20px 0; padding: 56px 20px 60px; background: #f5f5f5; }
.band-inner { max-width: var(--wide); margin: 0 auto; }
.band .lead { max-width: var(--column); margin: 0 auto 36px; text-align: center; color: #4a4a4a; }
.result { max-width: none; margin: 0 0 40px; }
.result-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 10px; }
.result-head h3 { margin: 0; font-size: 1.5rem; }
.result-stat { margin: 0; color: #4a4a4a; }
.result-stat b { color: #2a8a36; }
.result video { border-radius: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .12); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 15px; color: #363636; }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend .legend-note { color: var(--muted); font-style: italic; }
.swatch { display: inline-block; width: 26px; height: 5px; border-radius: 3px; }
.swatch.gt { background: #ffdc0a; }
.swatch.ours { background: #31a33c; }
.swatch.prm { background: #4084bb; }
.swatch.rrt { background: #fe9200; }
.swatch.irrt { background: #ce7eaa; }
.swatch.esdf { background: #cd4635; }
.band-note { margin: 0; text-align: center; color: var(--muted); font-size: 15px; }
@media (max-width: 720px) {
  section.band { padding: 40px 16px 44px; margin-top: 48px; }
  .result-head h3 { font-size: 1.25rem; }
}
.result.map { max-width: none; margin: 0 0 40px; border: 1px solid #dcdcdc; border-radius: 8px; background: #fff; }
.result.map > summary { list-style: none; cursor: pointer; margin: 0; padding: 14px 18px; border-radius: 8px; }
.result.map > summary::-webkit-details-marker { display: none; }
.result.map > summary:hover { background: #fafafa; }
.result.map > summary h3::before { content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 12px 3px 2px; border-right: 2px solid #363636; border-bottom: 2px solid #363636; transform: rotate(-45deg); transition: transform .15s; }
.result.map[open] > summary h3::before { transform: rotate(45deg); }
.result.map[open] > summary { border-bottom: 1px solid #eee; border-radius: 8px 8px 0 0; }
.result.map figure { max-width: none; margin: 0; padding: 12px 12px 14px; }
.result.map figure a { display: block; }
section.band.white { background: #fff; margin-top: 0; padding-bottom: 8px; }
.result figcaption { text-align: center; }

/* Pipeline stages: two phase boxes (as in the paper's framework figure), step cards joined by arrows */
.flow { width: min(var(--wide), calc(100vw - 40px)); margin: 20px 0 8px 50%; transform: translateX(-50%); }
.phase { position: relative; border: 2px solid #363636; border-radius: 10px; padding: 34px 22px 22px; }
.phase.online { border-color: #2a8a36; }
.phase-label {
  position: absolute; top: -15px; left: 18px; margin: 0; padding: 2px 12px;
  background: #fff; border: 2px solid #363636; border-radius: 6px;
  font-family: "Google Sans", "Noto Sans", var(--sans); font-size: 15px; font-weight: 600; color: #363636;
}
.online .phase-label { border-color: #2a8a36; color: #2a8a36; }
.step {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: center;
  padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.step video { aspect-ratio: 2 / 1; object-fit: cover; background: #fdfdfd; border-radius: 6px; }
.step-no {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  background: #363636; color: #fff; font-size: 14px; font-weight: 600;
}
.online .step-no { background: #2a8a36; }
.step h4 { margin: 10px 0 6px; font-family: "Google Sans", "Noto Sans", var(--sans); font-size: 1.25rem; font-weight: 600; color: #363636; }
.step p { margin: 0; color: #4a4a4a; font-size: 16px; line-height: 1.6; }
.flow-arrow { position: relative; height: 38px; }
.flow-arrow::before { content: ""; position: absolute; left: 50%; top: 4px; bottom: 11px; width: 3px; margin-left: -1.5px; background: #6b6b6b; }
.flow-arrow::after { content: ""; position: absolute; left: 50%; bottom: 2px; margin-left: -8px; border: 8px solid transparent; border-top: 10px solid #6b6b6b; border-bottom: 0; }
.flow-arrow.between { height: 50px; }
.flow-arrow.between::before { background: #363636; width: 3px; margin-left: -1.5px; }
.flow-arrow.between::after { border-top-color: #363636; margin-left: -8px; border-width: 8px; border-top-width: 10px; border-bottom: 0; }
@media (max-width: 720px) {
  .phase { padding: 30px 12px 14px; }
  .step { grid-template-columns: 1fr; gap: 12px; }
}

/* Zoomable image viewer */
figure a { cursor: zoom-in; }
.zoom { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #111; color: #fff; overflow: hidden; }
html:has(dialog.zoom[open]) { overflow: hidden; }
.zoom::backdrop { background: rgba(0, 0, 0, .85); }
.zoom-stage { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; background: #fff; }
.zoom-stage.dragging { cursor: grabbing; }
.zoom-stage img { position: absolute; top: 0; left: 0; height: auto; max-width: none; user-select: none; -webkit-user-drag: none; }
.zoom-bar { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; align-items: center; padding: 6px; border-radius: 10px; background: rgba(30, 30, 30, .85); }
.zoom-bar button, .zoom-bar a { min-width: 36px; height: 36px; padding: 0 10px; border: 0; border-radius: 7px; background: #3a3a3a; color: #fff; font: inherit; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.zoom-bar button:hover, .zoom-bar a:hover { background: #555; }
.zoom-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0; padding: 4px 12px; border-radius: 999px; background: rgba(30, 30, 30, .75); color: #ddd; font-size: 13px; white-space: nowrap; pointer-events: none; }
