/* ===========================================================================
   CRUXMS Product Design System — typography (v1.1 — post design review)
   Adopts the Crux brand's three faces for the PRODUCT UI too, replacing
   Inter (Calibr) and DM Sans / Montserrat (IB — DM Sans was never actually
   loaded in the live code; it silently fell back to system-ui).

   v1.1 fix: the first pass loaded Plex Sans at 400/500 and Plex Mono at
   400/500, but several components requested weight 700 (Plex Sans) and 600
   (Plex Mono) that were never loaded — the browser synthesised a faux bold
   in every one of those spots (kickers, table headers, stat numbers, module
   tags). Faux bold is a visible defect, not a style choice. Now loading the
   weights that are actually used.

   v1.1 fix #2: Archivo and Plex Sans converge visually below ~20px — both
   are neo-grotesques with similar skeletons, so a UI label set in Archivo at
   14–18px reads as inconsistent rather than deliberate. RULE: Archivo only
   at >=20px and weight 700/800. Everything below that — including "UI
   label" — uses Plex Sans. Negative letter-spacing is likewise restricted
   to >=20px; at small sizes it costs legibility for no visible benefit.
   =========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@700;800&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
}

/* Archivo restricted to >=20px / 700+ — do not apply it to anything smaller */
.display, h1 { font-family: var(--font-head); font-weight: 800; font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); color: var(--ink); }
h2            { font-family: var(--font-head); font-weight: 700; font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: var(--ls-h1); color: var(--ink); }

/* Below 20px: Plex Sans owns everything, including what used to be "Archivo
   600 UI label" in the brand doc's own print-oriented scale — that row does
   not survive the switch to a UI viewing distance/size without converging
   with body text. */
h3, .h2-ui    { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-h2); line-height: var(--lh-h2); color: var(--ink); }
.caption      { font-family: var(--font-body); font-weight: 400; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-muted); }
.label        { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-label); line-height: var(--lh-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-faint); }

code, .mono, .data-cell, td.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
