:root {
  color-scheme: light;
  --paper: #f7f7f0;
  --ink: #1d2921;
  --muted: #535f53;
  --line: #cbd1c3;
  --green: #48632c;
  --light-green: #dce8ba;
  --dark: #1f3027;
  --sans: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: .22em; }
button, input { font: inherit; }
a, button, input, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #537438; outline-offset: 4px; }
img, video { display: block; max-width: 100%; }
figure, h1, h2, h3, p { margin: 0; }
.shell { width: min(1256px, calc(100% - clamp(40px, 9vw, 144px))); margin-inline: auto; }
section[id] { scroll-margin-top: 85px; }
.skip-link { position: fixed; top: -6rem; left: 1rem; z-index: 20; padding: .65rem 1rem; color: white; background: var(--ink); }
.skip-link:focus { top: 1rem; }

.site-header { position: sticky; top: 0; z-index: 8; border-bottom: 1px solid var(--line); background: var(--paper); }
.nav, .nav-links, .venue, .resources, .gallery-label, .bib-tools, .footer { display: flex; align-items: center; }
.nav { min-height: 65px; justify-content: space-between; gap: 20px; }
.wordmark { white-space: nowrap; color: var(--ink); text-decoration: none; font-size: 1.22rem; font-weight: 700; letter-spacing: -.045em; line-height: 1; }
.nav-links { gap: clamp(14px, 2.7vw, 36px); font-size: .93rem; }
.nav-links a { text-decoration: none; }
.nav-links a:hover, .authors a:hover { text-decoration: underline; }
.nav-paper { padding: .41rem 1.18rem; border-radius: 3px; color: var(--paper); background: var(--ink); font-weight: 600; }
.nav-paper:hover { background: var(--green); }

