/* ==========================================================================
   CESTA – seeker landing page of Velká Lóže Zemí Českých
   Night → day scroll story. Everything the JS engine (static/js/cesta.js)
   touches is a CSS custom property on <html> or one of the class hooks listed
   in BUILD.md; the rest is pure CSS. No frameworks, no resets beyond this one.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Registered scalar properties (typed numbers, safe in calc()).
   They do NOT inherit on purpose: the engine writes each one on the element that
   consumes it (see cesta.js `C`), so a per-frame change re-styles a handful of
   elements instead of the ~4 000 inlined SVG nodes under <html>. Night values
   are the initial values; the day/final state is set per consumer in §1b.
   -------------------------------------------------------------------------- */
@property --p        { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --day      { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --carve    { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --stars    { syntax: '<number>'; inherits: false; initial-value: 1; }
@property --lantern  { syntax: '<number>'; inherits: false; initial-value: 1; }
@property --rest     { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --brothers { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --moon-y   { syntax: '<number>'; inherits: false; initial-value: 13; }
@property --moon-o   { syntax: '<number>'; inherits: false; initial-value: 1; }
@property --sun-y    { syntax: '<number>'; inherits: false; initial-value: 76; }
@property --sun-o    { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --rope-h   { syntax: '<number>'; inherits: false; initial-value: 4000; }
@property --bob-y    { syntax: '<number>'; inherits: false; initial-value: 4000; }
/* derived, typed so their computed value only changes when the rounded number does */
@property --snap     { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --dq       { syntax: '<number>'; inherits: true;  initial-value: 0; }
@property --accent   { syntax: '<color>';  inherits: true;  initial-value: #d6bd8a; }

/* --------------------------------------------------------------------------
   1. Tokens – night values are the defaults (BRIEF §4, p = 0)
   -------------------------------------------------------------------------- */
:root {
  --c-sky-top: #060914; --c-sky-mid: #0c1430; --c-sky-bottom: #1a2244;
  --c-far: #1d2545; --c-far-2: #161c38; --c-mid: #141a30; --c-mid-light: #202a4c;
  --c-near: #0b0f1c; --c-near-light: #1a2140;
  --c-stone-light: #aeb8d6; --c-stone-mid: #6d7799; --c-stone-shadow: #3b4463; --c-rough: #4a5272;
  --c-rim: #93a2d9; --c-flame: #ffb24a; --c-gold: #C8AA6E; --c-rope: #b89b6a; --c-brass: #b0894a;
  --c-ink: #f3efe6; --c-card: rgba(8,12,24,.55);

  /* static page tokens */
  --paper: #f6f1e8; --paper-2: #efe8dc; --card-paper: #fffdf9;
  --ink-day: #1d1a16; --ink-soft: #3a352e; --ink-muted: #5f584d;
  --gold-deep: #76602f; --gold-line: #d9c9a4;
  --stone-border: #8f8677; --stone-input: #fbf8f2; --stone-rule: #e3dbcc;
  --error: #8a2626;
  --f-display: "Cinzel", "Times New Roman", serif;
  --f-serif: "Playfair Display", Georgia, serif;
  --f-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* layout */
  --rope-x: 74vw;
  --gutter: 6vw;
  --card-w: clamp(300px, 32vw, 520px);
  --finale-pad: 148px;
  --card-left: calc(94vw - min(49vw, 640px));   /* left edge of the form card (desktop grid, see §11) */
  --depth-k: 1;
  --card-night: rgba(8,12,24,.6); --card-day: rgba(255,250,242,.8);
  color-scheme: dark;
}
@media (max-width: 1359px) { :root { --rope-x: 77vw; } }
@media (max-width: 1023px) { :root { --rope-x: 80vw; --gutter: 5vw; --finale-pad: 132px;
  --card-left: max(var(--gutter), calc((100vw - 640px) / 2)); } }
/* portrait: the rope hangs in the cards' right padding (cards are full width / 600 px left-aligned), so it
   never crosses text: 92 vw on phones (card text ends at 100vw − 36 px), 84 vw on portrait tablets */
@media (max-width: 1023px) and (orientation: portrait) { :root { --rope-x: 84vw; } }
@media (max-width: 767px)  { :root { --rope-x: 92vw; --gutter: 16px; --finale-pad: 112px; } }

/* day palette: no-JS fallback, server flag after a failed POST, Konami noon */
html.no-js, html.is-final, html.is-noon {
  --c-sky-top: #6fa8dc; --c-sky-mid: #bcd9f1; --c-sky-bottom: #e9eef2;
  --c-far: #a7b7cc; --c-far-2: #8b9db3; --c-mid: #6c7a8a; --c-mid-light: #9aa9bb;
  --c-near: #3b3a3f; --c-near-light: #5a5753;
  --c-stone-light: #f7f3ec; --c-stone-mid: #d9d2c8; --c-stone-shadow: #9a948b; --c-rough: #aaa49a;
  --c-rim: #fff1c9;
  --c-ink: #1d1a16; --c-card: rgba(255,250,242,.72);
  color-scheme: light;
}
/* 1b. final scene state without the engine (no-JS, server re-render after a failed POST,
   thank-you page): day scalars on their consumers – statue carved, sculptor at rest,
   brothers present, stars/lantern out, sun up. */
:is(html.no-js, html.is-final) :is(.layer--front, .gauge__fill) { --p: 1; }
:is(html.no-js, html.is-final) :is(.top, .steps .card, .layer--statue) { --day: 1; }
:is(html.no-js, html.is-final) :is(.layer--stars > svg, #st-rim, .sc-back-rim, .layer--sculptor > svg) { --stars: 0; }
:is(html.no-js, html.is-final) :is(.layer--bench, #bn-lit, #bn-glow) { --lantern: 0; }
:is(html.no-js, html.is-final) :is(#sc-pose-work, #sc-pose-rest) { --rest: 1; }
:is(html.no-js, html.is-final) :is(#br-old, #br-broad, #br-young) { --brothers: 1; }
:is(html.no-js, html.is-final) .layer--moon { --moon-o: 0; --moon-y: 22; }
:is(html.no-js, html.is-final) .layer--sun { --sun-o: 1; --sun-y: 18; }

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
/* no CSS scroll-behavior: smooth – it would turn every programmatic scrollTo into an animation
   (debug ?p=, tests); the in-page anchors are smooth-scrolled by cesta.js instead */
/* overflow-x: clip on <html> (not hidden, which would make it a scroll container and break the sticky
   stage on iOS): without it, a few px of horizontal overflow make Chrome Android lay the page out
   wider than the device and zoom it out to ~93 % – everything renders smaller than designed */
html { -webkit-text-size-adjust: 100%; background: #060914; overflow-x: clip; }   /* static night: only ever visible in overscroll, and a changing <html> background repaints the whole document */
body {
  margin: 0; min-height: 100vh;
  font: 400 17px/1.6 var(--f-sans);
  color: var(--ink-day);
  background: var(--paper);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
a, button, summary, label, [tabindex] { -webkit-tap-highlight-color: transparent; }   /* the gold focus ring + :active styles are the feedback */
h1, h2, h3, p, ul, ol, figure, fieldset { margin: 0; }
ul, ol { padding: 0; }
fieldset { padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
summary { cursor: pointer; }
::selection { background: var(--c-gold); color: #1d1a16; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--c-gold); outline-offset: 3px; }

/* --------------------------------------------------------------------------
   3. Skip link, header
   -------------------------------------------------------------------------- */
.skip {
  position: fixed; top: 10px; left: 10px; z-index: 100;
  padding: 10px 16px; border-radius: 4px;
  background: #1d1a16; color: #f6f1e8; font: 500 14px/1.2 var(--f-sans);
  text-decoration: none; transform: translateY(-200%); transition: transform .2s;
}
.skip:focus { transform: none; outline-color: #fff; }

.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 8;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--gutter); transition: color .3s;
  /* the header sits on the sky, which gets light earlier than the cards: ink snaps at day ≈ .61 (p ≈ .52) */
  color: color-mix(in srgb, #1d1a16 calc(clamp(0, (var(--day) - .60) * 50, 1) * 100%), #f3efe6);
  text-shadow: 0 1px 14px color-mix(in srgb, var(--c-sky-mid) 85%, transparent), 0 0 3px color-mix(in srgb, var(--c-sky-mid) 70%, transparent);
}
.top__logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.top__logo img { width: 44px; height: 44px; object-fit: contain; }
.top__name { font: 600 12px/1.2 var(--f-display); letter-spacing: .16em; text-transform: uppercase; }
@media (min-width: 1024px) { .top__name { white-space: nowrap; } }   /* the English name may take two lines beside the logo on tablets */
.top__nav { display: flex; align-items: center; gap: 22px; }
.top__main { font: 400 14px/1.2 var(--f-sans); letter-spacing: .02em; text-decoration: none; opacity: .82; padding: 14px 0; }   /* 44 px tap height (the row is 44 px anyway) */
.top__main:hover, .top__main:focus-visible { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
/* quiet language switch (EN ↔ CZ): same voice as .top__main, 44 px target, stays visible on phones */
.top__lang { font: 500 13px/1.2 var(--f-sans); letter-spacing: .12em; text-decoration: none; opacity: .82; padding: 14px 6px; min-width: 44px; text-align: center; }
.top__lang:hover, .top__lang:focus-visible { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.top__cta {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border: 1px solid var(--c-gold); border-radius: 999px;
  font: 500 13px/1 var(--f-sans); letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  color: inherit; transition: background-color .25s, color .25s;
}
.top__cta:hover, .top__cta:focus-visible { background: var(--c-gold); color: #1d1a16; }
@media (max-width: 767px) {
  .top { padding: 12px 16px; }
  .top__name { display: none; }
  .top__main { display: none; }
  .top__nav { gap: 10px; }
  .top__lang { padding: 14px 4px; }
  .top__cta { min-height: 44px; padding: 0 16px; font-size: 12px; }   /* 44 px touch target */
}

/* --------------------------------------------------------------------------
   4. Rope, hook, bob
   -------------------------------------------------------------------------- */
.rope {
  position: fixed; top: 0; left: var(--rope-x); width: 0; height: 100vh; z-index: 3;
  pointer-events: none; transform-origin: 50% 0;
  animation: rope-sway 5.2s ease-in-out infinite;
}
.rope__hook {
  position: absolute; top: -4px; left: 50%; width: 12px; height: 12px; margin-left: -6px;
  border: 2.5px solid var(--c-brass); border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.rope__line {
  position: absolute; top: 6px; left: 0; width: 2px; margin-left: -1px;
  height: calc(var(--rope-h) * 1px); max-height: 200vh;
  background: repeating-linear-gradient(180deg, var(--c-rope) 0 5px, color-mix(in srgb, var(--c-rope) 70%, #000) 5px 7px);
  transform-origin: 50% 0;
}
html.js .rope__line { animation: rope-drop .6s cubic-bezier(.3,.7,.2,1) .7s both; }
.rope__line::after {
  content: ""; position: absolute; left: -1px; top: 0; width: 4px; height: 18vh;
  background: linear-gradient(180deg, transparent, var(--c-gold) 50%, transparent);
  opacity: 0; filter: blur(1px);
}
.rope.is-pulse .rope__line::after { animation: rope-pulse .4s linear both; }
.rope__bob {
  position: absolute; top: calc(var(--bob-y) * 1px); left: 0; width: 40px; height: 80px; margin-left: -20px;
  opacity: 0; transition: opacity .22s;
}
.rope__bob svg { width: 100%; height: 100%; }
.rope.is-visible .rope__bob { opacity: 1; }
.rope.is-landed { animation: rope-swing 3.2s cubic-bezier(.3,.4,.3,1) both, rope-idle 6s ease-in-out 3.2s infinite; }
.rope.is-swinging { animation: rope-swing-big 3.4s cubic-bezier(.3,.4,.3,1) both, rope-idle 6s ease-in-out 3.4s infinite; }
html.no-js .rope { display: none; }
@media (max-width: 767px) { .rope__bob { width: 28px; height: 56px; margin-left: -14px; } }

@keyframes rope-sway  { 0%, 100% { transform: rotate(.6deg); } 50% { transform: rotate(-.6deg); } }
@keyframes rope-idle  { 0%, 100% { transform: rotate(.4deg); } 50% { transform: rotate(-.4deg); } }
@keyframes rope-drop  { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes rope-pulse { from { opacity: 1; transform: translateY(-18vh); } to { opacity: 0; transform: translateY(100vh); } }
@keyframes rope-swing {
  0% { transform: rotate(2.4deg); } 25% { transform: rotate(-1.6deg); } 48% { transform: rotate(1deg); }
  68% { transform: rotate(-.5deg); } 85% { transform: rotate(.2deg); } 100% { transform: rotate(0deg); }
}
@keyframes rope-swing-big {
  0% { transform: rotate(3.8deg); } 25% { transform: rotate(-2.6deg); } 48% { transform: rotate(1.6deg); }
  68% { transform: rotate(-.8deg); } 85% { transform: rotate(.3deg); } 100% { transform: rotate(0deg); }
}

/* --------------------------------------------------------------------------
   5. Gauge (24palcové měřítko)
   -------------------------------------------------------------------------- */
.gauge {
  position: fixed; left: 14px; top: 50%; z-index: 6; width: 18px; height: 36vh;
  translate: 0 -50%; opacity: .9; cursor: help;
}
.gauge__ticks { position: absolute; inset: 0 0 0 4px; display: flex; flex-direction: column; justify-content: space-between; }
.gauge__ticks i { display: block; width: 7px; height: 1px; background: color-mix(in srgb, var(--c-ink) 55%, transparent); transition: background-color .3s; }
.gauge__ticks i:nth-child(6n+1) { width: 14px; }
.gauge__fill {
  position: absolute; left: 0; bottom: 0; width: 2px; height: 100%;
  background: var(--c-gold); transform-origin: 50% 100%; transform: scaleY(var(--p));
  box-shadow: 0 0 6px color-mix(in srgb, var(--c-gold) 50%, transparent);
}
.gauge.is-full .gauge__fill { animation: gauge-glow 2s ease-out both; }
.gauge:focus-visible { outline-offset: 6px; }
@keyframes gauge-glow { 0% { box-shadow: 0 0 6px var(--c-gold); } 40% { box-shadow: 0 0 18px var(--c-gold), 0 0 32px color-mix(in srgb, var(--c-gold) 60%, transparent); } 100% { box-shadow: 0 0 6px color-mix(in srgb, var(--c-gold) 50%, transparent); } }
@media (max-width: 767px) {
  .gauge { left: 0; right: 0; top: 0; width: auto; height: 3px; translate: none; }
  .gauge::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 28px; }   /* invisible tap area for the 3 px bar (egg #5) */
  .gauge__ticks { inset: 0; flex-direction: row; }
  .gauge__ticks i { width: 1px; height: 3px; }
  .gauge__ticks i:nth-child(6n+1) { width: 1px; height: 5px; }
  .gauge__fill { top: 0; bottom: auto; width: 100%; height: 2px; transform-origin: 0 50%; transform: scaleX(var(--p)); }
}

/* --------------------------------------------------------------------------
   6. Story: sticky stage + steps
   -------------------------------------------------------------------------- */
.story { position: relative; display: grid; }
.stage {
  grid-area: 1 / 1; position: sticky; top: 0; align-self: start; z-index: 1;
  width: 100%; height: 100svh; overflow: hidden;
  contain: paint; container-type: size;
  background: #060914;   /* static; the sky itself is .layer--sky (covers the stage completely) */

  /* geometry (art-review composition notes), container units = stage box */
  --u: max(100cqw / 1920, 100cqh / 1080);   /* one colonnade/hills unit under xMidYMax slice */
  --floor: calc(240 * var(--u));              /* terrace edge from the stage bottom */
  --sS: calc(70cqh / 1000);                   /* statue px per user unit */
  --sC: 64cqw;                                /* block centre x */
  --sBottom: 10cqh;                           /* pedestal bottom (behind the slab) */
  --cS: calc(var(--sS) * 1.143);              /* sculptor px per unit */
  --cSoles: 79cqh;
  --bS: calc(23cqw / 900);                    /* brothers px per unit */
  --bLeft: 12cqw;
  --benchW: 70cqw;
  --moon-x: 43cqw; --moon-box: 16cqw;
  --sun-x: 82cqw;  --sun-box: 22cqw;
}
.steps { grid-area: 1 / 1; position: relative; z-index: 4; pointer-events: none; }

.layer { position: absolute; inset: 0; pointer-events: none; }
.layer > svg { position: absolute; display: block; }
.layer--sky { background: linear-gradient(180deg, var(--c-sky-top) 0%, var(--c-sky-mid) 42%, var(--c-sky-bottom) 60%, var(--c-sky-bottom) 100%); }

/* Compositor budget (measured: every full-screen compositor layer costs frames on software
   rasterisers and integrated GPUs, and any style change under <html> re-styles ~4 000 SVG nodes):
   · root layer  = sky gradient + stars (repaints only on palette steps and the stepped twinkle)
   · moon, sun   = two small composited layers (their per-frame transform is compositor-only)
   · .layer--back  = hills + colonnade + vignette + brothers, one static composited layer
   · .layer--front = statue + sculptor + bench in ONE parallax layer (same depth for all three:
                     the slab always covers the pedestal foot, the chisel stays on the stone) */
.layer--front {
  --depth: .09;
  transform: translate(0, calc((var(--p) - .5) * var(--depth) * var(--depth-k) * -100cqh));
  will-change: transform;
}
.layer--back { will-change: transform; }
.layer--moon, .layer--sun { inset: auto; will-change: transform; }

.layer--stars > svg { left: 0; top: 0; width: 114cqw; height: 65cqh; opacity: var(--stars); }
.layer--moon {
  width: var(--moon-box); height: var(--moon-box);
  left: calc(var(--moon-x) - var(--moon-box) / 2); top: calc(-.5 * var(--moon-box));
  transform: translate(0, calc(var(--moon-y) * 1cqh)); opacity: var(--moon-o);
}
.layer--sun {
  width: var(--sun-box); height: var(--sun-box);
  left: calc(var(--sun-x) - var(--sun-box) / 2); top: calc(-.5 * var(--sun-box));
  transform: translate(0, calc(var(--sun-y) * 1cqh)); opacity: var(--sun-o);
}
.layer--moon > svg, .layer--sun > svg, .layer--hills > svg, .layer--colonnade > svg { left: 0; top: 0; width: 100%; height: 100%; }
/* narrow aspect ratios (4:3 tablets, iPad landscape): the colonnade keeps its three columns on the
   left instead of losing the first one to the centred crop – the box gets its full 16:9 width and the
   uniform balustrade is what overflows on the right (stage clips it) */
.layer--colonnade > svg { width: max(100%, calc(100cqh * 1920 / 1080)); max-width: none; }
.layer--brothers > svg {
  width: calc(900 * var(--bS)); height: calc(520 * var(--bS));
  left: var(--bLeft); bottom: calc(var(--floor) - 20 * var(--bS));
}
.layer--statue .carve {
  position: absolute; width: calc(560 * var(--sS)); height: calc(1000 * var(--sS));
  left: calc(var(--sC) - 286.5 * var(--sS)); bottom: var(--sBottom);
}
.layer--statue .carve > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.layer--statue .dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; visibility: hidden; }
.layer--statue .dust.is-busy { visibility: visible; }   /* the canvas layer is only drawn while chips fly */
.carve-edge { display: none; }   /* the SVG's own clipped #st-edge band is used instead */
.layer--sculptor > svg {
  width: calc(520 * var(--cS)); height: calc(760 * var(--cS));
  left: calc(var(--sC) - 199.5 * var(--sS) - 520 * var(--cS)); top: calc(var(--cSoles) - 600 * var(--cS));
  overflow: visible;   /* the raised mallet may graze the sprite's top edge; the stage clips anyway */
  /* no drop-shadow filter (a compositor render surface per frame); the night separation comes
     from the baked --c-rim back-edge slivers, raised while the stars are out (.sc-back-rim) */
}
/* max-width: none – the §2 reset caps every svg at 100 % of its box; the phone row (--benchW > 100cqw) was silently
   shrunk to 100cqw, which squeezed the tools into the left 60 % of the screen and cut the square off at the edge */
.layer--bench > svg { width: var(--benchW); max-width: none; height: calc(var(--benchW) * 420 / 1800); right: 0; bottom: 0; }
/* lantern glow: painted inside the bench layer (no blend mode, no extra full-screen layer);
   box = the glow's own extent, centre = the lantern (95.7cqw, 88cqh) */
.layer--bench::after {
  content: ""; position: absolute; right: 0; bottom: 0; width: 62cqw; height: 56cqh;
  background: radial-gradient(42cqw 38cqh at 93% 78.6%, rgba(255,178,74,.30), rgba(255,178,74,.10) 38%, rgba(255,178,74,0) 72%);
  opacity: var(--lantern); pointer-events: none;
}
.layer--bench.is-lantern-out::after { opacity: 0; transition: opacity .3s; }
/* vignette: static (palette-tinted, so it only repaints with the palette) and part of the backdrop layer */
.layer--vignette {
  background: radial-gradient(ellipse 80% 70% at 50% 45%, transparent 55%,
    color-mix(in srgb, color-mix(in srgb, var(--c-sky-top) 50%, #000) 26%, transparent) 100%);
}
/* egg #7: the whole scene dims for ~2 s (a transparent pseudo costs nothing while opacity is 0) */
.stage::after { content: ""; position: absolute; inset: 0; z-index: 2; background: rgba(2,3,8,.6); opacity: 0; transition: opacity .5s; pointer-events: none; }
.stage.is-dim::after { opacity: 1; }

/* ---- statue: two overlaid copies clipped on their wrapper divs (carveY = 45 + 813·carve) */
.carve--block  { clip-path: inset(calc(4.5% + var(--carve) * 81.3%) 0 0 0); }
.carve--statue { clip-path: inset(0 0 calc(95.5% - var(--carve) * 81.3%) 0); }
.layer--statue.is-carved .carve--block, html.no-js .carve--block, html.is-final .carve--block { display: none; }
.layer--statue.is-carved .carve--statue, html.no-js .carve--statue, html.is-final .carve--statue { clip-path: none; }
#stb-statue, #stb-rim, #stb-sunrim, #st-block { display: none; }
#st-edge, #stb-edge {
  opacity: calc(min(var(--carve), 1 - var(--carve)) * 40);
  transform: translateY(calc(36px + var(--carve) * 813px)); transform-box: view-box;
}
#st-rim { opacity: calc(var(--stars) * .9); }
/* day-driven facet opacities use a 40-step quantised copy of --day so the statue repaints 40×, not every frame */
.layer--statue { --dq: calc(round(var(--day) * 40) / 40); }
#st-sunrim { opacity: calc(min(.7, (var(--dq) - .66) * 9) - max(0, (var(--dq) - .78) * 2)); }   /* peaks at sunrise, .26 by full day */
.st-lit, .stb-lit { opacity: calc(.6 + .4 * var(--dq)); }
#stb-block, #st-statue { pointer-events: visiblePainted; cursor: pointer; }

/* ---- sculptor */
#sc-pose-work { opacity: calc(1 - var(--rest)); transform: translateX(calc(var(--rest) * -30px)); transform-box: view-box; }
#sc-pose-rest { opacity: var(--rest); }
/* two-joint strike: the arm is drawn in the HIT position (mallet on the chisel butt); at rest it is
   raised (upper arm −6°, forearm −22°), the swing lands at 27 % of 410 ms (≈ 110 ms – the chips
   are spawned then) and returns without overshoot */
#sc-arm-mallet { transform-box: view-box; transform-origin: 280px 164px; transform: rotate(-6deg); will-change: transform; }
#sc-forearm-mallet { transform-box: view-box; transform-origin: 256px 53px; transform: rotate(-22deg); will-change: transform; }
@keyframes sc-strike-fore  { 0% { transform: rotate(-22deg); animation-timing-function: cubic-bezier(.55,0,1,.45); } 27% { transform: rotate(0deg); animation-timing-function: linear; } 37% { transform: rotate(0deg); animation-timing-function: cubic-bezier(0,.6,.3,1); } 100% { transform: rotate(-22deg); } }
@keyframes sc-strike-upper { 0% { transform: rotate(-6deg);  animation-timing-function: cubic-bezier(.55,0,1,.45); } 27% { transform: rotate(0deg); animation-timing-function: linear; } 37% { transform: rotate(0deg); animation-timing-function: cubic-bezier(0,.6,.3,1); } 100% { transform: rotate(-6deg); } }
.is-striking #sc-forearm-mallet { animation: sc-strike-fore 410ms both; }
.is-striking #sc-arm-mallet { animation: sc-strike-upper 410ms both; }
/* identical twins: consecutive strikes alternate .is-striking / .is-striking-b, so the animation restarts
   without the `void offsetWidth` forced reflow (a full style recalc + layout in the scroll frame) */
.is-striking-b #sc-forearm-mallet { animation: sc-strike-fore-b 410ms both; }
.is-striking-b #sc-arm-mallet { animation: sc-strike-upper-b 410ms both; }
@keyframes sc-strike-fore-b  { 0% { transform: rotate(-22deg); animation-timing-function: cubic-bezier(.55,0,1,.45); } 27% { transform: rotate(0deg); animation-timing-function: linear; } 37% { transform: rotate(0deg); animation-timing-function: cubic-bezier(0,.6,.3,1); } 100% { transform: rotate(-22deg); } }
@keyframes sc-strike-upper-b { 0% { transform: rotate(-6deg);  animation-timing-function: cubic-bezier(.55,0,1,.45); } 27% { transform: rotate(0deg); animation-timing-function: linear; } 37% { transform: rotate(0deg); animation-timing-function: cubic-bezier(0,.6,.3,1); } 100% { transform: rotate(-6deg); } }
.sc-back-rim { opacity: calc(.3 + .55 * var(--stars)); }

/* ---- bench & lantern */
.layer--bench [data-tool] { pointer-events: visiblePainted; cursor: pointer; transform-box: fill-box; transform-origin: 50% 100%; transition: filter .4s, transform .3s; }
.layer--bench [data-tool]:hover, .layer--bench [data-tool].is-lit { filter: brightness(1.4) saturate(1.1); }
.layer--bench.is-sweep [data-tool] { animation: bn-catch .4s ease both; }
.layer--bench.is-sweep [data-tool]:nth-child(2)  { animation-delay: .09s; }
.layer--bench.is-sweep [data-tool]:nth-child(3)  { animation-delay: .18s; }
.layer--bench.is-sweep [data-tool]:nth-child(4)  { animation-delay: .27s; }
.layer--bench.is-sweep [data-tool]:nth-child(5)  { animation-delay: .36s; }
.layer--bench.is-sweep [data-tool]:nth-child(6)  { animation-delay: .45s; }
.layer--bench.is-sweep [data-tool]:nth-child(7)  { animation-delay: .54s; }
.layer--bench.is-sweep [data-tool]:nth-child(8)  { animation-delay: .63s; }
.layer--bench.is-sweep [data-tool]:nth-child(9)  { animation-delay: .72s; }
.layer--bench.is-sweep [data-tool]:nth-child(10) { animation-delay: .81s; }
@keyframes bn-catch { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.6) saturate(1.2); } }
/* flame: stepped timing = ~9 repaints/s instead of 60; paused once the lantern is out */
#bn-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: bn-flicker 1.8s steps(4) infinite; }
@keyframes bn-flicker { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(.94, 1.06); } 55% { transform: scale(1.04, .96); } 80% { transform: scale(.97, 1.03); } }
.stage.is-unlit #bn-flame, html.no-js #bn-flame, html.is-final #bn-flame { animation-play-state: paused; }   /* JS: .stage.is-unlit when --lantern = 0 */
.layer--bench.is-lantern-out #bn-lit, .layer--bench.is-lantern-out #bn-glow { opacity: 0 !important; transition: opacity .25s; }

/* ---- colonnade & brothers */
.layer--colonnade [data-column] { pointer-events: visiblePainted; cursor: pointer; transition: filter .3s; }
.layer--colonnade [data-column]:hover, .layer--colonnade [data-column].is-lit { filter: brightness(1.25); }
.layer--brothers [data-brother].is-lit > [id$="-block"] { filter: brightness(1.25); }
#br-old   { opacity: min(1, calc(var(--brothers) * 3));     transform: translateY(calc((1 - min(1, var(--brothers) * 3)) * 6px)); }
#br-broad { opacity: min(1, calc(var(--brothers) * 3 - 1)); transform: translateY(calc((1 - min(1, max(0, var(--brothers) * 3 - 1))) * 6px)); }
#br-young { opacity: min(1, calc(var(--brothers) * 3 - 2)); transform: translateY(calc((1 - min(1, max(0, var(--brothers) * 3 - 2))) * 6px)); }
#br-broad-arm-mallet { transform-origin: 404px 192px; transform-box: view-box; }

/* ---- stars: twinkle per class, constellation egg, shooting star */
/* twinkle per class with stepped timing: ~12 small repaints/s of the stars layer instead of 60 */
#sk-a-group { animation: sk-twinkle 6s steps(18) infinite; }
#sk-b-group { animation: sk-twinkle 4.5s steps(14) -1.5s infinite; }
#sk-c-group { animation: sk-twinkle 3.2s steps(10) -.7s infinite; }
/* (no per-circle animation variant: a selector ending in `circle` puts the tag into the invalidation set of
   every class it is combined with – each html/.stage class toggle then re-styled all ~240 stars, 100 ms on
   a mid-range phone; three group animations give the field enough life) */
@keyframes sk-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
/* by day (JS: .stage.is-day when --stars = 0; no-JS/final state) the twinkle is paused and the
   sculptor's night halo filter removed */
:is(.stage.is-day, html.no-js .stage, html.is-final .stage) :is(#sk-a-group, #sk-b-group, #sk-c-group) { animation-play-state: paused; }
/* while the page scrolls (JS: html.is-scrolling, cleared 300 ms after the last scroll event) the
   decorative loops pause – they resume where they were, and the scroll frame keeps its full budget */
html.is-scrolling #sk-a-group, html.is-scrolling #sk-b-group, html.is-scrolling #sk-c-group,
html.is-scrolling #bn-flame, html.is-scrolling .rope, html.is-scrolling .rope__line, html.is-scrolling .rope__line::after,
html.is-scrolling .cue__line, html.is-scrolling #br-broad-arm-mallet { animation-play-state: paused; }
#sk-brightest { pointer-events: all; cursor: pointer; }
#sk-constellation { opacity: 0; transition: opacity .6s; }
.sk-line { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s ease; }
.sk-line:nth-child(2) { transition-delay: .35s; }
.sk-line:nth-child(3) { transition-delay: .9s; }
.sk-line:nth-child(4) { transition-delay: 1.25s; }
.layer--stars.is-constellation #sk-constellation { opacity: 1; }
.layer--stars.is-constellation .sk-line { stroke-dashoffset: 0; }
.layer--stars.is-shooting #sk-shooting { animation: sk-shoot 1.3s ease-out both; }
@keyframes sk-shoot { 0% { opacity: 0; translate: 0 0; } 15% { opacity: 1; } 100% { opacity: 0; translate: 250px 120px; } }

/* ---- pins (column eggs) & tooltip */
/* column labels (egg #1): fixed elements outside the stage so they sit ABOVE the text cards
   (z 5 > .steps 4, < gauge 6 / header 8); JS sets left/top in viewport px – centred on the column,
   clamped to 8 px side margins and to the band below the header (≥ 72 px) */
.pin {
  position: fixed; z-index: 5; width: min(220px, calc(100vw - 16px));   /* fixed width → the JS clamp is exact */
  left: 50vw; top: 72px;
  transform: translate(-50%, 6px);
  padding: 10px 14px; border-radius: 4px;
  background: rgba(8,12,24,.9); color: #f3efe6; border: 1px solid color-mix(in srgb, var(--c-gold) 55%, transparent);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.6);
  opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none;
}
.pin.is-open { opacity: 1; transform: translate(-50%, 0); }
.pin__label { display: block; font: 600 15px/1.2 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--c-gold); margin-bottom: 4px; }
.pin__line { display: block; font: 400 13px/1.45 var(--f-sans); }
/* tool / knock texts: a fixed element outside .stage (like the pins), so that on phones the bottom sheet sits ABOVE the
   bottom-anchored text cards (z 5 > .steps 4) – inside the stage (z 1) a card edge could cover it. JS sets left/top in
   viewport px next to a fine pointer. */
.tooltip {
  position: fixed; z-index: 5; left: 0; top: 0; max-width: 280px; padding: 10px 14px; border-radius: 4px;
  background: rgba(8,12,24,.9); color: #f3efe6; border: 1px solid color-mix(in srgb, var(--c-gold) 55%, transparent);
  font: 400 14px/1.45 var(--f-sans); opacity: 0; transition: opacity .2s, transform .25s; pointer-events: none;
}
.tooltip.is-open { opacity: 1; }
.tooltip__close { display: none; }
/* touch (all layouts): the sheet floats just ABOVE the tool row instead of over it, so the next tool can be tapped while
   it is open (it stays until the reader closes it) and the lit tool stays visible under its text; fades in place.
   Tablets / landscape: bench = 70 cqw of the stage = 70 vw wide, height = width × 420/1800 (bench.svg), + 8 px
   (≈ 12–15 px clearance to the lantern on portrait iPads – do not shrink); --benchW cannot be used here because the
   tooltip lives outside .stage. Phones (≤ 767 px): single tool row, tool tops ≈ 27 vw from the bottom → 28 vw. */
.tooltip--sheet, html.is-touch .tooltip {
  left: 8px; right: 8px; bottom: calc(70vw * 420 / 1800 + 8px); top: auto; max-width: none; min-height: 56px;
  padding: 16px 56px 16px 20px; border-radius: 8px; border-width: 1px;
  font-size: 16px; line-height: 1.45; transform: translateY(10px); opacity: 0; pointer-events: none;   /* closed: never in the way of a tap on the tools beneath */
  box-shadow: 0 12px 30px -12px rgba(0,0,0,.6);
}
.tooltip--sheet.is-open, html.is-touch .tooltip.is-open { transform: none; opacity: 1; pointer-events: auto; }
@media (max-width: 767px) {
  .tooltip--sheet, html.is-touch .tooltip { bottom: 28vw; }
}
/* the sheet stays until the reader closes it: × (44 px target), Escape, a tap outside or scrolling on (cesta.js) */
.tooltip--sheet .tooltip__close, html.is-touch .tooltip .tooltip__close {
  display: grid; place-items: center; position: absolute; top: 4px; right: 6px; width: 44px; height: 44px;
  padding: 0; border: 0; background: none; color: var(--c-gold); font: 300 28px/1 var(--f-sans); cursor: pointer;
}

/* --------------------------------------------------------------------------
   7. Steps & text cards
   -------------------------------------------------------------------------- */
.step {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: 10svh var(--gutter);
}
.step[data-step="4"] { min-height: 130svh; align-items: flex-start; padding-top: 18svh; }
.step[data-step="5"] { padding-left: min(calc(var(--rope-x) - var(--card-w) / 2), calc(96vw - var(--card-w))); }

.card { position: relative; border-radius: 4px; pointer-events: auto; }
.steps .card {
  --snap: round(clamp(0, calc((var(--day) - .7025) * 50), 1));   /* 0 or 1: ink + card flip together at p ≈ .61 (day ≈ .71), eased only by the 300 ms transition – never a grey-on-grey mid state */
  --accent: color-mix(in srgb, #5e4f31 calc(var(--snap) * 100%), #d6bd8a);   /* small gold text: ≥ 4.5:1 on both card themes */
  width: var(--card-w);
  padding: 32px 36px;
  color: var(--c-ink); background: var(--c-card);
  color: color-mix(in srgb, #1d1a16 calc(var(--snap) * 100%), #f3efe6);
  background-color: color-mix(in srgb, var(--card-day) calc(var(--snap) * 100%), var(--card-night));
  border: 1px solid color-mix(in srgb, var(--c-gold) calc(30% + var(--snap) * 15%), transparent);
  box-shadow: 0 20px 50px -30px rgba(0,0,0,.45);
  transition: color .3s, background-color .3s, border-color .3s, opacity .5s ease, transform .5s ease;
  opacity: 0; transform: translateY(24px);
}
.step.is-active .card, .step--hero .card, html.no-js .steps .card, html.is-final .steps .card, html.reduced-motion .steps .card { opacity: 1; transform: none; }
.steps .card p { font: 400 17px/1.6 var(--f-sans); }
.steps .card p + p { margin-top: .7em; }
/* .card--split: the long chapters are authored as two or three .card__part blocks – plain, margin-collapsing
   blocks on desktop (one card, unchanged), separate bottom-anchored cards with the scene between them on
   portrait phones (§7 phone block). The seam spacing below reproduces the original p + p rhythm. */
.card__part { display: block; }
.card__part + .card__part > p:first-child { margin-top: .7em; }
.steps .card h2 { font: 600 clamp(22px, 1.9vw, 30px)/1.22 var(--f-display); letter-spacing: .06em; margin: 0 0 16px; text-wrap: balance; }
.steps .card a { color: inherit; text-decoration: underline; text-decoration-color: var(--c-gold); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.steps .card a:hover, .steps .card a:focus-visible { text-decoration-thickness: 2px; }
.steps .card a.btn { text-decoration: none; }   /* in-card buttons: .btn--ghost, defined after .btn in §8 */
.steps .card p.card__cta { margin-top: 24px; }

.eyebrow {
  display: flex; flex-wrap: wrap; gap: 0 .6em; align-items: baseline;
  font: 500 12px/1.4 var(--f-sans); letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent, var(--c-gold));
  margin: 0 0 14px;
}
.eyebrow__num { font: 600 12px/1.4 var(--f-display); letter-spacing: .2em; }
.eyebrow__sep { opacity: .6; }
.eyebrow--touch { display: none; }

/* hero */
.steps .card--hero {   /* no card box in the hero: text on the sky with a soft dark halo */
  background: radial-gradient(ellipse 110% 90% at 30% 50%, color-mix(in srgb, rgba(255,250,242,.72) calc(var(--snap) * 100%), rgba(6,9,20,.62)) 20%, transparent 75%);
  background-color: transparent; border-color: transparent; box-shadow: none; padding: 40px 36px;
}
.card--hero .card__body { transform: translateY(calc(var(--p) * -400px)); opacity: calc(1 - var(--p) * 10); }
html.no-js .card--hero .card__body { transform: none; opacity: 1; }
.card--hero h1 {
  font: 600 clamp(28px, 2.6vw, 40px)/1.15 var(--f-display); letter-spacing: .08em; margin: 0 0 18px; text-wrap: balance;
}
html.js .card--hero h1 { animation: hero-in .8s cubic-bezier(.2,.7,.2,1) .4s both; }
/* SEO 6.2 (2026-11-25): the H1 also names the topic – a quiet line above the motto. Cinzel's lower case is small
   caps; the span's own letter-spacing keeps it out of the h1's letter-spacing entrance; the gold hairline below
   sets it apart from the motto, which stays the visual headline. One line at 390 px (CS) and in the desktop card. */
.hero__kicker {
  display: block; font: 600 clamp(14px, 1.15vw, 16px)/1.35 var(--f-display); letter-spacing: .1em;
  opacity: .84; margin: 0 0 14px; text-wrap: balance;
}
.hero__kicker::after { content: ""; display: block; width: 36px; height: 1px; margin-top: 14px; background: var(--accent, var(--c-gold)); }
@media (min-width: 1024px) and (max-height: 820px) {
  .hero__kicker { margin-bottom: 10px; }
  .hero__kicker::after { margin-top: 10px; }
}
@media (max-width: 380px) { .hero__kicker { letter-spacing: .06em; } }   /* still one line in a 360 px phone card */
/* short portrait phones (iPhone SE class): the hero is bottom-anchored, so every extra pixel pushes the organisation
   line towards the header – no hairline, tighter rhythm */
@media (max-width: 1023px) and (orientation: portrait) and (max-height: 760px) {
  .hero__kicker { letter-spacing: .06em; margin-bottom: 8px; }
  .hero__kicker::after { display: none; }
}
/* very short screens (portrait ≤ 650 px, landscape phones): the hero already fills the first screen – the line stays
   in the H1 for search engines and screen readers but is visually hidden, the hero keeps its previous height */
@media (max-width: 1023px) and (orientation: portrait) and (max-height: 650px), (max-height: 500px) and (orientation: landscape) {
  .hero__kicker { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
html.js .card--hero .lead, html.js .card--hero .eyebrow, html.js .card--hero .card__cta { animation: hero-fade .7s ease .6s both; }
.card--hero .lead { font: 300 clamp(16px, 1.15vw, 18px)/1.6 var(--f-sans); }
.card--hero .lead + .lead { margin-top: .8em; }
.eyebrow__org { text-wrap: balance; }   /* the organisation name: one line where there is room, otherwise two balanced lines (never an overflow or an orphaned word) */
@keyframes hero-in   { from { opacity: 0; letter-spacing: .28em; } to { opacity: 1; letter-spacing: .08em; } }
@keyframes hero-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cue { display: flex; flex-direction: column; gap: 10px; margin-top: 30px; font: 500 12px/1.4 var(--f-sans); letter-spacing: .16em; text-transform: uppercase; opacity: .85; transition: opacity .4s; }
.cue__line { display: block; width: 1px; height: 48px; margin-left: 2px; background: var(--c-gold); transform-origin: 50% 0; animation: cue-breathe 2.6s ease-in-out infinite; }
.cue.is-hidden { opacity: 0; }
.cue.is-hidden .cue__line { animation-play-state: paused; }
.cue__label--touch { display: none; }
@keyframes cue-breathe { 0% { transform: scaleY(.2); opacity: .6; } 50% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(.2); opacity: .6; } }
/* short desktop viewports (laptops, 1024×768 … 1366×768): the copy-v2 hero (two paragraphs, button, cue) keeps a
   tighter rhythm so the whole card, cue included, stays inside the first screen (it measured 94 % of 768 px) */
@media (min-width: 1024px) and (max-height: 820px) {
  .steps .card--hero { padding-top: 24px; padding-bottom: 24px; }
  .card--hero h1 { margin-bottom: 12px; }
  .steps .card--hero p.card__cta { margin-top: 16px; }
  .card--hero .cue { margin-top: 14px; gap: 6px; }
  .card--hero .cue__line { height: 20px; }
}

/* chapters I–V (copy v2): eyebrow, heading, short paragraphs – the base .steps .card p rhythm; step 4 keeps its
   silence beat (130 svh step, card at the top), step 5 sits under the rope */

/* ------- phones & portrait tablets: bottom-anchored cards over a centred scene */
@media (max-width: 1023px) and (orientation: portrait) {
  .stage {
    --sS: calc(52cqh / 1000); --sC: 53cqw;
    /* pedestal bottom 3.5 cqh below the terrace edge (--floor = 240·u = 22.2 cqh in portrait): the statue stands on the
       floor at every p – .layer--front parallaxes ±2.25 cqh on touch, so at p = 1 it is still 1.25 cqh below the edge.
       (The former fixed 26cqh kept the head above the card zone but hung the pedestal 3–6 % above the floor: "levitating".) */
    --sBottom: calc(var(--floor) - 3.5cqh);
    --cS: calc(var(--sS) * .95);
    /* scaffold feet (sprite y 760 = soles + 160 units) 1 cqh below the pedestal bottom, the desktop relation */
    --cSoles: calc(101cqh - var(--sBottom) - 160 * var(--cS));
    --bS: calc(48cqw / 900); --bLeft: -4cqw;
    --moon-x: 22cqw; --moon-box: 36cqw; --sun-x: 70cqw; --sun-box: 44cqw;
  }
  .layer--stars > svg { width: 100cqw; }
  /* Steps are column flex boxes with the card(s) at the bottom. padding-top guarantees ≥ 46 svh of free
     scene between the previous card and the next one even when a card is taller than 50 svh (16 px body
     text, verbatim copy, no inner scroll region – the three constraints that cannot all fit 50 svh on a
     375 px phone). Long chapters are split into parts (.card--split) with 36 svh of scene between them. */
  .step, .step[data-step="4"], .step[data-step="5"] {
    flex-direction: column; justify-content: flex-end; align-items: flex-start;
    min-height: 100svh; padding: 46svh var(--gutter) 4svh;
  }
  .step--hero { padding-top: 0; padding-bottom: 7svh; }   /* the scroll cue clears the bench row */
  .step[data-step="4"] { justify-content: flex-start; min-height: 130svh; padding-top: 14svh; }
  .steps .card--split { display: contents; }
  .steps .card, .steps .card--split > .card__part { width: min(100%, 600px); padding: 20px 20px 18px; }
  .steps .card--split > .card__part {
    --snap: round(clamp(0, calc((var(--day) - .7025) * 50), 1));
    --accent: color-mix(in srgb, #5e4f31 calc(var(--snap) * 100%), #d6bd8a);
    position: relative; border-radius: 4px; pointer-events: auto;
    color: color-mix(in srgb, #1d1a16 calc(var(--snap) * 100%), #f3efe6);
    background-color: color-mix(in srgb, var(--card-day) calc(var(--snap) * 100%), var(--card-night));
    border: 1px solid color-mix(in srgb, var(--c-gold) calc(30% + var(--snap) * 15%), transparent);
    box-shadow: 0 20px 50px -30px rgba(0,0,0,.45);
    transition: color .3s, background-color .3s, border-color .3s, opacity .5s ease, transform .5s ease;
    opacity: 0; transform: translateY(24px);
  }
  .steps .card--split > .card__part + .card__part { margin-top: 36svh; }
  .step.is-active .card__part, html.no-js .card__part, html.is-final .card__part, html.reduced-motion .card__part { opacity: 1; transform: none; }
  .card__part + .card__part > :first-child { margin-top: 0; }
  .steps .card h2 { font-size: 22px; margin-bottom: 12px; }
  .card--hero { padding: 26px 22px 24px; background: linear-gradient(180deg, transparent, color-mix(in srgb, rgba(255,250,242,.72) calc(var(--snap) * 100%), rgba(6,9,20,.66)) 30%); }
  .card--hero h1 { font-size: clamp(28px, 7.6vw, 32px); }
  /* 16 px body minimum on phones */
  .steps .card p { font-size: 16px; line-height: 1.5; }
  .steps .card p.card__cta { margin-top: 18px; }
  .cue { margin-top: 18px; }
  .cue__line { height: 28px; }
  .eyebrow--touch { display: flex; color: inherit; opacity: .8; letter-spacing: .14em; margin-bottom: 8px; }
}
/* landscape phones: tablet composition, but the steps stack as tall as their cards (a 300 px wide card
   centred in a 340 px high step overflowed into its neighbours) and the cards get the width of the viewport */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --card-w: min(70vw, 600px); }
  .step, .step[data-step="4"], .step[data-step="5"] { min-height: 0; align-items: flex-start; padding: 10svh var(--gutter) 12svh; }
  .steps .card { padding: 24px 28px 22px; }
  /* the hero must fit under the 68 px header in ~340 px: tighter rhythm, 2-line headline */
  .step--hero { padding-top: 72px; padding-bottom: 6svh; }
  .steps .card--hero { padding: 14px 24px 12px; }
  .card--hero h1 { font-size: 26px; margin-bottom: 10px; }
  .card--hero .eyebrow { margin-bottom: 10px; }
  .card--hero .lead { font-size: 15px; line-height: 1.5; }
  .cue { margin-top: 12px; gap: 6px; }
  .cue__line { height: 18px; }
}
@media (max-width: 767px) {
  /* bench: one row of six tools. Scale: the art-review row (user x 98–1206 = 1108 units) = 95 cqw; the row starts at
     2.5 cqw so the square no longer touches the screen edge, and the lantern (translated 34 units further left than the
     review's −566) ends at 91.5 cqw, left of the rope (92 vw) instead of under it */
  .stage { --benchW: calc(95cqw * 1800 / 1108); }
  .layer--bench > svg { left: calc(2.5cqw - 98 * var(--benchW) / 1800); right: auto; }
  #bn-gauge, #bn-chisel, #bn-ashlar, #bn-chips, #bn-book, #bn-shadows, #bn-warm { display: none; }
  #bn-trowel, #bn-mallet { transform: translateX(-290px); }
  #bn-lantern, #bn-glow { transform: translateX(-600px); }
  .layer--bench::after { width: 100cqw; height: 40cqh; background: radial-gradient(70cqw 26cqh at 87.5% 81%, rgba(255,178,74,.26), rgba(255,178,74,.08) 40%, rgba(255,178,74,0) 72%); }
  /* colonnade centred like the hills: the floor's vanishing point (user x 960) lands at the stage centre, the chequerboard
     is symmetric and the balustrade frames the statue. Left-anchored (the 4:3 tablet rule in §6) a phone showed the
     far-left slice of the art: two columns and a floor converging off-screen right, with a plain left half. */
  .layer--colonnade > svg { left: calc(50cqw - max(100cqw, 100cqh * 1920 / 1080) / 2); }
  #cl-architrave { display: none; }
  .layer--brothers { display: none; }
  .pin { max-width: 220px; }
}
@media (pointer: coarse) {
  :root { --depth-k: .5; }
  .cue__label--pointer { display: none; }
  .cue__label--touch { display: inline; }
}
html.is-touch { --depth-k: .5; }
html.is-touch .cue__label--pointer { display: none; }
html.is-touch .cue__label--touch { display: inline; }

/* --------------------------------------------------------------------------
   8. Finale: marble step, timeline, form card
   -------------------------------------------------------------------------- */
.finale {
  position: relative; z-index: 2; background: var(--paper); color: var(--ink-day);
  padding: var(--finale-pad) var(--gutter) 104px;
}
.finale::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 12px;
  background: linear-gradient(180deg, #fbf8f2 0%, #efe8dc 55%, #e2d9c8 100%);
  box-shadow: 0 1px 0 #d4cab6, 0 -14px 24px -12px rgba(0,0,0,.35);
}
.finale__grid { display: grid; gap: 56px; max-width: 1400px; margin: 0 auto; }
.finale h2 { font: 600 clamp(26px, 2.4vw, 36px)/1.2 var(--f-display); letter-spacing: .06em; text-wrap: balance; }
.finale__aside > h2 { margin-bottom: 32px; }
.timeline { list-style: none; counter-reset: tl; position: relative; padding-left: 48px; display: grid; gap: 26px; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 10px; bottom: 10px; width: 1px; background: var(--gold-line); }
.timeline li { position: relative; counter-increment: tl; }
.timeline li::before {
  content: counter(tl); position: absolute; left: -48px; top: -1px; width: 28px; height: 28px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--gold-deep); color: var(--gold-deep);
  font: 600 13px/1 var(--f-display);
}
.timeline h3 { font: 600 20px/1.3 var(--f-serif); margin-bottom: 6px; }
.timeline p { font: 400 16px/1.55 var(--f-sans); color: var(--ink-soft); }
.finale__closing { margin: 34px 0 18px; font: 400 16.5px/1.55 var(--f-sans); color: var(--ink-day); max-width: 52ch; }   /* quiet closing line of the timeline */
.finale__note { font: 400 14.5px/1.55 var(--f-sans); color: var(--ink-muted); max-width: 52ch; }
.finale a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.finale a:hover, .finale a:focus-visible { color: var(--ink-day); text-decoration-thickness: 2px; }
.finale :focus-visible { outline-color: var(--gold-deep); }

.finale__form { position: relative; }
.finale__plumb {
  position: absolute; left: calc(var(--rope-x) - var(--card-left)); top: calc(-1 * var(--finale-pad));
  width: 2px; height: calc(var(--finale-pad) - 92px); margin-left: -1px;
  background: repeating-linear-gradient(180deg, var(--c-rope) 0 5px, color-mix(in srgb, var(--c-rope) 70%, #000) 5px 7px);
}
.finale__plumb svg { position: absolute; top: 100%; left: 50%; width: 40px; max-width: none; height: 80px; margin-left: -20px; overflow: visible; }
html.js .finale__plumb { display: none; }
@media (max-width: 767px) {
  .finale__plumb { height: calc(var(--finale-pad) - 68px); }
  .finale__plumb svg { width: 28px; height: 56px; margin-left: -14px; }
}

.card--form {
  position: relative; width: min(100%, 640px); margin: 0 auto;
  padding: 40px 44px 36px; border-radius: 6px; color: var(--ink-day);
  background: var(--card-paper); border: 1px solid var(--stone-rule);
  box-shadow: 0 30px 70px -40px rgba(40,30,10,.35), 0 2px 0 #fff inset;
  transition: border-color .4s, transform .3s;
}
.card__contact {
  position: absolute; top: -2px; left: calc(var(--rope-x) - var(--card-left)); width: 160px; height: 4px;
  transform: translateX(-50%); border-radius: 2px;
  background: radial-gradient(closest-side, var(--c-gold), transparent);
  opacity: 0; transition: opacity .4s;
}
.card__eyebrow {
  position: absolute; top: -30px; left: calc(var(--rope-x) - var(--card-left)); transform: translateX(calc(-100% - 22px));   /* beside the bob's tip, never under it */
  font: 600 12px/1 var(--f-display); letter-spacing: .3em; text-transform: uppercase; color: var(--gold-deep);
  opacity: 0; transition: opacity .5s .2s;
}
@media (max-width: 767px) { .card__contact { width: 100px; } }
.card--form.is-touched { border-color: var(--c-gold); transform: translateY(1px); }
.card--form.is-touched .card__contact, .card--form.is-touched .card__eyebrow,
html.no-js .card__contact, html.no-js .card__eyebrow { opacity: 1; }
.card--form.is-touched .card__contact { animation: contact-pulse 1.2s ease-out both; }
.card--form.is-touched #id_birth_date, .card--form.is-touched #id_first_name { animation: ring-glow 1.2s ease-out both; }
@keyframes contact-pulse { 0% { opacity: 0; transform: translateX(-50%) scaleX(.3); } 40% { opacity: 1; transform: translateX(-50%) scaleX(1.25); } 100% { opacity: 1; transform: translateX(-50%) scaleX(1); } }
@keyframes ring-glow { 0% { box-shadow: 0 0 0 0 rgba(200,170,110,.0); } 30% { box-shadow: 0 0 0 4px rgba(200,170,110,.55); } 100% { box-shadow: 0 0 0 0 rgba(200,170,110,0); } }
.card__title { font: 600 clamp(22px, 1.8vw, 26px)/1.25 var(--f-display); letter-spacing: .06em; margin-bottom: 26px; }
.card__intro { margin: -14px 0 26px; font: 400 16px/1.55 var(--f-sans); color: var(--ink-soft); }   /* one sentence under the card title */

/* ---- fields */
#lead-form { display: grid; gap: 22px; }
.form-errors {
  padding: 14px 16px; border: 1px solid var(--error); border-left-width: 4px; border-radius: 4px;
  background: #fbf1ee; color: #4a1c1c; font: 400 14.5px/1.5 var(--f-sans);
}
.form-errors__title { font-weight: 500; color: var(--error); margin-bottom: 6px; }
.form-errors ul { list-style: none; display: grid; gap: 4px; }
.form-errors a { color: var(--error); }
.form-errors:focus-visible { outline-color: var(--error); }
.field-pair { display: grid; gap: 18px; }
.field-pair legend { font: 500 14px/1.4 var(--f-sans); letter-spacing: .01em; color: var(--ink-muted); margin-bottom: 10px; }
@media (min-width: 480px) { .field-pair { grid-template-columns: 1fr 1fr; gap: 16px; } .field-pair legend { grid-column: 1 / -1; } }
.field { display: grid; gap: 7px; }
.field > label, .field--region > legend { font: 500 14.5px/1.4 var(--f-sans); letter-spacing: .01em; color: var(--ink-day); }
.field--region > legend { margin-bottom: 8px; }
.field__help { font: 400 13.5px/1.5 var(--f-sans); color: var(--ink-muted); }
.field__help--link { margin-left: 36px; }
.field__hint { font: 400 13.5px/1.5 var(--f-sans); color: var(--gold-deep); }
p.error { font: 500 14px/1.45 var(--f-sans); color: var(--error); }
p.error::before { content: "– "; }
#lead-form input[type="text"], #lead-form input[type="email"], #lead-form input[type="tel"], #lead-form input[type="date"], #lead-form select, #lead-form textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 4px;
  border: 1px solid var(--stone-border); background: var(--stone-input); color: var(--ink-day);
  font: 400 16px/1.4 var(--f-sans); box-shadow: inset 0 1px 2px rgba(60,50,30,.06);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
#lead-form textarea { min-height: 128px; resize: vertical; line-height: 1.5; }
#lead-form input::placeholder, #lead-form textarea::placeholder { color: #6e675d; opacity: 1; }
#lead-form input:hover, #lead-form textarea:hover { border-color: #6f6758; }
#lead-form input:focus, #lead-form textarea:focus { outline: none; border-color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(118,96,47,.25); background: #fff; }
#lead-form input:focus-visible, #lead-form textarea:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.field.has-error input, .field.has-error textarea, .field.has-error .pill { border-color: var(--error); }
.field.has-error input:focus, .field.has-error textarea:focus { box-shadow: 0 0 0 3px rgba(138,38,38,.2); }

/* region pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border: 1px solid var(--stone-border); border-radius: 999px; background: var(--stone-input);
  font: 400 15px/1 var(--f-sans); color: var(--ink-day); cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}
.pill input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pill span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; border: 1px solid var(--stone-border); vertical-align: 1px; transition: background-color .2s, border-color .2s; }
.pill:hover { border-color: #6f6758; }
.pill:has(input:checked) { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff8e8; font-weight: 500; }
.pill:has(input:checked) span::before { background: #fff8e8; border-color: #fff8e8; }
.pill:has(input:focus-visible) { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
/* region helper lines: CSS fallback (JS toggles [hidden] the same way) */
.field--region:has(input[value="praha"]:checked) [data-help-static],
.field--region:has(input[value="brno"]:checked) [data-help-static],
.field--region:has(input[value="tabor"]:checked) [data-help-static],
.field--region:has(input[value="cr"]:checked) [data-help-static],
.field--region:has(input[value="zahranici"]:checked) [data-help-static] { display: none; }
.field--region:has(input[value="praha"]:checked) [data-help-local],
.field--region:has(input[value="brno"]:checked) [data-help-local],
.field--region:has(input[value="tabor"]:checked) [data-help-local] { display: block; }
.field--region:has(input[value="cr"]:checked) [data-help-far],
.field--region:has(input[value="zahranici"]:checked) [data-help-far] { display: block; }

/* checkboxes */
.field--check { gap: 6px; }
.check { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; min-height: 44px; padding: 10px 0 0; cursor: pointer; font: 400 15.5px/1.5 var(--f-sans); color: var(--ink-day); }
.check input { position: absolute; top: 10px; left: 0; width: 24px; height: 24px; margin: 0; opacity: 0; cursor: pointer; }
.check__box { width: 24px; height: 24px; border: 1px solid var(--stone-border); border-radius: 4px; background: var(--stone-input); position: relative; pointer-events: none; transition: background-color .2s, border-color .2s; }   /* clicks go to the real (transparent) input underneath */
.check__box::after { content: ""; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px; border: solid #fff8e8; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .15s; }
.check:has(input:checked) .check__box { background: var(--gold-deep); border-color: var(--gold-deep); }
.check:has(input:checked) .check__box::after { transform: rotate(45deg) scale(1); }
.check:has(input:focus-visible) .check__box { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.field.has-error .check__box { border-color: var(--error); }
.field--check .field__help { margin-left: 36px; }
.field--check p.error { margin-left: 36px; }

/* submit */
.field--submit { gap: 14px; margin-top: 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 32px;
  border: 1px solid #1d1a16; border-radius: 4px; background: #1d1a16; color: #ead9b3;
  font: 500 15px/1 var(--f-sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  transition: background-color .25s, color .25s, transform .15s;
}
.btn:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff8e8; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; }
/* outlined variant for the story cards (hero → chapter I, chapter V → #kontakt): inherits the card's ink, so it
   reads on the night card (light ink) and the day card (dark ink) alike; gold fill on hover/focus */
.btn--ghost { min-height: 48px; padding: 0 26px; background: transparent; border-color: var(--c-gold); color: inherit; font-size: 13px; letter-spacing: .1em; }
.btn--ghost:hover, .btn--ghost:focus-visible { background: var(--c-gold); border-color: var(--c-gold); color: #1d1a16; }
.btn--ghost:focus-visible { outline-color: var(--c-gold); }
.under-button { font: 400 13.5px/1.55 var(--f-sans); color: var(--ink-muted); }

@media (min-width: 1024px) {
  .finale__grid { grid-template-columns: 5fr 7fr; gap: 4vw; align-items: start; max-width: none; }
  .card--form { justify-self: end; margin: 0; }
}
/* single column: the form card comes first (the bob lands on it right after the story and the
   fixed rope never runs through the timeline text), the timeline follows */
@media (max-width: 1023px) {
  .finale__form { order: -1; overflow-x: clip; }   /* the contact spot under the rope may reach past the card edge: clipped here, never widening the layout viewport (which zoomed the page out on phones) */
}
@media (max-width: 767px) {
  .finale { padding-bottom: 72px; }
  .card--form { padding: 28px 20px 26px; }
  .card__title { margin-bottom: 20px; }
  #lead-form { gap: 18px; }
  .btn { width: 100%; }
  /* legible helper text on phones */
  .field > label, .field--region > legend, .field-pair legend { font-size: 15px; }
  .field__help, .field__hint, .under-button, .form-errors { font-size: 14.5px; }
  .check { font-size: 16px; }
}
@media (pointer: coarse) {
  /* standalone text links get a 44 px tap height without moving anything (footer links: see §9) */
  .field__help--link a, .thanks__links a, .finale__note a { display: inline-block; padding: 12px 0; margin: -12px 0; }
}

/* --------------------------------------------------------------------------
   8b. Formulář zájmu o členství (/cesta/#zajem-o-clenstvi): tři kroky, podmíněná pole, podmínky
   -------------------------------------------------------------------------- */
.anchor-alias { display: block; position: relative; top: -72px; height: 0; }   /* /cesta/#kontakt – původní kotva formuláře */
.card__subtitle { margin: -16px 0 20px; font: italic 400 clamp(17px, 1.3vw, 19px)/1.4 var(--f-serif); color: var(--gold-deep); }
.card__intro--multi { display: grid; gap: 10px; margin-top: 0; }
.legend__note { font-weight: 400; color: var(--ink-muted); }

/* indikátor postupu */
.steps-nav { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: -4px 0 2px; }
.steps-nav__item {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; padding: 10px 0 0;
  border-top: 2px solid var(--stone-rule); font: 500 13px/1.3 var(--f-sans); color: var(--ink-muted);
  transition: border-color .3s, color .3s;
}
.steps-nav__num {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--stone-border); font: 600 13px/1 var(--f-display); color: var(--ink-muted);
  transition: background-color .3s, border-color .3s, color .3s;
}
.steps-nav__item.is-current { border-top-color: var(--gold-deep); color: var(--ink-day); }
.steps-nav__item.is-current .steps-nav__num { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff8e8; }
.steps-nav__item.is-done { border-top-color: var(--gold-deep); color: var(--ink-soft); cursor: pointer; }
.steps-nav__item.is-done .steps-nav__num { border-color: var(--gold-deep); color: var(--gold-deep); }
.steps-nav__item.is-done:hover .steps-nav__num, .steps-nav__item.is-done:focus-visible .steps-nav__num { background: var(--c-gold); color: #1d1a16; }
.steps-nav__item:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
html.no-js .steps-nav, html.no-js [data-step-next], html.no-js [data-step-prev] { display: none; }   /* bez JS: jeden dlouhý formulář, jen Odeslat */

/* kroky */
.form-step { display: grid; gap: 22px; min-width: 0; }
.form-step[hidden] { display: none; }
.form-step__title { display: block; margin-bottom: 2px; font: 600 clamp(19px, 1.5vw, 22px)/1.3 var(--f-display); letter-spacing: .04em; color: var(--ink-day); }
.form-step__count { display: block; margin-bottom: 6px; font: 500 12px/1.4 var(--f-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep); }
.step-nav { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; margin-top: 6px; }
.step-nav .btn { flex: 1 1 auto; }
.step-nav [data-step-prev] { flex: 0 1 auto; }
.btn--back { background: transparent; border-color: var(--stone-border); color: var(--ink-day); }
.btn--back:hover, .btn--back:focus-visible { background: var(--stone-input); border-color: var(--ink-day); color: var(--ink-day); }
.btn.is-busy, .btn[disabled] { opacity: .65; cursor: progress; }
.btn.is-busy:hover, .btn[disabled]:hover { background: #1d1a16; border-color: #1d1a16; color: #ead9b3; transform: none; }

/* volby pod sebou (dlouhé popisky) */
.pills--stack { flex-direction: column; align-items: stretch; }
.pills--stack .pill { border-radius: 6px; }
.field--radio > legend { max-width: 60ch; }

/* podmíněná pole (CSS :has – funguje i bez JS): vysvětlení k účasti, jiný zdroj, předchozí členství, jméno člena */
.field--cond { display: none; }
#lead-form:has(input[name="attendance"][value="no"]:checked) .field--attendance-note,
#lead-form:has(input[name="how_learned_source"][value="other"]:checked) .field--how-learned-other,
#lead-form:has(input[name="has_previous_membership"][value="yes"]:checked) .field--previous-membership,
#lead-form:has(input[name="knows_member"][value="yes"]:checked) .field--references,
.field--cond.has-error { display: grid; }

/* upozornění, počitadlo, rozbalovací části, podmínky */
.notice { padding: 14px 16px; border-left: 3px solid var(--gold-deep); border-radius: 4px; background: var(--stone-input); font: 400 14.5px/1.55 var(--f-sans); color: var(--ink-soft); }
.notice--warn { border-left-color: var(--error); }
.field__counter { font: 400 13px/1.4 var(--f-sans); color: var(--ink-muted); text-align: right; }
.field__counter.is-ok { color: var(--gold-deep); }
.field__counter.is-over { color: var(--error); }
.more { border-top: 1px solid var(--stone-rule); border-bottom: 1px solid var(--stone-rule); padding: 2px 0; }
.more > summary { list-style: none; cursor: pointer; padding: 12px 0; font: 500 15px/1.4 var(--f-sans); color: var(--gold-deep); display: flex; align-items: center; gap: 10px; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--gold-deep); border-radius: 50%; font-weight: 600; line-height: 1; transition: transform .25s; }
.more[open] > summary::before { content: "–"; }
.more > summary:hover, .more > summary:focus-visible { color: var(--ink-day); }
.more > summary:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.more__body { display: grid; gap: 18px; padding: 4px 0 18px; }
.terms { display: grid; gap: 10px; padding: 16px 18px; border: 1px solid var(--stone-rule); border-radius: 4px; background: rgba(255,255,255,.55); font: 400 14.5px/1.55 var(--f-sans); color: var(--ink-soft); }
.terms__details > summary { cursor: pointer; font-weight: 500; color: var(--gold-deep); }
.terms__details > summary:hover, .terms__details > summary:focus-visible { color: var(--ink-day); }
.terms__details ul { margin: 10px 0 8px; padding-left: 20px; display: grid; gap: 4px; }
.thanks__lead { margin: -8px 0 20px; font: 400 17px/1.55 var(--f-sans); color: var(--ink-day); }

@media (max-width: 767px) {
  .steps-nav { gap: 6px; }
  .steps-nav__item { grid-template-columns: 24px 1fr; gap: 8px; font-size: 12px; }
  .steps-nav__num { width: 24px; height: 24px; font-size: 12px; }
  .step-nav { display: grid; grid-template-columns: 1fr; gap: 12px; }   /* under each other, full width: primary button first, „Zpět“ below (flex + wrap would start a 2nd column) */
  .step-nav .btn { width: 100%; }
  .step-nav [data-step-prev] { order: 2; }
  .terms { padding: 14px; }
}
@media (max-width: 420px) {
  .steps-nav__label { display: none; }                    /* na nejmenších displejích jen číslo kroku; název nese nadpis kroku */
  .steps-nav__item { grid-template-columns: 24px; justify-content: start; }
}

/* --------------------------------------------------------------------------
   9. FAQ, footer, toast
   -------------------------------------------------------------------------- */
.faq { position: relative; z-index: 2; background: var(--paper-2); color: var(--ink-day); padding: 88px var(--gutter) 96px;
  content-visibility: auto; contain-intrinsic-size: auto 900px; }   /* below the fold until the form is passed: not laid out / painted before (900 px = measured desktop height with copy v2, no scrollbar jump) */
.faq__inner { max-width: 760px; margin: 0 auto; }
.faq h2 { font: 600 clamp(24px, 2.2vw, 32px)/1.2 var(--f-display); letter-spacing: .06em; margin-bottom: 28px; }
.faq__item { border-top: 1px solid #d8cfbd; }
.faq__item:last-of-type { border-bottom: 1px solid #d8cfbd; }
.faq__item summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; min-height: 56px; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary h3 { font: 600 19px/1.35 var(--f-serif); }
.faq__item summary::after {
  content: ""; flex: 0 0 auto; width: 14px; height: 14px;
  background: linear-gradient(var(--gold-deep), var(--gold-deep)) center / 14px 1px no-repeat,
              linear-gradient(var(--gold-deep), var(--gold-deep)) center / 1px 14px no-repeat;
  transition: transform .3s;
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item summary:hover h3, .faq__item summary:focus-visible h3 { color: var(--gold-deep); }
.faq__item summary:focus-visible { outline-color: var(--gold-deep); outline-offset: -2px; }
.faq__body { padding: 0 0 22px; max-width: 64ch; }
.faq__body p { font: 400 16.5px/1.6 var(--f-sans); color: var(--ink-soft); }
.faq__body p + p { margin-top: 10px; }
.faq a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 3px; }
.faq a:hover, .faq a:focus-visible { color: var(--ink-day); }
.faq :focus-visible { outline-color: var(--gold-deep); }
.faq__closing { margin-top: 30px; font: italic 400 18px/1.5 var(--f-serif); color: var(--ink-day); }

.foot { position: relative; z-index: 2; background: #1d1a16; color: #d9d2c8; padding: 56px var(--gutter) 40px;
  content-visibility: auto; contain-intrinsic-size: auto 456px; }
.foot__inner { max-width: 1100px; margin: 0 auto; display: grid; gap: 18px; }
.foot__brand { display: flex; align-items: center; gap: 12px; }
.foot__brand img { width: 36px; height: 36px; object-fit: contain; }
.foot__name { font: 600 13px/1.2 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--c-gold); }
.foot__credo { font: italic 400 17px/1.5 var(--f-serif); color: #efe8dc; }
.foot__links { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 6px; }
.foot__links a { font: 400 14px/1.4 var(--f-sans); color: #e6ddc9; text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.foot__links a:hover, .foot__links a:focus-visible { border-bottom-color: var(--c-gold); color: #fff; }
@media (pointer: coarse) { .foot__links a { padding: 12px 0; } }   /* 44 px tap height */
.foot__copy { font: 400 13px/1.5 var(--f-sans); color: #a79f90; margin-top: 10px; }

.toast {
  position: fixed; left: 16px; bottom: 16px; z-index: 50; max-width: min(340px, calc(100vw - 32px));
  padding: 10px 14px; border-radius: 4px;
  background: rgba(8,12,24,.92); color: #f3efe6; border: 1px solid color-mix(in srgb, var(--c-gold) 60%, transparent);
  font: 400 13px/1.45 var(--f-sans); opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; pointer-events: none;
}
.toast.is-open { opacity: 1; transform: none; }
@media (max-width: 767px) {
  /* phones: under the header instead of bottom-left – never behind the on-screen keyboard, never over the submit button */
  .toast { left: 16px; right: 16px; bottom: auto; top: calc(76px + env(safe-area-inset-top)); max-width: none; transform: translateY(-8px); font-size: 14px; }
}

/* --------------------------------------------------------------------------
   10. Thank-you page
   -------------------------------------------------------------------------- */
html.is-thanks .stage { position: relative; }
html.is-thanks #bn-ashlar { transform: scale(1.4); transform-box: fill-box; transform-origin: 50% 100%; }
.finale--thanks { padding-bottom: 96px; }
.finale__thanks { position: relative; max-width: 640px; margin: 0 auto; }
.finale__thanks .finale__plumb { left: 50%; }
.finale__thanks .card__contact { left: 50%; animation: contact-pulse 1.2s ease-out .2s both; opacity: 1; }
.card--thanks h1 { font: 600 clamp(26px, 2.4vw, 34px)/1.2 var(--f-display); letter-spacing: .06em; margin-bottom: 22px; text-wrap: balance; }
.thanks__lines { list-style: none; counter-reset: th; display: grid; gap: 14px; }
.thanks__lines li { position: relative; padding-left: 34px; font: 400 16.5px/1.55 var(--f-sans); color: var(--ink-soft); counter-increment: th; }
.thanks__lines li::before { content: counter(th); position: absolute; left: 0; top: 0; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--gold-deep); color: var(--gold-deep); font: 600 12px/1 var(--f-display); }
.thanks__duration { margin-top: 22px; font: 400 16.5px/1.55 var(--f-sans); color: var(--ink-day); }
.thanks__links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 6px 18px; font: 400 15px/1.5 var(--f-sans); }
.thanks__quote { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--stone-rule); font: italic 400 clamp(19px, 1.5vw, 22px)/1.45 var(--f-serif); }
.stage__caption {
  position: absolute; right: 8cqw; bottom: 23cqh; z-index: 5; max-width: 230px; text-align: right;
  padding: 7px 11px; border-radius: 3px; background: rgba(255,250,242,.88); border: 1px solid rgba(118,96,47,.35);
  font: italic 400 14px/1.4 var(--f-serif); color: var(--ink-day); pointer-events: none;
}
.stage__caption::after { content: ""; position: absolute; right: 14px; top: 100%; width: 1px; height: 5.5cqh; background: var(--gold-deep); transform: rotate(-22deg); transform-origin: 50% 0; }
@media (max-width: 1023px) and (orientation: portrait) {
  html.is-thanks .stage { height: 72svh; }   /* portrait tablets: the confirmation card starts inside the first screen */
}
@media (max-width: 767px) {
  .stage__caption { display: none; }
  /* phones: a shorter scene so the confirmation card starts inside the first screen */
  html.is-thanks .stage { height: 58svh; }
  .finale--thanks { padding-top: 96px; }
  .finale__thanks .finale__plumb { top: -96px; height: 28px; }
}

/* --------------------------------------------------------------------------
   11. Reduced motion, print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  :root { --depth-k: 0; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .rope, .rope__line, .rope.is-landed, .rope.is-swinging { animation: none !important; transform: none !important; }
  .rope__line::after, .cue__line { animation: none !important; transform: none !important; opacity: 1; }
  #bn-flame, #sk-a-group, #sk-b-group, #sk-c-group { animation: none !important; }
  #sc-arm-mallet, #sc-forearm-mallet { animation: none !important; transform: rotate(0deg) !important; }   /* mallet resting on the chisel */
  .layer--statue .dust { display: none; }
  .card, .pain, .card--hero .card__body { opacity: 1 !important; transform: none !important; }
  .card--hero h1, .card--hero .lead, .card--hero .eyebrow { animation: none !important; }
}
html.reduced-motion { --depth-k: 0; }
html.reduced-motion .rope, html.reduced-motion .rope__line, html.reduced-motion #bn-flame,
html.reduced-motion .layer--stars svg *, html.reduced-motion .cue__line { animation: none !important; }
html.reduced-motion #sc-arm-mallet, html.reduced-motion #sc-forearm-mallet { animation: none !important; transform: rotate(0deg) !important; }
html.reduced-motion .layer--statue .dust { display: none; }

@media print {
  html { --c-sky-top: #6fa8dc; --c-sky-mid: #bcd9f1; --c-sky-bottom: #e9eef2; --c-far: #a7b7cc; --c-far-2: #8b9db3; --c-mid: #6c7a8a; --c-mid-light: #9aa9bb;
    --c-near: #3b3a3f; --c-near-light: #5a5753; --c-stone-light: #f7f3ec; --c-stone-mid: #d9d2c8; --c-stone-shadow: #9a948b; --c-rough: #aaa49a; --c-rim: #fff1c9; }
  .layer--statue, .top, .steps .card { --day: 1; }
  .layer--stars > svg, #st-rim, .sc-back-rim, .layer--sculptor > svg { --stars: 0; }
  .layer--bench, #bn-lit, #bn-glow { --lantern: 0; }
  #sc-pose-work, #sc-pose-rest { --rest: 1; }
  #br-old, #br-broad, #br-young { --brothers: 1; }
  .layer--moon { --moon-o: 0; } .layer--sun { --sun-o: 1; --sun-y: 18; }
  body { background: #fff; color: #000; }
  .top, .rope, .gauge, .toast, .tooltip, .pin, .steps, .faq, .skip, .finale__plumb, .under-button, .foot__links { display: none !important; }
  .story { display: block; }
  .stage { position: relative; height: 60vh; break-inside: avoid; transform: none; }
  .layer { transform: none !important; }
  .carve--block { display: none; }
  .carve--statue { clip-path: none; }
  .finale { padding: 24px 0; break-before: avoid; }
  .finale__grid { display: block; }
  .card--form { box-shadow: none; border: 1px solid #999; margin-top: 24px; }
  .finale__note { max-width: none; }
  .foot { background: none; color: #000; padding: 16px 0; }
  .foot__name, .foot__credo { color: #000; }
}
