/*
 * V154: Public Sans + Satoshi — the webapp-wide type layer.
 *
 * Pairing: Satoshi (ITF, free licence — the font.download release) carries
 * headings/display; Public Sans (SIL OFL, USWDS) carries body & UI text.
 * The code/badge voice is now the system mono stack
 * (ui-monospace/'Cascadia Mono'/Consolas/'Liberation Mono') — v196 removed
 * the Google-Fonts CDN load, and no local JetBrains Mono woff2 ships.
 * The legal serif (.contract-document) is untouched.
 *
 * Loaded LAST in every surface's <head> (admin, marketing, portal, auth,
 * engineer FieldApp) so these rules win over the theme stacks:
 *   - marketing-apple.css sets body + h1–h4 with !important → the body AND
 *     heading rules here need !important too (same specificity, later file
 *     wins).
 *   - auth-glass.css styles body.auth-glass (higher specificity than a
 *     bare `body`) → !important here beats it without touching anything
 *     else.
 *   - engineer pages set body 'Inter' inline → fonts.css link sits after
 *     those <style> blocks.
 * The !important lives on the BODY element's own declaration only, so
 * element-scoped voices stay intact (the mono badges/.mono/.btn via their
 * own stacks, the legal .contract-document serif, form controls with
 * their own fonts).
 * Both families are SELF-HOSTED woff2 (CSP font-src 'self' already allows
 * them): one DNS-less request per family subset, font-display swap so
 * mobile never blocks on text render, and the fallback stacks below keep
 * every layout identical while fonts stream in.
 */

/* ---- Public Sans: variable, weight 100–900 (official Google Fonts release) ---- */
@font-face{
  font-family:'Public Sans';
  src:url('../fonts/public-sans/public-sans-variable.woff2') format('woff2-variations'),
      url('../fonts/public-sans/public-sans-variable.woff2') format('woff2');
  font-weight:100 900;
  font-style:normal;
  font-display:swap;
}

/* ---- Satoshi: static weights 400 / 500 / 700 / 900 (ITF via Fontshare) ---- */
@font-face{
  font-family:'Satoshi';
  src:url('../fonts/satoshi/satoshi-400.woff2') format('woff2');
  font-weight:400;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:'Satoshi';
  src:url('../fonts/satoshi/satoshi-500.woff2') format('woff2');
  font-weight:500;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:'Satoshi';
  src:url('../fonts/satoshi/satoshi-700.woff2') format('woff2');
  font-weight:700;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:'Satoshi';
  src:url('../fonts/satoshi/satoshi-900.woff2') format('woff2');
  font-weight:900;
  font-style:normal;
  font-display:swap;
}

/* ---- Assignment: Public Sans = body/UI, Satoshi = display ---- */
:root{
  --font-body:'Public Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
  --font-display:'Satoshi',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
}

body{
  font-family:var(--font-body) !important;
}

input,
select,
textarea{
  font-family:var(--font-body);
}

h1,h2,h3,h4,h5,h6{
  font-family:var(--font-display) !important;
  letter-spacing:-0.01em;
}

/* Display-flavoured UI pieces that are headings in practice */
.admin-page-head h1,
.bento-tile-head h2,
.detail-section h2,
.money-strip .money-label{
  font-family:var(--font-display);
}

/* The money figures keep their tabular voice: Public Sans at heavy
   weight reads cleanly at both strip and KPI sizes, and unlike the
   JetBrains Mono accents (.mono, badges) these are prose-adjacent. */
.money-strip .money-value{
  font-family:var(--font-body);
  font-variant-numeric:tabular-nums;
}

/* Mobile responsiveness guard: the fallback metrics above match the
   system stack the app already used, so breakpoints and grid math are
   unchanged; swap ensures text paints immediately on slow connections. */
@media (max-width:640px){
  h1,h2,h3{ letter-spacing:-0.005em; }
}
