/* ==========================================================================
   PACT project page
   ========================================================================== */

/* ----- Tokens ----- */
:root {
  --bg: #ffffff;
  --bg-tint: #fafafa;
  --fg: #111111;
  --fg-soft: #2b2b2b;
  --muted: #6b6b6b;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);

  --pose: #2F6BFF;
  --contacts: #E8541E;
  --forces: #E0A800;
  --label: #E03030;   /* forces solved by the annotation pipeline */

  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);

  --content: 1100px;
  --wide: 1240px;
  --gutter: 24px;
  --nav-h: 60px;
  --section-pad: 96px;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Small yellow up arrow used before eyebrow labels */
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath d='M5 0 10 5.5H6.6V12H3.4V5.5H0z' fill='%23E0A800'/%3E%3C/svg%3E");
}

/* ----- Base ----- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "cv11" 0, "ss01" 0;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3 {
  margin: 0;
  color: var(--fg);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

p { margin: 0; }

a { color: inherit; }

img, video { display: block; max-width: 100%; }

figure { margin: 0; }

:focus-visible {
  outline: 2px solid var(--pose);
  outline-offset: 3px;
  border-radius: 6px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--fg);
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Accent words */
.c-pose     { color: var(--pose); }
.c-contacts { color: var(--contacts); }
.c-forces   { color: var(--forces); }

/* ----- Layout ----- */
.container {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: calc(var(--wide) + 2 * var(--gutter)); }

