/* Lesson colours: the one place to change them.
   Lesson pages get this through lib/page.css, interactives through lib/card-shell.css, and every film page
   links it; lib/lesson-colors.js hands the attention values to the two film runtimes. Change a value here and every
   page, interactive and film that uses it follows.

   light  the light lesson page and light interactives
   dark   the dark lesson page and dark interactives
   board  the film's dark board. Native-theme film renderers resolve these roles to the light tokens below on white;
          legacy film frames still use their inversion bridge until the renderer opts in.

   root    the square root being removed, and the trig expression it becomes
   dx      dx (or du) and the θ form it becomes
   button  the round button that opens an interactive

   attention: a piece the narration points at is recoloured and swells about its centre, then settles back.
   --lc-attn-board  the highlight on the dark board
   --lc-attn-light  the highlight on white. Native films paint it directly; lesson-colors.js compensates for inversion
                    only in older renderers which still use that bridge.
   --lc-attn-breath how much a highlighted piece swells: 1.12 is 12% larger at the peak.
   --lc-attn-light-glow, -glow-alpha, -glow-blur  on the light page only, a soft glow of this colour around the
                    highlighted strokes (blur in px of the 1280-wide frame), and the stroke takes the highlight colour
                    fully. Light films use magenta ink with a low-opacity same-hue glow, which reads as pale pink on
                    white. Both modes retain the existing attention timing and swell (Sohil, 2026-10-22). */
