/* ============================================================================
   FOUNDATIONS - the non-colour design tokens (V35).
   Linked after tokens.css. Colour lives in tokens.css (per-theme); THESE are
   theme-AGNOSTIC (identical in light and dark). One clean, documented layer;
   components reference these, never raw px. Full spec + snap maps:
   _docs/Design-System-V35.md. The v35 audit reports/blocks inline literals that
   bypass them. Shadows/glass stay in the shell (colour-coupled recipes).
   ============================================================================ */
:root {
  /* ---- type family -------------------------------------------------------- */
  --font-display: 'Baloo 2', sans-serif;
  --font-button: 'Baloo 2', sans-serif;
  --font-body: 'Nunito', sans-serif;

  /* ---- type scale (px) - 14 steps; every historical size snaps to one ----- */
  --fs-micro: 0.6875rem;     /* overlines, tiny chips        (was 10 / 10.5 / 11) */
  --fs-meta: 0.75rem;      /* meta, badges, durations      (was 11.5-12.8) */
  --fs-label: 0.84375rem;   /* buttons, chips, rows         (was 13 / 13.5) */
  --fs-base: 0.875rem;      /* secondary body / list labels (was 14 / 14.5) */
  --fs-body: 0.9375rem;      /* body                         (was 15 / 15.5) */
  --fs-lg: 1rem;        /* prominent body / inputs      (was 16 / 17) */
  --fs-xl: 1.125rem;        /* large labels / small titles  (was 18 / 19) */
  --fs-title: 1.25rem;     /* card / sheet / section titles(was 20 / 21) */
  --fs-h2: 1.375rem;        /* dialog / prominent titles    (was 22-26) */
  /* 2026-09-27 (founder: "tokens within 2 points of the lab font sizes"): the Login Lab
     draws at zoom 1, the app at 1.12, so a lab size L needs a token near L/1.12. Two
     headline sizes had no step within 2px on screen: lab 26-28 and lab 34-36. */
  --fs-h1: 1.5rem;          /* screen titles over a form or plan list (lab 26-28 -> 26.9 on screen) */
  --fs-hero: 1.75rem;      /* page hero titles             (was 28 / 30) */
  --fs-hero-lg: 2rem;       /* the sign-in door headline    (lab 34-36 -> 35.8 on screen) */
  --fs-stat: 2.125rem;      /* big stat numerals            (was 34 / 40) */
  --fs-display: 3.25rem;   /* splash display */
  /* banner numerals (2026-09-27, UI Lab sizes the founder approved): digits only, always in
     --font-numeral - never words */
  --fs-numeral: 2.75rem;    /* the nights on the Streak card + the Story Nights hero */
  --fs-numeral-xl: 3.875rem; /* the milestone morning numeral */

  /* ---- line-height - 6 steps --------------------------------------------- */
  --lh-none: 1;         /* single-line glyphs, stat numerals (also literal 0 for icon rows) */
  --lh-tight: 1.15;     /* headings                     (was 1.06-1.18) */
  --lh-snug: 1.25;      /* tight labels                 (was 1.2-1.25) */
  --lh-heading: 1.35;   /* multi-line headings          (was 1.3 / 1.35) */
  --lh-normal: 1.45;    /* dense body                   (was 1.4-1.45) */
  --lh-relaxed: 1.6;    /* body copy                    (was 1.5-1.6) */

  /* ---- weight scale (Baloo 400-800, Nunito 300-800) ---------------------- */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* ---- spacing rhythm - 4px grid (page gutter = --sp-4) ------------------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;

  /* ---- radius scale (px) - every historical radius snaps to one ---------- */
  --r-xs: 8px;       /* small insets                    (was 6 / 7 / 8 / 9) */
  --r-sm: 10px;      /* small cards / thumbs            (was 10) */
  --r-chip: 11px;    /* small tags / meta chips         (was 11) */
  --r-md: 12px;      /* fields / medium cards           (was 12 / 13) */
  --r-btn: 14px;     /* buttons                         (was 14 / 15) */
  --r-inset: 16px;   /* inset panels                    (was 16 / 17) */
  --r-lg: 18px;      /* large panels                    (was 18 / 19) */
  --r-field: 20px;   /* larger fields / floating pills  (was 20 / 21 / 22) */
  --r-card: 24px;    /* cards                           (was 23 / 24 / 26) */
  --r-sheet: 28px;   /* bottom sheets / modals          (was 28) */
  --r-pill: 999px;   /* fully-rounded pills             (was 999 / 9999) */

  /* ---- radius ROLES (V36, 2026-09-27) - components use THESE, not the size scale ----
     Founder: "radii properly aligned for similar type elements". One role per element kind,
     each an alias of one scale step, so a kind can never drift and a role can be retuned in one
     line. Motivating drift (rendered audit, _app/_baseline/v36-render-audit.json): cards at
     24/18/20/21, tiles at 16/18/12/14/20/24, chips at 9 (off-scale)/11/12. Concentric rule: a
     surface nested in another with padding P takes (outer - P), snapped to the scale. */
  --radius-sheet: var(--r-sheet);     /* bottom sheets, modals, full dialogs */
  --radius-card: var(--r-card);       /* cards, panels, banners, hero cards (>= ~96px tall) */
  --radius-floating: var(--r-field);  /* floating bars: nav island, mini player dock, sticky headers, toasts */
  --radius-row: var(--r-inset);       /* list rows (~56-96px tall) */
  --radius-tile: var(--r-inset);      /* story covers, content tiles */
  --radius-control: var(--r-btn);     /* non-pill buttons, segmented tracks, fields */
  /* control heights (2026-09-27, banner system): the one button's two sizes - sm meets the 44px
     tap target, md is the page's primary action */
  --control-h-sm: 44px;
  --control-h-md: 54px;
  --radius-plate: var(--r-md);        /* icon plates, small thumbs (<= ~48px) */
  --radius-chip: var(--r-chip);       /* tags, meta chips */
  --radius-pill: var(--r-pill);       /* pills, circular buttons */

  /* ---- numeral face (NUMBERS ONLY: counts, minutes, stat numerals). Words are never set in
     it (founder 2026-09-26: words in the serif read "too mature"). Loaded by the shell's font link. */
  --font-numeral: 'Fraunces', serif;

  /* ---- banner geometry (V36 banner system, promoted from the UI Lab 2026-09-27) ---- */
  --panel-h: 144px;          /* THE banner height (was the JS constant DZ_PANEL_H = 144) */
  --panel-h-tall: 188px;     /* the tall banner (Story ready, page heroes) */
  --panel-copy-w: 58%;       /* a banner's copy column */
  --stroke-hair: 1px;        /* the one border width (every card border spelled "1px" inline) */
  /* picture masks - alpha ramps, not colour (the picture keeps its colours, the card shows through) */
  --art-fade-left: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.35) 22%, #000 58%);
  --art-fade-bottom: linear-gradient(180deg, #000 0%, #000 42%, transparent 78%);
  /* a picture window whose foot meets the card's own body (the routine header, 2026-09-27): opaque for
     most of its height, then a short fall-off, so the subject stays whole and the edge never reads as a
     cut (--art-fade-bottom clears at 78%: it is for a picture the words rise out of) */
  --art-fade-foot: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);

  /* ---- motion: NOT HERE. Since 2026-09-25 every motion value (curves, durations,
     springs, the vocabulary) lives in ONE table, v36/motion-tokens.js, which
     publishes --ease-* / --dur-* and the rest as custom properties at load, so the
     app, its CSS and the Motion Lab can never disagree. (The copy that stood here
     had drifted from the engine's; its legacy aliases were unused.) */
}
