/* ============================================================================
   audora.css — the shared visual foundation.
   Tokens live in tokens.css (imported below) — that file, not this one, is
   what the app imports (docs/handoff/12-frontend.md §3): this file also
   carries www's own base/reset rules (a zero-JS static site needs a full
   reset; the app already has Tailwind's preflight for that), which the app
   has no reason to take on. build-www.mjs resolves this @import before
   inlining, so splitting the file costs www nothing at runtime — same
   bytes land in the page either way.
   ========================================================================== */

/* ============================================================================
   tokens.css — the shared token vocabulary. THE single source of truth for
   both surfaces (docs/handoff/12-frontend.md §3): audora.css @imports this
   for www (build-www.mjs resolves the import before inlining, so this stays
   zero-cost for www — no extra request, byte-identical output); the app
   imports it directly into src/index.css, deliberately bypassing audora.css's
   own base/reset rules below this file's sibling — those are www's own
   concern (a zero-JS static site needs a full reset; the app already has
   Tailwind's preflight + shadcn component styles for that job).
   Spacing and time are the same Fibonacci series; the maths adds up.
   ========================================================================== */

/* -- the two faces, served from our own origin ---------------------------
   Archivo 800 (headline register) and IBM Plex Mono 400/500/600/700 (mono and
   label), one file per weight per script, split by unicode-range so a page
   only downloads the scripts it actually prints. They were a Google Fonts
   stylesheet until 2026-09-24: that stylesheet blocked rendering on every www
   page (~0.8–1.8 s of mobile first paint in Lighthouse) and opened two extra
   origins before any text could show. Files are public/fonts/, SIL OFL 1.1
   (public/fonts/OFL.txt). A new weight means a new file here AND a new rule —
   a weight that is not listed gets a browser-synthesised one. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/archivo-800-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/archivo-800-latin-ext.woff2") format("woff2");
  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: "Archivo";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/archivo-800-latin.woff2") format("woff2");
  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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2");
  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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-latin-ext.woff2") format("woff2");
  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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-600-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-600-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-600-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-600-latin-ext.woff2") format("woff2");
  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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-600-latin.woff2") format("woff2");
  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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-700-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-700-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-700-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-700-latin-ext.woff2") format("woff2");
  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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-700-latin.woff2") format("woff2");
  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;
}

:root {
  /* -- the scale: space ------------------------------------------------- */
  --u1: 8px;
  --u2: 13px;
  --u3: 21px;
  --u4: 34px;
  --u5: 55px;
  --u6: 89px;

  /* -- the scale: time (docs/handoff/14-motion.md) ----------------------- */
  --t-1: 89ms;
  --t-2: 144ms;
  --t-3: 233ms;
  --t-4: 377ms;
  --t-5: 610ms;
  --e-in:  cubic-bezier(0, 0, 0.38, 0.9);
  --e-std: cubic-bezier(0.2, 0, 0.38, 0.9);
  --e-out: cubic-bezier(0.2, 0, 1, 0.9);

  /* -- colour ------------------------------------------------------------ */
  --paper: #EAE8E3;   /* ground */
  --card:  #F2F1ED;   /* raised surface */
  --ink:   #0C0C0E;   /* text, rules, chassis */
  --dim:   #4E5259;   /* secondary text */
  --faint: #67665F;   /* metadata at rest — AA on paper and card */
  --seam:  #C3C1BA;   /* hairline rules */
  --acc:   #D22910;   /* signal red — surfaces/chips; white text passes on it */
  --acc-text: #C22408; /* signal red as TEXT on paper/card — AA-passing */

  /* fixed status palette — never derived from artwork, never the accent */
  --st-warn: #B4520F;

  /* Same primitives, as bare H S L components — Tailwind's hsl(var(--x))
     convention (and its /alpha opacity modifiers) need the numbers, not a
     hex or a wrapped hsl(). The app maps these into its own semantic names
     (--background, --foreground, …) and extends with app-only tiers
     (card/popover/sidebar/charts) that have no www equivalent. Extending,
     not redefining — the app's --warning is intentionally its own value,
     independently contrast-verified against app surfaces; --st-warn above
     is the www one. Regenerate with `node -e` hex→HSL if a hex above changes. */
  --paper-hsl: 43 14% 90%;
  --card-hsl: 48 16% 94%;
  --ink-hsl: 240 8% 5%;
  --dim-hsl: 218 7% 33%;
  --faint-hsl: 53 4% 39%;
  --seam-hsl: 47 7% 75%;
  --acc-hsl: 8 86% 44%;
  --acc-text-hsl: 9 92% 40%;
  --st-warn-hsl: 24 85% 38%;

  /* -- type -------------------------------------------------------------- */
  --face: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
          Arial, sans-serif;
  /* Headline register only (weight 800, uppercase, tight tracking) —
     docs/handoff/12-frontend.md §4. Body copy stays on --face. */
  --face-display: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI",
                  "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo,
          Consolas, monospace;

  /* -- layout ------------------------------------------------------------ */
  --maxw: 1152px;                              /* 8 × 144 */
  --pad:  clamp(var(--u3), 4vw, var(--u5));
  --edge: max(var(--pad), calc((100vw - var(--maxw)) / 2));
}


/* -- base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--face);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* zero-specificity reset: class rules always win (the Prism lesson) */
:where(p, h1, h2, h3, h4, h5, h6, ul, ol, figure, table, blockquote) { margin: 0; }
:where(ul, ol) { padding: 0; list-style: none; }
:where(img, svg, video) { display: block; max-width: 100%; height: auto; }
/* <picture> only chooses the file (scripts/www-webp.mjs); it must not be a box,
   or an <img> sized against its container (.mx .bg) sizes against it instead. */
:where(picture) { display: contents; }
:where(a) { color: inherit; text-decoration: none; }
:where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(table) { border-collapse: collapse; }

/* focus is never invisible */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
