/* scene-proof.css - the three closing scenes of the PwP page, version 4:
 *   numbers  "Ahead of the baselines, even from one view."  metric lanes (Tables 1 and 3) + the paper tables
 *   why      "Why learn the sphere first?"                   the four ablation models, one video, one clock
 *   cite     "Cite PwP."                                     anonymous BibTeX with a copy button
 * Shared primitives (tokens, .v4-table, .v4-switch, .v4-screen ...) come from v4.css; this file only adds the
 * scenes' own v4-numbers-* / v4-why-* / v4-cite-* classes.
 */

/* =============================================================== numbers */
.v4-numbers-top { align-items: end; row-gap: var(--v4-s6); }
.v4-numbers-state { grid-column: 1 / span 5; align-self: start; }
.v4-numbers-head { max-width: 9.5em; }
.v4-numbers-say { margin-top: var(--v4-s5); max-width: 36ch; }
.v4-numbers-race { grid-column: 6 / -1; min-width: 0; padding-left: clamp(0px, 2vw, 32px); }

/* metric switch: one row of six; the auto-advance draws its progress along the chosen button */
.v4-numbers-metric { margin-bottom: var(--v4-s4); }
.v4-numbers-metric > button { position: relative; overflow: hidden; }
.v4-numbers-metric > button.is-auto::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--v4-paper); opacity: 0.75; transform-origin: 0 50%; transform: scaleX(0);
  animation: v4-numbers-prog var(--v4-numbers-auto, 3.4s) linear forwards;
}
@keyframes v4-numbers-prog { to { transform: scaleX(1); } }

/* lanes: one per evaluation set; better is always to the right */
.v4-numbers-lanes { display: grid; gap: var(--v4-s2); }
.v4-numbers-lane { border-top: 1px solid var(--v4-line); padding-top: 8px; }
.v4-numbers-lane__name { font-size: var(--v4-fs-xs); color: var(--v4-ink-3); line-height: 1.3; }
.v4-numbers-lane__name b { color: var(--v4-ink); font-weight: 650; }
.v4-numbers-track {
  --axis: 74px;                         /* axis height inside the track */
  position: relative; height: 138px; margin: 0 8px;
}
.v4-numbers-axis {
  position: absolute; left: -8px; right: -8px; top: var(--axis); height: 1px; background: var(--v4-line-2);
}
.v4-numbers-axis::after {             /* arrow head: better -> */
  content: ""; position: absolute; right: -1px; top: -3.5px; width: 7px; height: 7px;
  border-top: 1px solid var(--v4-ink-3); border-right: 1px solid var(--v4-ink-3); transform: rotate(45deg);
}
.v4-numbers-band {                     /* the three baselines' range */
  position: absolute; top: calc(var(--axis) - 3px); height: 7px; background: var(--v4-line);
  transition: left var(--v4-t3) var(--v4-ease), width var(--v4-t3) var(--v4-ease), opacity var(--v4-t3) var(--v4-ease);
}
.v4-numbers-lead, .v4-numbers-run {
  position: absolute; height: 0;
  transition: left var(--v4-t3) var(--v4-ease), width var(--v4-t3) var(--v4-ease), opacity var(--v4-t3) var(--v4-ease);
}
.v4-numbers-lead { top: calc(var(--axis) - 0.75px); border-top: 1.5px dashed var(--v4-ink-2); }
.v4-numbers-run { top: calc(var(--axis) - 1.5px); height: 3px; background: var(--v4-ink); }
.v4-numbers-dot {
  position: absolute; top: var(--axis); width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; border-radius: 50%;
  transition: left var(--v4-t3) var(--v4-ease), opacity var(--v4-t3) var(--v4-ease), transform var(--v4-t3) var(--v4-ease);
}
.v4-numbers-dot--base { width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; background: var(--v4-paper); box-shadow: inset 0 0 0 1.5px var(--v4-ink-3); }
.v4-numbers-dot--base.is-best { box-shadow: inset 0 0 0 1.5px var(--v4-ink-2); }
.v4-numbers-dot--one { background: var(--v4-paper); box-shadow: inset 0 0 0 2.5px var(--v4-ink); z-index: 1; }
.v4-numbers-dot--all { background: var(--v4-ink); z-index: 2; }
.v4-numbers-lab {
  position: absolute; left: 0; display: grid; justify-items: center; white-space: nowrap; line-height: 1.1;
  transition: left var(--v4-t3) var(--v4-ease), opacity var(--v4-t3) var(--v4-ease), transform var(--v4-t3) var(--v4-ease);
}
.v4-numbers-lab--up { bottom: calc(100% - var(--axis) + 13px); }
.v4-numbers-lab--down { top: calc(var(--axis) + 13px); }
.v4-numbers-lab b {
  font-family: var(--v4-display); font-stretch: 75%; font-weight: 650; font-size: clamp(21px, 1.9vw, 27px);
  color: var(--v4-ink); letter-spacing: -0.01em; font-variant-numeric: lining-nums tabular-nums;
}
.v4-numbers-lab span { font-size: 11.5px; color: var(--v4-ink-3); margin-top: 2px; }
.v4-numbers-lab--all b { font-size: clamp(27px, 2.5vw, 36px); }
.v4-numbers-lab--all span { color: var(--v4-ink); font-weight: 600; }
.v4-numbers-lab--one span { color: var(--v4-ink-2); font-weight: 600; }
.v4-numbers-lab--base b { color: var(--v4-ink-3); font-weight: 600; font-size: clamp(18px, 1.5vw, 22px); }
.v4-numbers-lab.is-fresh { animation: v4-numbers-fresh var(--v4-t2) var(--v4-ease); }
@keyframes v4-numbers-fresh { from { opacity: 0.15; } to { opacity: 1; } }

