/* ===========================================================
   MDA project page — Nerfies-style template
   =========================================================== */

:root {
  --bg: #fdfdfb;                  /* faint warm off-white */
  --bg-alt: hsl(38, 12%, 95%);    /* warm-leaning grey for alternating sections,
                                     harmonizes with the terracotta accent */
  --fg: #1f2024;
  --fg-mute: #585b62;             /* slightly warmer than the prior cool grey */
  /* Accent: warm orange (terracotta-leaning). Pulled in a touch from
     hsl(18, 70%, 52%) to feel more "earthen" and less "neon". */
  --link: hsl(19, 62%, 50%);
  --link-hover: hsl(19, 66%, 42%);
  --border: hsl(34, 12%, 89%);    /* warm hairline, was cool #e4e7eb */
  --ours: hsl(21, 72%, 95%);
  --ours-line: hsl(18, 64%, 46%);
  --code-bg: #1f2933;
  --code-fg: #e4e7eb;
  /* Single content width used by every section, panel, figure, and column.
     Anything that should align with the rest of the page should pin to this. */
  --content-w: 920px;
  --container: var(--content-w);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container.is-max-desktop { max-width: var(--content-w); }

.has-text-centered { text-align: center; }
.has-text-justified { text-align: justify; }
.has-background-light { background: var(--bg-alt); }

/* Every column class collapses to "fill the container" so titles, body text,
   figures, and panels all share the same outer width. The narrower-than-container
   centered-text rhythm now comes from the page's natural reading width inside
   each block, not from a separate is-three-fifths / is-four-fifths column. */
.columns { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; }
.columns.is-centered { justify-content: center; }
.column { flex: 1 1 100%; max-width: 100%; padding: 0; }
.column.is-four-fifths,
.column.is-three-fifths { flex: 0 0 100%; max-width: 100%; padding: 0; }

/* ===================== Section + Title ===================== */
.section { padding: 64px 0; }
.title {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  color: var(--fg);
}
.title.is-3 {
  font-size: 1.85rem;
  margin-bottom: 26px;
}
.section-lead {
  color: var(--fg-mute);
  font-size: 1.05rem;
  max-width: var(--content-w);
  margin: 0 auto 28px;
  text-align: left;
}

.hero-hook {
  max-width: var(--content-w);
  margin: 26px auto 0;
  color: #2a2f37;
  font-size: 1.12rem;
  line-height: 1.6;
}
.hero-hook b { color: var(--link); }

.figure-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 12px, #f3f4f6 12px, #f3f4f6 24px);
  color: #8a9099;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.98rem;
  text-align: center;
  padding: 24px;
}
.has-background-light .figure-placeholder {
  background: repeating-linear-gradient(45deg, #fff, #fff 12px, #f1f2f4 12px, #f1f2f4 24px);
}

.content p { margin: 0 0 1em; }
.content { color: var(--fg); }

/* ===================== Hero ===================== */
.hero {
  /* Slightly more visible warm gradient — same direction (white → cream),
     just a touch more saturated at the bottom to ground the terracotta accent. */
  background: linear-gradient(180deg, #ffffff 0%, hsl(38, 32%, 95%) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-body { padding: 80px 0 56px; }
/* The hero gets its own (wider) container so the long subtitle stays on a
   single line at a comfortable size, independent of --content-w. */
.hero .container { max-width: 1160px; }

.publication-title {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(1.65rem, 3.1vw, 2.6rem);
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}
.publication-title .title-sub {
  display: inline-block;
  margin-top: 4px;
  font-weight: 500;
  /* Capped so the subtitle stays on a single line at every viewport,
     giving the title exactly two lines total. Sized to fill the widened
     hero container (1160px) with a small safety margin. */
  font-size: clamp(1.2rem, 2.4vw, 1.85rem);
  line-height: 1.35;
  color: #2a2f37;
}
.publication-title .title-hl {
  color: var(--link);
  font-weight: 700;
  white-space: nowrap;
}

.publication-venue {
  color: #555;
  font-weight: 700;
  font-family: 'Google Sans', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.92rem;
  margin: 14px 0 22px;
}

.publication-authors {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.1rem;
  margin: 0 0 4px;
}
.publication-authors .author-block { display: inline-block; margin: 0 12px; }
/* Author links stay blue regardless of the active accent theme */
.publication-authors a { color: hsl(201, 78%, 51%); }
.publication-authors a:hover { color: hsl(204, 82%, 41%); text-decoration: underline; }
.publication-affiliations {
  color: #555;
  margin: 0 0 28px;
  font-size: 1rem;
}
.publication-affiliations span + span { margin-left: 18px; }
.publication-affiliations .eq-contrib {
  margin-left: 14px;
  color: #777;
  font-size: 0.93rem;
}
@media (max-width: 560px) {
  .publication-affiliations .eq-contrib { display: block; margin-left: 0; margin-top: 2px; }
}

/* ----- Link buttons ----- */
.publication-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.link-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: #1f2024;
  color: #fff !important;
  font-family: 'Google Sans', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: 1px solid #1f2024;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.link-button:hover {
  background: #000;
  border-color: #000;
  color: #fff !important;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.link-button .icon { font-size: 1rem; line-height: 1; display: inline-flex; align-items: center; }

/* ===================== Teaser ===================== */
.teaser-section { padding-top: 36px; padding-bottom: 32px; }
.teaser-section .figure { max-width: var(--content-w); margin-left: auto; margin-right: auto; }

.teaser-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}
.teaser-panel-wide { grid-column: 1 / -1; }
@media (max-width: 960px) {
  .teaser-grid { grid-template-columns: 1fr; }
  .teaser-panel-wide { grid-column: 1 / -1; }
}

.teaser-row3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-items: start;
}
.teaser-row3 + .teaser-row3 { margin-top: 8px; }
.teaser-row3-tight { margin-bottom: 0; }

/* Boundary slider rows inside the teaser. */
.teaser-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: start;
}
.teaser-row2 + .teaser-row2 { margin-top: 8px; }