.section {
  padding-block: var(--section-pad);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
.section--tint {
  background: var(--bg-tint);
  border-block: 1px solid var(--line);
}

/* ----- Section header pattern ----- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 9px;
  height: 11px;
  background: var(--arrow) center / contain no-repeat;
  flex: none;
}

.section-head { margin-bottom: 40px; }
.section-head h2 {
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 800;
}
.lede {
  max-width: 72ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: 18px;
}

.subsection + .subsection,
.subsection--spaced { margin-top: 80px; }
.subsection h3,
.figure-block h3,
.viewer__head h3 {
  font-size: clamp(21px, 2.3vw, 26px);
  font-weight: 800;
}
.sub-lede {
  max-width: 72ch;
  margin: 10px 0 24px;
  color: var(--muted);
}

/* ----- Navigation ----- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}
.nav__brand {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.nav__links {
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav__links a:hover { color: var(--fg); }
.nav__actions { display: flex; gap: 8px; }

/* ----- Pill buttons ----- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.pill:hover { border-color: var(--fg); }
.pill--dark {
  background: var(--fg);
  border-color: var(--fg);
  color: #fff;
}
.pill--dark:hover { background: #2a2a2a; transform: translateY(-1px); }
.pill--sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  gap: 6px;
}
.icon { width: 18px; height: 18px; flex: none; }
.pill--sm .icon { width: 15px; height: 15px; }

/* ----- Hero ----- */
.hero { padding: 72px 0 var(--section-pad); }
.hero__text { text-align: center; }

.wordmark {
  font-size: clamp(64px, 14vw, 160px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.9;
  /* optical compensation for the tight tracking */
  margin-right: -0.05em;
}
.hero__subtitle {
  max-width: 28ch;
  margin: 20px auto 0;
  font-size: clamp(21px, 2.8vw, 32px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-wrap: balance;
}

.authors,
.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.authors {
  max-width: 820px;
  margin-top: 36px;
  gap: 4px 22px;
  font-size: 17px;
  font-weight: 500;
}
.authors a {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.2s ease;
}
.authors a:hover { background-size: 100% 1px; }
.authors sup,
.affiliations sup {
  margin-left: 1px;
  font-size: 0.68em;
  color: var(--muted);
}
.affiliations {
  margin-top: 12px;
  gap: 4px 20px;
  font-size: 15px;
  color: var(--muted);
}
.affiliations sup { margin: 0 3px 0 0; }

.hero__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}

/* Hero strip: five portrait clips */
.strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 64px;
}

/* ----- Media cards ----- */
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f2f2f2;
  box-shadow: var(--shadow);
}
.card video,
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card--portrait  { aspect-ratio: 9 / 16; }
.card--wide      { aspect-ratio: 16 / 9; }
.card--triptych  { aspect-ratio: 1728 / 576; background: #fff; }
.card--forcewall { aspect-ratio: 1898 / 1252; background: #fff; }
.card--wide video { object-fit: contain; background: #000; }
.card--forcewall video { object-fit: contain; }

.clip figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

/* Labels aligned to the three panels of a world-space clip */
.panel-labels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}

.stack { display: grid; gap: 28px; }

.grid { display: grid; gap: 28px 20px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
/* An odd last item sits centred under the two columns */
.grid--center-last > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
  width: calc(50% - 10px);
  justify-self: center;
}

/* Small inline legend: an arrow swatch and its meaning */
.legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.legend__arrow {
  position: relative;
  width: 26px;
  height: 4px;
  border-radius: 2px 0 0 2px;
  flex: none;
}
.legend__arrow::after {
  content: "";
  position: absolute;
  right: -7px;
  top: -4px;
  border: 6px solid transparent;
  border-left: 8px solid currentColor;
  border-right: 0;
}
.legend__arrow--label { background: var(--label); color: var(--label); }
.legend__arrow--pact  { background: var(--forces); color: var(--forces); }
.sub-lede + .legend { margin-top: -10px; }

/* Annotation stages: five portrait clips in one synced row */
.stages {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.stage figcaption {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
}
.stage figcaption strong {
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.01em;
}

/* ----- TL;DR + abstract: one centred reading column ----- */
.summary {
  max-width: 740px;
  margin-inline: auto;
  text-align: center;
}
.summary .eyebrow { margin-bottom: 20px; }
.summary__tldr {
  font-size: clamp(24px, 3.1vw, 34px);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.28;
  text-wrap: balance;
}
.summary__tail {
  display: block;
  margin-top: 14px;
  font-size: 0.62em;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--muted);
}
/* Key words: a soft full-height tint in the brand colour, text stays dark */
.hl {
  color: inherit;
  padding: 0.04em 0.16em 0.06em;
  margin: 0 -0.04em;
  border-radius: 0.22em;
  background: var(--hl);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.hl--pose     { --hl: rgba(47, 107, 255, 0.16); }
.hl--contacts { --hl: rgba(232, 84, 30, 0.16); }
.hl--forces   { --hl: rgba(224, 168, 0, 0.26); }

.summary__rule {
  width: 48px;
  height: 3px;
  margin: 56px auto 48px;
  border: 0;
  border-radius: 2px;
  background: var(--forces);
}
.summary__abstract {
  color: var(--fg-soft);
  font-size: 17px;
  line-height: 1.65;
  text-align: justify;
  text-align-last: left;
  -webkit-hyphens: auto;
  hyphens: auto;
  hyphenate-limit-chars: 7 3 3;
}

/* ----- Method: staged vs end-to-end ----- */
.compare {
  display: grid;
  gap: 14px;
  margin-bottom: 80px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.compare__row {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 16px;
}
.compare__row + .compare__row {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.compare__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.compare__label--strong { color: var(--fg); }
.compare__row--staged .chip { color: var(--muted); }

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.flow__arrow {
  width: 22px;
  height: 1px;
  background: var(--line-strong);
  position: relative;
  flex: none;
}
.flow__arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  border: 3.5px solid transparent;
  border-left: 5px solid var(--line-strong);
  border-right: 0;
}
.chip-group { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  background: var(--bg);
}
.chip--model {
  background: var(--fg);
  border-color: var(--fg);
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot--pose     { background: var(--pose); }
.dot--contacts { background: var(--contacts); }
.dot--forces   { background: var(--forces); }

/* ----- Method: figure blocks ----- */
.figure-block {
  display: grid;
  grid-template-columns: 3fr 2fr;
  align-items: center;
  gap: 48px;
}
.figure-block + .figure-block { margin-top: 80px; }

.figure {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.figure a { display: block; border-radius: 8px; cursor: zoom-in; }
.figure img { width: 100%; height: auto; }

/* Numbered steps with small yellow circles */
.steps {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding-left: 40px;
  color: var(--fg-soft);
  counter-increment: step;
}
.steps li + li { margin-top: 14px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--forces);
  color: var(--fg);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* ----- Interactive 3D viewers ----- */
.viewer {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg);
  box-shadow: var(--shadow);
}
.viewer + .viewer { margin-top: 48px; }
.viewer__head { margin-bottom: 20px; }
.viewer__head p {
  max-width: 72ch;
  margin-top: 8px;
  color: var(--muted);
}
.viewer__key { font-weight: 600; }
.viewer__key--label { color: var(--label); }
.viewer__key--pact  { color: #B98A00; } /* the brand yellow, darkened for text contrast */

.viewer__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 20px;
}

.viewer__stage {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.viewer__stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: grab;
}
.viewer__stage canvas:active { cursor: grabbing; }
.viewer__status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.viewer__status[hidden] { display: none; }
/* Touch screens: the scene must be tapped before it captures gestures */
.viewer__tap {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 1;
  display: none;
  margin: 0;
  padding: 7px 14px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.78);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  white-space: nowrap;
}
.viewer.is-touch.is-ready:not(.is-engaged) .viewer__tap { display: block; }

.viewer__side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.viewer__video {
  height: 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f2f2f2;
}
.viewer__video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.viewer__chips,
.viewer__toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.vchip,
.vtoggle {
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.vchip:hover,
.vtoggle:hover { color: var(--fg); border-color: var(--fg); }
.vchip[aria-pressed="true"] {
  background: var(--fg);
  border-color: var(--fg);
  color: #fff;
}
.vtoggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 11px;
  font-size: 12.5px;
}
.vtoggle::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  flex: none;
}
.vtoggle[aria-pressed="true"] { color: var(--fg); }
.vtoggle[aria-pressed="true"]::before {
  background: var(--accent, var(--fg));
  border-color: var(--accent, var(--fg));
}
.vtoggle[hidden] { display: none; }

.viewer__transport {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.vbtn:hover { border-color: var(--fg); }
.vbtn--play {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--fg);
  border-color: var(--fg);
  color: #fff;
}
.vbtn--play .icon { width: 16px; height: 16px; }
.vbtn--play .icon--play,
.vbtn--play.is-paused .icon--pause { display: none; }
.vbtn--play.is-paused .icon--play { display: block; }
.vbtn--text {
  align-self: flex-start;
  justify-self: start;
  height: 32px;
  padding: 0 13px 0 11px;
  border-radius: 999px;
  color: var(--muted);
}
.vbtn--text:hover { color: var(--fg); }
.vbtn--text .icon { width: 15px; height: 15px; }

/* Frame scrubber */
.viewer__scrub {
  flex: 1;
  min-width: 0;
  height: 20px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.viewer__scrub::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(var(--fg), var(--fg)) 0 / var(--p, 0%) 100% no-repeat, #e4e4e4;
}
.viewer__scrub::-moz-range-track { height: 4px; border-radius: 2px; background: #e4e4e4; }
.viewer__scrub::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--fg); }
.viewer__scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.viewer__scrub::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ----- Citation ----- */
.bibtex {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-tint);
}
.bibtex pre {
  margin: 0;
  padding: 28px 28px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--fg-soft);
}
.bibtex__copy {
  position: absolute;
  top: 12px;
  right: 12px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.bibtex__copy:hover { border-color: var(--fg); }
.bibtex__copy.is-copied { border-color: var(--forces); }

/* ----- Footer ----- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 32px;
  font-size: 14px;
  color: var(--muted);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--fg); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .nav__links { display: none; }
  .figure-block { grid-template-columns: 1fr; gap: 28px; }
  .figure-block__text { max-width: 72ch; }
  .viewer__body { grid-template-columns: 1fr; }
  .viewer__stage { min-height: 0; }
  /* Video beside the controls when the side column drops below the scene */
  .viewer__side {
    display: grid;
    grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr;
    column-gap: 20px;
    row-gap: 14px;
    align-items: start;
  }
  .viewer__video { grid-row: 1 / span 4; height: 280px; }
}

