/* le19M — client deck as one editorial page.
   Tokens and idioms reused from v3/css/shared.css: cream ground, Georgia serif,
   italic le19M wordmark, outlined serif caps, hairline rules, rounded cards.
   Display numerals/names lean on the macOS didone faces (Didot/Bodoni MT),
   falling back to the project's Georgia — no webfonts, no external requests. */

:root {
  --cream: #fff9f4;
  --cream-deep: #f5eee4;
  --ink: #282828;
  --ink-soft: #5a544c;
  --kraft: #b99b6f;
  --gold: #a8842c;
  --serif: Georgia, 'Times New Roman', Times, serif;
  --didone: Didot, 'Bodoni MT', 'Didone LT STD', Georgia, 'Times New Roman', serif;
  --measure: 34em;
  --wide: 58rem;
  --hairline: rgba(40, 40, 40, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; }

/* ---------- return to top ---------- */

.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(40, 40, 40, 0.10);
  transition: background 0.2s ease, transform 0.2s ease;
}

.to-top:hover { background: var(--cream-deep); transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .to-top { transition: none; }
}

/* ---------- masthead ---------- */

.masthead { text-align: center; padding: 2.6rem 1rem 0; }

.brand {
  font-style: italic;
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.2;
}

.deck-kicker {
  margin: 2.8rem 0 0;
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.deck-title {
  margin: 0.5rem auto 0;
  max-width: 12em;
  font-family: var(--didone);
  font-weight: 400;
  font-size: clamp(1.95rem, 7.5vw, 5.2rem);
  line-height: 1.08;
}

.deck-note {
  margin: 1.8rem auto 0;
  max-width: 32em;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.deck-note a { border-bottom: 1px solid var(--hairline); text-decoration: none; }
.deck-note a:hover { color: var(--gold); }

/* ---------- chapter index ---------- */

.toc { margin: 3.4rem auto 0; max-width: 46rem; padding: 0 1.25rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { border-top: 1px solid var(--hairline); }
.toc li:last-child { border-bottom: 1px solid var(--hairline); }

.toc a {
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.85em 0.4em;
  min-height: 44px;
  text-decoration: none;
}
.toc a:hover { background: var(--cream-deep); }
.toc a:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.toc-num {
  font-family: var(--didone);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-soft);
  text-align: center;
}
.toc a:hover .toc-num { color: var(--gold); }

.toc-craft { letter-spacing: 0.1em; text-transform: uppercase; font-size: 1.02rem; }
.toc-maison { font-style: italic; font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- chapters ---------- */

.chapter { margin-top: clamp(6rem, 16vh, 11rem); scroll-margin-top: 1rem; }

.chapter-head { text-align: center; padding: 0 1rem; }

.chapter-num {
  margin: 0;
  font-family: var(--didone);
  font-weight: 400;
  font-size: clamp(6.5rem, 19vw, 13rem);
  line-height: 0.95;
  color: var(--ink);
}

.chapter-craft {
  margin: 1.6rem 0 0;
  font-size: 0.84rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* outlined serif caps — the project's maison-name idiom */
.maison-name {
  margin: 0.6rem 0 0;
  font-family: var(--didone);
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.12;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1.3px var(--ink);
}
@supports not (-webkit-text-stroke: 1px black) {
  .maison-name { color: var(--ink); }
}

/* ---------- steps ---------- */

.step {
  max-width: 74rem;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) 1.25rem 0;
  scroll-margin-top: 1rem;
}

.step-h {
  margin: 0 0 0.9em;
  font-weight: 400;
  font-size: 1.32rem;
  letter-spacing: 0.05em;
}
.step-h .cont {
  font-size: 0.85rem;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.step-text p { margin: 0 0 1.2em; }
.step-text .note { font-style: italic; color: var(--ink-soft); }

/* text-only slides — quiet measure column */
.lay-text .step-text { max-width: var(--measure); margin: 0 auto; }

/* side-by-side pairs (text column + media column) */
@media (min-width: 880px) {
  .lay-pair {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
  }
  .lay-pair .step-text {
    position: sticky;
    top: 2.5rem;
    max-width: 26em;
  }
  .lay-pair.rev .step-text { justify-self: end; }
}

.media .fig + .fig { margin-top: 1.6rem; }

/* 3-image media columns: first wide, two below */
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }
.media-grid .fig:first-child { grid-column: 1 / -1; }
.media-grid .fig + .fig { margin-top: 0; }

/* text on measure + asymmetric full-width grids */
.lay-grid3 .step-text, .lay-grid4a .step-text, .lay-grid4b .step-text,
.lay-grid5 .step-text, .lay-wide .step-text, .lay-bleed .step-text {
  max-width: var(--measure);
  margin: 0 auto 2.2rem;
}

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.4rem; align-items: start; }
.grid .fig { min-width: 0; }

.grid3 .fig:nth-child(1) { grid-column: 1 / 8; }
.grid3 .fig:nth-child(2) { grid-column: 8 / 13; }
.grid3 .fig:nth-child(3) { grid-column: 3 / 11; }

.grid4a .fig:nth-child(1) { grid-column: 1 / 6; }
.grid4a .fig:nth-child(2) { grid-column: 6 / 13; }
.grid4a .fig:nth-child(3) { grid-column: 1 / 8; }
.grid4a .fig:nth-child(4) { grid-column: 8 / 13; }

.grid4b .fig:nth-child(1) { grid-column: 1 / 8; }
.grid4b .fig:nth-child(2) { grid-column: 8 / 13; }
.grid4b .fig:nth-child(3) { grid-column: 1 / 6; }
.grid4b .fig:nth-child(4) { grid-column: 6 / 13; }

.grid5 .fig:nth-child(1) { grid-column: 1 / 5; }
.grid5 .fig:nth-child(2) { grid-column: 5 / 9; }
.grid5 .fig:nth-child(3) { grid-column: 9 / 13; }
.grid5 .fig:nth-child(4) { grid-column: 1 / 7; }
.grid5 .fig:nth-child(5) { grid-column: 7 / 13; }

/* wide stacked media (large landscapes) */
.wide-media { max-width: var(--wide); margin: 0 auto; }
.wide-media .fig + .fig { margin-top: 1.6rem; }

/* occasional full-bleed */
.bleed { width: 100vw; margin-left: calc(50% - 50vw); }
.bleed img { border-radius: 0; border-left: 0; border-right: 0; }
.bleed figcaption { text-align: center; }

/* ---------- figures ---------- */

.fig { margin: 0; }

.fig img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--cream-deep);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}