/* Force 1:1 clipping for the slider images inside the teaser so they match
   the sky / transparent cells below them. */
#teaserCompare .cs-input,
#teaserCompare .compare-slider .cs-base {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  height: auto;
  display: block;
}
#teaserCompare .compare-slider {
  aspect-ratio: 1 / 1;
}
#teaserCompare .compare-slider .cs-ours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#teaserCompare .cs-input-wrap figcaption {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.82rem;
  color: #555;
  margin-top: 5px;
  text-align: center;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.teaser-cell { margin: 0; position: relative; }
.teaser-cell img {
  width: 100%;
  aspect-ratio: 1 / 1;          /* clip every cell to a uniform square */
  object-fit: cover;            /* crop the longer axis from the center */
  border-radius: 8px;
  display: block;
  background: #000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.teaser-cell figcaption {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.82rem;
  color: #555;
  margin-top: 5px;
  text-align: center;
  font-weight: 500;
}
.teaser-cell.is-ours figcaption { color: var(--link); font-weight: 700; }
.teaser-cell.is-ours img {
  outline: 2px solid var(--link);
  outline-offset: -2px;
}

.teaser-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 14px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.teaser-title {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 2px 10px;
  text-align: center;
  color: var(--fg);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.teaser-input-row {
  display: flex;
  justify-content: center;
}
.teaser-thumb {
  margin: 0;
  width: 55%;
  text-align: center;
}
.teaser-thumb img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  background: #000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.teaser-thumb figcaption {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.78rem;
  color: #777;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.teaser-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.teaser-half { margin: 0; position: relative; }
.teaser-half img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  background: #000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.teaser-half figcaption {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.82rem;
  color: #555;
  margin-top: 5px;
  text-align: center;
  font-weight: 500;
}
.teaser-half.is-ours figcaption {
  color: var(--link);
  font-weight: 700;
}
.teaser-half.is-ours img {
  outline: 2px solid var(--link);
  outline-offset: -2px;
}

.teaser-caption {
  color: #555;
  font-size: 0.97rem;
  margin: 22px auto 0;
  text-align: center;
  line-height: 1.6;
}

.figure { margin: 0 auto 8px; text-align: center; }
.figure img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 10px 30px rgba(0,0,0,0.06);
}
.figure figcaption {
  color: #555;
  font-size: 0.95rem;
  margin-top: 14px;
  text-align: left;
  max-width: 84ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ===================== TL;DR cards ===================== */
.tldr-section { padding-top: 18px; padding-bottom: 18px; }
.tldr-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 18px;
}
@media (max-width: 980px) { .tldr-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .tldr-grid { grid-template-columns: 1fr; } }