/* the build: dots arrive from the baselines' side, in order (baselines, one view, all cameras) */
.v4-numbers-race.is-pre .v4-numbers-dot, .v4-numbers-race.is-pre .v4-numbers-lab { opacity: 0; transform: translateX(-36px); }
.v4-numbers-race.is-pre .v4-numbers-band, .v4-numbers-race.is-pre .v4-numbers-lead,
.v4-numbers-race.is-pre .v4-numbers-run { opacity: 0; }
.v4-numbers-lead { transition-delay: 0s, 0s, calc(3 * var(--v4-stagger)); }
.v4-numbers-run { transition-delay: 0s, 0s, calc(7 * var(--v4-stagger)); }
.v4-numbers-dot--one, .v4-numbers-lab--one { transition-delay: 0s, calc(4 * var(--v4-stagger)), calc(4 * var(--v4-stagger)); }
.v4-numbers-dot--all, .v4-numbers-lab--all { transition-delay: 0s, calc(8 * var(--v4-stagger)), calc(8 * var(--v4-stagger)); }

/* key: the marks on the lanes */
.v4-numbers-key {
  list-style: none; margin: clamp(28px, 4.5vh, 44px) 0 0; padding: 14px 0 0; border-top: 1px solid var(--v4-line);
  display: grid; gap: 9px; font-size: var(--v4-fs-xs); color: var(--v4-ink-3); max-width: 36rem;
}
.v4-numbers-key li { display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 12px; align-items: center; }
.v4-numbers-key__who { color: var(--v4-ink-2); }
.v4-numbers-mark { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; }
.v4-numbers-mark--base { width: 8px; height: 8px; box-shadow: inset 0 0 0 1.5px var(--v4-ink-3); }
.v4-numbers-mark--one { box-shadow: inset 0 0 0 2.2px var(--v4-ink); }
.v4-numbers-mark--all { background: var(--v4-ink); }
.v4-numbers-better { color: var(--v4-ink-2); font-weight: 600; }

