/* TAILWIND'S CASCADE-LAYER ORDER, DECLARED HERE BECAUSE THIS FILE LOADS FIRST.
   `index.html` links this stylesheet statically, so it is parsed before the bundled
   app CSS whichever way Vite injects that (a runtime <style> in dev, a <link> in the
   build). Layer order is fixed by FIRST APPEARANCE, so declaring the canonical order
   here makes it deterministic: `src/assets/tailwind.css` re-states the identical list
   and a repeated @layer statement with the same names is a no-op. Whichever file the
   browser reaches first, the order is the same one.

   It matters because of the rule below. Until 2026-09-01 the icon class was UNLAYERED,
   and unlayered CSS outranks EVERY cascade layer including `utilities` — so every
   Tailwind size utility ever written on a Material Symbol was silently discarded and
   every icon in the app rendered at 24px. 735 call sites carried a dead size utility
   (`.fleet/2026-09-01-eligibility-console/ICON-SIZE-BEFORE-AFTER.md` enumerates them).
   `!text-[N]` was the workaround people reached for; it treats a symptom per call site,
   and this is the cause. */
@layer theme, base, components, utilities;

/* Self-hosted Material Symbols Rounded (variable font: opsz, wght, FILL, GRAD).
   Replaces the render-blocking external stylesheet + third-party request to
   fonts.googleapis.com / fonts.gstatic.com — important for the PUBLIC /docs site,
   which otherwise pings Google on every load. The .woff2 is the same variable font
   Google's css2 endpoint serves; it is cached immutable by the hosting config.
   `font-display: block` keeps the icon glyphs hidden until the font loads instead of
   briefly flashing the raw ligature text (e.g. "home", "search").

   @font-face stays OUTSIDE the layer on purpose: it declares a font, it does not
   compete for a property, and layering it buys nothing while making the descriptor
   harder to find. */
@font-face {
  font-family: 'Material Symbols Rounded';
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url('/fonts/MaterialSymbols/material-symbols-rounded.woff2') format('woff2');
}

/* IN `base`, so a Tailwind size utility on the element WINS. Everything here is a
   DEFAULT for an icon that asks for nothing; a call site that asks is answered.
   Do not move this rule out of the layer — that is the defect, restored. */
@layer base {
  .material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    /* The default for an icon with no size utility. It is now a DEFAULT rather than a
       floor: `text-[16px]` on the element overrides it, which is what it always looked
       like it did. */
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    /* Pin EVERY variable axis. Without this, browsers that honor the font's fvar
       defaults (Safari/CoreText on macOS) render opsz 48 — thick, filled-looking
       glyphs at UI sizes — while Windows browsers auto-size opsz and look fine.
       To render a FILLED icon set `--msr-fill: 1` (CSS or :style) — never override
       `font-variation-settings` itself: that replaces the WHOLE axis list and
       silently drops the opsz/wght/GRAD pins (and breaks FILL transitions, which
       only interpolate between matching axis lists).

       ⚠ `opsz` STAYS PINNED AT 24 while the rendered size is now free to vary, and
       that is deliberate rather than an oversight. Optical size is a DESIGN axis, not
       a scale factor: leaving it pinned keeps every icon in the app drawn with one
       stroke weight, which is what makes a 14px icon read as the same family as a
       24px one. Letting it track font-size (`opsz: auto`) would thin the small ones
       and thicken the large ones — the exact inconsistency the pin was added to stop
       on Safari. If a very large icon ever looks under-weighted, that is a per-site
       decision about that icon, not a reason to unpin the axis globally. */
    --msr-fill: 0;
    font-variation-settings:
      'FILL' var(--msr-fill),
      'wght' 400,
      'GRAD' 0,
      'opsz' 24;
    font-feature-settings: 'liga';
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
  }
}