.tldr-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 20px 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.tldr-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.tldr-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--ours);
  color: var(--ours-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  margin-bottom: 10px;
}
.tldr-card h3 {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0 0 6px;
}
.tldr-card p { margin: 0; color: #444; font-size: 0.97rem; line-height: 1.55; }

/* ===================== Equation panel ===================== */
.eq-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 18px;
  margin: 14px 0 20px;
  overflow-x: auto;
}
.has-background-light .eq-panel { background: #fff; }

/* ===================== Boundary Quality video comparison ===================== */
.vid-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}
.vid-tab {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.94rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: #333;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.vid-tab:hover { background: #f0f1f3; }
.vid-tab.is-active {
  background: var(--link);
  color: #fff;
  border-color: var(--link);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--link) 25%, transparent);
}

.vid-grid {
  display: grid;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.vid-grid-5 { grid-template-columns: repeat(5, 1fr); }
.vid-grid video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.vid-grid video.vid-ours {
  outline: 2px solid var(--link);
  outline-offset: -2px;
}
.vid-header {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.92rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  margin-top: 4px;
  margin-bottom: 6px;
}
.vid-header .cmp-ours { color: var(--link); font-weight: 700; }

.vid-caption {
  text-align: center;
  color: #555;
  font-size: 0.95rem;
  margin: 16px auto 0;
  max-width: 84ch;
}

@media (max-width: 820px) {
  .vid-grid-5 { grid-template-columns: 1fr 1fr; }
  .vid-header { display: none; }
}

/* ===================== Reusable Compare-Slider ===================== */
.compare-panel {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  max-width: var(--content-w);
  margin: 0 auto;
}
.has-background-light .compare-panel { background: #fff; }

.compare-pair {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 720px) {
  .compare-pair {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
  }
}

.compare-pair-header { margin-bottom: 2px; }
.cmp-col-label {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.85rem;
  color: #555;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cmp-col-label .cmp-col-hl { color: var(--link); font-weight: 700; }
@media (max-width: 720px) {
  .compare-pair-header { display: none; }
}

.compare-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 auto;
}
.compare-panel-wide { max-width: var(--content-w); }

/* Blur-section grid: narrow label column + input column + two equal slider columns. */
.compare-pair.blur-row-grid {
  grid-auto-flow: row;
  grid-template-columns: 92px 1fr 1fr 1fr;
  grid-auto-columns: auto;
  gap: 12px;
  align-items: center;
}
.compare-pair.blur-row-grid .cs-input-wrap { margin: 0; }
.compare-pair.blur-row-grid .cs-input {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
@media (max-width: 720px) {
  .compare-pair.blur-row-grid { grid-template-columns: 1fr; }
}

/* Blur-level slider: scrub between the three blur strengths. */
.blur-slider-field {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 4px auto 20px;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--fg-mute);
}
.blur-slider-cap { font-size: 0.82rem; letter-spacing: 0.02em; }
.blur-slider-val {
  min-width: 3.6em;
  font-weight: 600;
  color: var(--link);
}
.blur-slider-val i { font-style: italic; }
.blur-slider-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 200px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--link), var(--link)) no-repeat,
              #e4e7eb;
  background-size: var(--range-fill, 100%) 100%;
  accent-color: var(--link);
  cursor: pointer;
}
.blur-slider-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--link);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--link) 35%, transparent);
  cursor: pointer;
}
.blur-slider-field input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--link);
  cursor: pointer;
}

.blur-row-label {
  font-family: 'Google Sans', sans-serif;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #1f2024;
}
.blur-row-label strong { font-size: 1.05rem; font-weight: 700; }
.blur-row-label span   { font-size: 0.85rem; color: #666; }
@media (max-width: 720px) {
  .blur-row-label { flex-direction: row; justify-content: center; gap: 8px; }
}
.cs-input-wrap { margin: 0; text-align: center; }
.cs-input-wrap .cs-input {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  background: #000;
}
.cs-input-wrap figcaption {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.8rem;
  color: #555;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cmp-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.cmp-tabs:last-of-type { margin-bottom: 16px; }
.cmp-tab {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  background: #f0f1f3;
  border: 1px solid var(--border);
  color: #333;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cmp-tab:hover { background: #e2e6eb; }
.cmp-tab.is-active {
  background: var(--link);
  color: #fff;
  border-color: var(--link);
}

/* Scene-selector strip: input thumbnails double as the scene picker, sitting
   below the panel so the input no longer needs its own column in each row. */
.scene-thumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.scene-thumbs-label {
  flex-basis: 100%;          /* own line so the thumbnails below stay centered */
  text-align: center;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.scene-thumb {
  padding: 0;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 9px;
  background: #000;
  cursor: pointer;
  line-height: 0;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.scene-thumb img {
  display: block;
  width: 112px;
  height: 84px;             /* 4:3, not square */
  object-fit: cover;
  border-radius: 7px;
}
.scene-thumb:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.14);
}
.scene-thumb.is-active {
  border-color: var(--link);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--link) 30%, transparent);
}
@media (max-width: 720px) {
  .scene-thumb img { width: 88px; height: 66px; }
}

.compare-slider {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  user-select: none;
  cursor: ew-resize;
  background: #000;
  line-height: 0;
  touch-action: none;
}
.compare-slider .cs-base {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}
.compare-slider .cs-ours {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: inset(0 0 0 50%);
  pointer-events: none;
  -webkit-user-drag: none;
}
.compare-slider .cs-handle {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
}
.compare-slider .cs-line {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
}
.compare-slider .cs-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1f2024;
  font-size: 0.85rem;
}
.compare-slider .cs-label {
  position: absolute;
  top: 10px;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  line-height: 1;
  pointer-events: none;
}
.compare-slider .cs-label-l { left: 12px; }
.compare-slider .cs-label-r {
  right: 12px;
  background: color-mix(in srgb, var(--link) 85%, transparent);
}

