/* ==========================================================================
   apex-v2 design tokens — two-tier architecture (ratified 2026-07-18)
   Tier 1: raw palette. Candidate B verbatim (mockups/candidates/EXTRACTION.md §1),
           plus values adopted from Candidate A for the confidence/status/evidence
           systems, plus the ratified AA aliases (R-3 deviations → PROVENANCE.md).
   Tier 2: semantic aliases. Components consume ONLY tier-2 names.
   ========================================================================== */

:root {
  /* ── tier 1 · raw: Candidate B palette (verbatim) ─────────────────────── */
  --b-paper: #f3ecdc;
  --b-paper-light: #fbf7ee;
  --b-paper-deep: #e7dcc5;
  --b-ink: #071a2b;
  --b-navy: #08233d;
  --b-navy-raised: #153a5a;
  --b-gold: #cda23d;
  --b-gold-dark: #7a581a;
  --b-muted: #5a6871;
  --b-rule: rgba(7, 26, 43, 0.22);
  --b-rule-strong: rgba(7, 26, 43, 0.62);

  /* tier 1 · raw: tokenized from B's non-token values (ratified Q2) */
  --b-ink-soft: #33434d;                      /* B serif deck/standfirst ink   */
  --b-on-dark-muted: #cad2d6;                 /* unified from #c8d0d4/#cad2d6  */
  --b-rule-inverse: rgba(250, 247, 238, 0.24);        /* consolidated .22–.24 */
  --b-rule-inverse-strong: rgba(250, 247, 238, 0.28);

  /* tier 1 · raw: AA aliases (ratified Q3; raw B tokens untouched) */
  --b-muted-aa: #56636c;        /* --b-muted darkened ×0.955 · 4.55:1 on paper-deep */
  --b-quiet-text-aa: #5d6264;   /* --a-quiet darkened ×0.805 · 4.55:1 on paper-deep */
  --b-elevated-text-aa: #815a1b;/* fallback if hue distinction from gold-dark wanted */

  /* tier 1 · raw: adopted from Candidate A (confidence · status · evidence) */
  --a-verified: #173e38;
  --a-verified-chip-text: #f4f1e8;
  --a-partial-light: #f1e3bd;
  --a-partial-chip-text: #513a14;
  --a-partial-chip-border: #9a742d;
  --a-single-light: #e1e3e3;
  --a-single-chip-text: #3f4852;
  --a-single-chip-border: #777d84;
  --a-severe: #7a342d;
  --a-elevated: #9b6d20;
  --a-watch: #31517f;
  --a-quiet: #747a7c;
  --a-quiet-panel: #e6e4de;
  --a-shadow-fine: 0 14px 34px #070f1e12;     /* evidence plates ONLY */

  /* ── tier 2 · semantic: surfaces ──────────────────────────────────────── */
  --surface-page: var(--b-paper);             /* body cream                    */
  --surface-record: var(--b-paper-deep);      /* parchment record-sheet ground */
  --surface-raised: var(--b-paper-light);     /* raised / bright panels        */
  --surface-dark: var(--b-navy);              /* primary dark bands / panels   */
  --surface-dark-raised: var(--b-navy-raised);
  --surface-deep: var(--b-ink);               /* deepest bands (utility, CTA)  */

  /* tier 2 · semantic: text */
  --text-primary: var(--b-ink);
  --text-secondary: var(--b-ink-soft);
  --text-muted: var(--b-muted-aa);            /* AA on both creams             */
  --text-label: var(--b-muted);               /* large/700 labels only (≥3:1)  */
  --text-on-dark: var(--b-paper-light);
  --text-on-dark-muted: var(--b-on-dark-muted);

  /* tier 2 · semantic: accents & rules */
  --accent: var(--b-gold);                    /* ornament, rules, on-dark text */
  --accent-text: var(--b-gold-dark);          /* the ONLY gold usable as text on cream */
  --rule: var(--b-rule);
  --rule-strong: var(--b-rule-strong);
  --rule-inverse: var(--b-rule-inverse);
  --rule-inverse-strong: var(--b-rule-inverse-strong);

  /* tier 2 · semantic: confidence system (vocabulary: VERIFIED · PARTIAL · SINGLE-SOURCE) */
  --confidence-verified: var(--a-verified);
  --confidence-verified-text: var(--a-verified-chip-text);
  --confidence-partial-ground: var(--a-partial-light);
  --confidence-partial-text: var(--a-partial-chip-text);
  --confidence-partial-border: var(--a-partial-chip-border);
  --confidence-single-ground: var(--a-single-light);
  --confidence-single-text: var(--a-single-chip-text);
  --confidence-single-border: var(--a-single-chip-border);

  /* tier 2 · semantic: theater status system */
  --status-severe: var(--a-severe);
  --status-elevated: var(--a-elevated);       /* bars / large text only        */
  --status-elevated-text: var(--b-gold-dark); /* small labels (ratified)       */
  --status-watch: var(--a-watch);
  --status-quiet: var(--a-quiet);             /* bars / large text only        */
  --status-quiet-text: var(--b-quiet-text-aa);
  --status-quiet-panel: var(--a-quiet-panel);

  /* ── typography (ratified Q4: brand, self-hosted) ─────────────────────── */
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --font-data: "Courier Prime", "Courier New", monospace;

  /* type ramp — Candidate B values under the #434 naming convention */
  --fs-wordmark: clamp(3rem, 5.4vw, 5.4rem);
  --fs-display: clamp(2.8rem, 4.5vw, 5.25rem);
  --fs-section: clamp(2.25rem, 4vw, 4rem);
  --fs-feature: clamp(2rem, 3.5vw, 3.5rem);
  --fs-headline: clamp(1.6rem, 2.5vw, 2.25rem);
  --fs-subhead: clamp(1.55rem, 2vw, 2.05rem);
  --fs-deck: clamp(1.1rem, 1.45vw, 1.35rem);
  --fs-body-serif: 1.08rem;
  --fs-card: 1.05rem;
  --fs-fine: 0.76rem;
  --fs-nav: 0.72rem;
  --fs-kicker: 0.69rem;
  --fs-caption: 0.68rem;
  --fs-mono: 0.68rem;
  --fs-mono-small: 0.62rem;

  /* tracking presets — B chrome set */
  --track-wide: 0.34em;
  --track-med: 0.13em;
  --track-tight: 0.08em;

  /* ── layout & rhythm (ratified Q6: B governs; A's reading measure) ────── */
  --page-max: 1440px;
  --gutter: clamp(18px, 3vw, 48px);
  --gap: clamp(20px, 2.2vw, 36px);
  --section-pad: clamp(68px, 8vw, 112px);
  --band-pad: clamp(28px, 5vw, 72px);
  --measure: 47rem;                           /* record-page prose cap (A)     */

  --transition: 150ms ease;
}