.fig figcaption {
  padding: 0.5em 0.2em 0;
  font-size: 0.8rem;
  font-style: italic;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

/* ---------- colophon ---------- */

.colophon {
  margin: 7rem auto 3rem;
  padding: 0 1.25rem;
  max-width: 40em;
  text-align: center;
}
/* hairline drawn in CSS so the entrance can draw it across (see reveal rules) */
.colophon::before {
  content: '';
  display: block;
  height: 1px;
  margin: 0 0 2.5rem;
  background: var(--hairline);
}
.colophon p { margin: 0; font-style: italic; font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- reveal (JS-gated; no-JS shows everything) ---------- */

.js .fade { opacity: 0; transform: translateY(12px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .fade.in { opacity: 1; transform: none; }

/* ---------- crafted entrances (same observer, varied per location) ---------- */

/* Chapter openers — letter-spacing settles from wide to normal + opacity.
   The generic block fade is cancelled; the three lines arrive staggered. */
.js .chapter-head.fade { opacity: 1; transform: none; }
.js .chapter-head .chapter-num,
.js .chapter-head .chapter-craft,
.js .chapter-head .maison-name {
  opacity: 0;
  transition: opacity 0.65s ease-out, letter-spacing 0.65s ease-out;
}
.js .chapter-head .chapter-num { letter-spacing: 0.3em; }
.js .chapter-head .chapter-craft { letter-spacing: 0.52em; transition-delay: 0.09s; }
.js .chapter-head .maison-name { letter-spacing: 0.44em; transition-delay: 0.18s; }
.js .chapter-head.in .chapter-num { opacity: 1; letter-spacing: 0; }
.js .chapter-head.in .chapter-craft { opacity: 1; letter-spacing: 0.22em; }
.js .chapter-head.in .maison-name { opacity: 1; letter-spacing: 0.14em; }

/* Step paragraphs — rise 11px while unmasking from the top; the generic
   block fade on steps is cancelled, children carry the entrance.
   Steps without animation reveal on IO (.in); steps with an animated cell
   (.has-scrub) hold their text until the player crosses p >= 0.5 (.txt-on,
   added by scrub-player.js). */
.js .step.fade { opacity: 1; transform: none; }
.js .step .step-h,
.js .step .step-text p {
  opacity: 0;
  transform: translateY(11px);
  -webkit-clip-path: inset(0 0 100% 0);
  clip-path: inset(0 0 100% 0);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out,
    -webkit-clip-path 0.55s ease-out, clip-path 0.55s ease-out;
}
.js .step.in:not(.has-scrub) .step-h,
.js .step.in:not(.has-scrub) .step-text p,
.js .step.txt-on .step-h,
.js .step.txt-on .step-text p {
  opacity: 1;
  transform: none;
  -webkit-clip-path: inset(0 0 0 0);
  clip-path: inset(0 0 0 0);
}
.js .step.in .step-text p:nth-of-type(1),
.js .step.txt-on .step-text p:nth-of-type(1) { transition-delay: 0.05s; }
.js .step.in .step-text p:nth-of-type(2),
.js .step.txt-on .step-text p:nth-of-type(2) { transition-delay: 0.11s; }
.js .step.in .step-text p:nth-of-type(3),
.js .step.txt-on .step-text p:nth-of-type(3) { transition-delay: 0.17s; }
.js .step.in .step-text p:nth-of-type(n+4),
.js .step.txt-on .step-text p:nth-of-type(n+4) { transition-delay: 0.23s; }

/* Figure groups — staggered rise, 75ms between figures */
.js .step .fig {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.js .step.in .fig { opacity: 1; transform: none; }
.js .step.in .fig:nth-child(2) { transition-delay: 0.075s; }
.js .step.in .fig:nth-child(3) { transition-delay: 0.15s; }
.js .step.in .fig:nth-child(4) { transition-delay: 0.225s; }
.js .step.in .fig:nth-child(5) { transition-delay: 0.3s; }

/* Colophon — hairline rule draws across, then the text rises */
.js .colophon.fade { opacity: 1; transform: none; }
.js .colophon::before { transform: scaleX(0); transition: transform 0.6s ease-out; }
.js .colophon p {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease-out 0.15s, transform 0.6s ease-out 0.15s;
}
.js .colophon.in::before { transform: scaleX(1); }
.js .colophon.in p { opacity: 1; transform: none; }

/* ---------- small screens: denser editorial compositions ---------- */

/* Below the desktop pair layout, figures collapse into a single sparse
   column no longer: multi-image steps become varied 2-up grids and offset
   pairs, so several images share one viewport. Rhythms differ per grid
   type, so chapters read differently by construction. */
@media (max-width: 879px) {
  .chapter-num { font-size: clamp(5.5rem, 26vw, 8rem); }

  /* asymmetric grids → dense 2-column rhythms (!important: the desktop
     nth-child placements out-specificity a plain mobile reset) */
  .grid { grid-template-columns: 1fr 1fr; gap: 1.1rem; }
  .grid .fig { grid-column: auto !important; }

  /* grid3: full-width hero, then a 2-up */
  .grid3 .fig:nth-child(1) { grid-column: 1 / -1 !important; }

  /* grid4a: straight 2×2 (base rules already give this) */

  /* grid4b: staggered 2×2 — the right column drops a beat */
  .grid4b .fig:nth-child(even) { margin-top: 1.8rem; }

  /* grid5 (5 figures): full-width hero, then two 2-up rows */
  .grid5 .fig:nth-child(1) { grid-column: 1 / -1 !important; }

  /* pair media columns become 2-up grids; text-first pairs get an
     offset second figure, media-first (rev) pairs stay straight */
  .media { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: start; }
  .media .fig + .fig { margin-top: 0; }
  /* only-of-type: a payoff-caption sibling must not break single-figure spans */
  .media .fig:only-of-type { grid-column: 1 / -1; }
  .lay-pair:not(.rev) > .media:not(.media-grid) .fig:nth-child(2) { margin-top: 1.8rem; }

  /* 3-figure media columns keep their hero + 2-up rhythm at every width */
  .media-grid { gap: 1.1rem; }
}

@media (max-width: 640px) {
  .toc a { grid-template-columns: 2.2rem 1fr; }
  .toc-maison { grid-column: 2; }
  .step { padding-top: 2.6rem; }
  .deck-kicker { font-size: 0.68rem; letter-spacing: 0.16em; }
  .deck-note { font-size: 0.86rem; }
  .grid, .media, .media-grid { gap: 0.9rem; }
  .grid4b .fig:nth-child(even) { margin-top: 1.4rem; }
  .lay-pair:not(.rev) > .media:not(.media-grid) .fig:nth-child(2) { margin-top: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .fade { opacity: 1; transform: none; transition: none; }

  /* every crafted entrance resolves to its final state, no animation */
  .js .chapter-head .chapter-num,
  .js .chapter-head .chapter-craft,
  .js .chapter-head .maison-name,
  .js .step .step-h,
  .js .step .step-text p,
  .js .step .fig,
  .js .colophon p {
    opacity: 1;
    transform: none;
    -webkit-clip-path: none;
    clip-path: none;
    transition: none;
  }
  .js .chapter-head .chapter-num { letter-spacing: 0; }
  .js .chapter-head .chapter-craft { letter-spacing: 0.22em; }
  .js .chapter-head .maison-name { letter-spacing: 0.14em; }
  .js .colophon::before { transform: none; transition: none; }
}

/* ---------- animated grid cells (approved sequences) ---------- */

/* A .scrub-cell is a .fig whose image is a canvas: it sits in a normal
   grid/pair slot and inherits every placement rule (desktop asymmetric
   grids, mobile 2-up rhythms, staggered-rise entrance). The canvas mirrors
   .fig img exactly, so an animated cell is indistinguishable from its
   static siblings until it moves. Any grid can hold 1–2 cells — no
   per-cell CSS needed. No vh/dvh units anywhere, so nothing resizes when
   mobile browser chrome collapses mid-scroll. */
.scrub-cell canvas {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: var(--cream-deep);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  -webkit-touch-callout: none;
}

/* payoff caption below an inline single — revealed past ~60% traversal
   (class toggled by scrub-player.js): hairline draws across, then the text
   rises. Always in flow, so the reveal costs no layout shift. Sits in the
   same media container as its cell; spans the full width of mobile grids. */
.scrub-payoff {
  margin: 1.15rem auto 0;
  max-width: 26em;
  text-align: center;
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.media .scrub-payoff { grid-column: 1 / -1; }

.scrub-payoff::before {
  content: '';
  display: block;
  width: 4.5rem;
  height: 1px;
  margin: 0 auto 0.85rem;
  background: var(--hairline);
}

.js .scrub-payoff {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease-out 0.18s, transform 0.6s ease-out 0.18s;
}

.js .scrub-payoff::before {
  transform: scaleX(0);
  transition: transform 0.55s ease-out;
}

.js .scrub-payoff.on { opacity: 1; transform: none; }
.js .scrub-payoff.on::before { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  .js .scrub-payoff { opacity: 1; transform: none; transition: none; }
  .js .scrub-payoff::before { transform: none; transition: none; }
}

/* ---------- Chinese mode (js/zh-toggle.js) — the default reading mode ---------- */

/* Licensed CN face: ChillDuanSans (SIL OFL 1.1 — license ships at
   deck/assets/fonts/chill-duan-sans/LICENSE.txt), subset to the deck's CN
   copy by .scratch/font/subset_fonts.py — RE-RUN that script whenever
   content-zh.json changes or glyphs will go missing. One family carries
   both voices: weight, not serif/sans contrast, marks display type. */
@font-face {
  font-family: "ChillDuanSans";
  src: url("../assets/fonts/chill-duan-sans/ChillDuanSans-Light.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "ChillDuanSans";
  src: url("../assets/fonts/chill-duan-sans/ChillDuanSans-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "ChillDuanSans";
  src: url("../assets/fonts/chill-duan-sans/ChillDuanSans-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "ChillDuanSans";
  src: url("../assets/fonts/chill-duan-sans/ChillDuanSans-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
:root {
  --zh-sans: "ChillDuanSans", "PingFang SC", "HarmonyOS Sans SC",
    "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --zh-serif: var(--zh-sans);
}

body.zh { font-family: var(--zh-sans); line-height: 1.85; }

/* CJK line breaking; never a synthesised oblique on Chinese text */
.zh .step-text p { line-break: strict; -webkit-line-break: strict; }
.zh i, .zh em, .zh cite { font-style: normal; }

/* latin display faces (chapter numerals, outlined maison names) stay as
   they are; CN display type takes weight from the one licensed family */
.zh .deck-title, .zh .chapter-craft, .zh .toc-craft { font-family: var(--zh-serif); }
.zh .deck-title { letter-spacing: 0.04em; font-weight: 300; }
.zh .chapter-craft { letter-spacing: 0.3em; font-weight: 600; }
.zh .toc-craft { letter-spacing: 0.12em; text-transform: none; font-weight: 600; }
.zh .step-h { letter-spacing: 0; font-weight: 500; }

/* toggle control — mirrors .to-top, opposite corner */
.zh-toggle {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: 50;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(40, 40, 40, 0.10);
  transition: background 0.2s ease, transform 0.2s ease;
}
.zh-toggle:hover { background: var(--cream-deep); transform: translateY(-2px); }
.zh-toggle[aria-pressed="true"] { background: var(--cream-deep); }

/* ---------- quiet small inline cell variant ---------- */

/* Owner: the weft works better smaller — a quiet small card in its media
   column, payoff copy below. Canvas stays 100% of the (smaller) figure. */
.scrub-cell-sm { width: min(58%, 15rem); margin-inline: auto; }

/* ---------- Layout A: slide-20 feather family band ---------- */

/* All five feather images share one screen with equal billing: same card
   span, staggered offsets, the animated s20-2 sitting among equals just
   off-centre — not the largest, never dominant. min-height uses svh (the
   constant small-viewport unit — no mid-scroll resizing). */
.mosaic { min-height: 100svh; align-content: center; }

/* desktop: equal 3/12 cards, row of three then an indented pair,
   right side left open — magazine asymmetry */
@media (min-width: 880px) {
  .mosaic .fig:nth-child(1) { grid-column: 1 / 4; grid-row: 1; }
  .mosaic .fig:nth-child(2) { grid-column: 4 / 7; grid-row: 1; margin-top: 2.4rem; }
  .mosaic .fig:nth-child(3) { grid-column: 7 / 10; grid-row: 1; margin-top: 0.9rem; }
  .mosaic .fig:nth-child(4) { grid-column: 2 / 5; grid-row: 2; margin-top: 1.6rem; }
  .mosaic .fig:nth-child(5) { grid-column: 5 / 8; grid-row: 2; margin-top: 3.2rem; }
}

/* mobile: the same rhythm on a six-column grid — three, then an indented pair */
@media (max-width: 879px) {
  .mosaic { grid-template-columns: repeat(6, 1fr); }
  .mosaic .fig:nth-child(1) { grid-column: 1 / 3 !important; grid-row: 1; }
  .mosaic .fig:nth-child(2) { grid-column: 3 / 5 !important; grid-row: 1; margin-top: 1.5rem; }
  .mosaic .fig:nth-child(3) { grid-column: 5 / 7 !important; grid-row: 1; margin-top: 0.7rem; }
  .mosaic .fig:nth-child(4) { grid-column: 2 / 4 !important; grid-row: 2; margin-top: 1.1rem; }
  .mosaic .fig:nth-child(5) { grid-column: 4 / 6 !important; grid-row: 2; margin-top: 2.1rem; }
}

/* ---------- Layout B: slide-29 polaroid stack ---------- */

/* Four near-identical frames: the step starts with one image and lays the
   other three on top as you scroll (IO-triggered once, staggered). All
   motion is transform/opacity on figures absolutely stacked inside a
   reserved 4:3 box — following content never shifts. */
.pstack {
  position: relative;
  aspect-ratio: 4 / 3;
}

.pstack .fig { position: absolute; inset: 0; margin: 0; }

.pstack .fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* settle rotations, 2–4°, alternating */
.pstack .fig:nth-child(1) { z-index: 1; }
.pstack .fig:nth-child(2) { z-index: 2; --r: -2.6deg; }
.pstack .fig:nth-child(3) { z-index: 3; --r: 3.1deg; }
.pstack .fig:nth-child(4) { z-index: 4; --r: -2.2deg; }

.pstack .fig:nth-child(n+2) img { box-shadow: 0 10px 30px rgba(40, 40, 40, 0.16); }

/* the deal is reversible (deck.js toggles .in with hysteresis): .in delays
   settle 2→3→4; base delays lift 4→3→2 — un-deal runs in reverse order.
   Base delays are scoped via .step so they out-rank the generic
   figure-group entrance delays on .step.in. */
.js .pstack .fig:nth-child(n+2) {
  opacity: 0;
  transform: translateY(22%);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}
.js .step .pstack .fig:nth-child(2) { transition-delay: 0.32s; }
.js .step .pstack .fig:nth-child(3) { transition-delay: 0.16s; }
.js .step .pstack .fig:nth-child(4) { transition-delay: 0s; }
.js .pstack.in .fig:nth-child(n+2) {
  opacity: 1;
  transform: translateY(0) rotate(var(--r));
}
.js .pstack.in .fig:nth-child(2) { transition-delay: 0.1s; }
.js .pstack.in .fig:nth-child(3) { transition-delay: 0.28s; }
.js .pstack.in .fig:nth-child(4) { transition-delay: 0.46s; }

.pstack-wrap { max-width: 34rem; margin: 1rem auto 0; }

/* one combined filename caption under the stack */
.pstack-cap {
  margin: 0;
  padding: 0.6em 0.2em 0;
  font-size: 0.8rem;
  font-style: italic;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- Layout C: full-bleed hero steps ---------- */

/* s33_1 (Massaro archive wall) and s39_1 (bag maquette): full-width,
   viewport-height heroes; copy sits on the image in a quiet cream block.
   svh is constant on iOS — no mid-scroll resizing. */
.hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);   /* the deck's .bleed idiom */
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
}

.hero .fig { position: absolute; inset: 0; margin: 0; }

.hero .fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

/* copy follows the image in normal flow (encounter pattern: image first,
   annotation after) — nothing sits on the image */
.lay-hero .step-text {
  max-width: var(--measure);
  margin: 2.4rem auto 0;
}

/* filename caption for the hero image, same register as .fig figcaption */
.hero-tag {
  margin: 0.7em 0 0;
  font-size: 0.8rem;
  font-style: italic;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

/* trailing figures after a hero (slide-39's s39_2 / s39_3) */
.hero-rest { margin-top: 1.4rem; }

@media (prefers-reduced-motion: reduce) {
  /* polaroid stack lands already stacked, no flight */
  .js .pstack .fig:nth-child(n+2) {
    opacity: 1;
    transform: rotate(var(--r));
    transition: none;
  }
}

/* ---------- chapter-opening encounters (idea #1) ---------- */

/* The thing itself before any title: one unlabeled full-bleed image per
   chapter, drawn from the chapter's own pool. Only images with short edge
   >= 1100px qualify (tier map in .scratch/image-tiers.json); chapters 2
   and 3 have no qualifying frame and open with the head alone. */
.encounter {
  width: 100vw;
  margin: 0 0 clamp(2.2rem, 6vw, 4rem) calc(50% - 50vw);
}

.encounter img {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
}

/* ---------- vernier progress instrument (idea #2) ---------- */

/* One fixed hairline rail: chapter marks, live gold tick tracking scroll,
   current chapter numeral in didone. Quiet, pointer-events none. */
.vernier {
  position: fixed;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  pointer-events: none;
}

.vernier-num {
  font-family: var(--didone);
  font-size: 1.05rem;
  line-height: 1;
  color: var(--gold);
}

.vernier-rail {
  position: relative;
  width: 1px;
  height: min(30svh, 15rem);   /* svh: constant on iOS, no chrome-collapse resize */
  background: var(--hairline);
}

.vernier-mark {
  position: absolute;
  left: -2.5px;
  width: 6px;
  height: 1px;
  background: var(--hairline);
}

.vernier-live {
  position: absolute;
  left: -4px;
  top: 0;
  width: 9px;
  height: 1px;
  background: var(--gold);
}

@media (max-width: 640px) {
  .vernier { right: 0.5rem; }
  .vernier-num { font-size: 0.9rem; }
}

/* ---------- scrub progress tick (idea #2) ---------- */

/* Thin brass dash under each animated cell; scrub-player.js scales it to
   the traversal p it already computes (transform only). */
.scrub-tick {
  display: block;
  height: 1px;
  margin-top: 0.5rem;
  background: var(--hairline);
}

.scrub-tick > i {
  display: block;
  height: 1px;
  background: var(--kraft);
  transform: scaleX(0);
  transform-origin: left center;
}

@media (prefers-reduced-motion: reduce) {
  .scrub-tick { display: none; }
}

/* ---------- magazine treatments (round 2, idea #1/#4 exploration) ---------- */

/* slide-23 — specimen plate + margin note: the small feather flower stays
   at its natural detail scale (never upscaled); the copy becomes a ruled
   margin column beside it. */
@media (min-width: 880px) {
  .lay-specimen .media .fig { max-width: 17rem; }
  .lay-specimen .step-text {
    border-left: 1px solid var(--hairline);
    padding-left: 1.7rem;
    font-size: 0.97rem;
    max-width: 22em;
  }
}
@media (max-width: 879px) {
  .lay-specimen .media { display: block; }
  .lay-specimen .media .fig { max-width: 13rem; margin: 0 auto; }
  .lay-specimen .media .fig + .fig { margin-top: 1.6rem; }
}

/* slide-43 — rotated side label: the Lunéville bleed keeps its image clean;
   the label reads bottom-up in the left margin of the copy column (on the
   cream ground, never on the image). */
.lay-label .step-text {
  position: relative;
  max-width: var(--measure);
  margin: 2.4rem auto 0;
}
.side-label {
  position: absolute;
  right: 100%;
  top: 0.25em;
  margin: 0 1.2rem 0 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink-soft);
}
@media (max-width: 879px) {
  .side-label {
    position: static;
    writing-mode: horizontal-tb;
    transform: none;
    display: block;
    margin: 0 0 0.9rem;
  }
}

/* slide-61 — overlapping plates: the second print lays over the first,
   cream-framed like a print on a contact sheet */
.lay-overlap .wide-media .fig:nth-child(2) {
  width: 62%;
  margin: -18% 0 0 auto;
  position: relative;
  z-index: 1;
  padding: 0.45rem;
  background: var(--cream);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(40, 40, 40, 0.14);
}
@media (max-width: 640px) {
  .lay-overlap .wide-media .fig:nth-child(2) { width: 74%; margin-top: -14%; }
}

/* slide-25 — zigzag interleave: small runway still left, brief mid and
   dropped, slingback portrait right and dropped again */
@media (min-width: 880px) {
  .lay-zigzag { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.4rem; align-items: start; }
  .lay-zigzag .media-a { grid-column: 1 / 4; grid-row: 1; }
  .lay-zigzag .step-text { grid-column: 4 / 9; grid-row: 1; margin-top: 4.5rem; max-width: 26em; }
  .lay-zigzag .media-b { grid-column: 10 / 13; grid-row: 1; margin-top: 11rem; }
}
@media (max-width: 879px) {
  .lay-zigzag .media { display: block; }
  .lay-zigzag .media-a .fig { max-width: 62%; }
  .lay-zigzag .step-text { margin: 1.8rem 0; }
  .lay-zigzag .media-b .fig { width: 78%; margin-left: auto; }
}

/* ---------- review UX layer (ux.js / lightbox.js / parallax.js) ---------- */

/* figure loading: shimmer skeleton, then a quiet fade-in */
.js .fig img, .js .encounter img, .js .toc-thumb {
  opacity: 0;
  transition: opacity 0.45s ease-out;
}
.js .fig img.ld, .js .encounter img.ld, .js .toc-thumb.ld { opacity: 1; }
.js .fig img:not(.ld), .js .encounter img:not(.ld) {
  background: linear-gradient(100deg, var(--cream-deep) 40%, #fdf7ee 50%, var(--cream-deep) 60%);
  background-size: 200% 100%;
  animation: ld-shimmer 1.6s linear infinite;
}
@keyframes ld-shimmer { to { background-position: -200% 0; } }

/* jump feedback: toast (A) and curtain (B) */
.jump-toast {
  position: fixed; left: 50%; bottom: calc(1.1rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px); opacity: 0;
  background: var(--ink); color: var(--cream);
  font-style: italic; font-size: 0.85rem; letter-spacing: 0.06em;
  padding: 0.5em 1.2em; border-radius: 999px;
  z-index: 70; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 80vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.jump-toast.on { opacity: 0.92; transform: translate(-50%, 0); }
.jump-curtain {
  position: fixed; inset: 0; background: var(--cream);
  opacity: 0; pointer-events: none; z-index: 65;
  transition: opacity 0.15s ease-in;
}
.jump-curtain.on { opacity: 1; }

/* sticky chapter chip */
.ch-chip {
  position: fixed; top: calc(0.6rem + env(safe-area-inset-top)); left: 50%;
  transform: translate(-50%, -180%);
  display: flex; gap: 0.55em; align-items: baseline;
  background: rgba(255, 249, 244, 0.92);
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 0.38em 1.1em; z-index: 45;
  transition: transform 0.35s ease;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ch-chip.on { transform: translate(-50%, 0); }
.ch-chip-num { font-family: var(--didone); color: var(--gold); line-height: 1; }
.ch-chip-maison { font-style: italic; font-size: 0.85rem; color: var(--ink-soft); }

/* TOC thumbnails (right column) */
.toc a { grid-template-columns: 2.6rem 1fr auto 3.4rem; align-items: center; }
.toc-thumb {
  grid-column: 4; grid-row: 1;
  width: 3.2rem; height: 3.2rem; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--hairline);
  background: var(--cream-deep);
}
@media (max-width: 640px) {
  .toc a { grid-template-columns: 2.2rem 1fr 3.4rem; }
  .toc-maison { grid-column: 2; }
  .toc-thumb { grid-column: 3; grid-row: 1 / span 2; }
}

/* next / prev chapter rows */
.ch-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin: 3.4rem 0 0; padding: 0.9rem 0.2em 0;
  border-top: 1px solid var(--hairline);
  font-style: italic; font-size: 0.9rem;
}
.ch-nav a {
  color: var(--ink-soft); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.2em;
}
.ch-nav a:hover { color: var(--gold); }
.ch-nav a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 80; display: none;
  background: rgba(24, 20, 16, 0.93); touch-action: none;
}
.lightbox.on { display: block; }
.lb-stage {
  margin: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.lb-stage img {
  max-width: 94vw; max-height: 82svh; object-fit: contain;
  border-radius: 6px; user-select: none; -webkit-user-drag: none;
}
.lb-stage figcaption {
  color: #d8cfc4; font-style: italic; font-size: 0.8rem; letter-spacing: 0.05em;
  padding: 0.9em 1em 0; text-align: center; max-width: 90vw;
}
.lb-close {
  position: absolute; top: calc(0.8rem + env(safe-area-inset-top)); right: 0.8rem;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 249, 244, 0.4); background: transparent;
  color: var(--cream); font-size: 1.3rem; line-height: 1;
}
body.lb-lock { overflow: hidden; }

/* parallax windows: heroes + encounters become clipped viewports */
.hero, .encounter { overflow: hidden; position: relative; }
.hero .fig img, .encounter img { transform-origin: center center; }
/* version B: the window gets an inset cream mat + hairline frame */
html.ver-b .hero::after, html.ver-b .encounter::after, html.ver-b .hero.panwin::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 10px var(--cream), inset 0 0 0 11px var(--hairline);
}
html.ver-b .chapter-num { will-change: transform; }

/* masthead motion teaser (B) */
.mast-movie { margin: 2.4rem auto 0; width: min(58vw, 14rem); }
.mast-movie canvas {
  display: block; width: 100%; aspect-ratio: 2 / 3;
  border-radius: 10px; border: 1px solid var(--hairline);
  background: var(--cream-deep);
}


/* vernier marks: tappable chapter targets */
.vernier-mark {
  pointer-events: auto; position: absolute;
  left: -12px; width: 25px; height: 25px;
  transform: translateY(-50%);
  background: transparent; border: 0; padding: 0; cursor: pointer;
}
.vernier-mark::before {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 6px; height: 1px; margin: -0.5px 0 0 -3px;
  background: var(--hairline);
}
.vernier-mark:hover::before, .vernier-mark:focus-visible::before { background: var(--gold); height: 2px; margin-top: -1px; }
.vernier-mark:focus-visible { outline: 1px solid var(--gold); outline-offset: -6px; border-radius: 50%; }

/* reduced motion: everything above resolves quiet */
@media (prefers-reduced-motion: reduce) {
  .js .fig img, .js .encounter img, .js .toc-thumb { transition: none; }
  .js .fig img:not(.ld), .js .encounter img:not(.ld) { animation: none; }
  .jump-toast, .jump-curtain, .ch-chip { transition: none; }
}
/* ---------- version-B scenes (b-scenes.js) ---------- */

.hero.panwin { min-height: 210svh; display: block; overflow: visible; }
.hero.panwin .fig {
  position: sticky;
  top: calc(50svh - min(43vw, 17rem));
  width: min(86vw, 34rem); height: min(86vw, 34rem);
  margin: 0 auto; overflow: hidden;
  border: 0; border-radius: 0;
  box-shadow: 0 0 0 10px var(--cream), 0 0 0 11px var(--hairline),
    0 22px 60px rgba(40, 40, 40, 0.16);
  will-change: transform;
}
.hero.panwin .fig img {
  position: absolute; top: 0; left: 50%;
  width: 165%; height: auto; max-width: none; max-height: none;
  border: 0; border-radius: 0;
  transform: translateX(-50%);
  will-change: transform;
}

/* 2. horizontal polaroid strip */
html.ver-b .pstack-wrap { position: relative; }
html.ver-b .pstack.hstrip {
  position: sticky; top: 0; left: 0;
  height: 100svh; width: max-content; max-width: none;
  display: flex; align-items: center; gap: 5vw;
  margin: 0; padding: 0 9vw;
  aspect-ratio: auto;
  will-change: transform;
}
html.ver-b .pstack.hstrip .fig {
  position: relative; inset: auto;
  width: 80vw; height: 58svh; margin: 0;
  display: flex; flex-direction: column;
}
/* the deal animation and stack shadows do not apply to the strip */
html.ver-b .pstack.hstrip .fig:nth-child(n+2) {
  opacity: 1; transform: none; transition: none;
}
html.ver-b .pstack.hstrip .fig:nth-child(n+2) img { box-shadow: 0 14px 40px rgba(40, 40, 40, 0.18); }
html.ver-b .pstack-cap { position: absolute; bottom: 0.6rem; left: 0; right: 0; }

/* 3. unfolding scrollytelling (slide-20) */
#slide-20.s20b {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 1.1rem; align-items: start;
}
#slide-20.s20b .s20-old { display: none; }
#slide-20.s20b .grid {
  display: flex; flex-direction: column; gap: 0.7rem;
  position: sticky; top: 10svh;
  height: 76svh; margin: 0;
  grid-column: 1; grid-row: 1;
}
#slide-20.s20b .grid .fig {
  flex: 1 1 0; min-height: 0; margin: 0;
  display: flex; flex-direction: column;
  opacity: 0.4; transition: opacity 0.45s ease, box-shadow 0.45s ease;
}
#slide-20.s20b .grid .fig.act { opacity: 1; box-shadow: 0 0 0 2px var(--gold); border-radius: 10px; }
#slide-20.s20b .grid .fig img,
#slide-20.s20b .grid .fig canvas {
  width: 100%; height: 100%; object-fit: cover;
  aspect-ratio: auto !important; flex: 1 1 auto; min-height: 0;
}
#slide-20.s20b .grid .fig figcaption { display: none; }
#slide-20.s20b .s20-col { display: flex; flex-direction: column; padding: 16svh 0.4rem 24svh 0; grid-column: 2; grid-row: 1; }
#slide-20.s20b .s20-txt {
  display: grid; grid-template-rows: 0fr; opacity: 0; transform: translateY(12px);
  transition: grid-template-rows 0.7s ease, opacity 0.7s ease, transform 0.7s ease;
  min-height: 38svh; align-content: start;
}
#slide-20.s20b .s20-txt > .s20-in { overflow: hidden; }
#slide-20.s20b .s20-txt.on { grid-template-rows: 1fr; opacity: 1; transform: none; }
#slide-20.s20b .s20-h {
  margin: 0 0 0.6em; font-size: 0.95rem; letter-spacing: 0.12em;
  color: var(--gold); font-weight: 600;
}
#slide-20.s20b .s20-txt p { margin: 0; max-width: 26em; }

/* reduced motion: scenes resolve to static layouts */
@media (prefers-reduced-motion: reduce) {
  .hero.panwin { min-height: auto; }
  .hero.panwin .fig { position: relative; top: 0; width: 100%; height: auto; aspect-ratio: 4 / 5; transform: none !important; }
  .hero.panwin .fig img { position: static; width: 100%; transform: none !important; }
  html.ver-b .pstack-wrap { height: auto !important; }
  html.ver-b .pstack.hstrip { position: relative; height: auto; width: auto; flex-wrap: wrap; transform: none !important; padding: 0 1.25rem; }
  html.ver-b .pstack.hstrip .fig { width: 46%; height: auto; }
  #slide-20.s20b .s20-txt { grid-template-rows: 1fr; opacity: 1; transform: none; min-height: 0; }
  #slide-20.s20b .grid { position: relative; top: 0; height: auto; }
}

/* ---------- version C: folding navigation (c-scenes.js) ---------- */
html.ver-c .brand, html.ver-c .deck-kicker, html.ver-c .deck-note { display: none; }
html.ver-c .masthead { min-height: 100svh; padding: calc(50px + 10px) 1rem 0; }
html.ver-c .deck-title {
  margin: 0; letter-spacing: 0.06em; white-space: nowrap;
  height: 64px; display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12px;
  font-size: min(8.5vw, 34px); line-height: 1;
}
html.ver-c.js .toc { display: none; }
html.ver-c .ch-chip { display: none; }
html.ver-c footer p { display: none; }
html.ver-c .cgap { height: 145svh; }
/* C·6: no scroll-driven text reveals — text is simply on the page */
html.ver-c.js .step .step-h,
html.ver-c.js .step .step-text p {
  opacity: 1; transform: none;
  -webkit-clip-path: none; clip-path: none;
  transition: none;
}
html.ver-c .cnav {
  position: fixed; left: 0; right: 0; top: 50px; bottom: 50px; z-index: 40; pointer-events: none;
  display: flex; flex-direction: column; justify-content: flex-start;
  /* c-scenes centers the stack with an explicit padding-top at measure time —
     flex centering would re-center on iOS URL-bar collapse and break the
     pinned bar's flush position against the top bar */
}
html.ver-c .cnav-row {
  pointer-events: auto; position: relative; display: block;
  height: 70px; margin: 0;
  background: var(--cream);
  overflow: hidden; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--hairline);
  will-change: transform;
}
html.ver-c .cnav-row:last-child { border-bottom: 0; }
/* approved PPT still fills the left of the row; trade name beside it on cream */
html.ver-c .cnav-img {
  position: absolute; left: 0; top: 0; display: block;
  width: 165px; height: 70px; object-fit: cover;
}
html.ver-c .cnav-txt {
  position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 0.3rem; text-align: right;
}
html.ver-c .cnav-zh { display: block; font-size: 1.05rem; line-height: 1; letter-spacing: 0.14em; }
html.ver-c .cnav-num {
  display: block; font-family: var(--didone); font-size: 0.78rem;
  line-height: 1; letter-spacing: 0.08em; color: var(--gold);
}
html.ver-c .chapter-head, html.ver-c .ch-nav { display: none; }
html.ver-c body { padding-top: 50px; padding-bottom: 50px; }
/* vernier becomes a fixed horizontal top bar */
.vernier-h {
  top: 0; left: 0; right: 0; transform: none;
  flex-direction: row; align-items: center; gap: 0.9rem;
  height: 50px; width: auto; padding: 0 1rem;
  background: var(--cream); border-bottom: 1px solid var(--hairline);
  z-index: 50;
}
.vernier-h .vernier-rail { width: auto; height: 1px; flex: 1 1 auto; }
.vernier-h .vernier-mark { left: 0; top: 50%; transform: translate(-50%, -50%); }
.vernier-h .vernier-mark::before { width: 1px; height: 7px; margin: -3.5px 0 0 -0.5px; }
.vernier-h .vernier-live { left: 0; top: -4px; width: 1px; height: 9px; }
html.ver-c .cfoot {
  position: fixed; left: 0; right: 0; bottom: 0; height: 50px; z-index: 50;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 0.8rem; background: var(--cream); border-top: 1px solid var(--hairline);
}
html.ver-c .cfoot .to-top { position: static; margin: 0; }
html.ver-c .c-hide { display: none; }
/* C·6 pan windows: full-width letterbox peek. The image fills the screen
   width behind cream framing bars top and bottom; scrolling drifts the view
   through the image, then the page moves on. Driven by b-scenes.js. */
html.ver-c .hero.panwin { min-height: 0; display: block; overflow: visible; }
html.ver-c .hero.panwin .fig {
  position: relative; top: 0; left: 0;
  width: 100%; height: 62svh; margin: 0;
  overflow: hidden; border: 0; border-radius: 0; box-shadow: none;
  will-change: auto;
}
html.ver-c .hero.panwin .fig::before,
html.ver-c .hero.panwin .fig::after {
  content: ''; position: absolute; left: 0; right: 0; height: 14px;
  background: var(--cream); z-index: 2; pointer-events: none;
}
html.ver-c .hero.panwin .fig::before { top: 0; box-shadow: 0 1px 0 var(--hairline), 0 14px 30px rgba(40, 40, 40, 0.12); }
html.ver-c .hero.panwin .fig::after { bottom: 0; box-shadow: 0 -1px 0 var(--hairline), 0 -14px 30px rgba(40, 40, 40, 0.12); }
html.ver-c .hero.panwin .fig img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 138%; max-width: none; max-height: none;
  object-fit: cover; border: 0; border-radius: 0;
  will-change: transform;
}
/* C·6: the polaroid deal is scroll-scrubbed by deck.js — no CSS transition */
html.ver-c.js .pstack .fig:nth-child(n+2) { transition: none; }
/* Goossens tool tray: sticky window over the 230%-scale tray; a slow camera
   tours the numbered tools (badges ride the same transform) while their
   captions appear below — active caption full, three before it dimmed */
html.ver-c .gpan-wrap { position: relative; min-height: 340svh; }
html.ver-c .gpan-pin {
  position: sticky; top: 120px; height: calc(100svh - 170px);
  /* top:120px = 50px top bar + 70px pinned chapter bar — the tray window
     must clear both; bottom clearance is the 50px footer bar */
  display: flex; flex-direction: column; padding-top: 0.8rem;
}
html.ver-c .gpan-pin .bleed { position: relative; width: 100%; margin: 0; flex: 0 0 46%; overflow: hidden; }
html.ver-c .gpan-stage {
  position: absolute; top: 0; left: 0;
  width: 230%; aspect-ratio: 1600 / 748;
  will-change: transform;
}
html.ver-c .gpan-stage .fig { margin: 0; height: 100%; }
html.ver-c .gpan-stage .fig img {
  display: block; width: 100%; height: 100%; max-width: none;
  border: 0; border-radius: 0;
}
html.ver-c .gpan-pin .bleed figcaption { display: none; }
html.ver-c .gpan-badge {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--gold);
  background: rgba(255, 249, 244, 0.88); color: var(--gold);
  font-family: var(--didone); font-size: 0.75rem; line-height: 1;
  opacity: 0.55;
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.4s ease, color 0.4s ease;
}
html.ver-c .gpan-badge.act {
  opacity: 1; transform: scale(1.3);
  background: var(--gold); color: var(--cream);
}
html.ver-c .gpan-caps {
  flex: 1 1 auto; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  gap: 0.55rem; padding: 0.7rem 1.2rem 0;
}
html.ver-c .gpan-cap {
  display: flex; gap: 0.6rem; align-items: baseline;
  height: 0; opacity: 0; transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
html.ver-c .gpan-cap.on { height: auto; opacity: 1; transform: none; }
html.ver-c .gpan-cap.on.dim { opacity: 0.38; }
html.ver-c .gpan-n { font-family: var(--didone); color: var(--gold); font-size: 0.9rem; flex: 0 0 auto; }
html.ver-c .gpan-cap p { margin: 0; font-size: 0.9rem; line-height: 1.55; }
@media (prefers-reduced-motion: reduce) {
  html.ver-c .gpan-wrap { min-height: auto; }
  html.ver-c .gpan-pin { position: static; height: auto; }
  html.ver-c .gpan-pin .bleed { flex: none; height: auto; }
  html.ver-c .gpan-stage { position: relative; width: 100%; transform: none !important; }
  html.ver-c .gpan-badge { opacity: 1; }
  html.ver-c .gpan-cap, html.ver-c .gpan-cap.dim { height: auto; opacity: 1; transform: none; }
  html.ver-c .hero.panwin .fig { height: auto; }
  html.ver-c .hero.panwin .fig::before, html.ver-c .hero.panwin .fig::after { content: none; }
  html.ver-c .hero.panwin .fig img { position: static; height: auto; transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  html.ver-c .cnav { position: static; pointer-events: auto; justify-content: flex-start; padding: 2rem 1.2rem 3rem; }
  html.ver-c .cnav-row { transform: none !important; }
  html.ver-c .cgap { display: none; }
  /* polaroids land already fanned to the approved spread */
  html.ver-c.js .pstack .fig:nth-child(2) { opacity: 1; transform: translate(-24%, 10%) rotate(-6.5deg); }
  html.ver-c.js .pstack .fig:nth-child(3) { opacity: 1; transform: translate(22%, 14%) rotate(5.8deg); }
  html.ver-c.js .pstack .fig:nth-child(4) { opacity: 1; transform: translate(-6%, -12%) rotate(-3.2deg); }
}