.compare-caption {
  text-align: center;
  color: #555;
  font-size: 0.95rem;
  margin: 14px auto 0;
  max-width: 84ch;
}

/* ===================== Comparison grids ===================== */
.cmp-grid {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}
.cmp-grid-5 { grid-template-columns: repeat(5, 1fr); }
.cmp-grid-4 { grid-template-columns: repeat(4, 1fr); }
.cmp-grid-3 { grid-template-columns: repeat(3, 1fr); }

.cmp-grid img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  background: #000;
}
.cmp-header {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.9rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  margin-top: 16px;
  margin-bottom: 4px;
}
.cmp-header .cmp-ours { color: var(--link); font-weight: 700; }

.row-label {
  font-size: 0.95rem;
  color: #555;
  text-align: center;
  font-family: 'Google Sans', sans-serif;
}

@media (max-width: 760px) {
  .cmp-grid-5, .cmp-grid-4, .cmp-grid-3 { grid-template-columns: 1fr 1fr; }
  .cmp-header { display: none; }
}

/* ===================== Unimodal 3D viewer (Why Flying Points) =====================
   Replaces the old bzoom magnifier. Left half: input image with the precomputed
   red depth-edge overlay; clicking snaps to the nearest edge pixel. Right half:
   Three.js point cloud unprojected from the baseline (DA3-GIANT) depth, with
   the clicked window of pixels lit in orange so the flying-point artifact
   becomes visually obvious. */
