/* ==========================================================================
   TOKENS — DIRECTION.md §4.3, §4.4, §5
   --------------------------------------------------------------------------
   This file is a translation of the settled palette and type call, not a
   generated token system. Every hex below is copied from a table in
   DIRECTION.md §4.3 or §4.4.

   The semantic scale (§4.5) is deliberately NOT in this file. It is scoped to
   the report component in report.css, because §4.2 locks semantic color to
   audit output only and validator check 3 asserts those hexes appear nowhere
   else. Same rule in reverse: the accent tokens below never enter report.css
   (check 4).
   ========================================================================== */

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-var.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* §5.6: IBM Plex Mono has no variable version, so every weight is a file.
   Two weights ship. Regular for readout body, SemiBold for numerals and
   status words. Validator check 13. */
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* --- Neutrals, light mode (§4.3) ------------------------------------- */
  --field: #e8e9ee;
  --sheet: #f5f6f9;
  --rule: #d2d5de;
  --border: #7e8595;
  --ink-muted: #565c6b;
  --ink: #14161e;

  /* --- Accent, light mode (§4.4) ---------------------------------------- */
  --accent: #2233cc;
  --accent-deep: #1a28a6;
  --accent-text: #2233cc;
  --accent-tint: #dcdffa;

  /* Label on an accent fill. Light mode uses the sheet value, 8.05:1 against
     the fill. No pure white anywhere (§4.3). */
  --on-accent: #f5f6f9;

  /* --- Type (§5.1) ------------------------------------------------------- */
  --font-sans: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* --- Scale (§5.4) ------------------------------------------------------ */
  --t-display: clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem);
  --t-h2: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --t-h3: 1.0625rem;
  --t-body: 1rem;
  --t-small: 0.875rem;
  --t-mono-body: 0.875rem;
  --t-mono-label: 0.75rem;
  --t-score: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem);
  --t-subject: clamp(1.375rem, 0.9rem + 2vw, 2.25rem);

  /* --- Space ------------------------------------------------------------- */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --s-9: 7rem;

  --measure: 62ch;
  --page-max: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* --- Neutrals, dark mode (§4.3) -------------------------------------- */
    --field: #0f1116;
    --sheet: #171a21;
    --rule: #2a2f3a;
    --border: #6e7688;
    --ink-muted: #9aa1af;
    --ink: #e6e8ee;

    /* --- Accent, dark mode (§4.4) ---------------------------------------- */
    --accent: #5468f5;
    --accent-deep: #4055e8;
    --accent-text: #93a0ff;
    --accent-tint: #1e2440;

    /* §4.4: the dark accent is "fine as a fill behind a dark label". The
       label takes the field value, the darkest ink available, 4.21:1 on the
       fill. Below AA for normal text, which is why the one place this pair
       appears (the primary button) sets its label at 19px/700 and so clears
       the large-text threshold at 3:1. */
    --on-accent: #0f1116;
  }
}