.masthead { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(235px, .66fr); align-items: end; gap: clamp(20px, 5vw, 85px); padding: clamp(35px, 4.4vw, 68px) 0 clamp(30px, 3.35vw, 51px); }
.venue, .kicker, .gallery-label, .bib-tools > span {
  font-family: var(--mono); font-size: .81rem; line-height: 1.35; font-weight: 500;
}
.venue { flex-wrap: wrap; gap: 9px; color: var(--muted); }
.venue > span:first-child { color: var(--green); font-weight: 700; }
.journal-short { display: none; text-decoration: none; }
.venue i { height: .8em; border-left: 1px solid #a9b3a3; }
h1 { margin: 15px 0 10px -0.055em; font-size: clamp(4.1rem, 8.4vw, 7.8rem); line-height: .88; font-weight: 550; letter-spacing: -.052em; }
.paper-title { font-size: clamp(1.25rem, 2.22vw, 2.05rem); line-height: 1.17; letter-spacing: -.05em; }
.intro-demo { margin-bottom: clamp(32px, 4.5vw, 64px); scroll-margin-top: 85px; }
.resources { flex-wrap: wrap; gap: 17px; font-size: .93rem; font-weight: 600; }
.resources a, .quiet-link, .footer a { text-decoration-thickness: 1px; text-decoration-color: #7f9075; }
.resources a:hover, .quiet-link:hover, .footer a:hover { color: var(--green); text-decoration-thickness: 2px; }
figcaption { margin-top: 11px; font-size: .91rem; line-height: 1.5; color: var(--muted); }
.section-line { border-top: 1px solid var(--line); }
.method, .citation, .application-band { padding-block: clamp(44px, 6.3vw, 92px); }
.citation { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.55fr); gap: clamp(30px, 6vw, 88px); align-items: center; }
.kicker { color: var(--green); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .85rem; }
.section-title { font-size: clamp(2.15rem, 4.1vw, 3.95rem); line-height: 1.02; letter-spacing: -.065em; font-weight: 550; text-wrap: balance; }
.citation > div > p:not(.kicker) { margin-block: 1.05rem; color: var(--muted); }
.quiet-link { font-weight: 600; font-size: .92rem; }
.gallery-label { justify-content: space-between; gap: 12px; }
.compare-stage { overflow: hidden; --split: 50%; position: relative; isolation: isolate; aspect-ratio: 736 / 414; border-radius: 3px; background: #d4ddd2; }
.compare-stage img { width: 100%; height: auto; border-radius: inherit; }
.compare-before, .split-line, .compare-stage input[type="range"] { position: absolute; inset: 0; }
.compare-before { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.split-line { z-index: 1; left: clamp(1px, var(--split), calc(100% - 1px)); right: auto; width: 2px; transform: translateX(-50%); background: white; box-shadow: 0 0 3px #52604f; pointer-events: none; }
.split-handle { position: absolute; top: 50%; left: 50%; display: flex; justify-content: center; align-items: center; gap: 4px; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 5px #15201955; }
.split-handle::before, .split-handle::after { content: ""; width: 6px; height: 6px; border-top: 2px solid var(--ink); border-right: 2px solid var(--ink); }
.split-handle::before { transform: rotate(-135deg); }
.split-handle::after { transform: rotate(45deg); }
.compare-stage input[type="range"] { z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare-stage:focus-within { outline: 3px solid var(--green); outline-offset: 4px; }

.application-band { color: #f1f4e9; background: var(--dark); }
.section-intro { display: grid; grid-template-columns: 1.1fr minmax(0, .9fr); align-items: end; gap: clamp(25px, 6vw, 90px); margin-bottom: clamp(22px, 3vw, 42px); }
.section-intro > p { color: var(--muted); max-width: 52ch; }
.gallery-label { margin: 0 0 8px; font-size: .875rem; color: #edf3e7; }
.gallery-label span, .gallery-label a { color: #cad5c5; font-family: var(--sans); font-size: .875rem; }
.frame-strip, .panorama-map, .panorama-viewport { background: #384339; border-radius: 2px; }
.frame-strip, .panorama-map img { display: block; width: 100%; height: auto; }
.frame-strip, .panorama-map { margin-bottom: 20px; }
.shenzhen-input-sequence { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; margin: 0 0 20px; padding: 0; list-style: none; }
.shenzhen-input-sequence img { width: 100%; height: auto; border-radius: 2px; }
@media (max-width: 680px) {
  .shenzhen-input-sequence { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.panorama-map { position: relative; min-width: 0; overflow: hidden; cursor: crosshair; touch-action: pan-y; user-select: none; }
.panorama-window { position: absolute; inset-block: 0; left: var(--window-left, 0%); width: var(--window-width, 35%); pointer-events: none; border: 2px solid #e7f7b6; background: rgb(211 234 168 / .05); box-shadow: 0 0 0 100vw rgb(10 17 13 / .35); }
.panorama-viewport { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #a6b59d #324136; cursor: grab; }
.panorama-viewport[data-dragging] { cursor: grabbing; }
.panorama-viewport img { width: var(--detail-width, 2981px); max-width: none; height: auto; user-select: none; -webkit-user-drag: none; }
.pan-control { display: grid; grid-template-columns: auto 1fr 4ch; gap: 15px; align-items: center; margin-bottom: 8px; color: #e0e7db; font-size: .92rem; }
.pan-control input[type="range"] { width: 100%; min-width: 0; height: 32px; margin: 0; touch-action: pan-y; accent-color: #c3dca0; cursor: ew-resize; }
.application-band :focus-visible { outline-color: #e7f7b6; }

.application-band #results { scroll-margin-top: 85px; }
.application-picker { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px clamp(4px, 1vw, 14px); min-inline-size: 0; margin: clamp(20px, 2.8vw, 38px) 0 0; padding: 0; border: 0; }
.application-picker > legend, .application-picker > input, .panorama-picker > legend, .panorama-picker > input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0; }
.application-picker > label { display: flex; align-items: center; min-height: 48px; padding: 8px clamp(7px, 1.2vw, 18px); border-top: 2px solid #6c7c6f; color: #d5dfd2; font-size: clamp(.92rem, 1.6vw, 1.35rem); font-weight: 550; line-height: 1.2; letter-spacing: -.025em; cursor: pointer; }
.application-picker > label:hover { background: #2c4033; }
.application-picker > input:checked + label { border-color: var(--light-green); color: white; background: #344b3a; }
.application-picker > input:focus-visible + label { outline: 3px solid #e7f7b6; outline-offset: 1px; }
.application-panel { display: none; order: 1; grid-column: 1 / -1; min-width: 0; }
.application-picker > input:checked + label + .application-panel { display: block; }
.panorama-picker { position: relative; display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); gap: 0 6px; min-inline-size: 0; margin: clamp(14px, 1.8vw, 26px) 0 0; padding: 0; border: 0; }
.panorama-picker > label { display: flex; align-items: baseline; flex-wrap: wrap; align-content: center; gap: 2px 9px; min-height: 44px; padding: 6px 13px; border: 1px solid #6c7c6f; border-radius: 4px; color: #d5dfd2; font-size: .94rem; line-height: 1.3; cursor: pointer; }
.panorama-picker > label span { font: .78rem/1.3 var(--mono); }
.panorama-picker > label:hover { background: #2c4033; }
.panorama-picker > input:checked + label { border-color: var(--light-green); color: var(--ink); background: var(--light-green); }
.panorama-picker > input:focus-visible + label { outline: 3px solid #e7f7b6; outline-offset: 2px; }
.panorama-scene { display: none; order: 1; grid-column: 1 / -1; min-width: 0; }
.panorama-picker > input:checked + label + .panorama-scene { display: block; }
#gallery-shenzhen { --detail-width: clamp(2400px, 265vw, 3500px); }
.application-caption { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 20px; margin: clamp(14px, 1.9vw, 27px) 0; color: #d1d9cb; }
.application-caption p { max-width: 80ch; }
.application-caption a { font-size: .85rem; white-space: nowrap; }
.application-media { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr); gap: clamp(12px, 2vw, 28px); align-items: start; }
.application-inputs { display: grid; gap: clamp(10px, 1.3vw, 20px); }
.application-image { position: relative; display: block; cursor: zoom-in; }
.application-image img { width: 100%; height: auto; border-radius: 2px; }
#panel-outpainting .application-media { grid-template-columns: minmax(0, 1fr) minmax(0, 3.5625fr); }
.with-footprint::after { content: ""; position: absolute; inset-block: 0; left: 25.1462%; width: 28.0702%; box-sizing: border-box; border: 2px dashed white; box-shadow: 0 0 0 1px #1f302780; pointer-events: none; }

@media (max-width: 680px) {
  .application-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panorama-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panorama-picker > label { display: grid; justify-items: start; gap: 2px; padding-inline: 9px; }
  .application-media, #panel-outpainting .application-media { grid-template-columns: minmax(0, 1fr); }
  .application-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #panel-outpainting .application-inputs { grid-template-columns: minmax(0, 1fr); width: min(50%, 230px); }
  .with-footprint::after { border-width: 1.5px; }
}
.pan-control output { font-family: var(--mono); text-align: right; }
video { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; border-radius: 3px; background: #101510; }
.method .section-intro { align-items: start; }
.prior-walkthrough, .challenge-overview, .method-chapter { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(0, 1.8fr); column-gap: clamp(24px, 4vw, 56px); align-items: start; }
.prior-walkthrough { margin-bottom: clamp(24px, 3vw, 44px); }
.prior-notes { display: grid; gap: clamp(20px, 2.7vw, 38px); }
.prior-notes section { border-top: 2px solid var(--line); padding-top: 12px; }
.prior-notes section[data-current] { border-color: var(--green); }
.prior-notes h3 { font-size: clamp(1.4rem, 2.35vw, 2rem); font-weight: 550; letter-spacing: -.045em; line-height: 1.1; }
.prior-notes p { margin: 8px 0 0; color: var(--muted); }
.prior-notes .quiet-link { display: inline-block; margin-top: 10px; }
.prior-player { position: relative; min-width: 0; }
.prior-anchor { position: absolute; top: 0; left: 0; scroll-margin-top: 82px; }
.prior-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 3px; background: black; }
.prior-stage video { position: absolute; inset: 0; height: 100%; border-radius: 0; background: black; }
.prior-compare-hint { position: absolute; inset-inline: 0; bottom: 1%; color: #eee; text-align: center; font-size: clamp(.625rem, 1vw, .83rem); line-height: 1.15; pointer-events: none; }
.prior-player [hidden] { display: none; }
/* Register the comparison to the panorama inside the video's final 1280 × 720 frame. */
.prior-stage .generative-compare { --split: 100%; position: absolute; left: 1.171875%; top: 8.472222%; width: 97.65625%; height: 83.055556%; border-radius: 0; background: black; overflow: clip; }
.generative-compare img { display: block; border-radius: 0; }
.generative-compare .split-line { width: 3px; }
.generative-compare .split-handle { z-index: 1; left: clamp(16px, var(--split), calc(100% - 16px)); width: 30px; height: 30px; background: white; pointer-events: none; }
.generative-compare [hidden] { display: none; }
.generative-compare input { touch-action: pan-y; }
.projection-mark { position: absolute; width: 6.3294%; height: 13.2239%; border: 2px solid white; border-radius: 14%; box-shadow: 0 0 0 1px #17201999; pointer-events: none; }
.tower-mark { left: 46.0792%; top: 17.466%; }
.sail-mark { left: 41.785%; top: 33.9724%; }
.pole-mark { left: 24.8997%; top: 77.3699%; }
.projection-mark > span { position: absolute; left: calc(100% + 4px); top: 50%; transform: translateY(-50%); padding: 2px 5px; border-radius: 2px; background: #18231ee8; color: white; font-size: clamp(.625rem, .9vw, .78rem); line-height: 1.2; font-weight: 600; white-space: nowrap; }
.prior-transport { display: flex; align-items: stretch; gap: 7px; margin-top: 7px; }
.prior-transport button, .challenge-steps button { min-height: 44px; padding: 5px 6px; font: 600 clamp(.78rem, 1.2vw, .93rem)/1.2 var(--sans); cursor: pointer; }
#prior-play { flex: 0 0 74px; border: 0; border-radius: 3px; background: var(--dark); color: #fff; }
#prior-play:hover { background: var(--green); }
.prior-chapters { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.prior-chapters button, .challenge-steps button { border: 0; border-top: 2px solid var(--line); background: transparent; color: var(--muted); }
.prior-chapters button:hover, .challenge-steps button:hover { background: #eaf0e1; }
.prior-chapters button[aria-current="step"], .challenge-steps button[aria-current="step"] { color: var(--ink); border-top-color: var(--green); background: #e4ebd8; }
.prior-chapters button[aria-current="step"] { position: relative; border-top-color: var(--line); }
.prior-chapters button[aria-current="step"]::before { content: ""; position: absolute; inset: -2px 0 auto; height: 3px; background: var(--green); transform: scaleX(var(--chapter-progress, 0)); transform-origin: left; }
.prior-fallback { margin-top: 8px; color: var(--muted); font-size: .9rem; }
.challenge-overview { margin-top: clamp(42px, 6vw, 86px); padding-top: clamp(24px, 3.3vw, 48px); border-top: 1px solid var(--line); scroll-margin-top: 84px; }
.challenge-overview .section-title { font-size: clamp(2.15rem, 3.3vw, 3.15rem); }
.challenge-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.challenge-links a { padding: 10px clamp(10px, 1.5vw, 22px) 12px; border-top: 2px solid var(--line); color: var(--ink); font-size: clamp(1.4rem, 2.35vw, 2rem); line-height: 1.1; font-weight: 550; letter-spacing: -.045em; text-decoration: none; }
.challenge-links a span { display: block; margin-top: 5px; color: var(--muted); font-size: clamp(.83rem, 1.2vw, 1rem); line-height: 1.35; letter-spacing: normal; font-weight: 400; }
.challenge-links a:hover { background: #eaf0e1; }
.challenge-links a[aria-selected="true"] { border-color: var(--green); background: #e4ebd8; }
.method-chapter { margin-block: clamp(22px, 3vw, 42px) clamp(36px, 4vw, 58px); scroll-margin-top: 84px; }
.challenge-step { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: start; }
.challenge-step [id] { scroll-margin-top: 84px; }
.challenge-step + .challenge-step { margin-top: 32px; }
.step-copy { border-top: 2px solid var(--green); padding-top: 12px; }
.step-copy h4 { margin: 0; font-size: clamp(1.4rem, 2.35vw, 2rem); font-weight: 550; letter-spacing: -.045em; line-height: 1.1; text-wrap: balance; }
.step-copy p { margin-top: 8px; color: var(--muted); }
.method-chapter figure, .window-study { min-width: 0; }
.method-chapter img, .training-example figure img { display: block; width: 100%; height: auto; border-radius: 2px; }
.method-chapter figcaption, .training-example figcaption { margin-top: 6px; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.challenge-media { display: grid; align-items: center; width: 100%; min-width: 0; aspect-ratio: 16 / 9; padding: clamp(12px, 2.3vw, 32px); border-radius: 3px; background: var(--dark); color: var(--paper); container-type: inline-size; }
.challenge-media figcaption { color: #e0e7db; }
.result-viewer { min-inline-size: 0; margin: 18px 0 0; padding: 0; border: 0; }
.result-viewer legend { padding: 0; font-size: .92rem; font-weight: 650; }
.result-picker { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto; gap: 7px 3px; margin-top: 7px; }
.result-picker input { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); }
.result-picker label { grid-row: 2; display: grid; place-items: center; min-height: 44px; padding: 4px 2px; border-top: 2px solid var(--line); color: var(--muted); font-size: clamp(.78rem, 1.05vw, .875rem); font-weight: 550; text-align: center; line-height: 1.15; cursor: pointer; }
.result-picker label:hover { background: #edf1e6; }
.result-picker input:checked + label { border-color: var(--green); background: #e4ebd8; color: var(--ink); }
.result-picker input:focus-visible + label { outline: 3px solid var(--green); outline-offset: 1px; }
.scene-result { display: none; grid-area: 1 / 1 / 2 / -1; grid-template-columns: subgrid; height: clamp(126px, 11vw, 162px); }
.result-picker input:checked + label + .scene-result { display: grid; }
.scene-locator { grid-column: span 2; min-width: 0; min-height: 0; background: #e6e9df; }
.scene-image { display: block; width: 100%; height: 100%; }
/* Each rectangle uses the pixel coordinates of its original full frame. */
.crop-box { fill: none; stroke: white; stroke-width: 2px; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 1px #263628); }
.scene-result .result-detail { grid-column: 3; width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #e6e9df; }

.fidelity-media { --wire: #9cae9c; --stem: clamp(11px, 2.5cqw, 23px); text-align: center; }
.rgb-inputs { display: grid; align-items: start; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(4px, 1.5cqw, 12px); }
.rgb-inputs img { aspect-ratio: 240 / 115; object-fit: contain; }
.rgb-inputs figcaption { font-size: clamp(.82rem, 2.4cqw, 1.2rem); line-height: 1.24; font-weight: 550; }
.merge-path { position: relative; width: 67%; height: var(--stem); margin: 10px auto 0; border-inline: 1px solid var(--wire); border-bottom: 1px solid var(--wire); }
.merge-path::before, .denoiser::before { content: ""; position: absolute; left: 50%; height: var(--stem); border-left: 1px solid var(--wire); }
.merge-path::before { bottom: 0; }
.denoiser { position: relative; display: grid; gap: 4px; justify-self: center; width: fit-content; margin: var(--stem) auto 0; padding: clamp(9px, 2cqw, 17px) clamp(12px, 4cqw, 38px); border: 1px solid var(--wire); border-radius: 3px; }
.denoiser::before { bottom: 100%; }
.denoiser strong { color: #e0edbe; font-size: clamp(1.1rem, 3.6cqw, 1.85rem); line-height: 1.1; }
.denoiser span, .patch-projection figcaption { font-size: clamp(.78rem, 1.9cqw, 1rem); }

.patch-projection { --source-axis: #ffcd7c; --target-axis: #89ddf2; }
.projection-headings { display: grid; grid-template-columns: 3.8889fr 37.0833fr 14.8494fr 40.5348fr 3.6436fr; margin-bottom: 5px; }
.projection-headings span:first-child { grid-column: 2; }
.projection-headings span:last-child { grid-column: 4; }
.projection-headings span { font-size: clamp(.85rem, 2.6cqw, 1.3rem); font-weight: 550; }
.projection-film { position: relative; }
.projection-film video { width: 100%; height: auto; aspect-ratio: 1440 / 400; border-radius: 0; background: var(--dark); }
/* The origins and frame extents match the two image planes in the 1440 × 400 film. */
.image-axes { position: absolute; top: 13.5%; color: var(--source-axis); pointer-events: none; text-shadow: 0 1px 2px #152018; }
.image-axes[data-view="source"] { left: 3.8889%; width: 37.0833%; height: 75.149%; }
.image-axes[data-view="target"] { left: 55.8216%; width: 40.5348%; height: 69.8445%; color: var(--target-axis); }
.axis-origin, .image-axes i { position: absolute; font: 600 clamp(.68rem, 1.75cqw, .95rem)/1 var(--mono); white-space: nowrap; }
.axis-origin { bottom: 100%; left: 0; margin-bottom: 4px; }
.image-axes::after { content: ""; position: absolute; top: 0; left: 0; width: 5px; height: 5px; border-radius: 50%; background: currentColor; transform: translate(-50%, -50%); }
.axis-u, .axis-v { position: absolute; top: 0; left: 0; filter: drop-shadow(0 1px 1px #14251e); }
.axis-u { width: 45%; border-top: 2px solid currentColor; }
.axis-v { height: 45%; border-left: 2px solid currentColor; }
.axis-u::after, .axis-v::after { content: ""; position: absolute; width: 5px; height: 5px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; }
.axis-u::after { right: 0; top: -1px; transform: translateY(-50%) rotate(45deg); }
.axis-v::after { left: -1px; bottom: 0; transform: translateX(-50%) rotate(135deg); }
.axis-u i { bottom: 4px; right: -3px; }
.axis-v i { right: 4px; bottom: -3px; }
.projection-transfer { position: absolute; top: 27%; left: 41.3%; width: 14%; display: grid; gap: 1px; justify-items: center; font-size: clamp(.68rem, 1.85cqw, 1rem); line-height: 1.1; pointer-events: none; text-shadow: 0 1px 3px var(--dark); }
.projection-transfer span:last-child { font-size: 1.65em; line-height: 1; }
.patch-projection figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px clamp(12px, 4cqw, 32px); margin-top: clamp(6px, 1.3cqw, 12px); }
.position-key b span:first-child { color: var(--source-axis); }
.position-key b span:last-child { color: var(--target-axis); }
.projection-play { margin-top: clamp(10px, 2.2cqw, 18px); min-height: 36px; padding: 5px 13px; border: 1px solid var(--wire); border-radius: 3px; color: var(--paper); background: transparent; font-weight: 550; cursor: pointer; }
.projection-play:hover, .projection-play:focus-visible { color: var(--ink); background: var(--light-green); }

@container (max-width: 540px) {
  .patch-projection .axis-u { width: 65%; }
  .projection-headings { margin-bottom: 9px; }
  .projection-transfer { position: static; }
  .projection-transfer span { position: absolute; left: 48.5%; transform: translateX(-50%); }
  .projection-transfer span:first-child { top: 100%; white-space: nowrap; }
  .projection-transfer span:last-child { top: 50%; padding-inline: 2px; background: #1f3027dc; border-radius: 2px; }
  .patch-projection figcaption { margin-top: 22px; }
}
.feature-key, .position-key { display: flex; justify-content: center; align-items: center; gap: .5em; }
.feature-key img { width: clamp(18px, 4.5cqw, 36px); height: auto; image-rendering: pixelated; }
.position-key b { font: 600 clamp(.83rem, 2cqw, 1.1rem)/1.3 var(--mono); color: #e0edbe; white-space: nowrap; }

.hpr-projection { width: min(100%, 690px); margin-inline: auto; }
.hpr-film { position: relative; }
.hpr-film video { aspect-ratio: 1440 / 760; }
.hpr-film[data-compact] video { aspect-ratio: 840 / 620; }
/* Match the three image planes in each film, including their top-left origins. */
.hpr-film [data-plane="source"] { left: 3.0556%; top: 27.6316%; width: 41.9444%; height: 44.7368%; }
.hpr-film [data-plane="dense"] { left: 54.1667%; top: 6.3158%; width: 42.3611%; height: 38.4211%; }
.hpr-film [data-plane="median"] { left: 54.1667%; top: 55.2632%; width: 42.3611%; height: 38.4211%; }
.hpr-film[data-compact] [data-plane="source"] { left: 25.0000%; top: 10.3226%; width: 50.0000%; height: 38.0645%; }
.hpr-film[data-compact] [data-plane="dense"] { left: 1.4286%; top: 65.6452%; width: 46.6667%; height: 30.3226%; }
.hpr-film[data-compact] [data-plane="median"] { left: 51.9048%; top: 65.6452%; width: 46.6667%; height: 30.3226%; }
.hpr-frame { --frame-axis: #ffcd7c; position: absolute; pointer-events: none; }
.hpr-frame[data-plane="dense"] { --frame-axis: #89ddf2; }
.hpr-label { position: absolute; bottom: calc(100% + 3px); left: 0; width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 0 5px; color: var(--paper); text-align: left; line-height: 1.15; }
.hpr-label strong { font-weight: 550; font-size: clamp(.8rem, 2.25cqw, 1.13rem); }
.hpr-readout { color: var(--frame-axis); font: 600 clamp(.7rem, 1.75cqw, .9rem)/1.15 var(--mono); white-space: nowrap; }
.hpr-frame .image-axes { inset: 0; color: var(--frame-axis); }
.hpr-frame .axis-origin { inset: 4px auto auto 5px; margin: 0; }
.hpr-frame .axis-u { width: 50%; }
.hpr-frame .axis-v { height: 50%; }
.hpr-frame .axis-u i { inset: 3px 0 auto auto; }
.hpr-frame .axis-v i { inset: auto auto 0 4px; }
.hpr-frame .axis-origin, .hpr-frame .image-axes i { padding: 1px 3px; border-radius: 2px; background: rgb(18 36 30 / .86); font-size: clamp(.63rem, 1.7cqw, .88rem); }
.hpr-frame .image-axes sub { font-size: .72em; }
.hpr-label strong, .hpr-readout { border-radius: 1px; background: var(--dark); box-shadow: 0 0 0 2px var(--dark); }
.hpr-film[data-compact] .hpr-frame:not([data-plane="source"]) .hpr-label { align-items: flex-start; flex-direction: column; }
.hpr-fork { position: absolute; inset: 0; display: none; width: 100%; height: 100%; pointer-events: none; color: #c7d1c3; }
.hpr-film[data-at-rest]:not([data-compact]) .hpr-fork-wide, .hpr-film[data-at-rest][data-compact] .hpr-fork-compact { display: block; }
.hpr-fork path { fill: none; stroke: currentColor; stroke-width: 1.5px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.hpr-fork .to-dense { color: #89ddf2; }
.hpr-fork .to-median { color: #ffcd7c; }
.hpr-transport { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px 18px; }
.hpr-transport .projection-play { margin: 0; }

.hpr-stages { position: relative; display: grid; align-self: stretch; grid-template-rows: auto 1fr; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 634px); min-width: 0; margin: 0 auto; padding: 0; border: 0; }
.hpr-stages > legend, .hpr-stages > input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hpr-stages > label { display: grid; align-items: center; min-height: 36px; border-bottom: 1px solid #617267; color: #bac6b8; font-size: clamp(.82rem, 2cqw, 1rem); font-weight: 550; cursor: pointer; }
.hpr-stages > label:hover { color: white; background: #293c30; }
.hpr-stages > input:checked + label { border-bottom: 2px solid #dce8ba; color: #e6efcf; background: #2e4133; }
.hpr-stages > input:focus-visible + label { outline: 2px solid #dce8ba; outline-offset: 2px; }
.hpr-stage-body { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr); align-items: center; padding-top: clamp(10px, 1.6cqw, 14px); }
/* Both panels reserve space so the controls stay put when the view changes. */
.hpr-stage-body > figure { grid-area: 1 / 1; }
#hpr-stage-projection:checked ~ .hpr-stage-body #hpr-attention,
#hpr-stage-attention:checked ~ .hpr-stage-body #hpr-projection { visibility: hidden; }
.hpr-attention-copy { display: none; }
#method-hierarchical:has(#hpr-stage-attention:checked) .hpr-project-copy { display: none; }
#method-hierarchical:has(#hpr-stage-attention:checked) .hpr-attention-copy { display: block; }

.head-diagram { width: min(100%, 560px); margin-inline: auto; line-height: 1.25; }
.head-inputs { display: flex; justify-content: center; align-items: center; gap: clamp(9px, 3cqw, 24px); }
.head-input { display: grid; justify-items: center; gap: 5px; font-size: clamp(.73rem, 1.85cqw, .94rem); }
.head-plus { color: #aebcaa; font-size: 1.2rem; }
.head-tokens, .head-coordinate { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.head-tokens img, .head-tokens .noise-token, .head-coordinate img { width: clamp(19px, 4cqw, 29px); height: auto; aspect-ratio: 1; border-radius: 2px; image-rendering: pixelated; }
.head-tokens i { font-style: normal; }
.noise-token { background: url("assets/method-figures/target-noise.webp") left center / 400% auto; }
.noise-token + .noise-token { background-position: 77% center; }
.head-flow, .head-merge { position: relative; margin-inline: auto; }
.head-flow { width: 1px; height: clamp(10px, 2.6cqw, 21px); background: var(--wire); }
.head-layer { padding: clamp(9px, 1.75cqw, 14px); border: 1px solid #849486; border-radius: 3px; }
.head-layer-title { display: block; color: var(--paper); font-size: clamp(1rem, 2.55cqw, 1.4rem); font-weight: 600; }
.head-layer p { margin: 3px auto clamp(9px, 1.8cqw, 15px); color: #cfdbcd; font-size: clamp(.73rem, 1.8cqw, .91rem); }
.head-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(6px, 1.8cqw, 14px); }
.head-group { display: grid; justify-items: center; align-content: start; row-gap: 4px; padding: clamp(7px, 1.5cqw, 13px) 3px; border-top: 2px solid var(--head-color); background: #293c31; }
.dense-heads { --head-color: #89ddf2; }
.median-heads { --head-color: #ffcd7c; }
.head-group > span:first-child { color: #d1decf; font-size: clamp(.7rem, 1.65cqw, .83rem); }
.head-group > strong { color: var(--head-color); font-size: clamp(.8rem, 2.15cqw, 1.1rem); font-weight: 600; }
.head-coordinate { margin-top: 4px; gap: 6px; }
.head-coordinate code { font: 550 clamp(.65rem, 1.65cqw, .88rem)/1.2 var(--mono); white-space: nowrap; }
.head-merge { width: 49%; height: clamp(6px, 1.4cqw, 12px); border: 1px solid var(--wire); border-top: 0; }
.head-merge::after { content: ""; position: absolute; top: 100%; left: 50%; height: 8px; border-left: 1px solid var(--wire); }
.head-output { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 8px; margin-top: 9px; color: #cfdbcd; font-size: clamp(.73rem, 1.85cqw, .96rem); }
.head-output strong { color: #e0edbe; font-weight: 600; }
@container (max-width: 420px) {
  .head-output { flex-direction: column; }
  .head-output [aria-hidden] { display: none; }
}

.challenge-steps { grid-area: 2 / 2; align-self: start; z-index: 1; display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 3px; margin-top: 7px; }
[data-challenge-tabs] .method-chapter { grid-template-rows: auto 1fr; }
[data-challenge-tabs] .challenge-step { grid-row: 1 / 3; grid-template-rows: subgrid; margin: 0; }
[data-challenge-tabs] .step-copy { grid-area: 1 / 1 / 3 / 2; }
[data-challenge-tabs] .challenge-media { grid-area: 1 / 2; }
.method-chapter[hidden], .challenge-step[hidden], .challenge-steps[hidden] { display: none; }
/* Fragment links keep both chapters readable when JavaScript is unavailable. */
@supports selector(:has(*)) {
  #method:not([data-challenge-tabs]):not(:has(#method-windows:target, #method-windows :target)) #method-windows,
  #method:not([data-challenge-tabs]):has(#method-windows:target, #method-windows :target) #method-fidelity { display: none; }
  #method:not([data-challenge-tabs]):not(:has(#method-windows:target, #method-windows :target)) #tab-fidelity,
  #method:not([data-challenge-tabs]):has(#method-windows:target, #method-windows :target) #tab-scale { border-color: var(--green); background: #e4ebd8; }
}
.training-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#method-spatial .challenge-media { aspect-ratio: auto; }
.window-study { --window: #89ddf2; --memory: #ffcd7c; width: min(100%, 790px); margin-inline: auto; }
.spatial-process { display: grid; grid-template-columns: minmax(0, 2.45fr) minmax(0, .62fr) minmax(0, .38fr) minmax(0, 1.22fr); align-items: center; }
.spatial-routing { display: grid; grid-template-columns: minmax(0, 1fr) 19%; align-items: stretch; }
.spatial-feeds { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); }
.spatial-feed { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-height: clamp(30px, 6.2cqw, 50px); padding-right: 4px; font-size: clamp(.76rem, 2.15cqw, 1.05rem); line-height: 1.15; }
.feed-samples { display: flex; align-items: center; gap: clamp(2px, .65cqw, 5px); }
.feed-samples i { display: block; width: clamp(14px, 4.1cqw, 31px); aspect-ratio: 1; border: 1px solid #b1b7ad; border-radius: 2px; background-image: url("assets/method-figures/spatial-tokens.webp"); background-origin: border-box; background-size: 300% 500%; background-position: 0 var(--sample-row); }
.feed-samples i:nth-child(2) { background-position-x: 50%; }
.feed-samples i:nth-child(3) { background-position-x: 100%; }
.input-feed { --sample-row: 0%; }
.noise-feed { --sample-row: 75%; }
.memory-feed { --sample-row: 50%; color: var(--memory); }
.memory-feed .feed-samples i { border-color: var(--memory); }
.window-study:not([data-phase="center"]) .input-feed { --sample-row: 25%; }
.window-study:not([data-phase="center"]) .noise-feed { --sample-row: 100%; }
.spatial-arrows { align-self: stretch; width: 100%; height: 100%; color: #cfdbcd; }
.spatial-arrows path { fill: none; stroke: currentColor; stroke-width: 1.3; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spatial-dit { display: grid; place-items: center; width: 100%; aspect-ratio: 1.4; border: 1px solid #b1bfae; border-radius: 3px; color: var(--paper); font-size: clamp(1.05rem, 3.9cqw, 1.85rem); font-weight: 550; }
.spatial-output-arrow { position: relative; height: 1px; margin: 0 4px; background: #cfdbcd; }
.spatial-output-arrow::after { content: ""; position: absolute; right: 1px; top: 50%; width: 6px; height: 6px; border-top: 1.5px solid #cfdbcd; border-right: 1.5px solid #cfdbcd; transform: translateY(-50%) rotate(45deg); }
.spatial-current { position: relative; }
.window-study figcaption { margin: 0 0 5px; color: var(--paper); font-size: clamp(.78rem, 2.1cqw, 1.05rem); line-height: 1.2; }
.spatial-current figcaption { position: absolute; bottom: 100%; width: 100%; }
#spatial-current, #spatial-canvas { display: block; width: 100%; height: auto; }
#spatial-current { border: 1.5px solid var(--window); aspect-ratio: 1; }
.spatial-panorama { position: relative; margin-top: clamp(14px, 3cqw, 25px); padding-bottom: 1.5em; }
#spatial-canvas { aspect-ratio: 8621 / 1009; }
#spatial-active-box, #spatial-prior-box, #spatial-overlap-box { fill: none; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
#spatial-active-box { stroke: var(--window); }
#spatial-prior-box { stroke: #e1e5d8; }
#spatial-overlap-box { stroke: var(--memory); fill: #ffcd7c36; }
.spatial-overlap-label { position: absolute; left: 54.3788%; bottom: 0; transform: translateX(-50%); color: var(--memory); font: 550 clamp(.72rem, 1.9cqw, .94rem)/1.35 var(--sans); white-space: nowrap; }
.window-study[data-shifting] :is(.memory-feed, #spatial-overlap-box, .spatial-overlap-label),
.window-study[data-phase="center"] :is(.adjacent-window, .memory-feed),
.window-study:not([data-phase="overlap"]) :is(#spatial-prior-box, #spatial-overlap-box, .spatial-overlap-label),
.window-study[data-phase="outward"] #spatial-active-box { visibility: hidden; }
.spatial-transport { display: flex; align-items: stretch; margin-top: clamp(9px, 1.6cqw, 14px); gap: 5px; }
.spatial-transport[hidden] { display: none; }
.spatial-transport .projection-play { margin: 0; min-width: 105px; border: 1px solid #9cae9c; }
#spatial-steps { display: grid; flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
#spatial-steps button { min-height: 38px; padding: 4px; border: 0; border-bottom: 1px solid #647567; background: transparent; color: #c7d4c6; font-size: clamp(.75rem, 1.9cqw, .92rem); font-weight: 550; line-height: 1.15; cursor: pointer; }
#spatial-steps button:hover, #spatial-steps button[aria-current="step"] { background: #2e4133; color: #e6efcf; }
#spatial-steps button[aria-current="step"] { border-bottom: 2px solid #dce8ba; }
.spatial-transport button:focus-visible { outline-color: #dce8ba; }
@container (max-width: 525px) {
  .spatial-process { grid-template-columns: minmax(0, 1.9fr) minmax(0, .59fr) minmax(0, .28fr) minmax(0, 1.23fr); }
  .spatial-feed { flex-direction: column; align-items: flex-start; justify-content: center; min-height: 43px; gap: 3px; }
  .spatial-feed, .window-study figcaption { font-size: .76rem; }
  .feed-samples i { width: clamp(13px, 4cqw, 18px); }
  .spatial-output-arrow { margin-inline: 2px; }
  .spatial-transport .projection-play { min-width: 0; padding-inline: 5px; flex: 0 0 23%; font-size: .78rem; line-height: 1.1; }
  .spatial-transport button { min-height: 42px; }
}

#method-relative .relative-media { aspect-ratio: auto; }
/* A full-width overview keeps the street visible at its 8.5:1 aspect ratio. */
#method-relative .scene-result { grid-template: 64px 150px / minmax(0, 1fr); row-gap: 5px; height: auto; }
#method-relative .scene-locator { grid-area: 1 / 1; display: flex; align-items: flex-end; justify-content: center; background: transparent; }
#method-relative .scene-image { height: auto; max-height: 100%; }
.detail-zoom { display: block; grid-area: 2 / 1; justify-self: center; height: 100%; aspect-ratio: 909 / 791; max-width: 100%; cursor: zoom-in; }
.detail-zoom:focus-visible { outline-offset: -3px; }
#method-relative .result-detail { background: transparent; }
.relative-study { --window: #89ddf2; width: min(100%, 730px); margin-inline: auto; }
.relative-context figcaption { margin: 0 0 5px; color: var(--window); font-size: clamp(.76rem, 1.9cqw, .98rem); text-align: right; }
.relative-context svg { display: block; width: 100%; height: auto; aspect-ratio: 8621 / 1009; }
.relative-context rect { fill: #89ddf216; stroke: var(--window); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.rope-ranges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 6cqw, 46px); margin: clamp(14px, 2.6cqw, 22px) 0; }
.rope-range { --ruler: #d5dfd1; min-width: 0; }
.far-range { --ruler: var(--window); }
.rope-range > strong, .rope-range > span { display: block; line-height: 1.25; }
.rope-range > strong { font-size: clamp(.88rem, 2.3cqw, 1.16rem); font-weight: 550; }
.rope-range > span { margin-top: 2px; font-size: clamp(.72rem, 1.8cqw, .91rem); color: #c9d5c7; }
.index-ruler { position: relative; margin-top: 1.4em; color: var(--ruler); border-top: 1.5px solid currentColor; }
.index-ruler::before, .index-ruler::after { content: ""; position: absolute; top: -4px; height: 7px; border-left: 1.5px solid currentColor; }
.index-ruler::after { right: 0; }
.index-ruler i, .index-ruler b { position: absolute; left: 88.8889%; transform: translateX(-50%); }
.index-ruler i { top: -4px; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.index-ruler b { bottom: 4px; font: 650 clamp(.72rem, 1.95cqw, .98rem)/1 var(--mono); }
.ruler-ends { display: flex; justify-content: space-between; margin-top: 5px; color: #c8d3c6; font: 500 clamp(.67rem, 1.65cqw, .84rem)/1.2 var(--mono); }
.rope-shifts { width: 100%; border-collapse: collapse; color: #e1e9df; text-align: left; }
.rope-shifts caption { color: var(--paper); text-align: left; padding: 0 0 6px; font-size: clamp(.86rem, 2.15cqw, 1.12rem); font-weight: 550; }
.rope-shifts th, .rope-shifts td { padding: clamp(5px, 1cqw, 8px) 4px; border-bottom: 1px solid #526358; line-height: 1.2; }
.rope-shifts thead th { color: #bacab9; font-weight: 500; font-size: clamp(.68rem, 1.75cqw, .9rem); }
.rope-shifts tbody th { font-weight: 550; font-size: clamp(.74rem, 1.95cqw, 1rem); }
.rope-shifts td { font: 500 clamp(.6875rem, 1.85cqw, .97rem)/1.2 var(--mono); white-space: nowrap; }
.rope-shifts th:not(:first-child), .rope-shifts td { text-align: center; }
.rope-shifts th:first-child { padding-left: 0; }
.rope-shifts .shared-shift { color: #d2dfce; background: #293c31; }
.rope-shifts tbody tr:last-child > * { border-bottom: 0; }
.dense-encoding td:last-child { color: var(--window); }
.median-encoding td:last-child { color: #ffcd7c; }
@container (max-width: 390px) {
  .rope-shifts th, .rope-shifts td { padding: 6px 1px; }
  .rope-shifts td { font-size: clamp(.6875rem, 3.2cqw, .75rem); }
  .rope-shifts tbody th { font-size: .72rem; }
  .rope-range > span { font-size: .7rem; }
}

.method-notes { border-top: 1px solid var(--line); }
.pipeline { border-bottom: 1px solid var(--line); }
.pipeline summary { padding: 13px 0; font-weight: 600; cursor: pointer; }
.pipeline summary:hover { color: var(--green); }
.pipeline p { max-width: 82ch; color: var(--muted); margin: .25rem 0 1rem; }
.pipeline > a > img { width: 100%; height: auto; margin: .75rem 0 1.2rem; background: white; cursor: zoom-in; }
.training-photos { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1.35fr); gap: clamp(14px, 4vw, 55px); margin: 16px 0 24px; }
.training-targets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.training-photos figure { display: grid; grid-template-rows: 1fr auto; min-width: 0; }
.training-photos figure img { align-self: center; }
@media (min-width: 681px) {
  [data-challenge-tabs] #method-fidelity, [data-challenge-tabs] #method-windows:has(#method-relative:not([hidden])) { grid-template-rows: 1fr auto; }
  #method-fidelity .challenge-step, #method-fidelity .step-copy, #method-fidelity .fidelity-media, #method-relative, #method-relative .step-copy, #method-relative .relative-media { align-self: stretch; }
  #method-fidelity .step-copy, #method-relative .step-copy { display: flex; flex-direction: column; }
  #method-fidelity .result-viewer, #method-relative .result-viewer { margin-top: auto; }
  #method-fidelity .result-viewer legend, #method-relative .result-viewer legend { padding-top: 18px; }
  /* Keep the method buttons in place as step descriptions wrap on narrower desktops. */
  #method-fidelity .fidelity-media { min-height: 29.5rem; }
}
@media (max-width: 900px) {
  .challenge-media { min-height: 260px; }
}
@media (max-width: 680px) {
  .prior-walkthrough, .challenge-overview, .method-chapter { grid-template-columns: minmax(0, 1fr); }
  .prior-walkthrough, .challenge-overview, .challenge-step { row-gap: 16px; }
  .challenge-media { aspect-ratio: 3 / 2; }
  #method-hierarchical .fidelity-media { aspect-ratio: auto; }
  .challenge-media figcaption { font-size: .76rem; line-height: 1.25; }
  [data-challenge-tabs] .method-chapter { grid-template-rows: auto auto 1fr; }
  [data-challenge-tabs] .challenge-step { grid-row: 1 / 4; row-gap: 0; }
  [data-challenge-tabs] .challenge-media { grid-area: 1 / 1; }
  .challenge-steps { grid-area: 2 / 1; }
  [data-challenge-tabs] .step-copy { grid-area: 3 / 1; margin-top: 16px; }
  .prior-notes { gap: 16px; }
  .prior-transport { gap: 4px; }
  #prior-play { flex-basis: 52px; }
  .prior-transport button { padding-inline: 2px; }
  .projection-mark { border-width: 1.5px; }
  .training-photos { grid-template-columns: minmax(0, 1fr); }
  .training-inputs { max-width: 305px; }
  .training-targets { gap: 6px; }
  .training-example .training-photos figcaption { font-size: .81rem; overflow-wrap: anywhere; }
}
.bib-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #edf0e6; }
.bib-tools { justify-content: space-between; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.bib-tools button { min-height: 32px; padding: 4px 10px; border: 1px solid #b3beaa; border-radius: 3px; background: var(--paper); color: var(--ink); font-size: .875rem; cursor: pointer; }
.bib-tools button:hover { background: var(--light-green); }
.bib-card pre { margin: 0; overflow-x: auto; padding: 18px; color: #314231; font: .82rem/1.65 var(--mono); tab-size: 2; }
.footer { justify-content: space-between; gap: 12px; padding-block: 20px 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }

@media (max-width: 820px) {
  .masthead { grid-template-columns: minmax(0, 1.35fr) minmax(185px, .7fr); gap: 24px; }
  .citation { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 24px; }
}
@media (max-width: 680px) {
  .shell { width: calc(100% - 36px); }
  .nav { min-height: 56px; gap: 10px; }
  .nav-links { gap: 14px; font-size: .875rem; }
  .nav-paper { padding: .32rem .66rem; }
  .wordmark { font-size: 1.08rem; }
  .masthead, .citation, .section-intro { grid-template-columns: minmax(0, 1fr); }
  .masthead { padding-top: 30px; gap: 16px; }
  .section-intro { gap: 12px; }
  .section-title { max-width: 20ch; }
  .gallery-label { margin-bottom: 6px; }
  .gallery-label span, .gallery-label a { font-size: .8rem; }
  .pan-control { grid-template-columns: 1fr 4ch; gap: 3px 12px; }
  .pan-control label { grid-column: 1 / -1; }
  .bib-card pre { font-size: .78rem; }
}
@media (max-width: 500px) {
  .venue .journal-long { display: none; }
  .journal-short { display: inline; }
}
@media (max-width: 380px) {
  .shell { width: calc(100% - 28px); }
  .nav-links { gap: 10px; }
  .venue { font-size: .75rem; gap: 6px; }
  .nav-paper { padding-inline: .45rem; }
}
@media (max-width: 360px) {
  .nav-links { gap: 8px; }
  .nav { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.method-comparison { padding-block: clamp(44px, 6.3vw, 92px); }
.comparison-browser, .baseline-options { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.comparison-browser { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px clamp(4px, 1vw, 14px); }
.comparison-sr, .comparison-browser input[type="radio"] { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0; }
.comparison-browser > label { min-width: 0; padding: 12px clamp(8px, 1.3vw, 19px); border-top: 2px solid var(--line); cursor: pointer; }
.comparison-browser > label strong { display: block; font-size: clamp(1.03rem, 1.7vw, 1.48rem); font-weight: 550; line-height: 1.16; letter-spacing: -.035em; }
.comparison-browser > label span { display: block; margin-top: 5px; color: var(--muted); font: .77rem/1.25 var(--mono); }
.comparison-browser > label:hover, .baseline-options label:hover { background: #edf1e6; }
.comparison-browser input:checked + label { color: var(--ink); border-color: var(--green); background: #e4ebd8; }
.comparison-browser input:focus-visible + label { outline: 3px solid var(--green); outline-offset: 1px; }
.comparison-case { display: none; order: 1; grid-column: 1 / -1; min-width: 0; }
.comparison-browser > input:checked + label + .comparison-case { display: block; }

.comparison-inputs { display: flex; gap: 8px 20px; align-items: center; margin: clamp(18px, 2.4vw, 32px) 0 clamp(14px, 1.7vw, 22px); }
.comparison-inputs figcaption { flex: none; margin: 0; font: .81rem/1.4 var(--mono); }
.comparison-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.comparison-input { display: block; border-radius: 2px; cursor: zoom-in; }
.comparison-input img { width: auto; height: clamp(48px, 4.9vw, 68px); border-radius: inherit; }
.comparison-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: clamp(10px, 1.5vw, 22px); }
.comparison-output { min-width: 0; }
.baseline-options { display: grid; grid-template-columns: repeat(3, max-content) minmax(0, 1fr); gap: 0 4px; }
.baseline-options label, .comparison-method-name { display: flex; align-items: center; min-height: 44px; margin: 0 0 6px; font: 600 clamp(.88rem, 1.1vw, 1rem)/1.2 var(--sans); }
.baseline-options label { grid-row: 1; padding: 4px clamp(7px, 1vw, 15px); border-bottom: 2px solid var(--line); color: var(--muted); cursor: pointer; }
.comparison-method-name { color: var(--ink); }
.comparison-image { display: block; width: 100%; aspect-ratio: 1.8; overflow: hidden; border-radius: 3px; background: #161d19; cursor: zoom-in; }
.comparison-image img { width: 100%; height: 100%; object-fit: contain; }
.baseline-options .comparison-image { grid-area: 2 / 1 / 3 / -1; display: none; }
.baseline-options input:checked + label + .comparison-image { display: block; }
.comparison-case[data-case="ski"] .comparison-image { aspect-ratio: 1.5; }
.comparison-case[data-case="stop"] .comparison-image { aspect-ratio: 1.61; }
.comparison-case[data-case="office"] .comparison-image { aspect-ratio: 1.45; }
/* The street panoramas need the full row to show the pedestrian and the cars. */
.comparison-case[data-case="pedestrian"] .comparison-pair { grid-template-columns: minmax(0, 1fr); }
.comparison-case[data-case="pedestrian"] .comparison-image { aspect-ratio: auto; }
.comparison-case[data-case="pedestrian"] .comparison-image img { height: auto; }
.comparison-note { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; color: var(--muted); font-size: .93rem; }
.comparison-note a { white-space: nowrap; }
.comparison-scores { margin-top: clamp(24px, 3vw, 40px); border-block: 1px solid var(--line); }
.comparison-scores summary { padding: 14px 2px; font-weight: 600; cursor: pointer; }
.comparison-scores summary::marker { color: var(--green); }
.comparison-score-body { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(20px, 6vw, 90px); padding: 12px 0 24px; }
.comparison-score-body h3 { font-size: 1.15rem; line-height: 1.3; }
.comparison-score-body p { margin: .5rem 0; color: var(--muted); }
.comparison-score-body table { width: 100%; border-collapse: collapse; text-align: right; font-size: .92rem; font-variant-numeric: tabular-nums; }
.comparison-score-body th, .comparison-score-body td { padding: 6px 10px; border-bottom: 1px solid var(--line); }
.comparison-score-body th:first-child { text-align: left; }
.comparison-score-body tbody th { font-weight: 400; }
.comparison-score-body tbody tr:last-child { background: #e4ebd8; }
.comparison-score-body tbody tr:last-child > * { font-weight: 700; }
.comparison-footnote { font-size: .81rem; }

@media (max-width: 680px) {
  .comparison-browser { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 4px; }
  .comparison-browser > label { padding: 9px 10px; }
  .comparison-inputs { flex-direction: column; align-items: start; }
  .comparison-pair, .comparison-score-body { grid-template-columns: minmax(0, 1fr); }
  .comparison-strip { max-width: 100%; }
  .comparison-case[data-case="pedestrian"] .comparison-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 420px; }
  .comparison-case[data-case="pedestrian"] .comparison-strip img { width: 100%; height: auto; }
}
@media (max-width: 520px) {
  .nav { gap: 6px; }
  .nav-links { gap: clamp(5px, 1.65vw, 8px); font-size: .80rem; }
  .nav-paper { padding-inline: .4rem; }
}
@media (max-width: 420px) {
  .nav { flex-direction: column; align-items: flex-start; gap: 2px; padding-block: 5px; }
  .nav-links { width: 100%; justify-content: space-between; gap: 3px; }
  .nav-links a { display: inline-flex; align-items: center; min-height: 30px; }
}