:root{
  --lc-on-accent:var(--lc-white);
  --lc-paper-light:#fbfbff; --lc-paper-dark:#181a22; --lc-paper:var(--lc-paper-light);
  --lc-ink-light:#111827; --lc-ink-dark:#f2f4f8; --lc-ink-board:#f2f4f8;
  --lc-rule-light:#e5e7eb; --lc-rule-dark:#343b46;
  --lc-fill-light:rgba(17,24,39,.045); --lc-fill-dark:rgba(242,244,248,.05);
  --lc-ink:var(--lc-ink-light); --lc-rule:var(--lc-rule-light); --lc-fill:var(--lc-fill-light);
  --lc-attn-soft-board:#fff4d6;

  --lc-root-light:#be185d; --lc-root-dark:#ff6fae; --lc-root-board:#ff6fae;
  --lc-dx-light:var(--lc-blue-light);   --lc-dx-dark:#67e8f9;   --lc-dx-board:#67e8f9;
  --lc-button-light:#db2777; --lc-button-light-hover:var(--lc-root-light);   /* the logo's pink (Sohil, 2026-10-03) */
  --lc-button-dark:var(--lc-root-dark);   --lc-button-dark-hover:#ff8fc0;
  --lc-attn-board:#ffd166; --lc-attn-light:#c000a8; --lc-attn-breath:1.12;
  --lc-attn-light-glow:var(--lc-attn-light); --lc-attn-light-glow-alpha:.2; --lc-attn-light-glow-blur:7;

  /* The course palette (Sohil, 2026-09-29): ink, pink, blue (deep sky blue on the light page, cyan on the dark page and the film board), green, and the attention highlight above. Every
     page, figure, card and film takes its colours from these roles only, so a change here reaches all of them. A page's
     planning/colour.md says which meaning takes which role; it never sets a colour of its own. No role-a/role-b/… classes.
     Pages are meant to be colour-rich (Sohil, 2026-09-30: pages that coloured only a few pieces read as mostly black):
     colour every piece the student follows, wherever it appears; answers, units and routine arithmetic stay ink.
     Pink, blue and green come first; orange and violet (added 2026-09-30) are for a page with a fourth or fifth meaning
     the student tracks at the same time (rate of change: rise, run, the fixed point, the moving point, the tangent); they sit in the
     hue gaps the first three leave (orange 17–27°, violet 262–272°), so every pair stays apart on paper, on the dark
     page and on the board, and orange stays clear of the board's yellow attention. Mute is for a guide or a spent
     piece, never a meaning. lc-ink puts a piece back to the page's ink inside a coloured one (the x under a pink root). No other colours (the blue role's cyan on dark is the only cyan; no teal).
       page text and figures   class lc-pink, lc-blue, lc-green, lc-orange, lc-violet, lc-mute (KaTeX: \htmlClass{lc-pink}{…});
                               SVG fill/stroke var(--lc-pink) etc.
       cards                   var(--lc-pink) etc. in CSS; on a canvas read getComputedStyle(root).getPropertyValue('--lc-pink')
                               every frame, so the theme is followed (card-shell.css imports this file)
       films                   lessonColor('pink-board'), lessonColor('orange-board') etc. (lesson-colors.js) */
  --lc-pink-light:var(--lc-root-light);  --lc-pink-dark:var(--lc-root-dark);  --lc-pink-board:var(--lc-root-board);
  --lc-blue-light:#0077cc;               --lc-blue-dark:var(--lc-dx-dark);    --lc-blue-board:var(--lc-dx-board);   /* light: bright deep sky blue, distinct from black on white (Sohil, 2026-10-22) */
  --lc-green-light:#065f46;              --lc-green-dark:#34d399;             --lc-green-board:#34d399;   /* light: deeper (2026-10-04) */
  --lc-orange-light:#c2410c;             --lc-orange-dark:#fb923c;            --lc-orange-board:#fb923c;
  --lc-violet-light:#7e22ce;             --lc-violet-dark:#c4a5fa;            --lc-violet-board:#c4a5fa;
  --lc-mute-light:#6b7280;               --lc-mute-dark:#a1aabd;              --lc-mute-board:#8791a1;
  --lc-pink:var(--lc-pink-light); --lc-blue:var(--lc-blue-light); --lc-green:var(--lc-green-light);
  --lc-orange:var(--lc-orange-light); --lc-violet:var(--lc-violet-light); --lc-mute:var(--lc-mute-light);

  /* Ramps (COLOUR-ROLES §8, decided 2026-11-04): a continuous colour between the palette's own tokens, for a quantity
     read by its colour; no lesson or device defines its own. Each is its stops, evenly spaced, read in OKLab between them;
     a cyclic ramp's last stop is its first. Each is chosen by tools/livanimate/tests/laws/ramps.mjs.
       phase   cyclic, for a phase (arg ψ, a phasor's angle): orange at 0, ink a quarter turn on, violet at a half, mute at
               three quarters. Two phases a quarter turn apart differ by ΔE00 10 or more for normal vision and simulated
               protanopia, deuteranopia and tritanopia, on the board and on the light page. No ring of the five hues alone
               does (the board's hues are equally bright and a red–green deficiency folds them), so it turns through
               lightness as well as hue. Sequential (a magnitude) and diverging (a signed quantity) ramps are added here,
               through the same check, when a picture first needs one. */
  --lc-ramp-phase-board:var(--lc-orange-board), var(--lc-ink-board), var(--lc-violet-board), var(--lc-mute-board), var(--lc-orange-board);
  --lc-ramp-phase-light:var(--lc-orange-light), var(--lc-ink-light), var(--lc-violet-light), var(--lc-mute-light), var(--lc-orange-light);
  --lc-ramp-phase-dark:var(--lc-ramp-phase-board);   /* the dark page's own mute is lighter and folds ink into it (ΔE00 7–9) */
  --lc-ramp-phase:var(--lc-ramp-phase-light);

  /* The lesson page's own surfaces, text and controls (2026-10-03). The shared page stylesheets used to set these in
     five places with different values for one name (--body, --mute, --axis, --accent each had three to five), and
     different names for one colour (two greens, two pinks, three button blues). Now lib/page.css points the page's
     names (--bg, --ink, --body, --accent, --green, …) here, once, and no other shared stylesheet sets a colour.
       bg, panel, field     the page ground, a card or panel on it, an input or a control's face
       body                 running text (ink is for headings, maths and what the student must read exactly)
       axis                 a figure's axes and guide lines
       control              a quiet button's face (the jump bar, the close mark, a film bar's buttons)
       accent               the UI accent, indigo: kickers, section and step numbers, the Check action
       amber                tags and traps: UI only, never a meaning in the maths
       key-tint             the Key idea's ground, at 10%; its edge and label are pink (the Hint is green)
       action, action-ink   the play mark and the Explain action, and its hover or text form
       glow                 the lamp's halo around a lit block
       board-bg             a film's board, behind a film that hasn't loaded
       white, black, shadow glass tints and shadows only, never a colour the student reads */
  --lc-white:#ffffff; --lc-black:#000000;
  --lc-bg-light:#f8f8fc;                     --lc-bg-dark:#131519;   /* dark: the grey page; every box on it (ideas, examples, */
  --lc-panel-light:var(--lc-white);          --lc-panel-dark:#0c0d10;   /* practice, tables, films, cards) is a muted black, so the films */
  --lc-field-light:var(--lc-white);          --lc-field-dark:#23272e;   /* pop out and nothing looks out of place (Sohil, 2026-10-05) */
  --lc-body-light:#001940;                   --lc-body-dark:#d0d5de;   /* running text: a deep navy (Sohil, 2026-10-03) */
  --lc-axis-light:#c3c8d6;                   --lc-axis-dark:#4b5563;
  --lc-control-light:#eef0fa;                --lc-control-dark:var(--lc-field-dark);
  --lc-control-hover-light:#e2e5f4;          --lc-control-hover-dark:var(--lc-rule-dark);
  --lc-accent-light:#4f46e5;                 --lc-accent-dark:#818cf8;
  --lc-amber-light:#b45309;                  --lc-amber-dark:#f7bd68;
  --lc-action-light:#2f6fed;                 --lc-action-dark:#6f9bff;
  --lc-action-ink-light:#2a5fd0;             --lc-action-ink-dark:#9db8ff;
  --lc-shadow-light:var(--lc-ink-light);     --lc-shadow-dark:var(--lc-black);
  --lc-glow:#82b4ff; --lc-board-bg:#0c0d10;   /* a muted black (Sohil, 2026-10-05; pure black 10-04 read shiny); chalkpen.js paints its board with it */
  --lc-board-bg-light:#0a0a0f;   /* the board under the light page's inversion: the old board, so a film's see-through
                                    fills keep the tint they had on the light page (chalkpen.js) */
  --lc-key-tint:#ff00be;   /* the Key idea's ground: #ff00be59 at 10%, so 3.5% (Sohil, 2026-10-04); its edge and label are --lc-pink */
  /* Film and card chrome (2026-10-04), so the film player, its bar and the cards' keys take their colours from here too.
     A film is always drawn dark, so its player keeps its own near-black set (board, ink, quiet, line, accent); its bar
     follows the page in light mode (tints of the accent) and the film's dark set in dark mode. "off" is a muted sound or
     captions key. */
  --lc-film-bg:#0c0d10; --lc-film-ink:#e9e7e0; --lc-film-quiet:#a5a5b1; --lc-film-dim:#8b8ba0; --lc-film-line:#2b2b34;
  --lc-film-accent:#a78bfa; --lc-film-focus:#c5b1ff; --lc-film-soft:#cbc9d5; --lc-film-text:#bab8c5;
  --lc-fb-bg-light:#f1f0f8;  --lc-fb-bg-dark:#13131a;
  --lc-fb-edge-light:#e3e2f0; --lc-fb-edge-dark:#23232e;
  --lc-fb-dim-light:#8b8fa3;
  --lc-fb-btn-dark:#26263a;  --lc-fb-btn-ink-dark:#ece9ff; --lc-fb-btn-hover-dark:#33334d; --lc-fb-hover-dark:#23233a; --lc-fb-track-dark:#2b2b3a;
  --lc-fb-focus-dark:#22d3ee; --lc-fb-forced-dark:#6f6f86;
  --lc-off-light:#c0504d;    --lc-off-dark:#f0a4a4;
  --lc-off:var(--lc-off-light);
  --lc-bg:var(--lc-bg-light); --lc-panel:var(--lc-panel-light); --lc-field:var(--lc-field-light); --lc-body:var(--lc-body-light);
  --lc-axis:var(--lc-axis-light); --lc-control:var(--lc-control-light); --lc-control-hover:var(--lc-control-hover-light);
  --lc-accent:var(--lc-accent-light); --lc-amber:var(--lc-amber-light); --lc-action:var(--lc-action-light);
  --lc-action-ink:var(--lc-action-ink-light); --lc-shadow:var(--lc-shadow-light);

  /* the theme's own values, for use in a page or card stylesheet */
  --lc-root:var(--lc-root-light); --lc-dx:var(--lc-dx-light);
  --lc-button:var(--lc-button-light); --lc-button-hover:var(--lc-button-light-hover);
}
:root[data-theme=dark]{
  --lc-paper:var(--lc-paper-dark);
  --lc-ink:var(--lc-ink-dark); --lc-rule:var(--lc-rule-dark); --lc-fill:var(--lc-fill-dark);
  --lc-root:var(--lc-root-dark); --lc-dx:var(--lc-dx-dark);
  --lc-button:var(--lc-button-dark); --lc-button-hover:var(--lc-button-dark-hover);
  --lc-pink:var(--lc-pink-dark); --lc-blue:var(--lc-blue-dark); --lc-green:var(--lc-green-dark);
  --lc-orange:var(--lc-orange-dark); --lc-violet:var(--lc-violet-dark); --lc-mute:var(--lc-mute-dark);
  --lc-bg:var(--lc-bg-dark); --lc-panel:var(--lc-panel-dark); --lc-field:var(--lc-field-dark); --lc-body:var(--lc-body-dark);
  --lc-axis:var(--lc-axis-dark); --lc-control:var(--lc-control-dark); --lc-control-hover:var(--lc-control-hover-dark);
  --lc-accent:var(--lc-accent-dark); --lc-amber:var(--lc-amber-dark); --lc-action:var(--lc-action-dark);
  --lc-action-ink:var(--lc-action-ink-dark); --lc-shadow:var(--lc-shadow-dark);
  --lc-off:var(--lc-off-dark);
  --lc-ramp-phase:var(--lc-ramp-phase-dark);
}
.lc-pink{color:var(--lc-pink)} .lc-blue{color:var(--lc-blue)} .lc-green{color:var(--lc-green)} .lc-ink{color:var(--ink,inherit)}
.lc-orange{color:var(--lc-orange)} .lc-violet{color:var(--lc-violet)} .lc-mute{color:var(--lc-mute)}