/* the paper tables, behind two tabs */
.v4-numbers-tables { margin-top: clamp(56px, 8vh, 96px); }
.v4-numbers-tabbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--v4-s3) var(--v4-s6);
  border-bottom: 1px solid var(--v4-line); margin-bottom: var(--v4-s2);
}
.v4-numbers-tabs { position: relative; display: flex; gap: clamp(20px, 3vw, 44px); }
.v4-numbers-tab {
  display: inline-flex; align-items: baseline; gap: 10px;
  padding: 6px 0 12px; border: 0; background: none;
  font-family: var(--v4-display); font-stretch: 75%; font-weight: 650; font-size: clamp(21px, 2vw, 30px);
  line-height: 1; letter-spacing: -0.01em; color: var(--v4-ink-4); white-space: nowrap;
  transition: color var(--v4-t1) var(--v4-ease);
}
.v4-numbers-tab:hover { color: var(--v4-ink-2); }
.v4-numbers-tab[aria-selected="true"] { color: var(--v4-ink); }
.v4-numbers-tab__no { font: 600 12px/1 var(--v4-sans); letter-spacing: 0.02em; color: var(--v4-ink-3); }
.v4-numbers-tabs__ink {                 /* the chosen tab's rule, slides between tabs */
  position: absolute; bottom: -1px; left: 0; height: 2px; width: 0; background: var(--v4-ink);
  transition: transform var(--v4-t2) var(--v4-ease), width var(--v4-t2) var(--v4-ease);
}
.v4-numbers-legend { padding-bottom: 12px; }
.v4-numbers-legend b { color: var(--v4-ink); }
.v4-numbers-legend u { text-underline-offset: 3px; }
.v4-numbers-panel:not([hidden]) { animation: v4-numbers-in var(--v4-t2) var(--v4-ease); }
@keyframes v4-numbers-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.v4-numbers-tw { position: relative; }
.v4-numbers-tw::after {                  /* more columns to the right (phones) */
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 40px; pointer-events: none;
  background: linear-gradient(to right, rgba(243, 241, 236, 0), var(--v4-paper));
  opacity: 0; transition: opacity var(--v4-t1) var(--v4-ease);
}
.v4-numbers-tw:has(> .v4-tablewrap:not(.is-end))::after { opacity: 1; }
.v4-numbers-t th[scope="row"] { font-weight: 500; color: var(--v4-ink); position: sticky; left: 0; z-index: 1; background: var(--v4-paper); }
.v4-numbers-t tr.is-group th { letter-spacing: 0.04em; }
.v4-numbers-gt { position: sticky; left: 12px; display: inline-block; }
.v4-numbers-note { font-size: 11.5px; color: var(--v4-ink-3); font-weight: 400; margin-left: 4px; }
.v4-numbers-t td[data-m] { transition: background var(--v4-t2) var(--v4-ease); }
.v4-numbers-mbtn {
  padding: 2px 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer;
  text-decoration: underline dotted transparent; text-underline-offset: 4px;
}
.v4-numbers-mbtn:hover { text-decoration-color: var(--v4-ink-3); }
.v4-numbers-mbtn[aria-pressed="true"] { text-decoration: underline solid var(--v4-ink); text-decoration-thickness: 2px; }
/* the metric on the lanes is tinted in the tables too */
.v4-numbers-t[data-focus="psnr"] [data-m="psnr"], .v4-numbers-t[data-focus="ssim"] [data-m="ssim"],
.v4-numbers-t[data-focus="lpips"] [data-m="lpips"], .v4-numbers-t[data-focus="fvd"] [data-m="fvd"],
.v4-numbers-t[data-focus="fid"] [data-m="fid"], .v4-numbers-t[data-focus="qalign"] [data-m="qalign"] {
  background: rgba(20, 21, 24, 0.045);
}

/* =============================================================== why */
.v4-why-top { margin-bottom: clamp(26px, 4vh, 44px); }
.v4-why-head { grid-column: 4 / -1; justify-self: end; text-align: right; }
.v4-why-fig { max-width: calc(1024px * 1.25 + 40px); margin: 0 auto; }
.v4-why-matrix {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px;
}
.v4-why-axis { font-size: var(--v4-fs-xs); color: var(--v4-ink-3); line-height: 1.2; }
.v4-why-axis--c1 { grid-column: 2; grid-row: 1; }
.v4-why-axis--c2 { grid-column: 3; grid-row: 1; color: var(--v4-ink); font-weight: 600; }
.v4-why-axis--r1, .v4-why-axis--r2 {
  grid-column: 1; writing-mode: vertical-rl; transform: rotate(180deg); align-self: center; justify-self: center;
  white-space: nowrap;
}
.v4-why-axis--r1 { grid-row: 2; }
.v4-why-axis--r2 { grid-row: 3; color: var(--v4-ink); font-weight: 600; }
.v4-why-axis--c1::before, .v4-why-axis--c2::before { content: "↓ "; color: var(--v4-ink-4); }
.v4-why-panes {
  grid-column: 2 / 4; grid-row: 2 / 4;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px;
}
.v4-why-pane { position: relative; min-width: 0; }
.v4-why-pane .v4-gate { --v4-ar: 2 / 1; background: var(--v4-void); }
.v4-why-pane canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.v4-why-src { position: absolute; left: 0; top: 0; width: 2px; height: 1px; opacity: 0; pointer-events: none; }
.v4-why-chip {
  position: absolute; z-index: 5; bottom: 10px; left: 10px;
  padding: 5px 8px; font-size: 12px; line-height: 1.2; white-space: nowrap;
  background: rgba(12, 12, 14, 0.62); color: rgba(255, 255, 255, 0.86);
}
.v4-why-chip b { color: #fff; font-weight: 650; margin-right: 5px; }
.v4-why-pane--ours .v4-why-chip { background: rgba(255, 255, 255, 0.94); color: var(--v4-ink-2); }
.v4-why-pane--ours .v4-why-chip b { color: var(--v4-ink); }
.v4-why-foot {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--v4-s4) var(--v4-s7);
  margin: calc(var(--v4-mark-off) + 22px) 0 0 40px;
}
.v4-why-say { flex: 1 1 380px; }
.v4-why-transport { flex: 0 1 460px; min-width: 260px; }
.v4-why-fig > .v4-slate { margin-left: 40px; border-top: 1px solid var(--v4-line); padding-top: 10px; margin-top: var(--v4-s5); }