@media (max-width: 720px) {
  :root {
    --gutter: 16px;
    --nav-h: 56px;
    --section-pad: 56px;
  }
  body { font-size: 16px; }

  .hero { padding-top: 48px; }
  .authors { gap: 2px 16px; font-size: 16px; }
  .affiliations { font-size: 14px; }
  .hero__buttons { gap: 8px; }
  .hero__buttons .pill { height: 40px; padding: 0 16px; font-size: 14px; }

  /* Hero strip and annotation stages become edge-to-edge snap rows */
  .strip,
  .stages {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 38%;
    gap: 12px;
    margin-inline: calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .strip { margin-top: 44px; }
  .strip::-webkit-scrollbar,
  .stages::-webkit-scrollbar { display: none; }
  .strip .card,
  .stages .stage { scroll-snap-align: start; }
  .strip .card,
  .stages .card { border-radius: 12px; }
  .stage figcaption { font-size: 13px; }

  .summary__rule { margin: 40px auto 36px; }
  .summary__abstract { font-size: 16px; }
  .lede { font-size: 17px; }

  .compare { padding: 18px; }
  .compare__row { grid-template-columns: 1fr; gap: 10px; }

  .subsection + .subsection,
  .subsection--spaced,
  .figure-block + .figure-block { margin-top: 56px; }
  .compare { margin-bottom: 56px; }

  .panel-labels { font-size: 12px; }

  .viewer { padding: 16px; border-radius: 16px; }
  .viewer + .viewer { margin-top: 32px; }
  .viewer__stage { aspect-ratio: 4 / 5; border-radius: 12px; }
  .viewer__side { grid-template-columns: minmax(0, 132px) minmax(0, 1fr); column-gap: 14px; }
  .viewer__video { height: 236px; }
}

@media (max-width: 560px) {
  .grid--2 { grid-template-columns: 1fr; }
  .grid--center-last > :last-child:nth-child(odd) { width: auto; }
  .bibtex pre { padding: 56px 18px 20px; font-size: 12.5px; }
}

/* Very narrow screens: justified text leaves gaps, so the abstract goes ragged-right */
@media (max-width: 480px) {
  .summary__abstract { text-align: left; }
  .summary__tail { font-size: 0.7em; }
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
