/* =============================================================
   Gaussian Light Transport — stylesheet
   No frameworks, no build step. Everything is driven by the
   custom properties in :root, so re-skinning is a one-file job.

   Two voices. Mono carries every piece of structure — the nav,
   the section titles, the rail numbers, figure tags, and every
   measurement on the page. A neutral sans carries prose, and
   nothing else. Warm paper, one oxblood ink, hairline rules.
   ============================================================= */

/* ---------- 1. Design tokens ---------------------------------- */

:root {
  /* palette — warm paper and one ink */
  --bg:            #f2ebdd;
  --bg-tint:       #ece3d1;
  --surface:       #f8f3e8;
  --surface-2:     #e7dcc7;
  --ink:           #241f19;
  --ink-soft:      #4d453a;
  --ink-faint:     #6a6053;
  --line:          #d5c8b1;
  --line-strong:   #b9a888;

  --accent:        #8e2f1c;   /* oxblood */
  --accent-2:      #a8601f;   /* sienna — only where the two mix */
  --accent-soft:   #e7d9c6;
  --accent-ink:    #7a2818;

  --shadow-sm: 0 1px 2px rgba(36, 31, 25, .06);
  --shadow-md: 0 2px 5px rgba(36, 31, 25, .07), 0 10px 26px rgba(36, 31, 25, .07);
  --shadow-lg: 0 3px 8px rgba(36, 31, 25, .08), 0 22px 48px rgba(36, 31, 25, .10);

  /* type */
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: var(--font-mono);

  /* metrics */
  --radius-sm: 3px;
  --radius:    4px;
  --radius-lg: 5px;
  --shell:     1160px;
  --rail:      3.25rem;
  --nav-h:     58px;
  --ease:      cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 2. Reset & base ----------------------------------- */

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

html {
  /* Every size on the page is in rem, so this is the one dial that
     scales the whole thing. */
  font-size: 15.75px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
  color-scheme: light;   /* keeps native scrollbars in step with the palette */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* A trace of paper grain — low enough to register as texture rather
   than as noise, and dropped entirely for print. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

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

h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 500; }

a {
  color: var(--accent-ink);
  text-decoration-color: color-mix(in srgb, var(--accent-ink) 30%, transparent);
  text-underline-offset: .16em;
}
a:hover { text-decoration-color: currentColor; }

button { font: inherit; color: inherit; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--bg); text-decoration: none;
  font-family: var(--font-mono); font-size: .82rem;
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 12px; }


/* ---------- 3. Layout ----------------------------------------- */

.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}
.shell--medium { width: min(100% - 2.5rem, 880px); }
.shell--narrow { width: min(100% - 2.5rem, 760px); }

.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section--slim { padding: clamp(2rem, 4vw, 3rem) 0; }
.section--tint {
  background: var(--bg-tint);
  border-block: 1px solid var(--line);
}

/* A section is a numbered band: an index in the rail, a hairline down
   the side, and the content to the right of it. The number comes from a
   CSS counter, so deleting a section renumbers the rest by itself. */
main { counter-reset: band; }

.band {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  align-items: start;
}

.band__no {
  counter-increment: band;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--ink-faint);
  padding-top: .3rem;
}
.band__no::before { content: counter(band, decimal-leading-zero); }

/* Holds the rail column open for a band that takes no index. */
.band__spacer { margin: 0; }

.band__body {
  border-left: 1px solid var(--line);
  padding-left: clamp(1.25rem, 2.5vw, 2.25rem);
}
/* The masthead takes the rail's indent so it shares the axis of every
   section below it, but no rule — nothing is numbered up there. */
.band__body--bare { border-left-color: transparent; }

@media (max-width: 820px) {
  .band { display: block; }
  .band__no { display: block; padding-top: 0; margin-bottom: .35rem; }
  .band__spacer { display: none; }
  .band__body { border-left: 0; padding-left: 0; }
}