/* =============================================================== cite (the end card) */
.v4-cite { display: grid; justify-items: center; text-align: center; padding-bottom: var(--v4-s6); }
.v4-cite-head { font-size: clamp(38px, 4.4vw, 68px); }
.v4-cite-plate { width: min(100%, 900px); margin-top: clamp(24px, 4vh, 40px); text-align: left; }
.v4-cite-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--v4-s4); margin-bottom: 10px; }
.v4-cite-kind { font-weight: 650; color: var(--v4-ink); font-size: 14px; }
.v4-cite-kind span { font-weight: 400; color: var(--v4-ink-3); font-size: var(--v4-fs-xs); margin-left: 8px; }
.v4-cite-copy.is-done { background: var(--v4-paper); color: var(--v4-ink); }
.v4-cite-bib { white-space: pre-wrap; overflow-x: visible; padding: var(--v4-s5) var(--v4-s5) var(--v4-s5) var(--v4-s5); box-shadow: var(--v4-shadow); }
.v4-cite-l { display: block; padding-left: 15ch; text-indent: -15ch; overflow-wrap: anywhere; }
html.v4-js .v4-cite-plate.v4-rise .v4-cite-l {
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--v4-t3) var(--v4-ease), transform var(--v4-t3) var(--v4-ease);
  transition-delay: calc(4 * var(--v4-stagger) + var(--i, 0) * 2 * var(--v4-stagger));
}
html.v4-js .v4-cite-plate.is-shown .v4-cite-l, html.v4-reduced .v4-cite-l { opacity: 1; transform: none; }
.v4-cite-note { margin-top: 12px; }
.v4-cite-status { color: var(--v4-ink); font-weight: 600; }

/* =============================================================== responsive */
@media (max-width: 1099px) {
  .v4-numbers-state { grid-column: 1 / -1; }
  .v4-numbers-head { max-width: none; }
  .v4-numbers-race { grid-column: 1 / -1; }
  .v4-why-head { grid-column: 1 / -1; }
}
@media (max-width: 719px) {
  .v4-numbers-metric { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .v4-numbers-metric > button { justify-content: center; padding: 0 6px; border-bottom: 1px solid var(--v4-line); }
  .v4-numbers-metric > button:nth-child(3n) { border-right: 0; }
  .v4-numbers-metric > button:nth-child(n + 4) { border-bottom: 0; }
  .v4-numbers-race { padding-left: 0; }
  .v4-numbers-track { height: 124px; --axis: 66px; }
  .v4-numbers-lab b { font-size: 21px; }
  .v4-numbers-lab--all b { font-size: 25px; }
  .v4-numbers-lab--base b { font-size: 17px; }
  .v4-numbers-lab span { font-size: 11px; }
  .v4-numbers-tabbar { border-bottom: 0; }
  .v4-numbers-tabs { width: 100%; border-bottom: 1px solid var(--v4-line); gap: 18px; }
  .v4-numbers-tab { font-size: 19px; flex-direction: column; align-items: flex-start; gap: 5px; white-space: normal; text-align: left; }
  /* phones: Method and the metric chosen above (the lanes' switch), nothing to scroll sideways */
  .v4-numbers-t th[data-m], .v4-numbers-t td[data-m] { display: none; }
  .v4-numbers-t[data-focus="psnr"] [data-m="psnr"], .v4-numbers-t[data-focus="ssim"] [data-m="ssim"],
  .v4-numbers-t[data-focus="lpips"] [data-m="lpips"], .v4-numbers-t[data-focus="fvd"] [data-m="fvd"],
  .v4-numbers-t[data-focus="fid"] [data-m="fid"], .v4-numbers-t[data-focus="qalign"] [data-m="qalign"] {
    display: table-cell; background: none; text-align: right;
  }
  .v4-numbers-t { width: 100%; }
  .v4-numbers-t th[scope="row"] { position: static; }
  .v4-numbers-tw::after { display: none; }
  .v4-numbers-t th, .v4-numbers-t td { padding: 8px 9px; font-size: 13.5px; }
  .v4-numbers-gt { white-space: normal; max-width: calc(100vw - 2 * var(--v4-gutter) - 24px); }

  .v4-why-matrix { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .v4-why-axis { display: none; }
  .v4-why-panes { grid-column: 1; grid-row: auto; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .v4-why-chip { bottom: 6px; left: 6px; font-size: 11.5px; padding: 4px 6px; }
  .v4-why-foot { margin-left: 0; }
  .v4-why-transport { flex: 1 1 100%; }
  .v4-why-fig > .v4-slate { margin-left: 0; }

  .v4-cite { justify-items: stretch; text-align: left; }
  .v4-cite-bar { flex-wrap: wrap; }
  .v4-cite-bib { font-size: 12px; padding: var(--v4-s4); }
  .v4-cite-l { padding-left: 4ch; text-indent: -4ch; }
}
@media print {
  .v4-numbers-metric, .v4-why-transport, .v4-cite-copy { display: none; }
}
