/* 177X — per-product LIGHT ground.
   ===========================================================================
   HOW TO LOAD THIS — it is not unconditional.

   These selectors are `:root[data-product="…"]`, specificity 0,2,0. The dark
   surface sets the same roles on plain `:root`, 0,1,0. Higher specificity wins
   REGARDLESS of load order, so if this file is live in dark mode it keeps the
   light ground while the text stays light:

       Paper text on Galvanised = 1.01:1.  Invisible.

   That shipped to coil.177x.ai and was caught by a human looking at the screen,
   not by any check here — the canon measured clean because each file is correct
   in isolation; only the composition fails.

     · A product with AUTO DARK (Coil) must load this light-only:
           <link rel="stylesheet" href="ground-per-product.css"
                 media="(prefers-color-scheme: light)">

     · A product that is LIGHT ON BOTH surfaces (Diamond, per its DESIGN-SPEC)
       loads it unconditionally — it never wants the dark ground at all.
   =========================================================================== */

/* Original note follows.
   Decided 2026-08-03. Supersedes the single Paper ground for these two products.

   WHY THIS EXISTS
   Paper #F3F2EA is hue 53. Voltage is hue 74. Twenty-one degrees apart means the
   accent has no hue distance to travel, so it stops behaving like an accent —
   which is what reads as "sand". Cooling the ground fixes it WITHOUT touching
   Voltage, Voltage Deep, Ink, or anything on the dark surface.

   Polarity is already per-product (BRAND.md). Ground now is too, for the same
   reason: the products are made of different material.

     Coil    dark text on white cards. BONE — a cool near-white, so Voltage
             reads as hi-vis rather than as highlighter on newsprint.
             This ground sits only five values below its own surface, so the
             card edge does NOT come from tone: it comes from
             --x-elevation-raised, applied in the consumer. Anything that
             restores separation by darkening this value is undoing the
             change on purpose — see the Coil block below.
     Diamond tinted role blocks on a grid, for CAR WASHES — cleanliness is the
             product, so the ground must read spotless. CHALK, since 2026-08-07:
             a neutral near-white that a card can actually sit ON. Diamond is
             the one product here that wants the ground to READ as a ground, so
             the Coil block's warning below does not apply to it.

   Rattle keeps Paper: client audit reports should stay warm on paper.
   Strike and any dark-polarity product are unaffected.

   ---------------------------------------------------------------------------
   MEASURED — but no longer here.

   This block used to carry a hand-typed table of Coil's and Diamond's figures.
   It is gone because it was hand-typed: every number in it moved when a ground
   moved, and nothing failed when they were not updated.

   `scripts/contrast.py` now composes this file into each product's stack, so
   those numbers are generated. Run it after any change here:

       python3 scripts/contrast.py --check    # CI; exits 1 on a failure
       python3 scripts/contrast.py --write    # regenerate CONTRAST.md

   Until 2026-08-04 the checker did not read this file at all, which meant Coil
   and Diamond were measured against Paper while rendering on their own grounds.
   That was survivable only because both were near Paper in value.

   --x-label is the CORRECTED value #676A71, not brand Graphite #6E7178.
   Graphite is 4.35:1 on Paper at 9-11px and worse as the ground cools; it fails
   AA as small text on every ground including the one it shipped on. Brand
   Graphite remains a palette constant for the lockup by-line. See BRAND-FIXES.md.
*/

/* ---------------------------------------------------------------- coil ---- */
/* BONE. Owner-approved 2026-08-04, replacing Galvanised #F0F3F5.

   WHY. A warm off-white behind Voltage makes the lime read as highlighter on
   newsprint rather than as hi-vis. Bone is cooler and lighter, so the accent
   stops competing with the ground and carries all the personality.

   THE TRADE-OFF, STATED PLAINLY, because it is the thing a future reader will
   otherwise try to "fix". Bone sits five values below its own surface —
   1.04:1 field-to-card against Galvanised's 1.06 — so a card edge gets almost
   nothing from tone. Separation therefore comes from --x-elevation-raised,
   which house/tokens.css already defines and surface-dark.css already nulls,
   applied to card surfaces IN THE CONSUMER.

   Do not restore separation by darkening this ground, thickening --x-rule, or
   adding a new rule role. Any of those undoes the change this block exists to
   make, and the rules are decorative by design (see surface-light.css) — a
   card edge is structure, not a control boundary, and is allowed to be quiet.

   Measured: nothing here is asserted. contrast.py composes this file into
   Coil's stack, so `--check` covers this ground rather than Paper. */
[data-product="coil"]:root,
:root[data-product="coil"] {
  --x-ground:      #FAFAF9;   /* Bone — the field      (was #F0F3F5)         */
  --x-surface:     #FCFCFB;   /* cards, table body     (was #F8FAFB)         */
  --x-surface-2:   #FFFFFF;   /* inner panel           (unchanged)           */
  --x-rule:        rgba(11, 11, 13, .10);
  --x-rule-strong: rgba(11, 11, 13, .18);
}