.head { margin: 0 0 clamp(1.5rem, 3vw, 2.25rem); }
.head h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -.03em;
  color: var(--ink);
}
/* The page's one piece of ornament. Do not add others. */
.head h2::before { content: "/"; color: var(--accent); }

.head .lede {
  margin: .9rem 0 0;
  max-width: 40rem;
  color: var(--ink-soft);
  font-size: .97rem;
  text-wrap: pretty;
}
/* Inline citation in a lede. */
.ref { color: var(--ink-faint); font-size: .88em; }


/* ---------- 4. Navigation ------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line-strong); }

.nav__progress {
  position: absolute; inset: auto 0 0 0; height: 1.5px;
  transform-origin: 0 50%; transform: scaleX(0);
  background: var(--accent);
}

.nav__inner {
  display: flex; align-items: center; gap: 1.25rem;
  height: var(--nav-h);
}

.nav__brand {
  font-family: var(--font-mono);
  font-size: .92rem; font-weight: 500;
  color: var(--ink); text-decoration: none;
  letter-spacing: -.03em;
  white-space: nowrap;
}
.nav__brand i { font-style: normal; color: var(--accent); }
/* The paper's title is long; below the breakpoint the short form keeps the
   bar on one line. The <a> carries the full name as its label. */
.nav__brand-short { display: none; }
@media (max-width: 760px) {
  .nav__brand-full { display: none; }
  .nav__brand-short { display: inline; }
}

.nav__links {
  display: flex; gap: 1.1rem; margin-inline: auto 0;
  overflow-x: auto; scrollbar-width: none;
  /* the list scrolls on narrow screens; fade the trailing edge so that
     reads as "there is more" rather than as a clipped label */
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  padding-right: 6px;
}
.nav__links::-webkit-scrollbar { display: none; }
@media (min-width: 860px) {
  .nav__links { mask-image: none; -webkit-mask-image: none; }
}

.nav__links a {
  padding: .5rem 0 .45rem;
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--ink-faint); text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.02em;
  border-bottom: 1.5px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.nav__links a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.nav__links a.is-current { color: var(--accent-ink); border-bottom-color: var(--accent); }

.icon {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}


/* ---------- 5. Hero ------------------------------------------- */

/* Left-aligned: the masthead sits on the same axis as everything below
   it, which is the whole point of the rail. */
.hero { padding: clamp(2.5rem, 5.5vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.5rem); }

.hero__venue {
  display: flex; flex-wrap: wrap; gap: .45rem;
  margin: 0 0 1.6rem;
}

.pill {
  display: inline-block;
  padding: .3rem .8rem;
  border-radius: 99px;
  border: 1px solid var(--accent);
  background: var(--accent); color: var(--bg);
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: -.01em;
}
.pill--ghost {
  background: transparent;
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.hero__title {
  position: relative;
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 4.5vw, 3.3rem);
  font-weight: 500;
  letter-spacing: -.05em;
  line-height: 1.12;
  margin: 0 0 1.1rem;
}
.hero__title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* The title is first drawn as a precomputed mixture of flat 2D Gaussians
   (main.js §8), which then hands the letters back to the real text. The
   words stay in the DOM throughout — only their opacity is animated — so
   the heading is intact for a11y, for search, and without JS. */
.gfit__w { white-space: nowrap; }
/* The <em> paints its gradient through background-clip: text, and that clip
   is built from its descendants' glyphs — making the inner spans transparent
   does not remove them from it. So the <em> itself has to be faded too. */
.gfit__w, .hero__title em { transition: opacity .4s var(--ease); }
.gfit__strut { display: inline-block; width: 0; height: 0; }

.gfit__canvas {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s var(--ease);
}

/* Going in is instant — a cross-fade there would flash the real text under
   the ellipses. Coming back out is what the transitions above are for. */
