/* Gala UI pack · Chalk — cbse · the classroom, not the exam hall
 *
 * The six panel tints are not a lightness ramp. They carry three things a
 * painter uses and a gradient does not:
 *
 *   VALUE STRUCTURE   the composition reads at a squint. `main` is the
 *                     lightest surface, the screen panes the darkest, so the
 *                     panels separate without borders.
 *   COMPLEMENT MIX    peripheral panels take a TRACE of the complement, which
 *                     greys them and pushes them back. Not a hue rotation —
 *                     rotating orange toward blue just gives you yellow.
 *   CHROMA FALLOFF    saturation is highest at the focal plane and falls to
 *                     the edges, as it does in a painting.
 *
 * Hues stay within ~15°, so it reads as one light source on several surfaces.
 * Every text pairing computed: body 14.99:1 light, 15.24:1 dark.
 */
:root{
  --paper:#EBF3E8; --ink:#181E15; --card:#F5F8F4;
  --rule:#CDDDC5; --muted:#5F7255;
  --sp-main:#F5F8F3;     /* focal plane — lightest, purest */
  --sp-line:#E4EBE0;     /* the near edge */
  --sp-figure:#E4E9E2;
  --sp-ledger:#E9EBE7; /* periphery — greyed, recedes */
  --sp-reel:#DADED8;
  --sp-poster:#D6DAD4; /* deepest recess — the screen sits in it */
  --crimson:#B5432E; --ochre:#C08A3E; --olive:#5A6B4A; --teal:#2E5A66;

/* ── the four canvases the packs predate ─────────────────────────────────
   still, talk, setl and setr were cut into the Vista after these palettes
   were computed, so they had no tint and fell back to --card — the theme
   broke exactly where the eye lands first.
   These are ALIASES to the nearest computed tint, not new values: `still`
   sits in the periphery with `ledger`; `talk` sits near the focal plane with
   `line`; the two strips take the near edge. Aliasing is honest and
   provisional. Proper values need the same value-structure / complement-mix /
   chroma-falloff pass the six originals had. */
  --sp-still: var(--sp-ledger);
  --sp-talk:  var(--sp-line);
  --sp-setl:  var(--sp-line);
  --sp-setr:  var(--sp-line);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --paper:#131811; --ink:#EAEDE8; --card:#1F271C;
    --rule:#364031; --muted:#96A38F;
    --sp-main:#1A2515; --sp-line:#10140E; --sp-figure:#121611;
    --sp-ledger:#191D18; --sp-reel:#151615; --sp-poster:#161716;
    --crimson:#D9694F;
  }
}
:root[data-theme="dark"]{
  --paper:#131811; --ink:#EAEDE8; --card:#1F271C;
  --rule:#364031; --muted:#96A38F;
  --sp-main:#1A2515; --sp-line:#10140E; --sp-figure:#121611;
  --sp-ledger:#191D18; --sp-reel:#151615; --sp-poster:#161716;
  --crimson:#D9694F;
}
.gala-lit{
  background:
    radial-gradient(120% 90% at 18% 0%, color-mix(in srgb,var(--card) 92%,transparent) 0%, transparent 62%),
    radial-gradient(140% 120% at 82% 108%, color-mix(in srgb,var(--ink) 8%,transparent) 0%, transparent 58%),
    var(--paper);
  position:relative;
}
.gala-lit::after{
  content:"";position:absolute;inset:0;pointer-events:none;opacity:.5;mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='.22'/%3E%3C/svg%3E");
}
