/* ============================================================================
   SHINOME DESIGN SYSTEM v3 · TOKENS (Phase 1 draft, 2026-08-14)
   東雲 · the stamp language. Aged paper, committed inks, numerals, frames.

   Every color below is PIXEL-SAMPLED from the 7 stamps in
   moodboard/Timbres/ (exposure-normalized so each stamp's paper reads as
   true aged paper, hue ratios preserved). No eyeballed hexes.

   Sources:
   - night blue  → Mexico Tonanzintla 1942 (#1a2d46 core, #101b2b raw depth)
                   + USSR 1985 space (slate #5c829a engraving)
   - brass/gold  → Japan Nippon radio 1977 (#bf8848 lit, #844a2c bronze)
   - carmine     → Mexico Aeroméxico (#bd4360) + Jaipur peacock
   - amethyst    → DPR Korea 1995 (#8b649f) · the v2 mauve soul, surviving
   - plum        → Aeroméxico secondary ink (#58344f)
   - paper       → median of the 7 papers, warm cluster (#eee6dc)

   Two skies, restated in stamp language:
   - PAPER (client-facing default): aged paper ground, night-blue ink voice.
   - NIGHT INK (coach cockpit): the same stamp printed in negative · night
     ground, paper text. DS v2 dark survives here.

   Ink pair rule (Phase 1 proposal, pending approval):
   NIGHT BLUE + GOLD are the pair. CARMINE is the rare accent (one per
   artifact max). Amethyst = heritage accent, client-jewel duty. Never more
   than two inks + one accent on one surface.
   ========================================================================== */

:root {
  /* --- type roles ------------------------------------------------------- */
  /* INTERNAL voice (coach docs, cockpit, specimens) · locked 2026-08-18 */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif; /* engraved display, opsz 9-144 */
  --font-body: "Satoshi", "Clash Grotesk", sans-serif;           /* R3 vote 2026-08-05 */
  --font-numeral: "Space Mono", ui-monospace, monospace;          /* denominations, data, captions */
  --font-kanji: "Noto Sans JP", var(--font-body);                 /* 東雲 only */
  /* RULE: any aligned column of numbers renders in --font-numeral.
     Clash Grotesk and General Sans have NO tabular figures (verified 2026-08-05). */

  /* SALES voice (sales page, client-facing web) · voted 2026-08-23 on
     pair.html, approved 2026-08-25 on the full sales.html mock.
     Cormorant loads WEIGHT 600 ONLY (display duty, never body). */
  --font-display-sales: "Cormorant", "Iowan Old Style", Georgia, serif; /* 600 only */
  --font-body-sales: "Satoshi", "Clash Grotesk", sans-serif;            /* shared with internal */
  --font-numeral-sales: "DM Sans", var(--font-body-sales);              /* clean figures, tabular-nums for columns */
  /* PRICE BOX rule (locked 2026-08-23, applies EVERYWHERE, any surface):
     label/subline = Satoshi · the price figure = JetBrains Mono. */
  --font-price: "JetBrains Mono", ui-monospace, monospace;

  /* type scale · stamp proportions: big numeral, small caps captions */
  --text-nano: 10.5px;
  --text-micro: 12px;
  --text-small: 13.5px;
  --text-body: 15px;
  --text-lede: 17px;
  --text-h3: 21px;
  --text-h2: 27px;
  --text-h1: clamp(34px, 5vw, 44px);
  --text-denom: clamp(48px, 8vw, 72px); /* the stamp denomination slot */

  --track-caps: 0.12em;   /* ONE tracking for text (X6 ceiling) · wordmark lockup exempt */
  --leading-body: 1.6;

  /* --- space / radius / borders ---------------------------------------- */
  /* six stops (B8) · adding one means removing one */
  --sp-1: 8px;  --sp-2: 12px; --sp-3: 16px;
  --sp-4: 24px; --sp-5: 32px; --sp-6: 48px;
  --r-sm: 2px;   /* stamps are square-cornered; radius is near-zero */
  --r-frame: 4px;
  --border-w: 1px;
  --border-w-frame: 2px;
}

/* ---------------------------------------------------------------------------
   PAPER · the client-facing default. Aged paper, night-blue ink.
   -------------------------------------------------------------------------- */
