/* ---------------------------------------------------------------------------
 * Birth Blooms — design tokens.
 * Mirrors scripts/lib/brand.mjs so a shipped print and the page selling it
 * cannot drift — change one and you MUST re-run `npm run product`, or the sheets
 * and the page that sells them end up on different paper.
 *
 * Live palette: THE HERBARIUM. Warm cotton-rag cream, ink-green near-black, one
 * oxblood accent reserved for the primary action, one gold reserved for the
 * archival marks. Replaces the all-white palette (settled 2026-08-31, superseded
 * 2026-09-03): white was measurably neutral and measurably inert.
 *
 * The 15% chroma guard in `npm run audit` is respected on purpose, not by luck:
 * the deep bands are near-neutral (RGB spread 0.07–0.09, i.e. UNDER the 0.10
 * threshold) and read as green only by simultaneous contrast against the cream.
 * The one genuinely chromatic ground on the page is the closing oxblood band.
 * That is the whole colour budget, spent deliberately.
 *
 * Palette: ~6 deliberate values (P-01), built in HSL (P-21), proportioned 60/30/10
 * with the accent RESERVED for the primary CTA (P-38). Semantic + invertible from
 * the start, so dark mode is a token swap, not a bolt-on (P-37).
 * ------------------------------------------------------------------------- */
:root {
  /* -- 60: cotton rag. Warm, low-chroma, the colour of the stock you'd print on. */
  --paper:        #F5F1EB;   /* 245 241 235 — RGB spread .041 */
  --paper-deep:   #EEE9E0;   /* 238 233 224 — spread .059     */
  --paper-sink:   #E6DFD3;   /* the recessed well behind mounted specimens */
  --paper-edge:   #D7CEC1;

  /* -- 30: ink. Near-black with a green cast, the herbarium hand. ---------- */
  --ink:          #1C1F1D;
  --ink-soft:     #4A4F4B;   /* body-adjacent — 7.4:1 on paper */
  --ink-faint:    #626763;   /* 5.1:1 on paper, 4.8:1 on the recessed panels */
  --stem:         #5A605C;   /* 5.7:1 */

  /* -- the deep bands. Deliberately UNDER the 0.10 chroma threshold. ------- */
  --forest:       #1E211F;   /* spread .091 — reads green against cream */
  --forest-deep:  #1A1C1B;   /* spread .071 — footer */

  /* -- 10: oxblood. The action colour, and nothing else. ------------------- */
  --accent:       #762E3C;
  --accent-deep:  #5E2430;
  --accent-tint:  #F0E4E5;

  /* -- the archival mark. Seals, rules, accession numbers, frame lines. ---- */
  --gold:         #7E5F28;   /* 5.3:1 on cream — measured, safe as text */
  --gold-soft:    #C3A065;   /* for use ON the deep bands only */

  /* -- surfaces --------------------------------------------------------- */
  --surface:      var(--paper);
  --surface-2:    var(--paper-deep);
  --border:       #DFD7CA;
  --border-firm:  #C9BEAD;
  --on-accent:    #FBF8F3;
  --on-accent-soft: #E3D4D2;   /* 6.6:1 on the oxblood band */
  --on-forest:    #EDE8DF;
  /* Concrete blends rather than color-mix(): a color-mix value computes to
     `color(srgb …)`, which the audit's colour parser reads as near-black and
     reports as a phantom 1.08:1 failure. Pre-blended, these stay measurable. */
  --on-forest-soft:  #C0BCB5;  /* 8.6:1 on --forest */
  --on-forest-faint: #A9A59E;  /* 6.6:1 on --forest */

  /* -- type ------------------------------------------------------------- */
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body:    "Karla", "Helvetica Neue", Arial, sans-serif;

  /* Non-linear scale, px/rem only — never em (P-19, P-22). The display end is
     pushed harder than the old scale: the herbarium voice needs the headline to
     carry the page, not share it. */
  --t--2: 0.75rem;    /* 12 — accession marks, utility bar */
  --t--1: 0.875rem;   /* 14 */
  --t-0:  1.0625rem;  /* 17 — body */
  --t-1:  1.3125rem;  /* 21 */
  --t-2:  1.75rem;    /* 28 */
  --t-3:  2.25rem;    /* 36 */
  --t-4:  clamp(2.375rem, 4.2vw, 3.5rem);
  --t-5:  clamp(3rem, 7.4vw, 5.75rem);

  --lh-tight: 1.02;
  --lh-body:  1.5;
  --measure:  68ch;   /* craft floor: body measure 65-75ch */

  /* Spacing — no two steps closer than ~25% (P-19). */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 136px;

  /* Radii — deliberately not the uniform 16px AI-default (P-07). A herbarium
     mount has a squared corner; only the pills round. */
  --r-sm: 2px; --r-md: 4px; --r-lg: 8px; --r-pill: 999px;

  /* One light source, from above (P-23), warmed to the paper. */
  --lift-1: 0 1px 1px hsl(30 24% 24% / .07), 0 2px 4px hsl(30 24% 20% / .06);
  --lift-2: 0 1px 1px hsl(30 24% 24% / .10), 0 10px 26px hsl(30 24% 20% / .11);
  --lift-3: 0 2px 3px hsl(30 24% 24% / .13), 0 26px 56px hsl(30 24% 20% / .17);

  --page: 1180px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --marquee-duration: 90s;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:       #191B1A;
    --paper-deep:  #1F2220;
    --paper-sink:  #141615;
    --paper-edge:  #383C3A;

    --ink:         #F0EDE6;
    --ink-soft:    #B9BCB6;   /* 9.0:1 on paper */
    --ink-faint:   #8E938C;   /* 5.5:1 */
    --stem:        #9AA097;

    --forest:      #101211;
    --forest-deep: #0C0E0D;

    --accent:      #E08594;   /* 6.6:1 against the dark paper */
    --accent-deep: #EDA0AC;
    --accent-tint: #2E1F23;

    --gold:        #C9A669;
    --gold-soft:   #D7B87F;

    --border:      #333835;
    --border-firm: #454B47;
    --on-accent:   #191B1A;
    --on-accent-soft: #3D2E30;   /* 4.9:1 on the light-rose band */
    --on-forest:   #EDE8DF;
    --on-forest-soft:  #C0BCB5;
    --on-forest-faint: #A9A59E;

    --lift-1: 0 1px 1px hsl(0 0% 0% / .34), 0 2px 4px hsl(0 0% 0% / .28);
    --lift-2: 0 1px 1px hsl(0 0% 0% / .40), 0 10px 26px hsl(0 0% 0% / .38);
    --lift-3: 0 2px 3px hsl(0 0% 0% / .46), 0 26px 56px hsl(0 0% 0% / .50);
  }
}