.uv-card {
  margin: 20px 0 0;
  padding: 60px 16px 16px;   /* top padding leaves a comfortable gap between
                                 the badge and the image below it. */
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 12px 28px rgba(15, 23, 42, 0.06);
  position: relative;
}
.uv-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 760px) {
  .uv-pair { grid-template-columns: 1fr; }
}
.uv-input-wrap,
.uv-canvas-wrap {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 504 / 378;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.uv-input-wrap { cursor: crosshair; }
.uv-input-wrap:hover { border-color: hsl(0, 60%, 75%); }
.uv-canvas-wrap { cursor: grab; }
.uv-canvas-wrap:hover { border-color: color-mix(in srgb, var(--link) 45%, #fff); }
.uv-canvas-wrap:active { cursor: grabbing; }
.uv-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.uv-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
/* Snap marker — small orange dot + ring at the clicked-and-snapped pixel,
   positioned with translate(-50%, -50%) from its left/top origin. */
.uv-marker {
  display: none;
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #ff7a3a;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px #ff7a3a, 0 0 10px rgba(255, 122, 58, 0.55);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}
.uv-hud {
  position: absolute;
  left: 8px; bottom: 8px;
  z-index: 2;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #4a5160;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
}
.uv-card figcaption {
  margin: 14px auto 0;
  max-width: 84ch;
  font-size: 0.93rem;
  color: #4a5160;
  line-height: 1.55;
  text-align: left;
}
.uv-card figcaption b { color: var(--fg); }
.uv-edge-text   { color: hsl(0, 70%, 45%); font-weight: 600; }
.uv-orange-text { color: hsl(20, 90%, 47%); font-weight: 600; }

/* RGB + Depth zoom crops, drawn below the input/3D pair. Each is a square
   canvas showing a ZOOM_RADIUS-pixel window around the snapped pixel,
   redrawn (with crosshair) on every click. */
/* The zoom row sits below the main pair. Two square panels, centered with a
   max-width so the zoom crops don't dominate when the card grows wide. */
.uv-zoom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px auto 0;
  max-width: 380px;
}
.uv-zoom {
  position: relative;
  background: #0a0d12;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.uv-zoom canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.uv-zoom-label {
  position: absolute;
  top: 6px; left: 8px;
  z-index: 2;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: #c8d2dd;
  background: rgba(0, 0, 0, 0.62);
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
}

/* ===================== Sky 3D viewer cells =====================
   Each .sky-row cell holds an interactive Three.js point cloud canvas. Sized
   like the static .cmp-grid img cells (matching aspect & corner radius) so the
   row visually replaces the image grid without disturbing the section layout. */
.sky-row .sky-cell {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 504 / 378;
  cursor: grab;
}
.sky-row .sky-cell:active { cursor: grabbing; }
.sky-row .sky-cell canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;  /* let OrbitControls own pointer gestures */
}
/* Input <img> sizing is already handled by `.cmp-grid img` (width:100%, natural
   aspect 504x378), which matches the canvas cells' aspect — no extra rule. */
.sky-hint {
  margin: 10px 2px 0;
  font-size: 0.85rem;
  color: var(--fg-mute);
  font-family: 'Google Sans', sans-serif;
  text-align: center;
}

/* Sky section — interactive comparison wrapper. position:relative so the
   viewer-badge can dock to the top-left, with per-row scene labels above
   each row and a descriptive figcaption at the bottom. */
.sky-comparison {
  position: relative;
  max-width: var(--content-w);
  margin: 16px auto 0;
  padding: 38px 0 0;
}
.sky-badge { top: 0; left: 0; }
.sky-caption {
  margin: 16px 4px 0;
  font-size: 0.94rem;
  color: #4a5160;
  line-height: 1.6;
  text-align: left;
}
.sky-caption b { color: var(--fg); }

/* Polish: subtle hover affordance on the 3D cells so the cursor change is
   reinforced by a quick border-tint, matching the interactive-feel of the
   other viewers on the page. */
.sky-row .sky-cell { transition: border-color 0.15s ease; }
.sky-row .sky-cell:hover { border-color: color-mix(in srgb, var(--link) 45%, #fff); }

/* ===================== Charts row ===================== */
.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.charts .figure.half img { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
@media (max-width: 760px) { .charts { grid-template-columns: 1fr; } }
.charts-caption {
  max-width: 84ch;
  margin: 14px auto 0;
  text-align: center;
  color: #4a5160;
  font-size: 0.95rem;
  line-height: 1.5;
}
.charts-caption b { color: var(--fg); }

/* ===================== Bullets ===================== */
.bullet-list {
  padding-left: 22px;
  margin: 0;
}
.bullet-list li { margin: 10px 0; }

/* ===================== BibTeX ===================== */
.bibtex {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 22px 24px;
  border-radius: 12px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}
.bibtex code { color: inherit; background: none; }

/* ===================== Footer ===================== */
.footer {
  padding: 36px 0 60px;
  text-align: center;
  color: #555;
  font-size: 0.92rem;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* ===================== Depth-distribution viewer ===================== */
.dviewer-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 12px 28px rgba(15, 23, 42, 0.06);
  max-width: var(--content-w);
  margin: 0 auto;
}
.dviewer-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  align-items: center;
}
.dviewer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.dviewer-field {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--fg);
}
.dviewer-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 220px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--link), var(--link)) no-repeat,
              #e4e7eb;
  background-size: var(--range-fill, 0%) 100%;
  accent-color: var(--link);
  cursor: pointer;
}
.dviewer-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--link);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--link) 35%, transparent);
  cursor: pointer;
}
.dviewer-field input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--link);
  cursor: pointer;
}
.dviewer-view-num {
  display: inline-block;
  min-width: 1.4em;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-weight: 600;
  color: var(--link);
  text-align: center;
}
/* Main row: RGB (clickable) | PDF plot — equal width, equal height (4:3 each). */
.dviewer-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}
@media (max-width: 920px) {
  .dviewer-stage { grid-template-columns: 1fr; }
}

/* Aux row: small mask + stats box, equal height. */
.dviewer-aux {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 920px) {
  .dviewer-aux { grid-template-columns: 1fr; }
}