.hero__title.is-fitting .gfit__canvas { opacity: 1; transition: none; }
.hero__title.is-fitting .gfit__w,
.hero__title.is-fitting em { opacity: 0; transition: none; }

.hero__tagline {
  max-width: 34rem; margin: 0 0 1.9rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  text-wrap: pretty;
}

.authors, .affiliations {
  list-style: none; padding: 0;
  display: flex; flex-wrap: wrap;
  column-gap: 1.3rem; row-gap: .15rem;
}
.authors { margin: 0 0 .45rem; font-size: 1rem; font-weight: 500; }
.authors a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.authors a:hover { color: var(--accent-ink); border-color: currentColor; }
.authors sup, .affiliations sup { color: var(--accent); }

.affiliations {
  margin: 0;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: .90rem;
}

.linkbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.8rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink);
  font-family: var(--font-mono);
  font-size: .82rem; text-decoration: none;
  letter-spacing: -.02em;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.btn:hover { border-color: var(--ink); background: var(--surface); }
.btn .icon { width: 15px; height: 15px; }

/* Trailing marker for a link whose target is not live yet ("soon"). */
.btn__tag {
  padding: .05rem .4rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-ink);
  font-size: .68rem;
  letter-spacing: 0;
}

.btn--primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--bg); }


/* ---------- 6. Media plates ----------------------------------- */

/* One plate style for every piece of media: a hairline, a hint of shadow
   and a warm mount. Widths are capped short of the shell so that no single
   figure spans a large monitor edge to edge. */
.plate {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  isolation: isolate;
}
.plate > img, .plate > video { width: 100%; }

.figcap {
  display: block;
  margin: .8rem 0 0;
  max-width: 46rem;
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.6;
  text-wrap: pretty;
}
.figcap strong { font-weight: 600; color: var(--ink); }
/* Figure tag, run in at the head of a caption. */
.fignum {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent-ink);
  margin-right: .55em;
  white-space: nowrap;
}

.teaser { margin: clamp(1.75rem, 3.5vw, 2.75rem) 0 0; max-width: 980px; }

/* The figure is the paper's own export and keeps the paper's colours. Only
   the mount is ours: near-white so the figure's pale panels read as intended,
   warmed just enough not to punch a hole in the page. */
.plate--paper {
  background: #fbf8f1;
  padding: clamp(.9rem, 2vw, 1.4rem);
  max-width: 1000px;
}
.plate--paper img { border-radius: 2px; }
/* The overview is a wide strip of line art; below the breakpoint it is more
   use scrollable at a legible size than shrunk to fit. */
@media (max-width: 700px) {
  .plate--paper { overflow-x: auto; }
  .plate--paper img { min-width: 620px; }
}


/* ---------- 7. Carousel --------------------------------------- */

.carousel { position: relative; }

.carousel__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  padding-bottom: .5rem;
}
.carousel__viewport::-webkit-scrollbar { display: none; }

.carousel__track {
  display: flex; gap: 1.25rem;
  list-style: none; margin: 0; padding: 0;
}

.carousel__slide { flex: 0 0 100%; scroll-snap-align: center; }
@media (min-width: 860px) {
  .carousel__slide { flex-basis: calc((100% - 1.25rem) / 2); }
}

.carousel__nav {
  position: absolute; top: calc(50% - 2rem);
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .2s var(--ease);
}
.carousel__nav--prev { left: -14px; }
.carousel__nav--next { right: -14px; }
.carousel__nav:hover { transform: scale(1.07); }
.carousel__nav[disabled] { opacity: .3; pointer-events: none; }
@media (max-width: 700px) {
  .carousel__nav--prev { left: 2px; }
  .carousel__nav--next { right: 2px; }
}

.carousel__dots { display: flex; justify-content: center; gap: .45rem; margin-top: 1.4rem; }
.carousel__dots button {
  width: 7px; height: 7px; padding: 0;
  border: 0; border-radius: 99px;
  background: var(--line-strong); cursor: pointer;
  transition: width .25s var(--ease), background .25s var(--ease);
}
.carousel__dots button.is-active { width: 22px; background: var(--accent); }


