/*
 * codex.css — the Codex token mirror for the community theme (Phase B0).
 *
 * REGISTER: D3 · Open Hand (Hanken Grotesk + terracotta, warm neutrals) — the
 * 2026-06-16 re-brand that moves Plectra decisively off Aldis. The community
 * theme LEADS this re-brand: these values are the D3 contract. The apex landing's
 * `@theme` (plectra.app app/globals.css) reconciles to D3 in Wave 2; until then
 * the two repos INTENTIONALLY diverge (theme = D3, apex = legacy Codex). Once Wave 2
 * lands, this file is again a VERBATIM mirror of the apex contract — same
 * paper/ink/accent, same type scale (DESIGN-SPEC §3.2).
 *
 * These are exposed as the SAME-NAMED custom properties as the apex
 * (--color-*, --font-*, --text-*, --radius-*, …) so bespoke-surface CSS in the
 * later B-waves consumes them with identical names. theme.json keeps its own
 * --wp--preset--* vars for block content; this file is the bespoke-surface layer.
 *
 * Pinned by scripts/codex-tokens-gate.mjs — values here MUST equal the contract
 * (now the D3 contract; the gate was re-pointed in lockstep with this file).
 * Do not edit a value here without changing the gate (and, in Wave 2, the apex).
 *
 * @package plectra-theme
 */

:root {
  /* ---------- Paper & ink (D3 · Open Hand — light. §1.1) ---------- */
  --color-paper: #FAF6EF;       /* page background (warm neutral — NOT Aldis cream) */
  --color-ivory: #FFFFFF;       /* card surface (raised) */
  --color-parchment: #F2EBDD;   /* recessed / active nav-chip bg */
  --color-ink: #1A1A1A;
  --color-mist: #5F574C;        /* warm AA-safe secondary text (verified test-contrast) */
  --color-rule: #E4DCCD;
  --color-rule-dark: #CBBBA0;

  /* ---------- Accents (D3 terracotta — AA-gated; §1.2) ----------
     Text-safe: accent(terracotta)/plum-dark/moss. plum-light = paper/ivory hover only.
     Pillar borders render the DARKENED variants only (raw hues never shown):
     cerulean/coral/amber here ARE the >=3:1 (WCAG 1.4.11) border values.
     NB: the plum-dark/plum-light SLUGS are retained from the Codex register to
     avoid CSS churn; their VALUES are now Terracotta Dark/Light (see theme.json). */
  --color-accent: #A8412A;      /* terracotta — primary sigil, links, AA text on paper */
  --color-plum-dark: #7E3320;   /* Terracotta Dark — extra headroom / hover→ink path */
  --color-plum-light: #C25C40;  /* Terracotta Light — hover tint, paper/ivory ONLY */
  --color-moss: #3A5B47;        /* text-safe secondary accent + success */
  --color-sage: #6B8F5E;        /* large headings / borders only */
  --color-cerulean: #3E7C97;    /* border variant */
  --color-coral: #B85C3C;       /* border variant */
  --color-amber: #9A7322;       /* border variant */

  /* ---------- Semantic state (DESIGN-SPEC §1.2b) ---------- */
  --color-error: #A32D24;       /* AA normal text everywhere (6.26/6.64/5.76) */
  --color-success: #3A5B47;     /* = moss */

  /* ---------- Type families (DESIGN-SPEC §1.3 — self-hosted, see fonts.css) ----------
     The "<Family> Fallback" faces are the Capsize metric-matched fallbacks
     declared in fonts.css; including them here keeps swap-CLS at zero when the
     B-waves apply these families. */
  --font-heading: "Hanken Grotesk", "Hanken Grotesk Fallback", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Sans 3", "Source Sans 3 Fallback", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-hand: "Caveat", "Caveat Fallback", "Bradley Hand", cursive;
  --font-default: var(--font-heading); /* back-compat alias */

  /* ---------- Type scale (DESIGN-SPEC §1.4) ---------- */
  --text-wordmark: clamp(4rem, 6vw + 2rem, 6rem);
  --text-wordmark-line-height: 1;
  --text-wordmark-letter-spacing: -0.02em;

  --text-display: clamp(2rem, 3vw + 1rem, 3rem);
  --text-display-line-height: 1.15;
  --text-display-letter-spacing: -0.015em;

  --text-section-title: 1.5rem;
  --text-section-title-line-height: 1.3;

  --text-lede: clamp(1.25rem, 1vw + 1rem, 1.5rem);
  --text-lede-line-height: 1.35;
  --text-lede-letter-spacing: -0.01em;

  --text-body-lg: 1.125rem;
  --text-body-lg-line-height: 1.7;

  --text-body: 1.125rem;
  --text-body-line-height: 1.6;

  --text-evidence: 0.875rem;
  --text-evidence-line-height: 1.6;

  --text-caption: 0.9375rem;
  --text-caption-line-height: 1.5;

  --text-eyebrow: 0.8125rem;
  --text-eyebrow-line-height: 1.4;
  --text-eyebrow-letter-spacing: 0.12em;

  /* ---------- Radii / shadow / motion / containers (DESIGN-SPEC §1.5) ---------- */
  --radius-card: 2px;
  --shadow-card: 0 1px 2px rgba(26, 26, 26, 0.06);
  --shadow-card-hover: 0 6px 20px -8px rgba(26, 26, 26, 0.16), 0 2px 6px rgba(26, 26, 26, 0.05);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  --container-content: 40rem;   /* prose measure */
  --container-shell: 56rem;     /* layout shell */
}