.dviewer-image { margin: 0; text-align: center; }
.dviewer-image-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;        /* matches the source's 504×378 */
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: crosshair;
}
.dviewer-image-mask .dviewer-image-canvas { cursor: default; }
.dviewer-image-canvas img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}
.dviewer-image-canvas .dviewer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
}
.dviewer-image figcaption,
.dviewer-plot-wrap figcaption {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.82rem;
  color: #555;
  margin-top: 6px;
  letter-spacing: 0.02em;
}

.dviewer-plot-wrap { margin: 0; text-align: center; }
.dviewer-plot {
  width: 100%;
  aspect-ratio: 4 / 3;          /* matches the RGB image dimensions */
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: block;
}

/* 3D point-cloud panel below the input + distribution stage. Filled lazily
   on cache load; hidden when the active cache has no points.json. */
.dviewer-pc-wrap {
  margin: 18px 0 0;
  text-align: center;
}
.dviewer-pc-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;          /* wide, since this is "scene context" */
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: border-color 0.15s ease;
}
.dviewer-pc-canvas-wrap:hover { border-color: color-mix(in srgb, var(--link) 45%, #fff); }
.dviewer-pc-canvas-wrap:active { cursor: grabbing; }
.dviewer-pc-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
/* Shared "Point cloud" pill — top-left corner of any 3D canvas. Identifies
   the panel as an interactive point-cloud viewer at a glance. Same blue
   chip vocabulary as .viewer-badge so the affordance reads consistently. */
.pc-canvas-label {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--link);
  background: color-mix(in srgb, var(--link) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--link) 28%, transparent);
  padding: 3px 9px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
}
.pc-canvas-label i { font-size: 0.92em; }
.dviewer-pc-hud {
  position: absolute;
  right: 10px; bottom: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #4a5160;
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.dviewer-pc-wrap figcaption {
  margin-top: 12px;
  font-size: 0.93rem;
  color: #4a5160;
  text-align: left;
  line-height: 1.55;
  max-width: 84ch;
  margin-left: auto;
  margin-right: auto;
}
.dviewer-pc-wrap figcaption b { color: var(--fg); }
@media (max-width: 720px) {
  .dviewer-pc-canvas-wrap { aspect-ratio: 4 / 3; }
}

.dviewer-stats {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 14px 16px;
  border-radius: 10px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0;
  overflow-x: auto;
  white-space: pre;
  align-self: stretch;
}

/* ===================== §1 video: 3-column + baseline tabs ===================== */
.vid-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .vid-grid-3 { grid-template-columns: 1fr; } }
.scene-thumbs.boundary-thumbs {
  margin: 0 0 22px;
}
.boundary-thumbs .tv-thumb-row {
  padding-top: 12px;
}
.vid-tabs-baseline {
  margin-top: 4px;
  align-items: center;
}
.vid-tabs-label {
  color: var(--fg-mute);
  font-size: 0.9rem;
  margin-right: 4px;
  align-self: center;
}

/* ===================== Interactive viewer card + badge ===================== */
/* A boxed container that marks an interactive widget apart from the body text
   and static figures flowing around it. */
.viewer-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 62px 22px 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 12px 28px rgba(15, 23, 42, 0.06);
  max-width: var(--content-w);
  margin: 0 auto 8px;
}
.dviewer-panel { position: relative; }
.dviewer-panel .viewer-badge { top: 18px; left: 18px; right: auto; }

/* Pill in the top-left corner of an interactive card. */
.viewer-badge {
  position: absolute;
  top: 16px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--link);
  background: color-mix(in srgb, var(--link) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--link) 28%, transparent);
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--link) 12%, transparent);
}
.viewer-badge i { font-size: 0.92em; }

/* ===================== §3 boundary magnifier ===================== */
.bzoom {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}
/* Two equal columns that grow to fill the card, so their outer edges line up
   with the body paragraphs above. */
.bzoom-stage {
  position: relative;
  flex: 1 1 320px;
  max-width: none;
  cursor: crosshair;
  touch-action: none;
}
.bzoom-stage img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}
.bzoom-lens {
  position: absolute;
  display: none;
  width: 24px;
  height: 18px;            /* 4:3, matches the view + image aspect (no distortion); smaller = more zoom */
  border: 2px solid var(--link);
  border-radius: 6px;
  background: color-mix(in srgb, var(--link) 13%, transparent);
  pointer-events: none;
}
.bzoom-view {
  flex: 1 1 320px;
  max-width: none;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: #fff;
  background-repeat: no-repeat;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 10px 30px rgba(0,0,0,0.06);
}
@media (max-width: 560px) { .bzoom-view { width: 100%; max-width: 504px; } }

