/* v16 system layer: tokens -> roles for the whole page (the rework plan, section 3). Loaded after every older sheet.
   Intent: one spacing scale, one container, one type ladder and one evening-arc ground, so every section is built from
   the same parts. Letter: new tokens only (never redefining the app's or the site's existing ones), applied only to
   sections v16.js has opted in (data-rhythm / data-register / data-ground). The frozen shelf and keepsakes are fenced:
   they keep v15's exact values, proven by tools/frozen_diff.py. */

#app-frame {
  /* Section rhythm on the 4 px grid (extends --sp-1..8 = 4..40 px). Desktop values; phones below. */
  --sp-12: 48px; --sp-14: 56px; --sp-20: 80px; --sp-24: 96px; --sp-30: 120px; --sp-40: 160px;
  --rhythm-compact: var(--sp-24);    /* Q, a breath */
  --rhythm-standard: var(--sp-30);   /* M, a feature */
  --rhythm-stage: var(--sp-40);      /* L, a stage (pinned scenes own their height) */
  /* Inner gaps: eyebrow to heading, heading to lead, lead to the proof */
  --gap-eyebrow: var(--sp-4); --gap-lead: var(--sp-4); --gap-proof: var(--sp-8);   /* 16 / 16 / 40: the values most v15 sections already used (16, 16, 35) */
  /* One container */
  --v16-max: 76rem;
  /* Type ladder: display is the loudest thing on the page, used by the hero and the finale only */
  --display-hero: clamp(2.4rem, 1.2rem + 4.2vw, 5rem);
  --display-stage: clamp(2.3rem, 1.4rem + 3.8vw, 4.4rem);   /* = v15 .h2--xl, so the frozen headings already sit on it */
  --display-section: clamp(1.9rem, 1.35rem + 2.2vw, 3rem);  /* = --site-h2 */
  --body-min: 1rem;
  /* Evening-arc ground stops (one set for both themes: in light the arc paints only the night panels). Warm night family
     only: never cream, purple or black. Consumed by v16.js (phase 3). */
  --ground-dusk: #2a2119;
  --ground-page: #211c15;   /* = --surface-page in the dark theme; a literal so the light theme's night panels never blend to cream */
  --ground-night: var(--feature-bg);    /* #1d1813 */
  --ground-deep: #16120e;
  --ground-sky: #1a1612;
}
@media (max-width: 819.98px) {
  #app-frame { --rhythm-compact: var(--sp-8); --rhythm-standard: var(--sp-14); --rhythm-stage: var(--sp-20); --gap-proof: var(--sp-6); }
}

/* ---- the frozen fence ----
   Both sections show the page ground through (no background of their own), and they must keep doing so: an opaque
   background of the same colour measurably changes text antialiasing inside them (1 level, frozen_diff 2026-10-03).
   The fence is therefore in v16.js: the evening arc (phase 3) is pinned to exactly the page ground at both edges of
   either section and never paints them, and no v16 rule selects them (checked by frozen_diff via SW.v16.fence()). */