/* ------------------------------------------------------------- diamond ---- */
/* CHALK. Owner-approved 2026-08-07, replacing Rinse #F4F9FA.

   READ THE COIL BLOCK ABOVE FIRST, then read this, because they now say
   opposite things and that is deliberate. Coil's whole point is a near-white
   field, so darkening its ground to win card separation undoes the change.
   Diamond's point is not a near-white field. For Diamond, SEPARATION IS THE
   GOAL — this is a change of intent, not a tweak to a number, and the warning
   above is about Coil.

   WHY. Rinse sat 1.06:1 from the white a card is drawn on. A ground a reader
   cannot distinguish from the thing sitting on it is not a ground; it is a
   background colour that happens to differ. Cards therefore had to earn their
   edges from --x-elevation-raised, which is a shadow standing in for a tone
   relationship the palette should have supplied.

   MEASURED, ground against the white cards actually use (--x-surface-2):

       Rinse #F4F9FA ....... 1.062:1     Chalk #F1F2F3 ....... 1.121:1

   Roughly double, and enough to hold a card with no shadow at all. Against the
   middle role --x-surface the same move reads 1.040 -> 1.063.

   WHAT IT COSTS. Ink on the ground drops from 18.52:1 to 17.54:1 — still the
   third-highest figure in the system and 3.9x the AA threshold. That is the
   entire price.

   WHAT IT BUYS BEYOND SEPARATION. Chalk sits at OKLCH chroma 0.0017, against
   Rinse's 0.0055 and Paper's 0.0107 — near enough to neutral that Voltage
   becomes the only chromatic thing on the screen. That is a stronger position
   for an accent than being 116 degrees away from a tint of itself.

   A LIMER GROUND WAS CONSIDERED AND REJECTED ON MEASUREMENT, not on taste: a
   lime tint lands at hue 73 against Voltage's 74 (HSL, the units this file uses
   throughout). That is the "sand" problem the per-product grounds exist to
   escape — Paper's 53 against 74 was already too close at 21 degrees apart, and
   one degree apart is that failure taken to its limit.

   The earlier note here recorded that a BRIGHTER ground separates the tinted
   role blocks better — measured fill-vs-ground 1.20 on Rinse against 1.05 on a
   slate ground, with detailing vanishing entirely at 1.00. That measurement
   still stands and Chalk does not undo it: Chalk is a neutral near-white, not a
   slate, and the blocks keep --x-block-border regardless. The border was the
   fix for the blocks; the ground was never it. */
[data-product="diamond"]:root,
:root[data-product="diamond"] {
  --x-ground:      #F1F2F3;   /* Chalk — the field     (was Rinse #F4F9FA)   */
  --x-surface:     #F8F9F9;   /* cards, table body     (was #FBFDFD)         */
  --x-surface-2:   #FFFFFF;   /* inner panel           (unchanged)           */
  --x-rule:        rgba(11, 11, 13, .10);
  --x-rule-strong: rgba(11, 11, 13, .18);

  /* The separation fix. Applies at any ground; belongs in the fourth tier. */
  --x-block-border: 1.5px;
}

/* --------------------------------------------------------------- track ---- */
/* BONE, at Coil's values. Proposed 2026-08-12; owner review is the PR that
   carries this block. Track (then named Intake) had no block here and fell
   through to Paper.

   READ THE COIL BLOCK ABOVE — this is that decision applied to a second
   product, not a new one. Same argument, and it lands harder here: Track
   spends its single volt on one headline clause and one send button, so a
   ground that mutes the accent wastes both of the two places it appears.

   THE VALUES ARE COIL'S ON PURPOSE. Track and Coil are the same material —
   dark text on a near-white document surface — and a third near-white would be
   drift rather than a decision. If Bone is ever re-tuned, both move together.

   THE TRADE-OFF IS COIL'S TOO, so the Coil block's warning applies here
   verbatim and Diamond's does not: Bone sits five values below its own
   surface, the card edge comes from --x-elevation-raised in the consumer, and
   restoring separation by darkening this ground, thickening --x-rule or adding
   a rule role undoes the change on purpose.

   NO --x-rule / --x-rule-strong LINES, unlike Coil and Diamond. Both siblings
   restate the light-surface defaults unchanged; Track wants those defaults, so
   it inherits them rather than pinning a second copy. Deliberate, not an
   omission.

   LOADED UNCONDITIONALLY, not behind a media query. Track is light on both
   surfaces — respondents are a client's own customers reading a long document
   and there is no dark mode — so it is in Diamond's category, not Coil's. See
   the header of this file for why that distinction is the one that shipped an
   invisible screen.

   Measured: nothing here is asserted. contrast.py composes this file into
   Track's stack, so `--check` covers Bone rather than Paper. */
[data-product="track"]:root,
:root[data-product="track"] {
  --x-ground:      #FAFAF9;   /* Bone — the page       (was Paper #F3F2EA)   */
  --x-surface:     #FCFCFB;   /* panels, cards                               */
  --x-surface-2:   #FFFFFF;   /* inner panel, field fill                     */
}

/* Anything without a product attribute keeps Paper. Do not change that
   default — it is what Rattle and the house site rely on. */
