:root {
  --ink: #111;
  --mute: #666;
  --line: #d2d2d2;
  --panel: #f3f3f3;
  --accent: #b85a14;
  --peach: #fbe4cb;
  --win: 16 / 9;
}
* { box-sizing: border-box; border-radius: 0; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #fff; font: 16px/1.55 "Helvetica Neue", Helvetica, Arial, sans-serif; }
a { color: var(--ink); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.hero { text-align: center; padding-top: 44px; }
h1, h2, .subtitle { font-family: "Times New Roman", Times, "Nimbus Roman", serif; font-weight: 700; }
h1 { font-size: 52px; line-height: 1.1; margin: 0 0 6px; }
.subtitle { font-size: 26px; line-height: 1.25; margin: 0 auto 18px; max-width: 820px; }
.authors { margin: 0 0 4px; font-size: 18px; }
.affs { display: block; margin-top: 4px; color: var(--mute); font-size: 15px; }
.aff + .aff { margin-left: 22px; }
.links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0 30px; }
.links a, .links span { padding: 7px 16px; border: 1px solid var(--ink); text-decoration: none; font-size: 14px; background: #fff; }
.links a:hover { background: var(--ink); color: #fff; }
.links span { color: #9a9a9a; border-color: #bdbdbd; cursor: default; }

.fig { margin: 0; }
.fig img { display: block; width: 100%; height: auto; }
.fig figcaption { margin-top: 10px; font-size: 14px; color: var(--mute); text-align: left; }

.block { padding-top: 44px; padding-bottom: 8px; }
h2 { font-size: 30px; margin: 0 0 14px; border-bottom: 1px solid var(--ink); padding-bottom: 6px; }
.lead { max-width: 860px; margin: 0 0 18px; }
.abstract { margin: 0; text-align: justify; hyphens: auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 22px; }
.stat { background: var(--panel); padding: 12px 14px; border-top: 3px solid var(--accent); }
.stat b { display: block; font: 700 32px/1.1 "Times New Roman", Times, serif; }
.stat span { font-size: 13px; color: var(--mute); }

.method-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 10px; font-size: 15px; }

.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 18px; }
.thumb { position: relative; padding: 0; border: 2px solid transparent; background: #ddd; cursor: pointer; display: block; overflow: hidden; }
.thumb img { display: block; width: 100%; height: 100px; object-fit: cover; }
.thumb .tag { font-size: 11px; padding: 1px 5px; }
.thumb.on { border-color: var(--accent); }
.thumb:hover { border-color: #888; }
.thumb.on:hover { border-color: var(--accent); }

.tabs { display: flex; border-bottom: 1px solid var(--ink); }
.tab { background: #fff; border: 1px solid transparent; border-bottom: 0; padding: 9px 22px; font: inherit; font-size: 15px; cursor: pointer; color: var(--mute); }
.tab.on { border-color: var(--ink); color: var(--ink); font-weight: 700; margin-bottom: -1px; background: #fff; }
.scene-line { font-size: 13px; color: var(--mute); margin: 8px 0 10px; min-height: 20px; }
.panel { display: none; }
.panel.on { display: block; }

.controls { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-bottom: 10px; font-size: 14px; }
.controls label { display: inline-flex; align-items: center; gap: 6px; }
.controls .grow { flex: 1 1 300px; }
.controls .grow input { flex: 1; }
.check { cursor: pointer; }
select, .btn { font: inherit; font-size: 14px; border: 1px solid var(--ink); background: #fff; color: var(--ink); padding: 5px 10px; }
.btn { cursor: pointer; }
.btn:hover { background: var(--panel); }
.btn.on { background: var(--ink); color: #fff; }
.seg { display: inline-flex; }
.seg .btn + .btn { margin-left: -1px; }
input[type=range] { accent-color: var(--ink); }
.stk-label { font-variant-numeric: tabular-nums; }

.stage { position: relative; width: 100%; aspect-ratio: var(--win); background: #ddd; overflow: hidden; user-select: none; -webkit-user-select: none; }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; }
.stage input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.divider { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.55); pointer-events: none; }
.grip { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; border: 1px solid #000; font-size: 10px; line-height: 1; padding: 8px 6px; letter-spacing: 3px; white-space: nowrap; }

.tag { position: absolute; bottom: 8px; background: rgba(0,0,0,.58); color: #fff; font-size: 13px; line-height: 1.3; padding: 2px 8px; pointer-events: none; }
.tag b { font-weight: 700; }
.tag-l { left: 8px; }
.tag-r { right: 8px; }

.cbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 8px 0 12px; font-size: 12px; color: var(--mute); }
.cbar .bar { width: 220px; height: 10px; border: 1px solid #aaa; }
.thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.thumbs figure { margin: 0; cursor: pointer; border: 2px solid transparent; }
.thumbs figure:hover { border-color: #888; }
.thumbs figure.on { border-color: var(--accent); }
.thumbs img { display: block; width: 100%; aspect-ratio: var(--win); object-fit: contain; background: #ddd; }
.thumbs figcaption { font-size: 12px; line-height: 1.3; padding: 3px 2px; }
.thumbs figcaption b { font-weight: 700; }
.note { font-size: 13px; color: var(--mute); margin: 12px 0 0; max-width: 900px; }

.viewers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.vwr { border: 1px solid var(--line); background: var(--panel); }
.vhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; font-size: 13px; }
.vhead select { font-size: 13px; padding: 3px 6px; max-width: 70%; }
.vcanvas { position: relative; }
.vcanvas canvas { display: block; width: 100%; aspect-ratio: var(--win); background: #f3f3f3; touch-action: none; cursor: grab; }
.vcanvas canvas:active { cursor: grabbing; }
.vmsg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--mute); pointer-events: none; }
.vfoot { padding: 4px 8px 6px; font-size: 12px; color: var(--mute); display: flex; justify-content: space-between; align-items: center; }
.vfoot label { cursor: pointer; }

.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.trio figure { margin: 0; }
.frame { position: relative; aspect-ratio: var(--win); background: #ddd; }
.frame img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.chart { margin-top: 12px; }
.chart svg { display: block; width: 100%; max-width: 560px; height: auto; }
.slices { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.slices figure { margin: 0; cursor: pointer; border: 2px solid transparent; }
.slices figure.on { border-color: var(--accent); }
.slices img { display: block; width: 100%; aspect-ratio: var(--win); object-fit: contain; background: #ddd; }
.slices figcaption { font-size: 12px; padding: 3px 2px; }

.tablewrap { overflow-x: auto; }
table.results { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.results th, .results td { padding: 5px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.results th:first-child, .results td:first-child { text-align: left; }
.results thead th { border-bottom: 1px solid var(--ink); border-top: 1px solid var(--ink); }
.results tr.grp td { text-align: left; font-style: italic; color: var(--mute); background: #fff; border-bottom: 1px solid var(--ink); }
.results tr.ours td { background: var(--peach); }
.results .best { font-weight: 700; }
.results .second { text-decoration: underline; }
.results .sub { color: var(--mute); font-size: 12px; }

.works { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.work { border: 1px solid var(--line); padding: 14px 16px; }
.work h3 { font: 700 18px/1.3 "Times New Roman", Times, "Nimbus Roman", serif; margin: 0 0 4px; }
.work h3 a { text-decoration: none; }
.work h3 a:hover { text-decoration: underline; }
.work p { margin: 0 0 10px; font-size: 15px; }
.work .meta { color: var(--mute); font-size: 14px; margin-bottom: 8px; }
.wlinks { display: flex; gap: 8px; margin: 0; }
.wlinks a { border: 1px solid var(--ink); padding: 4px 12px; text-decoration: none; font-size: 13px; }
.wlinks a:hover { background: var(--ink); color: #fff; }
.results td a { color: inherit; text-decoration: underline dotted; }

.bib { background: var(--panel); padding: 14px 16px; font: 13px/1.5 Menlo, Consolas, monospace; overflow-x: auto; margin: 0; }
.foot { padding-top: 30px; padding-bottom: 50px; color: var(--mute); font-size: 13px; }

@media (max-width: 860px) {
  h1 { font-size: 40px; }
  .subtitle { font-size: 21px; }
  .method-grid { grid-template-columns: 1fr; }
  .picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .viewers { grid-template-columns: 1fr; }
  .trio { grid-template-columns: 1fr; }
}
