/* ==========================================================================
   frontier-ds / tokens.css  (v1, 2026-10-06, Iris)
   Design tokens shared by the Frontier MVPs. Pure CSS, no JS, no inline styles,
   no external requests (fonts are self-hosted next to this file in ./fonts/).

   An app themes itself by overriding ONLY the "identity" block (see README):
     --ds-font-display, --ds-display-weight, --ds-display-stretch,
     --ds-display-tracking, --ds-accent, --ds-accent-hover, --ds-accent-soft,
     --ds-accent-soft-fg, --ds-highlight, --ds-r-md (optionally --ds-bg).
   Everything else is the system and stays the same across apps.
   ========================================================================== */

/* ---------- Self-hosted variable fonts (OFL, from @fontsource-variable) ----- */
/* Body / UI face: Public Sans (USWDS). Latin + Latin Extended (PL, DE, PT, ES). */
@font-face {
  font-family: "Public Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/public-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Public Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/public-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/public-sans-latin-ext-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Public Sans Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/public-sans-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Utility / data face: JetBrains Mono (quotes from records, CSV grids, VINs, hashes, money math). */
@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("fonts/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face { /* unhack */
  font-family: "Bricolage Grotesque Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/bricolage-grotesque-latin-ext-opsz-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/bricolage-grotesque-latin-opsz-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* ---------- Tokens ---------------------------------------------------------- */
:root {
  /* Type faces */
  --ds-font-body: "Public Sans Variable", "Public Sans", system-ui, "Segoe UI", Roboto, sans-serif;
  --ds-font-mono: "JetBrains Mono Variable", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* === IDENTITY (the ONLY block an app should override) ===================== */
  --ds-font-display: var(--ds-font-body);
  --ds-display-weight: 650;
  --ds-display-stretch: 100%;
  --ds-display-tracking: -0.02em;
  --ds-display-leading: 1.06;
  --ds-accent: #1F4E8C;            /* neutral system default; every app replaces it */
  --ds-accent-hover: #173D6E;
  --ds-accent-fg: #FFFFFF;         /* text on accent */
  --ds-accent-soft: #E8EEF7;       /* tinted surface */
  --ds-accent-soft-fg: #173D6E;    /* text on the tinted surface (AA on soft) */
  --ds-highlight: #FFF4B8;         /* evidence / target highlight */
  --ds-bg: #F6F7F9;                /* page background (apps may warm or cool it) */
  /* ======================================================================== */

  /* Colour roles (shadcn-style naming) */
  --ds-surface: #FFFFFF;
  --ds-surface-2: #F1F3F6;         /* inset surfaces: code, evidence, table heads */
  --ds-fg: #1B1F27;                /* 16.5:1 on white */
  --ds-fg-2: #3C4553;              /* leads, secondary copy (10:1) */
  --ds-muted: #5B6472;             /* captions, hints (6:1 on white, 5.6:1 on bg) */
  --ds-border: #D7DCE3;
  --ds-border-strong: #8A94A6;     /* form control borders (3:1 vs white, WCAG 1.4.11) */

  --ds-danger: #B42318;      --ds-danger-soft: #FCEBE9;   --ds-danger-fg: #8E1B12;
  --ds-warning: #8A5300;     --ds-warning-soft: #FFF1D6;  --ds-warning-fg: #6E4200;
  --ds-success: #1E6B3C;     --ds-success-soft: #E4F3E9;  --ds-success-fg: #175430;
  --ds-info: #1F4E8C;        --ds-info-soft: #E8EEF7;     --ds-info-fg: #173D6E;

  /* Severity (findings) maps onto the semantic roles so colour means one thing */
  --ds-sev-high: var(--ds-danger);     --ds-sev-high-soft: var(--ds-danger-soft);     --ds-sev-high-fg: var(--ds-danger-fg);
  --ds-sev-medium: var(--ds-warning);  --ds-sev-medium-soft: var(--ds-warning-soft);  --ds-sev-medium-fg: var(--ds-warning-fg);
  --ds-sev-low: #5B6472;               --ds-sev-low-soft: #EEF1F5;                    --ds-sev-low-fg: #3C4553;

  /* Fluid type scale (minor third-ish, clamps between 390 and 1440) */
  --ds-fs-xs: 0.875rem;                                   /* 14  captions, never smaller */
  --ds-fs-sm: 0.9375rem;                                  /* 15  hints, table cells */
  --ds-fs-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);  /* 16-17 body */
  --ds-fs-md: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem); /* 17-19 lead */
  --ds-fs-lg: clamp(1.1875rem, 1.1rem + 0.45vw, 1.375rem);/* 19-22 h3 */
  --ds-fs-xl: clamp(1.5rem, 1.35rem + 0.7vw, 1.875rem);   /* 24-30 h2 */
  --ds-fs-2xl: clamp(1.875rem, 1.6rem + 1.2vw, 2.5rem);   /* 30-40 h1 */
  --ds-fs-display: clamp(2.25rem, 1.7rem + 2.4vw, 3.625rem); /* 36-58 hero */
  --ds-fs-stat: clamp(2.5rem, 2rem + 2.4vw, 4rem);        /* 40-64 big numbers */

  --ds-lh-body: 1.55;
  --ds-lh-tight: 1.2;
  --ds-measure: 68ch;        /* body copy */
  --ds-measure-lead: 56ch;   /* lead paragraphs */

  /* 4 px spacing scale */
  --ds-sp-1: 0.25rem;   /* 4 */
  --ds-sp-2: 0.5rem;    /* 8 */
  --ds-sp-3: 0.75rem;   /* 12 */
  --ds-sp-4: 1rem;      /* 16 */
  --ds-sp-5: 1.25rem;   /* 20 */
  --ds-sp-6: 1.5rem;    /* 24 */
  --ds-sp-8: 2rem;      /* 32 */
  --ds-sp-10: 2.5rem;   /* 40 */
  --ds-sp-12: 3rem;     /* 48 */
  --ds-sp-16: 4rem;     /* 64 */
  --ds-sp-20: 5rem;     /* 80 */
  --ds-sp-24: 6rem;     /* 96 */

  /* Radii: md is the one apps may change (4 = sharper, 12 = softer) */
  --ds-r-sm: 4px;
  --ds-r-md: 8px;
  --ds-r-lg: calc(var(--ds-r-md) + 4px);
  --ds-r-xl: calc(var(--ds-r-md) + 8px);
  --ds-r-pill: 999px;

  /* Shadows (cool, low) */
  --ds-shadow-sm: 0 1px 2px rgba(27, 31, 39, 0.06), 0 1px 1px rgba(27, 31, 39, 0.04);
  --ds-shadow-md: 0 2px 6px rgba(27, 31, 39, 0.08), 0 8px 24px -12px rgba(27, 31, 39, 0.18);
  --ds-shadow-lg: 0 4px 10px rgba(27, 31, 39, 0.08), 0 24px 48px -16px rgba(27, 31, 39, 0.22);

  /* Focus ring: visible on every background, 3px, offset 2px */
  --ds-ring-width: 3px;
  --ds-ring-offset: 2px;
  --ds-ring-color: var(--ds-accent);

  /* Motion */
  --ds-dur-fast: 120ms;
  --ds-dur: 200ms;
  --ds-ease: cubic-bezier(0.2, 0, 0, 1);

  /* Layout */
  --ds-container: 72rem;    /* 1152 */
  --ds-content: 52rem;      /* reading / form column, 832 */
  --ds-gutter: var(--ds-sp-5);
  --ds-tap: 2.75rem;        /* 44 px minimum target */
  --ds-control-h: 2.75rem;  /* inputs, selects, buttons */
}

@media (min-width: 720px) {
  :root { --ds-gutter: var(--ds-sp-8); }
}

@media (prefers-reduced-motion: reduce) {
  :root { --ds-dur-fast: 0ms; --ds-dur: 0ms; }
}

/* Tokens can be flipped to dark later; not shipped in v1 (print-first, consumer forms). */
