/* LAWS:
   - one token per SURFACE decision; never a component rule, never a selector but :root
   - a theme may move anything in here and nothing outside it
   - values are moved, never rewritten: the default (`night`) render must stay byte-identical
   History: NOTES.md */

/* ── THE SEMANTIC TIER ──────────────────────────────────────────────────────────────────────────
   88 of the 105 :root properties, MOVED here byte-for-byte from index.html's inline sheet. These
   are the ones a palette block re-decides: `night` (the absence of a data-theme attribute) is what
   this file declares, and day · paper · midnight override from here down (rockpool did, until it retired 2026-11-11).
   The html[data-theme] blocks themselves stay in index.html for now — folding them is Stage 4. */
:root{
  /* night sky ramp */
  --bg:#070b1e; --bg2:#101736; --card:#1b2450; --card2:#232e63; --ink:#f4f6ff; --mut:#a3b0e8;
  /* the family palette that a look re-hues (the lantern golds are raw and stay put) */
  --green:#7ce38b; --cyan:#6be7ff;
  /* how a painted stamp (ui/kit/stamps.js, §58.1) meets the card under it: on a light card it is ink multiplied into
     the paper; on a dark card a multiply would turn the ink near-black, so the night looks draw it plainly */
  --stamp-blend:normal; --stamp-ink:1; --stamp-lift:brightness(1.5);
  /* --line is EVERY component boundary in the app: the only text input, the Word Forge drop slots,
     the sort piles, the card edges. At #3a45a0 it computed 1.79:1 on card and was, for a good number
     of people, simply not there (M22). #5866c8 clears the 3:1 WCAG 1.4.11 bar for a UI boundary while
     staying a blue that belongs to this night sky. The value is MEASURED, not chosen: #5866c8 (the
     first candidate) computes 2.71:1 against the card's lighter top stop and so still misses. */
  --tile:#2b3775; --tileOn:#3d4d9e; --line:#6c79cb;

  /* ── THE THEME SURFACE (2026-08-09) ─────────────────────────────────────────────────────────
     "The same book at different hours." Everything below holds the EXACT literal it replaced in the
     sheet, so the default render — `night` — is byte-for-byte what it was before tokenisation; the
     html[data-theme] blocks near the bottom of index.html are the only thing that moves them.
     THREE RULES that are easy to break later:
     ① Two surfaces that happen to share a hex today get TWO tokens (--cardLo/--stepBg/--chipBg are
        all #141b46). A theme moves a SURFACE, not a colour, and day proves it: the card goes warm
        paper while the journey step goes cool slate.
     ② Gold-as-FILL and gold-as-TEXT are different jobs. --gold/--goldD/--goldL never move — the
        lantern is the brand, and it is raw. --goldInk is the one a light theme has to darken,
        because #ffd166 type on warm paper measures 1.4:1.
     ③ The rgb TRIPLET tokens (--mutRGB/--greenRGB/--cyanRGB/--faceLight/--faceDark) exist so a
        theme can move a colour that is used at several different alphas without inventing a token
        per alpha. They are `r,g,b` and are consumed as rgba(var(--x),.55).
     Parchment, the certificate, the print block and the tester/storage chrome are DELIBERATELY not
     in here: the warm beats are the same warm beats at every hour, and a safety rail should not be
     restyleable. */
  /* raised panels */
  --cardHi:#1e2765; --cardLo:#141b46;                /* .card gradient ends (mid stop = --card) */
  --panelHi:#242e70; --panelLo:#161d4c;              /* .prof · .doorbtn · .sitem · #jhere */
  --weekHi:#212b68; --weekLo:#161d4c;                /* #weekcard — a shade off panel on purpose */
  --launchHi:#2b3a86; --launchLo:#1b2560;            /* the grown-up's offer */
  /* the tile family: typing tiles, keycaps, sort chips */
  --tileHi:#414ead; --tileLo:#2b3775; --tileEdge:#1a2352;
  --tileInk:#fff;                                    /* letters ON a tile — day flips this dark */
  --tileRing:#38439b;                                /* the ghost/extra tile's 1-2px inner ring */
  --tileHovHi:#4a58c2; --tileHovLo:#333f8a;          /* .kb-k:hover */
  --fnHi:#2c3570; --fnLo:#1e2554; --fnEdge:#141a3c;  /* the board's function keys */
  --okHi:#41b473; --okLo:#1f6b46; --okEdge:#124c30;  /* a letter already got right */
  --tileDimHi:#2a3266; --tileDimLo:#1c2247; --tileDimEdge:#141a3c;   /* the extra-letter tile */
  /* the second button + the grapheme bricks */
  --btn2Hi:#3d4aa6; --btn2Lo:#2a3477; --btn2Edge:#1b2358;
  --chunkHi:#4e5cc4; --chunkLo:#33409a; --chunkEdge:#222c6e;
  --chunk2Hi:#5f50c2; --chunk2Lo:#3e3499; --chunk2Edge:#2a2270;
  /* sunk + inset surfaces */
  --well:#0d1338; --sunk:#131a44; --pileBg:rgba(13,19,56,.5);
  --rowBg:#161d4c; --rowMine:#1b2450; --rowMineLine:#3d4d9e; --cheerOn:#3a2f10;
  --stepBg:#141b46; --stepHere:#20296a; --chipBg:#141b46; --chipOn:#1d2660;
  --clozeHi:#121b48; --clozeLo:#0d1436;
  --shelfHi:#151c4a; --shelfLo:#101638; --growHi:#111b36; --growLo:#0d1430;
  /* small marks */
  --pipBg:#2c3878; --dotOff:#4f5dbb; --dotOffRing:#8e98d7;
  --pill:rgba(27,36,80,.88); --pill2:rgba(27,36,80,.6);   /* the quiet chrome pills */
  --glass:rgba(27,36,80,.88); --glassHi:rgba(30,39,101,.9); --glassLine:rgba(255,255,255,.14);   /* paper over a painting: the card's own colours, see-through */
  --faceLight:255,236,190; --faceDark:9,14,36; --faceRing:rgba(108,121,203,.95);
  /* the world behind the page */
  --auraLow:rgba(107,231,255,.11); --auraTop:rgba(255,209,102,.14);
  --seaLine:rgba(107,231,255,.055); --seaGlow:rgba(107,231,255,.10);
  --shade:#000; --shadeSoft:rgba(0,0,0,.8);
  /* type that is not --ink */
  --h1Ink:#fff; --h1Sh:#090e26; --wordInk:#fff; --tfSh:#0d2a1c;
  --goldInk:var(--gold); --goldInkH:var(--goldL); --linkU:rgba(255,209,102,.45);
  --redInk:var(--red); --artInk:var(--ink); --artMut:var(--mut);
  /* THE WRITING DESK'S MARKS AS TEXT (launch board #186, 2026-10-18). The squiggle stays --dk-mark/--dk-ask, drawn on the
     page's own paper in every look; these are the same red and orange as LETTERS on a theme surface (the check panel's
     heading). --dk-mark on the night card measured 3.16:1; a lighter TRUE red (not --red's soft pink, RULINGS §9 ②) and
     the orange as it is reach 5.3 and 4.95. The light looks deepen both. */
  --markInk:#ff6b5e; --askInk:var(--dk-ask);
  --mutRGB:163,176,232; --greenRGB:124,227,139; --cyanRGB:107,231,255;

  /* ── THE GLOW TIER (Stage 4) ────────────────────────────────────────────────────────────────
     Until now a look could re-decide every COLOUR in this file and not one SHADOW, so `paper` —
     which is the night look with every halo taken off — could only say so by naming 19 components
     by hand at the bottom of index.html. These are those 19 rules turned inside out: the value
     each component had is its default here, and a look moves it in ui/kit/themes.css.
     Each holds the EXACT declaration it replaced, so `night` is byte-for-byte what it was.

     WHY THERE ARE 27 OF THEM AND NOT 19. Five of the folded rules listed several selectors at once
     (`.dot.on, #weekcard .pip.on{ box-shadow:none }`), and the selectors in such a list share the
     look's ANSWER without sharing their own DEFAULT — the dot's halo is 12px at .75, the week pip's
     is 10px at .45, and both simply go. One token cannot carry two defaults, so those rows split
     here and are re-joined in the look that wants them equal (paper aliases --elev-shelf/-cloud/
     -growshelf onto one --elev-panel-hair). Splitting is the honest direction: two surfaces that
     happen to agree today get two tokens — the same rule ① already states above.

     A NAMING RULE, so this tier does not sprawl: --elev-* is a box-shadow (a thing sitting above
     its surface), --glow-* is a text-shadow, and anything else is named for what it switches. */
  /* the sky and the lantern sheen — the three switches that make a look FLAT */
  --star-display:block;                              /* .star — day and paper have no star field */
  --sky-veil-display:block; --sky-veil-opacity:1;    /* #sky::after, the sea at the bottom of the world */
  --card-sheen-display:block;                        /* .card::before, the lantern above every panel */
  /* type that carries a halo */
  --glow-title:0 2px 0 var(--h1Sh), 0 0 34px rgba(255,209,102,.28);          /* h1 */
  --glow-display:0 2px 0 var(--h1Sh);                                        /* .booktitle */
  --glow-cheer:0 2px 0 var(--h1Sh), 0 0 34px rgba(255,209,102,.45);          /* #recap .cheer */
  --glow-misswant:0 3px 0 var(--tileEdge), 0 0 30px rgba(255,209,102,.34);   /* .misswant */
  --glow-anchor:0 3px 0 var(--tfSh), 0 0 34px rgba(var(--greenRGB),.28);     /* #tfknown */
  --splash-filter:drop-shadow(0 8px 22px rgba(255,209,102,.4));              /* #splash img */
  /* the pressable things FLOAT (owner, 2026-10-25: "Yes use the new buttons throughout"). There is no `0 Npx 0` ledge
     under anything a child taps any more: each piece keeps its edge colour as a 2px foot INSIDE its shape and is lifted
     by --float-drop, a soft shadow that each look answers (the dark looks a deep one, day and paper a light one). The
     `0 0 Npx` halo is still the look's, and paper still drops it. */
  --float-drop:0 2px 4px -1px rgba(0,0,0,.28), 0 7px 14px -9px rgba(0,0,0,.65);
  /* THE SETTINGS SHEET'S ROWS (app-feel, 2026-11-11): the hairline between two rows and round each group, the groove a
     switch or a three-way answer sits in when it is off, and the raised segment that is chosen. Each look answers. */
  --setHair:rgba(108,121,203,.30); --setOff:rgba(255,255,255,.10); --setOn:#2b3775;
  /* THE GOLD BUTTON FLOATS (owner, 2026-10-25, the button board: "Buttons: F"). It was a 5px dark-gold ledge under every
     yellow button ("quite a thick bottom edge… given their prevalence, let's optimise"); now it is a rounded slab of gold
     lifted by a soft shadow, lit along its top and shaded along its foot INSIDE the shape, and it settles 2px when pressed
     (--elev-btn-down). The halo stays the dark looks' own; day and paper answer with a warm drop and no halo. The tiles'
     and chips' `0 Npx 0` edges below are unchanged: the owner was asked whether they follow and has not said. */
  --elev-gold:inset 0 1px 0 rgba(255,255,255,.75), inset 0 -1px 0 rgba(160,110,20,.30), 0 2px 4px -1px rgba(120,80,0,.25),
              0 8px 16px -10px rgba(0,0,0,.75), 0 10px 26px -12px rgba(255,209,102,.55);
  /* `.btn` reads --elev-btn and the quiet button redeclares it on itself; a gold button that is ALSO `.sec` (the first
     run's lone "New speller") reads --elev-gold, which nothing redeclares, so it can still find the gold. */
  --elev-btn:var(--elev-gold);
  --elev-btn-down:inset 0 1px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(160,110,20,.30), 0 1px 2px rgba(120,80,0,.25);
  --elev-tile-ok:inset 0 -2px 0 var(--okEdge), var(--float-drop), 0 0 22px -8px var(--green), inset 0 2px 0 rgba(255,255,255,.3);
  --elev-tile-grow:inset 0 -2px 0 rgba(160,110,20,.35), var(--float-drop), 0 0 28px -8px var(--gold), inset 0 2px 0 rgba(255,255,255,.6);
  --elev-tile-cursor:inset 0 0 0 3px var(--cyan), 0 0 24px -6px var(--cyan);
  --elev-chip-sel:inset 0 -2px 0 rgba(160,110,20,.35), inset 0 1px 0 rgba(255,255,255,.7), var(--float-drop), 0 0 26px -6px var(--gold);  /* .schip.sel */
  --elev-chip-on:0 0 18px -6px var(--gold);                                  /* .wchip.on */
  --elev-facechip-on:inset 0 0 0 3px var(--gold), 0 0 16px -4px var(--gold);
  --elev-agechip-on:inset 0 -2px 0 rgba(160,110,20,.35), var(--float-drop), 0 0 20px -6px var(--gold);
  /* small marks */
  --elev-dot-on:0 0 12px rgba(255,209,102,.75);                              /* .dot.on */
  --elev-pip-on:0 0 10px rgba(255,209,102,.45);                              /* #weekcard .pip.on */
  /* the inviting blank, whose halo BREATHES — so the animation is a token too, or a flat look
     would keep pulsing a shadow it had just switched off */
  --elev-gap:inset 0 -4px 0 var(--goldInk), 0 8px 18px -12px var(--gold);
  --gap-animation:gapglow 2.6s ease-in-out infinite;
  /* the three big soft panels, and the two portrait circles */
  --elev-shelf:inset 0 0 0 1px rgba(255,209,102,.18), inset 0 -22px 34px -26px rgba(255,209,102,.6);
  --elev-cloud:inset 0 0 0 1px rgba(255,209,102,.18);
  --elev-growshelf:inset 0 0 0 1px rgba(var(--greenRGB),.16);
  --elev-face:inset 0 0 0 2px rgba(255,209,102,.34), 0 0 24px -8px rgba(255,209,102,.5);
  --elev-face-hero:inset 0 0 0 2px rgba(255,209,102,.36), 0 0 30px -8px rgba(255,209,102,.55);
}
