/* ==========================================================================
   AN AUSTRIAN ECONOMIST · V4 GAZETTE FOUNDATION · TOKENS
   --------------------------------------------------------------------------
   The design constants of the printed object. Loaded first, before
   gazette.css and gazette-motion.css. Pure custom properties; no selectors
   beyond :root. Palette hexes are house-brand canon and change there first.

   V4 architecture: rebuilt pages load fonts.css + gazette-tokens.css +
   gazette.css + gazette-motion.css and NOTHING of the V3 stack
   (journal/revamp/vintage-paper/engraved-plate.css; retired and pruned at the July 10 2026 promotion). Pages not yet rebuilt
   keep the V3 stack untouched. The two stacks never meet on one page.
   ========================================================================== */

:root {
  /* ----- The sheet: paper and ink (house-brand canon) ----- */
  --paper:       #ECE0BD;   /* the field */
  --paper-deep:  #DCCD9C;   /* recessed paper, plate fills */
  --paper-edge:  #C9B888;   /* sheet edges, subtle borders */
  --paper-line:  #B49C66;   /* hairline rules, column rules */
  --ink:         #1B1409;   /* primary text, headlines */
  --ink-2:       #3A2D18;   /* secondary text */
  --ink-3:       #6B5A3E;   /* captions, muted */
  --ink-4:       #9C8B6A;   /* faint annotation ONLY: 2.53:1, never read text */

  /* ----- Accents (gold is the hero; oxblood/navy are semantic) ----- */
  --gold:        #94691A;   /* 3.72:1 on paper: LARGE text (24px+/18.7px bold+) and marks only */
  --gold-deep:   #6E4D0F;   /* 5.84:1: gold as read text, kickers, mono labels, links */
  --gold-bright: #B6852A;   /* hover lift, brighter gold moments */
  --oxblood:     #6B2A22;   /* force, loss, danger */
  --navy:        #2A3A5E;   /* the state, institutions, the technical */
  --green:       #2D6A4F;   /* rare positive/exit indicator */
  --bitcoin:     #F7931A;   /* Bitcoin marks only, never large fills */
  --copper:      #D97757;   /* warmer Bitcoin-adjacent moments */

  /* ----- Dark plate surfaces ----- */
  --dark:        #1A1A2E;
  --dark-deep:   #0F0F17;
  --on-dark:     #FAFAF8;

  /* ----- Computed composite surfaces (engraving-cookbook: solid tones,
           never translucent overlays, so halos and seams never fringe) ----- */
  --surface-deed:  #E4D6AC;  /* paper-deep @ .52 over paper */
  --surface-band:  #E5D7AE;  /* paper-deep @ .45 over paper */
  --surface-panel: #E3D6AB;  /* paper-deep @ .55 over paper */
  --surface-court: #E7DAB4;  /* near-paper recess */

  /* ----- The faces (self-hosted; see fonts.css / assets/fonts/FONTS.md).
           Apparatus note: Source Serif 4 owns captions/UI/metadata in V4
           (elevation brief). Inter ships on no V4 page; embedded apps that
           need it load their own copy. ----- */
  --font-display:   'Playfair Display', 'Playfair Display Fallback', 'Playfair Display Fallback 2', Georgia, serif;
  --font-text:      'EB Garamond', 'EB Garamond Fallback', 'EB Garamond Fallback 2', Georgia, 'Times New Roman', serif;
  --font-apparatus: 'Source Serif 4', 'Source Serif 4 Fallback', 'Source Serif 4 Fallback 2', Georgia, serif;
  --font-mono:      'JetBrains Mono', 'JetBrains Mono Fallback', 'JetBrains Mono Fallback 2', ui-monospace, Menlo, monospace;
  --font-epigraph:  'IM Fell English', 'IM Fell English Fallback', 'IM Fell English Fallback 2', Georgia, serif;
  --font-versal-ground: 'EBG Initials F1';   /* woodcut ground layer, A-Z */
  --font-versal-letter: 'EBG Initials F2';   /* letter layer, A-Z */

  /* ----- Fluid type scale.
           Continuous between 320 and 2560; no register jumps at breakpoints.
           Body is EB Garamond, which runs small on the body: 17.5 -> 19px
           (the brief's named compensation). Checked at 320/390/540/768/900/
           1180/1400/2560 by the specimen's live readouts. ----- */
  --type-caption:  clamp(0.8125rem, 0.79rem + 0.10vw, 0.875rem);   /* 13 -> 14  */
  --type-small:    clamp(0.875rem, 0.8438rem + 0.14vw, 0.9375rem); /* 14 -> 15  */
  --type-body:     clamp(1.0938rem, 1.0313rem + 0.26vw, 1.1875rem);/* 17.5 -> 19 */
  --type-md:       clamp(1.1875rem, 1.1094rem + 0.38vw, 1.375rem); /* 19 -> 22  */
  --type-lg:       clamp(1.375rem, 1.2578rem + 0.55vw, 1.75rem);   /* 22 -> 28  */
  --type-xl:       clamp(1.625rem, 1.4219rem + 0.90vw, 2.375rem);  /* 26 -> 38  */
  --type-2xl:      clamp(2.125rem, 1.6953rem + 1.90vw, 3.5rem);    /* 34 -> 56  */
  --type-display:  clamp(2.375rem, 0.75rem + 5.20vw, 5.5rem);      /* 38 -> 88  */

  /* Fixed registers: plate furniture never varies between leaves. */
  --type-plate-label: 0.8125rem;      /* mono 13px, tracking 2.2px */
  --track-plate: 0.169em;             /* 2.2px at 13px */
  --track-kicker: 0.20em;
  --track-smallcaps: 0.05em;

  /* ----- Body register weight (checkpoint ruling 1, July 8 2026).
           EB Garamond 400 reads silvery at DPR1; the variable file carries
           the compensation. A/B'd 430 vs 445 at DPR1 on the lede
           (screenshots-rollout/ab_lede_dpr1_w*.png): 445 ships. 430 keeps a
           whisper of silver in the hairlines; 445 reads as pressed ink with
           counters still open, and stays crisp at DPR2. ----- */
  --weight-body: 445;

  /* ----- Leading ----- */
  --leading-body: 1.68;               /* ~30px at 18px */
  --leading-caption: 1.5;
  --leading-head: 1.12;
  --leading-tight: 1.04;

  /* ----- The measure: locked 60-68ch at every width ----- */
  --measure: 66ch;
  --measure-narrow: 52ch;

  /* ----- Space: a 6px rhythm ----- */
  --s-1: 0.375rem;   /*   6 */
  --s-2: 0.75rem;    /*  12 */
  --s-3: 1.125rem;   /*  18 */
  --s-4: 1.5rem;     /*  24 */
  --s-5: 1.875rem;   /*  30 */
  --s-6: 2.25rem;    /*  36 */
  --s-8: 3rem;       /*  48 */
  --s-10: 3.75rem;   /*  60 */
  --s-12: 4.5rem;    /*  72 */
  --s-16: 6rem;      /*  96 */

  /* Fluid flows: section-scale space breathes with the sheet. */
  --flow-band:    clamp(2.25rem, 1.5rem + 3.0vw, 4.5rem);   /* 36 -> 72  */
  --flow-section: clamp(3rem, 1.9rem + 4.4vw, 6.75rem);     /* 48 -> 108 */
  --gutter:       clamp(1.125rem, 0.5rem + 4.0vw, 4.5rem);  /* page side margins */

  /* Figure wells breathe exactly two body lines above and below. */
  --space-figure: calc(var(--type-body) * var(--leading-body) * 2);

  /* Headings carry 2:1 space above:below. */
  --space-head-below: clamp(0.75rem, 0.6rem + 0.7vw, 1.25rem);
  --space-head-above: calc(var(--space-head-below) * 2);

  /* ----- Containers ----- */
  --leaf-max: 75rem;                  /* 1200px: the widest composed sheet */
  --content-max: 60rem;               /* 960px */

  /* ----- The rule grammar: three weights plus the engraved swelled rule.
           Colors here; the press-pulled images live in gazette.css. ----- */
  --rule-hairline-color: var(--paper-line);
  --rule-text-color: rgba(27, 20, 9, 0.32);
  --rule-ceremonial-color: var(--ink);

  /* ----- Ornament degradation ladder thresholds (container query px).
           full engraving >= ladder-full; simplified band >= ladder-band;
           below that, a rule. Components may re-tune per slot. ----- */
  --ladder-full: 420px;
  --ladder-band: 240px;

  /* ----- Z / elevation conventions.
           Within an HTML-native plate: ground(1) < shade(2) < line(3) <
           label(4). Inlined SVG plates keep their own internal order. ----- */
  --z-plate-ground: 1;
  --z-plate-shade: 2;
  --z-plate-line: 3;
  --z-plate-label: 4;
  --z-running-head: 30;
  --z-masthead: 40;
  --z-foldout: 90;
  --z-skiplink: 100;

  /* ----- Motion constants (gazette-motion.css consumes) ----- */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0.06, 0.68, 0.19);
  --dur-ui: 200ms;      /* hover ink-in 180-220 */
  --dur-enter: 240ms;
  --dur-exit: 150ms;    /* ~75% of enter */
  --dur-settle: 520ms;  /* figure settles */

  /* ----- Texture assets -----
     The page field is the V3 site's photographed aged paper, veiled and
     baked to one tile (assets/textures/_derive-aged-tile.py) and laid at
     V3's 600px pitch: the creator's ruling (feedback ledger item 1,
     July 2026) restored the old paper's visible strength and character
     over the faint baked-noise tile that V4 first shipped. Every seat
     wrapper paints this same field; consumers take the size from the
     token so the pitch can never drift apart. paper-tile.png remains on
     disk, unreferenced. */
  --paper-tile: url('../assets/textures/paper-aged-tile.png');
  --paper-tile-size: 600px 600px;
  --paper-tooth: url('../assets/textures/paper-tooth.png');
}