/* ===================== Showcase teaser + TL;DR box ===================== */
.showcase-section { padding-top: 40px; padding-bottom: 40px; }

.tldr-box {
  max-width: var(--content-w);
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 34px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 12px 28px rgba(15, 23, 42, 0.06);
}
/* Compact single-paragraph TL;DR card.
   Visual notes vs. the default .tldr-box:
   - Warm gradient background (hooks into the page's terracotta accent).
   - 4 px terracotta accent rail on the left edge.
   - Small inline pill label at top-left (replaces the big centered banner).
   - Larger, more breathable body text; bolded terms picked out in the
     accent color to guide the eye through the takeaway. */
.tldr-section { padding-bottom: 24px; }

.tldr-box-summary {
  position: relative;
  padding: 26px 36px 26px 44px;     /* extra left padding for accent rail */
  /* Full warm cream wash — kept distinctly off-white through the whole
     card so the TL;DR reads as a callout, not just another white block. */
  background: linear-gradient(180deg,
    hsl(34, 45%, 94%) 0%,
    hsl(36, 38%, 95.5%) 100%);
  border-color: color-mix(in srgb, var(--link) 25%, var(--border));
  overflow: hidden;
}
.tldr-box-summary::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(
    180deg,
    var(--link) 0%,
    color-mix(in srgb, var(--link) 55%, transparent) 100%
  );
}

/* Inline lead-in inside the paragraph, replacing the prior pill label.
   Bolded, slightly larger, terracotta-tinted — reads as a "TL;DR:"
   journalistic dek rather than a separate section header. */
.tldr-inline-label {
  font-weight: 700;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  color: var(--link);
  letter-spacing: 0.04em;
  margin-right: 4px;
}
/* `<b class="tldr-inline-label">` is the markup; guarantee the bold weight
   even where `<b>`'s default font-weight conflicts with cascade. */
b.tldr-inline-label { font-weight: 700; }

.tldr-summary-text {
  margin: 0;
  max-width: 78ch;
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--fg);
  text-align: left;
}
.tldr-summary-text b {
  color: var(--link);
  font-weight: 600;
}
.tldr-box-label {
  display: block;
  text-align: center;
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--link);
  margin: 0 0 22px;
}
.tldr-headline {
  margin: 0 0 14px;
  font-family: 'Google Sans', sans-serif;
  font-size: 1.4rem;
  line-height: 1.32;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.tldr-key { color: var(--link); }
.tldr-detail {
  margin: 0 0 18px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #4a5160;
}
.tldr-detail b { color: var(--fg); font-weight: 600; }
.tldr-points {
  margin: 0;
  padding: 18px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--link) 20%, #fff);
  display: grid;
  gap: 12px;
  list-style: none;
  color: #2f3742;
  font-size: 1rem;
  line-height: 1.55;
}
.tldr-points li {
  position: relative;
  padding-left: 28px;
}
.tldr-points li::before {
  content: "→";
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--link);
  font-weight: 700;
  font-size: 1.15em;
  line-height: 1.4;
}
.tldr-points b { color: var(--fg); font-weight: 600; }

/* Two-column Problem | Fix layout inside the TL;DR card.
   Each column is marked by a colored left bar — red for problem, blue for fix —
   replacing the prior pill tags. */
.tldr-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 22px;
}
.tldr-col {
  position: relative;
  padding: 4px 0 4px 18px;
  border-left: 3px solid;
  border-radius: 2px;
}
/* Problem red shifted a few degrees toward magenta — pulls it visibly away
   from the terracotta/brown of the Fix column, so the two columns are
   clearly different colors instead of two adjacent warm tones. */
.tldr-col-problem { border-left-color: hsl(350, 72%, 58%); }
.tldr-col-fix     { border-left-color: var(--link); }
.tldr-divider { display: none; }  /* no longer used; left in case markup lingers */
.tldr-col-tag {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  background: none !important;
  border: none !important;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}
/* Problem red pulled toward magenta (hue 350°) — distinctly cooler than
   the Fix terracotta (~22°), so the two subtitles no longer read as two
   shades of the same warm color. */
.tldr-tag-problem { color: hsl(348, 75%, 40%); }
.tldr-tag-fix     { color: hsl(22, 75%, 42%); }
.tldr-col p {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.6;
  color: var(--fg);
}
@media (max-width: 720px) {
  .tldr-cols { grid-template-columns: 1fr; gap: 20px; }
}

