/* r5-page: bar, film, numbers, ending (results, abstract, BibTeX, footer).
   Loaded after style.css, so it overrides it.

   Look rules this file keeps: no borders or boxes, no hard edges in light or
   colour, hairline rules only inside the numbers list, accent cyan #23e6ff on
   black and #0a7f95 on light. */

   :root {
    --end: #fbfbfd;          /* the quiet off-white ending */
    --end-muted: #6e6e73;
    --accent-deep: #0a7f95;  /* cyan, darkened for light sections */
    --hair-dark: rgba(245, 245, 247, 0.12);
    --hair-light: rgba(0, 0, 0, 0.08);
    --num: clamp(96px, 6vw, 112px);
    --unit: clamp(24px, 1.8vw, 34px);
    --spec-label: 18px;
  }
  
  /* Smooth scroll: Lenis drives the window, so native smooth scrolling must
     be off, and the pinned scenes keep working because Lenis scrolls the
     real window (window.scrollY and native scroll events stay valid). */
  
  html.lenis,
  html.lenis body {
    height: auto;
  }
  
  .lenis,
  .lenis.lenis-smooth {
    scroll-behavior: auto !important;
  }
  
  .lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
  }
  
  .lenis.lenis-stopped {
    overflow: hidden;
  }
  
  /* Colour transitions: long, eased dissolve, no seam ---------------------- */
  
  /* The stops follow a smoothstep curve in 17 steps, so both ends leave and
     arrive slowly and no step reads as a line (human, 2026-10-28). At 62vh each
     fade was a screen of empty gradient and the page read block by block; they
     are now about a quarter of the window, so one section runs straight into
     the next (human, 2026-10-29). */
  
  .tone {
    height: 26vh;
  }
  
  .mounts + .tone--light-to-dark {
    height: 26vh;
  }
  
  /* Numbers into the ending's off-white. */
  
  .numbers + .tone--to-end {
    height: 26vh;
  }
  
  .tone--to-end {
    background: linear-gradient(
      180deg,
      #000000 0%,
      #030303 1.12305%,
      #0b0b0b 4.29688%,
      #171717 9.22852%,
      #272728 15.625%,
      #3a3a3b 23.1934%,
      #4f4f50 31.6406%,
      #666667 40.6738%,
      #7e7e7e 50%,
      #959596 59.3262%,
      #acacad 68.3594%,
      #c1c1c2 76.8066%,
      #d4d4d5 84.375%,
      #e4e4e6 90.7715%,
      #f0f0f2 95.7031%,
      #f8f8fa 98.877%,
      #fbfbfd 100%
    );
  }
  
  /* Sticky bar: the brand at the left, the Paper button at the right. The
     chapters moved to their own list on the left of the page (chapters.css). */
  
  .bar-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 24px;
  }
  
  .bar-brand {
    justify-self: start;
  }
  
  /* Paper and Code side by side (human, 2026-11-01). */
  .bar-links {
    justify-self: end;
    display: flex;
    gap: 10px;
  }
  
  /* Film: the whole picture on the dark page, its controls below it ---------- */
  
  .film {
    /* A soft pool of light in the dark around the picture: the fade happens
       outside the film, never over it. */
    background: radial-gradient(
      ellipse 58% 78% at 50% 47%,
      #1e1e23 0%,
      #101013 36%,
      #040405 62%,
      #000 80%
    );
    padding: clamp(48px, 7vh, 72px) 0 clamp(40px, 7vh, 64px);
  }
  
  /* No mask, vignette or gradient over the picture (human, 2026-10-28): the
     film's white slides must stay white. Only the corners round, and only the
     dark around the picture fades. */
  
  .film-inline {
    position: relative;
    width: min(1560px, 80vw);
    margin-inline: auto;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
  }
  
  .film-inline-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    background: #000;
  }
  
  /* Controls: below the picture, never over it ------------------------------ */
  
  .film-controls {
    width: min(1560px, 80vw);
    margin: clamp(14px, 2vh, 22px) auto 0;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--fg-dark);
  }
  
  .film-btn {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--fg-dark);
    cursor: pointer;
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
  }
  
  .film-btn:hover {
    background: rgba(245, 245, 247, 0.1);
  }
  
  .film-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
  }
  
  .film-btn.is-muted {
    color: var(--muted-dark);
  }
  
  .film-timeline,
  .film-volume {
    position: relative;
    height: 32px;
    cursor: pointer;
    touch-action: none;
  }
  
  .film-timeline {
    flex: 1 1 auto;
    min-width: 120px;
  }
  
  .film-volume {
    flex: 0 0 84px;
  }
  
  .film-track,
  .film-timeline-fill,
  .film-volume-fill {
    position: absolute;
    left: 0;
    top: 50%;
    height: 4px;
    margin-top: -2px;
    border-radius: 2px;
    pointer-events: none;
  }
  
  .film-track {
    right: 0;
    background: rgba(245, 245, 247, 0.16);
  }
  
  .film-timeline-fill {
    width: 0;
    background: var(--accent);
  }
  
  .film-volume-fill {
    width: 0;
    background: rgba(245, 245, 247, 0.82);
  }
  
  .film-knob {
    position: absolute;
    top: 50%;
    left: 0;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: var(--fg-dark);
    opacity: 0;
    transition: opacity 0.2s var(--ease);
    pointer-events: none;
  }
  
  .film-timeline .film-knob {
    background: var(--accent);
  }
  
  .film-timeline:hover .film-knob,
  .film-timeline.is-dragging .film-knob,
  .film-volume:hover .film-knob,
  .film-volume.is-dragging .film-knob {
    opacity: 1;
  }
  
  .film-time {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums lining-nums;
    color: var(--muted-dark);
    white-space: nowrap;
  }
  
  /* Numbers: the module sticky on the left, the paper's figures on the right -- */
  
  .numbers {
    background: var(--bg-dark);
    color: var(--fg-dark);
    padding: 5vh 5vw 2vh;
  }
  
  .numbers-grid {
    display: grid;
    /* The module gets close to half the width: it is the only visual in this
       section, so a narrow column left too much black beside it. */
    grid-template-columns: minmax(0, 0.94fr) minmax(0, 1fr);
    gap: clamp(24px, 3vw, 64px);
    align-items: start;
    max-width: 1760px;
    margin-inline: auto;
  }
  
  .numbers-media {
    /* Not sticky: js/viewer/numbers.js holds the stage in the middle of the
       window and fades it in and out whole, so no window edge ever slices it. */
    align-self: start;
    display: grid;
    align-items: start;
  }
  
  #numbers-stage {
    position: relative;
    width: 100%;
    height: min(86vh, 920px);
    will-change: transform;
    /* Nothing may read as a dropped-in canvas: the stage's edges dissolve. */
    -webkit-mask-image: radial-gradient(
      ellipse 74% 76% at 50% 50%,
      #000 46%,
      rgba(0, 0, 0, 0.72) 76%,
      transparent 100%
    );
    mask-image: radial-gradient(
      ellipse 74% 76% at 50% 50%,
      #000 46%,
      rgba(0, 0, 0, 0.72) 76%,
      transparent 100%
    );
  }
  
  .numbers-list {
    /* The space under the last row lets the list finish before the section's
       bottom, so the module fades out beside the last figures instead of being
       carried into the light section below (js/viewer/numbers.js). */
    padding-block: 2vh 12vh;
  }
  
  .spec {
    padding: clamp(14px, 1.8vh, 22px) 0 clamp(12px, 1.5vh, 18px);
  }
  
  /* No rule between rows: no hard division lines (Astra review, 2026-10-28). */
  .spec + .spec {
    margin-top: clamp(6px, 1vh, 12px);
  }
  
  .spec-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 28px;
  }
  
  .spec-label {
    margin: 0;
    max-width: 34ch;
    font-size: var(--spec-label);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.005em;
    color: var(--muted-dark);
  }
  
  .spec-value {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 0.16em;
    white-space: nowrap;
  }
  
  .num {
    font-size: var(--num);
    font-weight: 700;
    line-height: 0.84;
    letter-spacing: -0.045em;
    font-variant-numeric: tabular-nums lining-nums;
  }
  
  .num--mark {
    color: var(--accent);
  }
  
  .unit {
    font-size: var(--unit);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.015em;
    color: var(--muted-dark);
  }
  
  .times {
    font-size: var(--unit);
    font-weight: 400;
    line-height: 1;
    color: var(--muted-dark);
    margin-left: 0.24em;
    transform: translateY(-0.06em);
  }
  
  .spec-foot {
    margin: 12px 0 0;
    max-width: 44ch;
    font-size: 16px;
    line-height: 1.45;
    letter-spacing: -0.005em;
    color: #6e6e73;
  }
  
  /* The paper's cost breakdown, as quiet rows under the cost figure. */
  
  .cost-list {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    max-width: 480px;
  }
  
  .cost-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    padding: 6px 0;
    font-size: 15px;
    line-height: 1.35;
    color: #8b8b90;
  }
  
  .cost-list li span:last-child {
    font-variant-numeric: tabular-nums lining-nums;
    color: #a1a1a6;
  }
  
  /* Ending: results, abstract, BibTeX, footer ------------------------------- */
  
  .results {
    background: var(--end);
    color: var(--fg-light);
    display: block;
    max-width: none;
    margin-inline: 0;
    padding: 6vh 5vw 9vh;
  }
  
  .results-inner {
    max-width: 1120px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: clamp(64px, 9vh, 108px);
  }
  
  /* One numeral to one sentence (human, 2026-10-28): every row holds a single
     figure on the left and the paper's words about it on the right, so two
     numerals can never run together. */
  .result {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 700px);
    align-items: center;
    gap: 0 clamp(40px, 4.5vw, 76px);
  }
  
  .result-figures {
    display: flex;
    flex-direction: column;
    gap: 0.06em;
  }
  
  .result-figure {
    display: block;
    font-size: clamp(160px, 10vw, 200px);
    font-weight: 700;
    line-height: 0.88;
    letter-spacing: -0.045em;
    font-variant-numeric: tabular-nums lining-nums;
    color: var(--accent-deep);
  }
  
  .result-label {
    display: block;
    margin-top: 18px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0;
    color: var(--end-muted);
  }
  
  .results .result-copy {
    justify-self: start;
    max-width: 700px;
    margin: 0;
    font-size: clamp(28px, 1.7vw, 31px);
    line-height: 1.42;
    letter-spacing: -0.01em;
    color: #4a4a4f;
  }
  
  /* Abstract and BibTeX ----------------------------------------------------- */
  
  .abstract {
    background: var(--end);
    color: var(--fg-light);
    padding: 6vh 5vw 5vh;
  }
  
  /* The closing statement (the paper's Discussion, opening sentences; human's
     choice, 2026-10-28): short, so it reads large. */
  .abstract-copy {
    max-width: 980px;
    margin-inline: auto;
    padding-block: 8vh;
    font-size: clamp(30px, 2.4vw, 44px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #1d1d1f;
    text-align: center;
  }
  
  .bibtex {
    background: var(--end);
    color: var(--fg-light);
    padding: 0 5vw 3vh;
  }
  
  .bibtex-inner {
    max-width: 860px;
    margin-inline: auto;
  }
  
  .bibtex-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
  }
  
  .bibtex-details {
    flex: 1 1 auto;
    min-width: 0;
  }
  
  .bibtex-summary {
    display: inline-block;
    list-style: none;
    cursor: pointer;
    padding: 2px 0;
  }
  
  .bibtex-summary::-webkit-details-marker {
    display: none;
  }
  
  .bibtex-summary::marker {
    content: "";
  }
  
  .bibtex-title {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.02em;
    transition: color 0.3s var(--ease);
  }
  
  .bibtex-summary:hover .bibtex-title {
    color: var(--accent-deep);
  }
  
  .bibtex-code {
    margin: 20px 0 0;
    font-size: 14px;
    line-height: 1.7;
    color: #3a3a3e;
    opacity: 0.9;
  }
  
  .bibtex .copy-button {
    align-self: flex-start;
    flex: 0 0 auto;
  }
  
  .bibtex .copy-button.is-copied {
    background: var(--accent-deep);
    color: #fff;
  }
  
  /* The idle "scroll" arrow: a small, semi-transparent chevron with the word,
     bobbing at the bottom centre until the visitor scrolls (human, 2026-10-28). */
  
  .scroll-hint {
    position: fixed;
    left: 50%;
    bottom: 3.4vh;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    color: rgba(245, 245, 247, 0.66);
    opacity: 0;
    transform: translate(-50%, 10px);
    pointer-events: none;
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  }
  
  .scroll-hint.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  
  .scroll-hint.is-light {
    color: rgba(29, 29, 31, 0.62);
  }
  
  .scroll-hint-arrow {
    width: 16px;
    height: 18px;
    animation: scroll-hint-bob 1.9s cubic-bezier(0.45, 0, 0.25, 1) infinite;
  }
  
  .scroll-hint-word {
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: lowercase;
  }
  
  @keyframes scroll-hint-bob {
    0%,
    100% {
      transform: translateY(0);
      opacity: 0.55;
    }
    50% {
      transform: translateY(5px);
      opacity: 1;
    }
  }
  
  .footer {
    background: var(--end);
    color: var(--end-muted);
    padding: 0 0 48px;
  }
  
  .footer-inner {
    padding-inline: 5vw;
  }
  
  @media (prefers-reduced-motion: reduce) {
    .scroll-hint {
      transition: none;
    }
  
    .scroll-hint-arrow {
      animation: none;
    }
  }
  
  /* Section headings (human, 2026-10-29) ---------------------------------------
     Each section opens with its chapter name, so a visitor always knows where one
     part of the story ends and the next begins. The words are the chapter list's
     own. In a pinned section the heading sits at the top left of the pinned frame,
     clear of the chapter list; elsewhere it leads the section in the flow. */
  
  .section-head {
    margin: 0;
    font-size: clamp(36px, 3.6vw, 60px);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.022em;
    color: inherit;
  }
  
  .section-head--pin {
    position: absolute;
    top: calc(var(--bar-h) + 4.5vh);
    left: max(var(--ch-gutter, 0px), 5vw);
    z-index: 4;
    pointer-events: none;
  }
  
  .section-head--flow {
    width: min(1560px, 80vw);
    margin: 0 auto clamp(28px, 4.5vh, 48px);
  }
  
  /* The reveal owns opacity until it has run; then the scroll fade takes over. */
  .section-head[data-head-fade].in {
    opacity: var(--head-fade, 1);
    transition: transform 0.9s var(--ease);
  }
  
  /* Numbers spans the page's own padded width; Results sits in its column. */
  .section-head--wide {
    width: auto;
    max-width: 1760px;
    margin-inline: auto;
    /* Clear of the chapter list, as the pinned headings are. */
    padding-left: max(0px, calc(var(--ch-gutter, 0px) - 5vw));
  }
  
  .section-head--inner {
    width: auto;
    margin: 0 0 calc(clamp(8px, 2vh, 24px) - clamp(64px, 9vh, 108px));
  }
  
  /* Film entrance (human, 2026-10-29): the opening loop goes to black, then the
     film rises out of that black instead of arriving as a lit box. page.js sets
     --film-in from 0 to 1 as the film comes up the window. The picture is never
     masked: at rest it is at full strength and its white slides stay white. */
  
  .film {
    --film-in: 1;
    padding-top: clamp(96px, 16vh, 168px);
  }
  
  .film-inline {
    opacity: var(--film-in);
    transform: translateY(calc((1 - var(--film-in)) * 48px))
      scale(calc(0.9 + 0.1 * var(--film-in)));
    transform-origin: 50% 0%;
    will-change: opacity, transform;
  }
  
  /* Mounts: each sentence carries the name of its assembly. */
  .mounts-copy__title {
    display: block;
    margin-bottom: 6px;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.012em;
    color: var(--fg-light);
  }
  
  /* The same frosted invitation as the live model's, in the light section's
     colours. It comes up once both modules are home (mounts.js) and goes on the
     first click into a part. */
  .mounts-hint {
    position: absolute;
    left: 50%;
    top: calc(var(--bar-h) + 4.5vh);
    z-index: 4;
    margin: 0;
    transform: translateX(-50%);
    padding: 13px 24px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 980px;
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    color: var(--fg-light);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s var(--ease);
  }
  
  .mounts.is-hint .mounts-hint {
    opacity: 1;
  }
  
  @media (prefers-reduced-motion: reduce) {
    .film-inline {
      opacity: 1;
      transform: none;
    }
  }
  
  /* Opening (human, 2026-10-29) -------------------------------------------------
     The loop plays in a band about two thirds of the window tall, the module
     up and to the right; the title, authors, affiliation, venue and Paper sit at
     the top left in white. The band's foot fades to black, so the film below
     follows on the same black with no block in between. */
  
  .hero {
    height: 68vh;
    min-height: 560px;
    background: #000;
  }
  
  /* The frame is drawn a little larger than the band and anchored up and to the
     right, so the module sits in the upper right; the frame's own black meets
     the band's black, so its cropped edges never show. */
  .hero-film,
  #hero-film {
    inset: auto;
    top: -15%;
    right: -4vw;
    left: auto;
    width: auto;
    height: 118%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, rgba(0, 0, 0, 0.5) 78%, transparent 90%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 62%, rgba(0, 0, 0, 0.5) 78%, transparent 90%);
  }
  
  .hero-copy {
    top: calc(var(--bar-h) + 7vh);
    bottom: auto;
    width: min(44vw, 640px);
  }
  
  .hero-title {
    font-size: clamp(64px, 5.6vw, 104px);
    color: #fff;
  }
  
  .hero-sub {
    margin-top: 16px;
    font-size: clamp(20px, 1.6vw, 26px);
    font-weight: 600;
    color: #fff;
  }
  
  .hero-authors {
    margin-top: 26px;
    font-size: 18px;
    color: #fff;
  }
  
  .hero-authors a {
    color: #fff;
  }
  
  .hero-affil {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.86);
  }
  
  .hero-venue {
    margin: 12px 0 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--accent);
  }
  
  .hero-links {
    display: flex;
    gap: 14px;
    margin-top: 28px;
  }
  
  .hero-copy .pill--large {
    margin-top: 0;
  }
  
  /* The film follows the band closely: no long run of empty black first. */
  .film {
    padding-top: clamp(24px, 5vh, 56px);
  }
  
  /* Narrower windows: the module moves further right and the copy narrows, so
     the subtitle and names never run into the module. */
  @media (max-width: 1280px) {
    .hero-film,
    #hero-film {
      right: -14vw;
    }
  
    .hero-copy {
      width: min(38vw, 440px);
    }
  
    .hero-title {
      font-size: clamp(56px, 5.4vw, 72px);
    }
  
    .hero-sub {
      font-size: 19px;
    }
  
    .hero-authors,
    .hero-affil {
      font-size: 16px;
    }
  }
  
  /* The 3D sections on white (human, 2026-10-29) ------------------------------ */
  
  /* Sub-headings of Hardware Design: one step down from the section headings. */
  .section-head--sub {
    font-size: clamp(30px, 2.8vw, 46px);
  }
  
  /* --- The 3D sections on white ---------------------------------------------- */
  
  .inside,
  .inside-pin,
  .model,
  .model-pin,
  .numbers {
    background: var(--bg-light);
    color: var(--fg-light);
  }
  
  .inside-pin::before,
  .model-glow {
    display: none;
  }
  
  .inside-copy .copy {
    color: var(--fg-light);
  }
  
  .inside-copy .inside-title {
    color: var(--muted-light);
  }
  
  .inside-beat.is-title-only .inside-title {
    color: var(--fg-light);
  }
  
  #inside-stage .part-label,
  #inside-stage .part-label__title,
  #hero-stage .part-label,
  #hero-stage .part-label__title {
    color: var(--fg-light);
  }
  
  #hero-stage .part-label--soft .part-label__title {
    color: rgba(29, 29, 31, 0.78);
  }
  
  #inside-stage .part-label.is-hot .part-label__title {
    color: var(--accent-deep);
  }
  
  #inside-stage .part-line,
  #hero-stage .part-line {
    background: #a1a1a6;
  }
  
  #inside-stage .part-line.is-on.is-hot {
    background: var(--accent-deep);
  }
  
  #inside-stage .part-prompt,
  #hero-stage .part-prompt {
    color: var(--accent-deep);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'><path d='M3 1.4 5.7 4 3 6.6' fill='none' stroke='%230a7f95' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  }
  
  /* The live model's invitation, in the light sections' frosted glass. */
  .model-hint {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.55);
    color: var(--fg-light);
  }
  
  .model-hint:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.14);
  }
  
  /* Numbers on white. */
  .spec-label,
  .unit,
  .times {
    color: var(--muted-light);
  }
  
  .num--mark {
    color: var(--accent-deep);
  }
  
  .spec-foot {
    color: var(--muted-light);
  }
  
  .cost-list li {
    color: #6e6e73;
  }
  
  .cost-list li span:last-child {
    color: #424245;
  }
  
  .numbers {
    padding-bottom: 0;
  }
  
  /* After the opening: the old page (human, 2026-10-29) -------------------------
     The opening loop dissolves straight into white, and from the Abstract on the
     page keeps the old page's own format: pure white, a centred heading, a
     justified paragraph in a column about 760px wide, centred figures and a thin
     grey rule between sections. The 3D sections sit inside Hardware Design on
     the same white. No chapter list. */
  
  :root {
    --bg-light: #ffffff;
    --end: #ffffff;
    --ch-gutter: 0px;
  }
  
  body {
    background: #fff;
  }
  
  /* The opening is a little taller, so the copy ends above the dissolve. */
  .hero {
    height: 76vh;
    min-height: 600px;
  }
  
  .hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0) 80%,
      rgba(255, 255, 255, 0.05) 83%,
      rgba(255, 255, 255, 0.22) 87%,
      rgba(255, 255, 255, 0.5) 91%,
      rgba(255, 255, 255, 0.78) 95%,
      rgba(255, 255, 255, 0.95) 98.5%,
      #fff 100%
    );
  }
  
  .classic {
    background: #fff;
    color: #4a4a4a;
    padding: 48px 24px;
  }
  
  .classic--tail {
    padding-top: 24px;
  }
  
  .classic-inner {
    max-width: 763px;
    margin-inline: auto;
  }
  
  .classic-inner--wide {
    max-width: 960px;
  }
  
  .classic-title {
    margin: 0 0 24px;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.125;
    text-align: center;
    color: #363636;
  }
  
  .classic-content p {
    margin: 0;
    font-size: 19px;
    line-height: 25px;
    text-align: justify;
    color: #4a4a4a;
  }
  
  .classic-content strong {
    font-weight: 700;
    color: #363636;
  }
  
  .classic-figure {
    max-width: 800px;
    margin: 24px auto 0;
    /* Wider than the text column, as on the old page. */
    width: calc(100% + 37px);
    margin-inline: -18.5px;
  }
  
  .classic-figure--wide {
    max-width: 960px;
    width: calc(100% + 197px);
    margin-inline: -98.5px;
  }
  
  .classic-figure--narrow {
    max-width: 720px;
    width: 94%;
    margin-inline: auto;
  }
  
  .classic-figure img {
    display: block;
    width: 100%;
    height: auto;
  }
  
  .classic-rule {
    border: none;
    border-top: 2px solid #eee;
    margin: 32px auto;
    max-width: 80%;
  }
  
  /* The film, after the Abstract, on the white page. */
  .film--classic {
    background: #fff;
    padding: 8px 24px 48px;
  }
  
  .film--classic .film-inline,
  .film--classic .film-controls {
    width: min(960px, 90vw);
    border-radius: 10px;
  }
  
  .film--classic .film-controls,
  .film--classic .film-btn {
    color: #363636;
  }
  
  .film--classic .film-btn:hover {
    background: rgba(0, 0, 0, 0.06);
  }
  
  .film--classic .film-track {
    background: rgba(0, 0, 0, 0.14);
  }
  
  .film--classic .film-timeline-fill,
  .film--classic .film-volume-fill {
    background: #363636;
  }
  
  .film--classic .film-knob {
    background: #363636;
  }
  
  .film--classic .film-time {
    color: #7a7a7a;
  }
  
  /* BibTeX, as on the old page: a heading with Copy beside it over the entry. */
  .classic-bibtex-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
  }
  
  .classic-bibtex-head .classic-title {
    margin: 0;
    text-align: left;
  }
  
  #bibtex .bibtex-code {
    margin: 0;
    padding: 5px 5px 5px 10px;
    border: 1px solid grey;
    border-radius: 3px;
    background: #eee;
    font-size: 14px;
    line-height: 1.2;
    color: #363636;
    white-space: pre-wrap;
    overflow-x: auto;
    opacity: 1;
  }
  
  .classic-footer {
    display: flex;
    justify-content: center;
    padding: 48px 24px 64px;
    background: #fff;
  }
  
  /* The 3D sections' sub-headings in the old page's heading style, one step down
     from its section titles, so Hardware Design reads as one section. */
  .section-head--sub {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0;
    color: #363636;
  }
  
  /* System Introduction without the layer-by-layer walk (human, 2026-10-29):
     the separate, the open labelled stack and the close only, at their old pace
     (explode.js, WALK and SKIP_AT), so the pinned run is 3.5 screens, not 8.4. */
  .inside {
    height: 453vh;
  }
  
  /* System Introduction and the Interactive Model as blocks in the page
     (human, 2026-10-29: these two were the only full-screen, pinned sections and
     felt dizzying). Each is a frame about three quarters of the window tall, no
     wider than the page's figures, that scrolls with the page; its heading sits
     above it in the old page's style. explode.js and hero.js read the block's
     place in the window. */
  .inside,
  .model {
    height: auto;
    padding: 40px 24px 24px;
  }
  
  .inside-pin,
  .model-pin {
    position: relative;
    top: auto;
    height: min(74vh, 780px);
    min-height: 520px;
    max-width: 1180px;
    margin-inline: auto;
  }
  
  .section-head--block {
    position: static;
    margin: 0 auto 8px;
    text-align: center;
  }
  
  .inside-copy {
    left: 24px;
    bottom: 24px;
  }
  
  /* Mounts as a block in the page too (human, 2026-10-29). It is a little taller
     than the other two, because its sentences sit under the assemblies. */
  .mounts {
    height: auto;
    padding: 40px 24px 24px;
  }
  
  .mounts-pin {
    position: relative;
    top: auto;
    /* The pair fills the block's height, so the block sets their size
       (human, 2026-10-29: the two animations read too large at 84%). */
    height: min(66vh, 680px);
    min-height: 520px;
    max-width: 1180px;
    margin-inline: auto;
  }
  
  .mounts-hint {
    top: 12px;
  }
  
  /* Numbers' heading centred like the other Hardware Design sub-headings. */
  .numbers .section-head--sub {
    padding-left: 0;
    text-align: center;
  }
  
  /* Platform Evaluation (was "Numbers"; the paper's own heading, Sec. VI-A) as
     a compact block (human, 2026-10-29): the model in its own column beside the
     figures, centred on the list's height, nothing following the window, the
     figures set smaller and tighter so the two columns balance. */
  .numbers {
    padding: 40px 24px 48px;
    --num: clamp(48px, 4.2vw, 68px);
    --unit: 20px;
    --spec-label: 16px;
  }
  
  .numbers-grid {
    max-width: 1180px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(24px, 3vw, 56px);
    align-items: stretch;
  }
  
  .numbers-media {
    align-self: stretch;
    display: block;
    position: relative;
  }
  
  #numbers-stage {
    position: absolute;
    inset: 0;
    height: auto;
    min-height: 0;
  }
  
  .numbers-list {
    padding-block: 0;
  }
  
  .spec {
    padding: 10px 0 8px;
  }
  
  .spec + .spec {
    margin-top: 0;
  }
  
  .spec-foot {
    margin-top: 6px;
    font-size: 14px;
  }
  
  .cost-list {
    margin-top: 8px;
  }
  
  .cost-list li {
    padding: 2px 0;
    font-size: 13.5px;
  }
  
  /* The list is taller than the window, so the model keeps a fixed stage that
     stays level with the figures while the visitor reads down them; it only
     travels within its own block, never holding the window. */
  .numbers {
    --num: clamp(44px, 3.6vw, 58px);
  }
  
  .numbers-grid {
    align-items: start;
  }
  
  .numbers-media {
    position: sticky;
    top: max(72px, calc(50vh - 280px));
    height: min(560px, 70vh);
    align-self: start;
  }
  
  /* Hardware Overview (human, 2026-10-29): System Introduction and the separate
     live model merged into one block. Its invitation is the mounts' frosted
     hint; it shows while the open stack lights its layers in turn (explode.js). */
  .inside-hint {
    position: absolute;
    left: 50%;
    top: 12px;
    z-index: 4;
    margin: 0;
    transform: translateX(-50%);
    padding: 13px 24px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 980px;
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    color: var(--fg-light);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s var(--ease);
  }
  
  .inside.is-hint .inside-hint {
    opacity: 1;
  }
  
  /* Hardware Overview: the open stack can be dragged to turn it. */
  #inside-stage canvas {
    cursor: grab;
  }
  
  #inside-stage.is-part canvas {
    cursor: pointer;
  }
  
  #inside-stage.is-grabbing canvas,
  #inside-stage.is-grabbing.is-part canvas {
    cursor: grabbing;
  }
  
  /* The part view's way back (human, 2026-10-29: hard to find). A frosted,
     labelled pill at the top right, at full strength, with the Esc key shown. */
  #layer-overlay .overlay-close {
    top: 22px;
    right: 28px;
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px 11px 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 980px;
    background: rgba(255, 255, 255, 0.14);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    opacity: 1;
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
  }
  
  #layer-overlay .overlay-close:hover {
    background: rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.45);
  }
  
  .overlay-close__x {
    font-size: 22px;
    font-weight: 300;
    line-height: 0.8;
  }
  
  .overlay-close__key {
    padding: 3px 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.75);
  }
  
  /* The key insight (human, 2026-10-29): one large, centred line between the
     opening and the Abstract, the word "perch" in the light sections' cyan. */
  .insight {
    background: #fff;
    padding: clamp(40px, 7vh, 80px) 24px clamp(8px, 2vh, 24px);
  }
  
  .insight-line {
    max-width: 980px;
    margin: 0 auto;
    font-size: clamp(30px, 3vw, 46px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-align: center;
    text-wrap: balance;
    color: #1d1d1f;
  }
  
  .insight-mark {
    color: var(--accent-deep);
  }
  
  /* Platform Evaluation as one even grid (human, 2026-10-29). Two columns of
     figures beside the model: each figure at one size with its unit, its label
     under it, the notes below the grid. The model's column centres on the grid
     and no longer travels with the scroll. */
  .numbers-grid {
    align-items: center;
  }
  
  .numbers-media {
    position: relative;
    top: auto;
    height: min(520px, 62vh);
    align-self: center;
  }
  
  .stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 40px;
    padding: 0;
  }
  
  .stat {
    margin: 0;
  }
  
  .stat-value {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: #1d1d1f;
    white-space: nowrap;
  }
  
  .stat-num {
    font-size: clamp(34px, 2.8vw, 44px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums lining-nums;
  }
  
  .stat-unit {
    font-size: 18px;
    font-weight: 500;
    color: #6e6e73;
  }
  
  .stat-unit--pre {
    margin-right: -2px;
  }
  
  .stat-label {
    margin: 8px 0 0;
    max-width: 30ch;
    font-size: 15px;
    line-height: 1.4;
    color: #6e6e73;
  }
  
  /* The notes take the cell beside the seventh figure, so the grid ends even. */
  .stat-notes {
    align-self: end;
  }
  
  .stat-notes p {
    margin: 0 0 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #86868b;
  }
  
  /* The teaser sits between the insight line and the Abstract (human, 2026-10-29). */
  .insight-figure {
    margin-top: clamp(28px, 4.5vh, 48px);
  }
  
  /* Phones and touch-only tablets (human, 2026-10-29: the page crashed iOS
     Safari). The deploy build marks the page "no-3d" there and never loads the
     3D viewer (src/deploy/make_standalone.py, js/sp-start.js). Hardware Overview
     is left out (Hardware Design's paper figure shows the parts), How to Perch
     keeps its two descriptions, Platform Evaluation its figures. */
  /* Where there is no 3D, each 3D section shows a still of its model, rendered
     from the live page (human, 2026-10-29: "not empty, you just cannot
     interact"): the opened stack with its five names, the two mounts with their
     modules docked, the platform. The stills are hidden everywhere else. */
  .still {
    display: none;
  }
  
  .no-3d .still {
    display: block;
    height: auto;
    margin: 8px auto 0;
  }
  
  .no-3d .still--overview {
    width: min(560px, 100%);
  }
  
  /* Each mount's still sits directly above its own name and sentence, so the
     picture and its text stay together however the two stack (human,
     2026-10-29: one wide picture over two stacked texts did not line up). */
  .no-3d .still--mount {
    width: min(280px, 72%);
    margin: 0 auto 14px;
  }
  
  /* Each mount reads as one centred, captioned picture under the centred
     heading, like the page's other pictures (human, 2026-10-29). */
  .no-3d .mounts-copy .copy {
    text-align: center;
  }
  
  .no-3d .still--model {
    width: min(300px, 70%);
  }
  
  .no-3d .inside-pin {
    height: auto;
    min-height: 0;
    max-width: 880px;
  }
  
  .no-3d #inside-stage,
  .no-3d .inside-hint,
  .no-3d .inside-beat:not([data-beat="lead"]) {
    display: none;
  }
  
  .no-3d .inside-copy {
    position: static;
    width: auto;
    margin-top: 16px;
  }
  
  .no-3d .inside-beat[data-beat="lead"] {
    position: static;
    opacity: 1;
    transform: none;
  }
  
  .no-3d .inside-copy .copy {
    font-size: 17px;
    color: var(--fg-light);
  }
  
  .no-3d .mounts-pin {
    height: auto;
    min-height: 0;
    max-width: 880px;
  }
  
  .no-3d #mounts-stage,
  .no-3d .mounts-hint {
    display: none;
  }
  
  .no-3d .mounts-copy {
    position: static;
    inset: auto;
    width: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 32px 40px;
  }
  
  .no-3d .mounts-copy .copy,
  .no-3d .mounts-copy .copy[data-step] {
    position: static;
    left: auto;
    width: auto;
    max-width: none;
    opacity: 1;
    transform: none;
    color: var(--fg-light);
  }
  
  .no-3d .numbers-media {
    position: static;
    height: auto;
  }
  
  .no-3d #numbers-stage {
    display: none;
  }
  
  .no-3d .numbers-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 760px;
  }
  
  /* Phone widths: the opening's title block takes the width, the figures fit
     the column, the figures of Platform Evaluation stack. */
  @media (max-width: 760px) {
    .hero {
      height: auto;
      min-height: 0;
      padding: calc(var(--bar-h) + 28px) 0 140px;
    }
  
    .hero-film,
    #hero-film {
      top: auto;
      bottom: -4%;
      right: -30vw;
      height: 62%;
      opacity: 0.85;
    }
  
    .hero-copy {
      position: relative;
      left: 0;
      top: 0;
      width: auto;
      padding: 0 24px;
    }
  
    .hero-title {
      font-size: 48px;
    }
  
    .hero-sub {
      font-size: 18px;
    }
  
    .hero-authors,
    .hero-affil {
      font-size: 15px;
    }
  
    .classic-figure,
    .classic-figure--wide {
      width: 100%;
      margin-inline: 0;
    }
  
    .classic-content p {
      text-align: left;
    }
  
    .insight-line {
      font-size: 26px;
    }
  
    .stat-grid {
      grid-template-columns: minmax(0, 1fr);
    }
  
    .classic-bibtex-head .classic-title {
      font-size: 26px;
    }
  
    /* The film's control row fits a phone: the mute button stays, the volume
       slider goes, the timeline takes the room left. */
    .film-volume {
      display: none;
    }
  
    .film-controls {
      min-width: 0;
    }
  
    .film-timeline {
      flex: 1 1 auto;
      min-width: 0;
    }
  
    .bar-inner {
      padding-inline: 20px;
    }
  
    /* Nothing may widen the page past the screen. */
    html,
    body {
      overflow-x: clip;
    }
  }
  