/* ==========================================================================
   Design tokens — Mehran Moazzami
   Brass on ink, steel for structure. Token architecture follows
   InfraStructure/shared/rtl-design-tokens; the values are this site's own.

   Contrast note, and the reason there are two brasses: --brass measures
   1.91:1 on --paper, which is unreadable. On light sections brass may only be
   a FILL BEHIND DARK TEXT or the mark itself, never text — use --brass-deep
   there. tests/contrast.spec.ts recomputes every ratio below from this file
   and fails the build if one drops under its floor. Do not trust these
   comments; they are documentation, the test is the check.
   ========================================================================== */

:root {
  /* -- Ground -- */
  --ink: #0f0f0e;           /* primary dark ground                          */
  --ink-raised: #171613;    /* cards and panels on ink                      */
  --paper: #edebe6;         /* light section ground                         */
  --paper-raised: #f6f5f2;

  /* -- Line -- */
  --line: #2b2822;          /* on ink                                       */
  --line-soft: #211f1b;
  --line-paper: #d8d4cb;    /* on paper                                     */

  /* -- Accent -- */
  --brass: #d9a32f;         /* 8.43:1 on --ink   — dark grounds only        */
  --brass-deep: #7a5c18;    /* 5.23:1 on --paper — light grounds only       */
  --brass-dim: #9a7b33;     /* supporting marks on ink, not body text       */
  --ink-on-brass: #12100b;  /* 8.41:1 on --brass — text and marks on a fill */

  /* -- Secondary structure -- */
  --steel: #7e8b95;         /* 5.49:1 on --ink                              */
  --steel-deep: #4a545c;    /* on paper                                     */

  /* -- Text -- */
  --text: #e8e5de;          /* on ink                                       */
  --text-dim: #a8a296;      /* on ink, secondary                            */
  --text-ink: #16150f;      /* on paper                                     */
  --text-ink-dim: #56524a;  /* on paper, secondary                          */

  /* -- Semantic (distinct from the accent, per usual practice) -- */
  --ok: #7fa86b;
  --warn: #c2743a;

  /* -- Architecture diagram --
     The hero artefact draws on its own grounds, so its colours are tokens
     rather than hex buried in the SVG: hardcoded fills are invisible to
     tests/contrast.spec.ts, and the first version of that diagram shipped
     label text at 3.20:1 for exactly that reason. Every pair below is
     measured in that test alongside the page palette. --diagram-line is a
     box boundary, not text, so it answers to the 3:1 non-text floor. */
  --diagram-ground: #141310;        /* legacy and storefront boxes           */
  --diagram-ground-bridge: #1b1710; /* the bridge box                        */
  --diagram-line: #5a646d;          /* 3.13:1 on --ink, a boundary not text  */
  --diagram-text: #9aa5ae;          /* 7.43:1 on --diagram-ground            */
  --diagram-text-dim: #7e8b95;      /* 5.36:1 on --diagram-ground            */
  --brass-mid: #b08f42;             /* 5.84:1 on --diagram-ground-bridge     */

  /* -- Type -- */
  --font-display: 'Archivo Black', 'Arial Black', Impact, sans-serif;
  --font-body: Newsreader, Georgia, 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-fa: Vazirmatn, Tahoma, Arial, sans-serif;

  --fs-hero: clamp(2.6rem, 7.4vw, 5.6rem);
  --fs-statement: clamp(2.2rem, 6.4vw, 4.8rem);
  --fs-h2: clamp(1.7rem, 3.6vw, 2.9rem);
  --fs-h3: 1.06rem;
  --fs-lead: clamp(1.05rem, 1.5vw, 1.28rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9rem;
  --fs-label: 0.6875rem;

  /* 0.82 is the signature of the display setting. It is also the setting most
     likely to collide — tests/type.spec.ts renders the longest German
     compound at hero size and asserts the line boxes do not overlap. */
  --lh-display: 0.82;
  --lh-snug: 1.22;
  --lh-body: 1.62;

  --ls-display: -0.04em;
  --ls-label: 0.16em;

  /* -- Space -- */
  --space-section: clamp(4rem, 9vw, 8.5rem);
  --space-gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 66ch;
  --max-width: 1240px;

  /* -- Motion (Tier 0/1 only; Tier 2 is a later phase) -- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 160ms;
  --dur: 340ms;
  --dur-slow: 620ms;
}

/* Persian raises the display size one step: no Persian face carries the visual
   weight of a Latin grotesque at 900, so matching the Latin size makes the
   Persian hero read lighter than the English one. Setting it larger is the
   correct fix; stretching the glyphs is not. */
:root:lang(fa),
[dir='rtl'] {
  --fs-hero: clamp(2.9rem, 8.2vw, 6.1rem);
  --lh-display: 1.05;
  --ls-display: 0;
}