:root,
:root[data-theme="paper"] {
  color-scheme: light;

  --bg: #eee6dc;            /* aged paper (sampled median) */
  --bg-deep: #e4d9c7;       /* shadowed paper, wells, table stripes */
  --surface: #f4eee6;       /* raised paper card */
  --line: #d5c9b4;          /* frame hairlines */
  --line-strong: #b9a98d;   /* frame borders */

  --ink: #1a2d46;           /* night blue · THE ink */
  --ink-2: #3c4d63;         /* secondary text */
  --muted: #4f5b6e;         /* recessive text, 5.1:1 on paper (reviewer-fixed 2026-08-14) */
  --ink-inverse: #eee6dc;   /* text on ink fills */

  /* F1: PAPER CARRIES NO GOLD. Numerals and seals on paper print in ink.
     Gold exists only in the night theme below. */
  --carmine: #bd4360;       /* rare accent · fills, chips, large numerals · never sentences */
  --accent-text: #58344f;   /* PRUNE is the second text ink on paper (Jérôme, 2026-08-18) · 9.7:1 */
  --amethyst: #b6a6cd;      /* P2 locked 2026-08-16 · 3.84:1 on paper: seals/fills only, never sentences */
  --plum: #58344f;          /* deep support ink = --accent-text */
  --slate: #46617a;         /* engraved shading lines */

  --ok: #3d6b4f;
  --warn: #8a6116;
  --danger: #a53c50;

  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink);
  --scrim: rgb(26 45 70 / 0.5);
}

/* ---------------------------------------------------------------------------
   NIGHT INK · the coach cockpit. The stamp printed in negative.
   -------------------------------------------------------------------------- */
:root[data-theme="night"] {
  color-scheme: dark;

  --bg: #101b2b;            /* Tonanzintla night, unnormalized depth */
  --bg-deep: #0a1220;
  --surface: #16233a;
  --line: #24344d;
  --line-strong: #3a4d6b;

  --ink: #eee6dc;           /* paper becomes the ink */
  --ink-2: #c3bfb2;
  --muted: #8d94a6;
  --ink-inverse: #101b2b;

  --gold: #bf8848;          /* brass · night only: big numerals, seals, borders */
  --brass: #d8a25e;         /* lifted brass, night hover/highlight */
  --carmine: #d16a82;       /* lifted to read on night */
  --amethyst: #b6a6cd;      /* P2, same value both skies */
  --plum: #8f6a85;          /* 3.76:1 on night · fills and large glyphs only, never text */
  --slate: #5c829a;         /* USSR engraving slate · 4.21:1: hatching and lines, not small text */
  --slate-lift: #8ec5e3;    /* lifted slate · the lit chart window only (x5-asset), ruled 03.09.2026 (Q): the dawn line's mid-tone. Never UI, never text. */
  --slate-mid: #75a4bf;     /* the dawn line's blue, chart window only (x5-asset). Ruled 07.09.2026 (C): slate-lift was too bright against the brass. */
  --dawn-pale: #a8adad;     /* the dawn line's pale stop, chart window only (x5-asset), ruled 07.09.2026 (C). Never UI, never text. */

  --ok: #85d9ac;
  --warn: #eac57e;
  --danger: #f2939f;

  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--brass);
  --scrim: rgb(5 9 16 / 0.72);
}

/* ---------------------------------------------------------------------------
   PHASE 2 NOTE · stamp perforations must be PUNCHED (mask-image with
   transparent holes), never painted in the backdrop color: painted holes
   break the moment the stamp sits on any other ground, and a rectangular
   box-shadow betrays the scalloped silhouette. Until the mask component
   exists, drive hole color via a --punch variable set by the ground.

   TEXTURE · aged paper grain (verified-visible recipes, R5 2026-08-12)
   paper: black noise, multiply, alpha .07 (ruled 07.09.2026, ballot /grain, C2).
   night: white noise, alpha .10, the chart window ONLY (x5-asset): a rect with
   this filter right above the night ground, under the light and the curve.
   Apply the paper grain as a ::after overlay on the page ground, never on text
   containers. The night sheet outside the window carries no grain of its own.
   -------------------------------------------------------------------------- */
:root {
  --grain-paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-night: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.10 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