/* ---------- 8. Prose ------------------------------------------ */

.prose p {
  margin: 0 0 1rem;
  max-width: 44rem;
  color: var(--ink-soft);
  font-size: .99rem;
  line-height: 1.7;
  text-wrap: pretty;
}
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose abbr { text-decoration: underline dotted; cursor: help; }
.prose--small p { font-size: .96rem; }

.ack__title {
  font-family: var(--font-mono);
  font-size: 1rem; font-weight: 500;
  letter-spacing: -.03em;
  margin-bottom: .5rem;
}
.ack__title::before { content: "/"; color: var(--accent); }

/* Notes on the method: a ruled list in columns, not a row of cards. */
.notes {
  list-style: none; padding: 0;
  margin: clamp(1.75rem, 3.5vw, 2.5rem) 0 0;
  display: grid; gap: 1.3rem 2.2rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.notes li { border-top: 1px solid var(--line); padding-top: .7rem; }
.notes h3 {
  font-family: var(--font-mono);
  font-size: .8rem; font-weight: 500;
  letter-spacing: -.02em;
  color: var(--accent-ink);
  margin: 0 0 .4rem;
}
.notes p { margin: 0; color: var(--ink-soft); font-size: .96rem; line-height: 1.6; }

code {
  font-family: var(--font-mono);
  font-size: .84em;
  padding: .1em .35em;
  background: var(--surface-2);
  border-radius: 3px;
}


/* ---------- 9. YouTube facade --------------------------------- */

.yt { position: relative; aspect-ratio: 16 / 9; background: #000; }
.yt__poster { width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: opacity .3s var(--ease); }
.yt:hover .yt__poster { opacity: .68; }

.yt__play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border: 0; background: none; cursor: pointer;
}
.yt__play svg { width: 72px; height: auto; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .45)); }
.yt__play-bg { fill: #212121; fill-opacity: .82; transition: fill .2s var(--ease); }
.yt__play-arrow { fill: #fff; }
.yt:hover .yt__play-bg { fill: #f00; fill-opacity: 1; }

.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }


/* ---------- 10. Comparison slider ----------------------------- */

/* Two sliders to a row once there is room: on a wide monitor one slider
   across the whole measure is far larger than the detail it shows. */
.cmp-grid {
  display: grid;
  gap: clamp(1.75rem, 3vw, 2.5rem) 1.4rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .cmp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cmp { margin: 0; }

.cmp__head {
  margin-bottom: .6rem;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.cmp__head h3 {
  font-family: var(--font-mono);
  font-size: .92rem; font-weight: 500;
  letter-spacing: -.03em;
}
.cmp__meta {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--ink-faint);
}

.cmp__frame {
  --pos: 50%;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  background: var(--surface-2);
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}

.cmp__img { width: 100%; display: block; pointer-events: none; -webkit-user-drag: none; }

/* the clipped layer holds the baseline; the layer beneath it is ours */
.cmp__clip {
  position: absolute; inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
  will-change: clip-path;
}
.cmp__clip .cmp__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.cmp__tag {
  position: absolute; top: 10px; z-index: 3;
  padding: .2rem .5rem; border-radius: 2px;
  background: rgba(20, 16, 12, .7);
  backdrop-filter: blur(6px);
  color: #f6efe2;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: -.01em;
  pointer-events: none;
}
.cmp__tag--left  { left: 10px; }
.cmp__tag--right { right: 10px; background: color-mix(in srgb, var(--accent) 90%, black); }

.cmp__handle {
  position: absolute; top: 0; bottom: 0; z-index: 4;
  left: var(--pos);
  width: 2px; margin-left: -1px;
  background: rgba(248, 243, 232, .94);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .22), 0 0 16px rgba(0, 0, 0, .32);
  cursor: ew-resize;
}

.cmp__grip {
  position: absolute; top: 50%; left: 50%;
  translate: -50% -50%;
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(248, 243, 232, .96);
  box-shadow: 0 3px 14px rgba(0, 0, 0, .28);
  transition: scale .18s var(--ease);
}
.cmp__frame:hover .cmp__grip { scale: 1.08; }
.cmp__handle:focus-visible { outline: none; }
.cmp__handle:focus-visible .cmp__grip { outline: 2px solid var(--accent); outline-offset: 3px; }
.cmp__grip svg {
  width: 18px; height: 18px;
  fill: none; stroke: #241f19; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.cmp__methods { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }

.chip {
  padding: .3rem .7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: -.02em;
  cursor: pointer;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Metric line under a comparison slider, swapped with the baseline chips. */
.cmp__note {
  margin: .55rem 0 0;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: .74rem;
  line-height: 1.6;
}


/* ---------- 11. Scene grid: paired clips under one toggle ----- */

.switch {
  display: flex; align-items: center; flex-wrap: wrap; gap: .4rem;
  margin: 0 0 1.2rem;
}
.switch__label {
  font-family: var(--font-mono);
  font-size: .74rem; color: var(--ink-faint);
  margin-right: .2rem;
}

.scenes {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.4rem 1.15rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
@media (min-width: 940px) {
  .scenes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.scene { margin: 0; }
.scene__stack {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.scene__stack video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity .45s var(--ease);
}
/* Both layers stay in the DOM; only the one named by data-vswap-show is
   shown, and main.js §9 only ever plays that one. */
[data-vswap-layer] { opacity: 0; }
[data-vswap-show="render"] [data-vswap-layer="render"],
[data-vswap-show="flat"]   [data-vswap-layer="flat"] { opacity: 1; }
/* Without JS the attribute is never set, so fall back to the render. */
[data-vswap]:not([data-vswap-show]) [data-vswap-layer="render"] { opacity: 1; }

.scene figcaption {
  margin-top: .5rem;
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--ink-faint);
  letter-spacing: -.01em;
}
.scene figcaption b {
  display: block;
  color: var(--ink);
  font-weight: 500;
  font-size: .86rem;
}


/* ---------- 12. Code block ------------------------------------ */

.codeblock {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.codeblock pre { margin: 0; padding: 1.15rem 1.3rem; overflow-x: auto; }
.codeblock code {
  font-size: .8rem; line-height: 1.75;
  color: var(--ink-soft);
  background: none; padding: 0;
  white-space: pre;
}

.codeblock__copy {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .26rem .6rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: .72rem; cursor: pointer;
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.codeblock__copy:hover { border-color: var(--ink); color: var(--ink); }
.codeblock__copy .icon { width: 13px; height: 13px; }
.codeblock__copy.is-done { color: var(--accent-ink); border-color: var(--accent); }


/* ---------- 13. Footer ---------------------------------------- */

.footer {
  padding: 2.25rem 0 2.75rem;
  border-top: 1px solid var(--line-strong);
  background: var(--bg-tint);
  color: var(--ink-faint);
  font-size: .9rem;
}
.footer p { margin: 0; max-width: 46rem; line-height: 1.6; }
.footer__meta {
  margin-top: .7rem;
  font-family: var(--font-mono);
  font-size: .84rem;
}


/* ---------- 14. Reveal on scroll ------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}


/* ---------- 15. Print ----------------------------------------- */

@media print {
  .nav, .carousel__nav, .carousel__dots, .codeblock__copy, .skip-link, .switch { display: none; }
  body { background: #fff; color: #000; }
  body::before { display: none; }
  .plate, .cmp__frame, .scene__stack { box-shadow: none; }
  .band__body { border-left: 0; padding-left: 0; }
  .reveal { opacity: 1; transform: none; }
  [data-vswap-layer="flat"] { display: none; }
}
