/* Cross-Skeleton Retargeting project page */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --track: #e3e3e8;
  --accent: #0071e3;
  --accent-text: #0066cc; /* darker version of the accent for text on white or #f5f5f7 (WCAG AA) */
  --accent-far: #99c6f4; /* lighter tint of the accent for far-side limbs in the hero */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: 16px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* Smooth jumps for in-page links only once the page has settled (site.js adds the class), so that
   opening a chapter link lands directly on the chapter instead of gliding through the page. */
html.is-settled { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 1080px);
  margin-inline: auto;
}
.wrap-text { max-width: 760px; }

/* Header */

.masthead {
  padding: clamp(14px, 1.4vw, 20px) 0 clamp(14px, 1.4vw, 20px);
  text-align: center;
}
.venue {
  margin: 0 0 6px;
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.title {
  margin: 0 auto;
  max-width: 1240px;
  font-size: clamp(34px, 4.1vw, 54px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.nowrap { white-space: nowrap; }
.title-rest {
  display: block;
  margin-top: 0.2em;
  color: var(--muted);
  font-size: 0.5em;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.authors {
  margin: clamp(12px, 1.2vw, 16px) 0 0;
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.45;
}
.authors a { color: var(--text); white-space: nowrap; }
.authors a:hover { color: var(--accent-text); text-decoration: none; }
sup { font-size: max(12px, 0.62em); line-height: 0; margin-left: 1px; }
.affiliation {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}
.departments {
  margin: 1px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.departments .dot { margin: 0 6px; }
.departments sup { margin: 0 1px 0 0; vertical-align: 0.2em; }

.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: clamp(12px, 1.2vw, 16px);
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 20px;
  border-radius: 980px;
  border: 1px solid var(--accent);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, filter 0.2s ease;
}
.pill:hover { text-decoration: none; }
.pill-primary { background: var(--accent-text); border-color: var(--accent-text); color: #fff; }
.pill-primary:hover { filter: brightness(1.08); }
.pill-secondary { background: transparent; border-color: var(--accent-text); color: var(--accent-text); }
.pill-secondary:hover { background: var(--accent-text); color: #fff; }
.pill-small {
  min-height: 28px;
  padding: 0 14px;
  font-size: 13px;
}

/* Hero animation. hero.js draws the SVG in screen pixels, so the sizes below are real sizes. */

.hero { padding: clamp(6px, 1vw, 14px) 0 clamp(48px, 6vw, 80px); }
.hero-wrap {
  width: min(100% - 2 * var(--gutter), 1080px);
  margin-inline: auto;
}
/* Below 900px the stage uses the phone layout, scaled up to at most this width. */
@media (max-width: 899px) {
  .hero-wrap { max-width: 560px; }
}
.hero-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--font);
  overflow: visible;
}
.hero-line {
  margin: clamp(18px, 2vw, 28px) auto 0;
  text-align: center;
  font-size: clamp(24px, 1rem + 1.2vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.accent-text { color: var(--accent-text); }

.hx-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; fill: var(--text); }
.hx-sub { font-size: 15px; font-weight: 500; fill: var(--muted); }
.hx-label { font-size: 15px; font-weight: 500; fill: var(--muted); }
.hx-label-strong { font-weight: 600; fill: var(--text); }
.hx-meter { font-size: 15px; font-weight: 600; fill: var(--text); }
.hx-note { font-size: 13px; fill: var(--muted); }
.hx-status { font-size: 14px; font-weight: 600; fill: var(--accent-text); }
.hx-status-off { fill: var(--muted); }
.hx-table-head { font-size: 13px; font-weight: 600; fill: var(--muted); }
.hx-track { fill: var(--track); }
.hx-fill { fill: var(--accent); }
.hx-card { fill: var(--bg-alt); }
.hx-dot { fill: #b9b9bf; }
.hx-rule { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.hx-arrow {
  fill: none;
  stroke: #b9b9bf;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Figures: ink colour per figure, a lighter tint of it for the limbs on the far side. */
.hx-src { --ink: var(--text); --ink-far: #b4b4b9; }
.hx-out { --ink: var(--accent); --ink-far: var(--accent-far); }
.hx-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.hx-thick { stroke-width: 5.6; }
.hx-far .hx-line { stroke: var(--ink-far); }
.hx-fillink { fill: var(--ink); }

.hero-svg.is-narrow .hx-title { font-size: 17px; }
.hero-svg.is-narrow .hx-sub,
.hero-svg.is-narrow .hx-label,
.hero-svg.is-narrow .hx-note,
.hero-svg.is-narrow .hx-status,
.hero-svg.is-narrow .hx-table-head { font-size: 12px; }
.hero-svg.is-narrow .hx-meter { font-size: 14px; }
/* Figure strokes are in screen pixels; --k is the scale hero.js applies to the phone layout. */
.hero-svg.is-narrow .hx-line { stroke-width: calc(3px * var(--k, 1)); }
.hero-svg.is-narrow .hx-thick { stroke-width: calc(4px * var(--k, 1)); }
.hero-svg.is-narrow .hx-arrow { stroke-width: 1.25; }

/* Text bands */

.band { padding: clamp(56px, 8vw, 104px) 0; }
.band-alt { background: var(--bg-alt); }

.eyebrow {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}
.lead {
  margin: 0;
  font-size: clamp(21px, 1rem + 0.8vw, 26px);
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: -0.012em;
}

.fold { margin-top: 32px; }
.fold summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  color: var(--accent-text);
  font-size: 17px;
  font-weight: 500;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.3s ease;
}
.fold[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.fold-body {
  margin: 20px 0 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  overflow-wrap: anywhere;
}
.fold[open] .fold-body { animation: fold-in 0.4s ease; }
@keyframes fold-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* Citation */

.code-block {
  position: relative;
  background: var(--surface, var(--bg));
  border-radius: 18px;
  padding: 22px 22px 22px;
}
.code-block pre {
  margin: 0;
  padding-top: 26px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.copy-button {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 980px;
  background: var(--on-surface, var(--bg-alt));
  color: var(--accent-text);
  font: 500 13px var(--font);
  cursor: pointer;
}
.copy-check {
  display: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.copy-button.is-done .copy-label { display: none; }
.copy-button.is-done .copy-check { display: block; }

/* Chapters. Each chapter is <section class="chapter"> or <section class="chapter chapter-alt">;
   the two alternate white and #f5f5f7. --surface is the colour for cards and code on that chapter,
   --on-surface the colour for things sitting on those cards. */

.chapter {
  --surface: var(--bg-alt);
  --on-surface: var(--bg);
  padding: clamp(88px, 11vw, 160px) 0;
  background: var(--bg);
}
.chapter-alt {
  --surface: var(--bg);
  --on-surface: var(--bg-alt);
  background: var(--bg-alt);
}
/* A chapter that still holds only its marker comment takes no space. */
.chapter:empty { display: none; }

.wrap-wide {
  width: min(100% - 2 * var(--gutter), 1280px);
  margin-inline: auto;
}

/* The plain-question heading, the lead sentence and the paper term under it. */
.chapter-title {
  margin: 0;
  max-width: 15em;
  font-size: clamp(36px, 1rem + 4.6vw, 80px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.chapter-lead {
  margin: clamp(20px, 2.2vw, 28px) 0 0;
  max-width: 34em;
  color: var(--muted);
  font-size: clamp(20px, 1rem + 0.7vw, 26px);
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}
.chapter-lead strong { color: var(--text); font-weight: 600; }
.term {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0.005em;
}
/* Space between the heading block and the visual that follows it. */
.chapter-body { margin-top: clamp(40px, 5.5vw, 80px); }
/* A second heading inside a chapter (for example the two explanations in chapter 3). */
.chapter-sub {
  margin: clamp(72px, 9vw, 128px) 0 0;
  max-width: 20em;
  font-size: clamp(26px, 1rem + 1.9vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.chapter-sub + .chapter-lead { margin-top: 16px; }

.caption {
  margin: 18px 0 0;
  max-width: 42em;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}
.caption + .term { margin-top: 6px; }

/* Full-width frame for a video. The renders have white backgrounds, so the frame is white:
   a rounded card on #f5f5f7 chapters, seamless on white ones. Set --ratio for the clip's shape. */
.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: clamp(12px, 1.6vw, 22px);
  background: var(--bg);
  aspect-ratio: var(--ratio, 16 / 9);
}
.media-frame > video,
.media-frame > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Short label for a clip, above its frame. */
.video-label {
  display: block;
  margin: 0 0 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.media-frame + .caption { margin-top: 20px; }

/* Round play/pause button that videos.js puts in a clip's corner. */
.video-toggle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(232, 232, 237, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease, background-color 0.2s ease;
}
.video-toggle svg { width: 14px; height: 14px; fill: currentColor; }
.video-toggle .icon-play { display: none; margin-left: 2px; }
.video-toggle.is-paused .icon-play { display: block; }
.video-toggle.is-paused .icon-pause { display: none; }
.video-toggle:hover { background: rgba(210, 210, 215, 0.9); }
/* Shown on hover, on keyboard focus, while paused, and always on touch screens. */
.has-video-toggle:hover .video-toggle,
.video-toggle:focus-visible,
.video-toggle.is-paused { opacity: 1; }
@media (hover: none) { .video-toggle { opacity: 1; } }
/* Phones: a smaller button, closer to the corner, so it covers less of the clip. */
@media (max-width: 699px) {
  .video-toggle { right: 6px; bottom: 6px; width: 28px; height: 28px; }
  .video-toggle svg { width: 11px; height: 11px; }
}

/* Cards (for example the three links in chapter 8). */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(12px, 1.6vw, 20px);
}
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 150px;
  padding: clamp(22px, 2.4vw, 30px);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.3s ease;
}
a.card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
}
.card-title {
  margin: 0;
  font-size: clamp(19px, 1rem + 0.35vw, 22px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.012em;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 500;
}
.card-link::after {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
  transform: rotate(45deg);
}

/* Large button (for example "View the code on GitHub"). */
.pill-large {
  min-height: 52px;
  padding: 0 30px;
  font-size: 18px;
}

/* Code in a chapter: same block as the citation, one <pre> per snippet. */
.chapter .code-block pre + pre {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Pinned steps (steps.js). Wide screens: beat texts on the left scroll past a visual pinned on the
   right. Below 900px, or before steps.js runs: each beat text, then a still of the visual. */
.steps { position: relative; }
.steps-visual { display: none; }
.step { padding: 28px 0; }
.step-text {
  margin: 0;
  max-width: 24em;
  font-size: clamp(21px, 1rem + 0.8vw, 28px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.014em;
  text-wrap: pretty;
}
.step-still {
  margin-top: 20px;
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}
.step-still .steps-stage { width: 100%; }

@media (min-width: 900px) {
  /* --steps-lift (set by steps.js) is the empty space above the centred visual; the section is pulled
     up by it, and the content after it likewise, so no screen-high gaps open around the visual. */
  .steps.is-pinned {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: clamp(32px, 4vw, 64px);
    margin-top: calc(-1 * var(--steps-lift, 0px));
    margin-bottom: calc(-1 * var(--steps-lift, 0px));
  }
  /* The pulled-up parts overlap the content around the section; let clicks through to it. */
  .steps.is-pinned .steps-beats,
  .steps.is-pinned .steps-sticky { pointer-events: none; }
  .steps.is-pinned .step-text,
  .steps.is-pinned .steps-stage { pointer-events: auto; }
  .steps.is-pinned .steps-beats {
    grid-column: 1;
    grid-row: 1;
    padding-bottom: 20vh;
  }
  .steps.is-pinned .steps-visual {
    display: block;
    grid-column: 2;
    grid-row: 1;
  }
  .steps.is-pinned .steps-sticky {
    position: sticky;
    top: 52px;
    display: flex;
    align-items: center;
    height: calc(100vh - 52px);
  }
  .steps.is-pinned .steps-sticky > .steps-stage {
    width: 100%;
    border-radius: 22px;
    background: var(--surface);
    overflow: hidden;
  }
  /* Beats closer than a screen apart, so the next text comes up before the last one has gone. */
  .steps.is-pinned .step {
    display: flex;
    align-items: center;
    min-height: 72vh;
    padding: 0;
  }
  .steps.is-pinned .step-text {
    opacity: 0.3;
    transition: opacity 0.5s ease;
  }
  .steps.is-pinned .step.is-current .step-text { opacity: 1; }
  .steps.is-pinned .step-still { display: none; }
}

/* Bars that grow once when they first appear (bars.js). Without the script they are drawn full. */
.bar-track {
  position: relative;
  height: 10px;
  border-radius: 980px;
  background: var(--track);
}
.bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  border-radius: inherit;
  background: var(--accent);
}
[data-bars].is-armed .bar-fill {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
[data-bars].is-armed .bar-fill.grows-left { clip-path: inset(0 0 0 100%); }
[data-bars].is-armed.is-grown .bar-fill { clip-path: inset(0 0 0 0); }
[data-bars].is-armed .bar-after {
  opacity: 0;
  transition: opacity 0.5s ease;
  transition-delay: calc(0.7s + var(--i, 0) * 90ms);
}
[data-bars].is-armed.is-grown .bar-after { opacity: 1; }

/* Lightbox (videos.js). */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 64px var(--gutter) 28px;
  background: rgba(245, 245, 247, 0.94);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lightbox.is-open { opacity: 1; }
.lightbox-frame {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}
.lightbox[hidden] { display: none; }
/* --r is the clip's width / height, set by videos.js; the clip fits inside the screen either way. */
.lightbox-frame video {
  display: block;
  width: min(100vw - 2 * var(--gutter), (100vh - 150px) * var(--r, 1.7778), 1400px);
  width: min(100vw - 2 * var(--gutter), (100svh - 150px) * var(--r, 1.7778), 1400px);
  height: auto;
  aspect-ratio: var(--r, 1.7778);
  cursor: pointer;
}
.lightbox-label {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.07);
  color: var(--text);
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(0, 0, 0, 0.12); }
/* The lightbox's play/pause button, left of the close button. */
.lightbox > .video-toggle {
  top: 14px;
  right: 62px;
  bottom: auto;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.07);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  opacity: 1;
}
.lightbox > .video-toggle:hover { background: rgba(0, 0, 0, 0.12); }
.lightbox > .video-toggle svg { width: 14px; height: 14px; }
.lightbox-close svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.is-lightbox-open { overflow: hidden; }

@media (max-width: 560px) {
  .caption { font-size: 14px; }
  .video-label { font-size: 14px; }
  .step-text { font-size: 20px; }
}

/* Footer */

.footer {
  padding: 48px 0 64px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.footer-head {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.footer-head + * { margin-top: 0; }
.footer-list { margin: 0 0 18px; padding: 0; list-style: none; }
.footer p { margin: 0 0 12px; }
.footer a { color: var(--muted); text-decoration: underline; overflow-wrap: anywhere; }

/* Top bar, shown after the hero */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1), visibility 0s linear 0.45s;
}
.topbar.is-visible {
  transform: none;
  visibility: visible;
  transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1), visibility 0s;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100% - 2 * var(--gutter), 1080px);
  height: 52px;
  margin-inline: auto;
}
.topbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.topbar-title:hover { text-decoration: none; }
.topbar-links { display: flex; gap: 8px; flex-shrink: 0; }
.topbar-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

@media (max-width: 560px) {
  .title { font-size: clamp(27px, 7.6vw, 32px); }
  .authors { font-size: 15px; line-height: 1.4; margin-top: 10px; }
  .affiliation { font-size: 14px; }
  .departments { font-size: 12px; line-height: 1.4; }
  .departments span { display: block; }
  .departments .dot { display: none; }
  .buttons {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
  }
  .buttons .pill { min-height: 34px; padding: 0 12px; font-size: 14px; }
  .topbar-title {
    font-size: 14px;
    line-height: 1.15;
    letter-spacing: -0.015em;
    white-space: normal;
  }
  .topbar-links { gap: 6px; }
  .pill-small { padding: 0 11px; }
}
/* The smallest phones: the short title stays on one line. */
@media (max-width: 400px) {
  .topbar-title { font-size: 13px; white-space: nowrap; }
  .topbar-inner { gap: 10px; }
  .pill-small { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html,
  html.is-settled { scroll-behavior: auto; }
  .topbar,
  .topbar.is-visible { transition: none; }
  .fold[open] .fold-body { animation: none; }
  .card,
  .video-toggle,
  .lightbox,
  .steps.is-pinned .step-text,
  [data-bars].is-armed .bar-fill,
  [data-bars].is-armed .bar-after { transition: none; }
  a.card:hover { transform: none; }
}