/* "Extensions" footer: subtle accent rail across the bottom of the card,
   visually subordinate to the Problem | Fix grid above. */
.tldr-extras {
  margin: 4px 0 0;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--link) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--link) 25%, #fff);
  border-radius: 10px;
  text-align: center;
}
.tldr-extras-label {
  display: inline-block;
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--link);
  margin-right: 10px;
}
.tldr-extras p {
  display: inline;
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.55;
  color: #4a5160;
}
.tldr-extras b { color: var(--fg); font-weight: 600; }
@media (max-width: 560px) {
  .tldr-box { padding: 22px 22px 20px; }
  .tldr-headline { font-size: 1.2rem; }
}

/* ===================== Teaser video slider (DA3 ↔ Ours) ===================== */
.teaser-video-section { padding-top: 28px; padding-bottom: 36px; }

/* Compare stage: two stacked buffers cross-fade so swaps never flash black.
   JS sets aspect-ratio per clip; 16/9 is just the pre-load fallback. */
.tv-compare {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  user-select: none;
  cursor: ew-resize;
  background: #000;
  line-height: 0;
  touch-action: none;
  box-shadow: 0 6px 26px rgba(0,0,0,0.16);
}
.tv-compare .tv-base,
.tv-compare .tv-ours {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;                       /* hidden until its buffer is the active one */
  transition: opacity 0.3s ease;
}
.tv-compare .tv-base { z-index: 1; }
.tv-compare .tv-ours {
  z-index: 2;
  clip-path: inset(0 0 0 50%);
}
.tv-compare .tv-base.is-shown,
.tv-compare .tv-ours.is-shown { opacity: 1; }
.tv-compare .tv-handle {
  position: absolute;
  top: 0; left: 50%;
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
}
.tv-compare .tv-line {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
}
.tv-compare .tv-label {
  position: absolute;
  top: 12px;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  line-height: 1;
  pointer-events: none;
  z-index: 3;
}
.tv-compare .tv-label-l { left: 14px; }
.tv-compare .tv-label-r {
  right: 14px;
  background: color-mix(in srgb, var(--link) 85%, transparent);
}

/* Input clip as a picture-in-picture inset in the box's bottom-left corner. */
.tv-compare .tv-input-large {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 4;                    /* above the video layers (2) and handle (3) */
  width: 26%;
  max-width: 300px;
  aspect-ratio: 16 / 9;          /* JS overrides per clip */
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  line-height: 0;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 4px 16px rgba(0,0,0,0.45);
  pointer-events: none;          /* let the slider scrub underneath it */
}
.tv-compare .tv-input-large .tv-input-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;                    /* cross-fade buffers, same as the comparison */
  transition: opacity 0.3s ease;
}
.tv-compare .tv-input-large .tv-input-vid.is-shown { opacity: 1; }
.tv-input-tag {
  position: absolute;
  top: 6px; left: 8px;
  z-index: 2;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  line-height: 1;
}
@media (max-width: 720px) {
  .tv-compare .tv-input-large { width: 34%; }
}

/* Thumbnails play the original input videos — always a single row. */
.tv-thumbs { margin-top: 18px; }
.tv-thumb-row {
  display: flex;
  flex-wrap: nowrap;           /* never wrap to a second row */
  gap: 10px;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 0 8px;         /* headroom so the zoomed thumb isn't clipped */
}
.tv-thumbs .scene-thumb {
  flex: 1 1 0;                 /* share the row width, shrink to fit */
  min-width: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.15s ease, box-shadow 0.2s ease;
  transform-origin: center bottom;
}
.tv-thumbs .scene-thumb video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;        /* uniform thumbnails regardless of source ratio */
  object-fit: cover;
  border-radius: 7px;
  background: #000;
  filter: brightness(0.82) saturate(0.92);   /* idle siblings sit back a bit */
  transition: filter 0.15s ease;
}
.tv-thumbs .scene-thumb:hover video,
.tv-thumbs .scene-thumb.is-active video { filter: none; }

/* The picked scene zooms forward. */
.tv-thumbs .scene-thumb:hover { transform: translateY(-2px); }
.tv-thumbs .scene-thumb.is-active {
  transform: scale(1.22);
  z-index: 2;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--link) 35%, transparent);
}
@media (max-width: 720px) {
  .tv-thumb-row { gap: 5px; }
  .tv-thumbs .scene-thumb.is-active { transform: scale(1.14); }
}
