/* THE EIGHT ANSI COLOURS, for figures that are captured terminal screens.
   `tools/term-capture` writes them as tokens rather than values, so a captured
   screen follows the reader's theme the way a drawn one already does.

   THIS IS NOT IN base.css, AND THAT IS THE RULE RATHER THAN AN OVERSIGHT.
   `base.css` and `portal.css` came from `portal-frontend` byte for byte and
   nothing is added to them here, not even a fix. `app.css` may only override,
   once per accessibility defect in the copied file. A vocabulary the portal has
   no screens for is neither, so it gets a file of its own — which is what
   `exercises.css` is, and this is the second of them.

   THERE ARE TWO SETS AND THAT IS NOT REDUNDANCY. htop's header bar is black
   text on a green ground. A FOREGROUND has to hold its contrast against
   `--panel`, which flips between themes, so the foregrounds flip with it. A
   BACKGROUND has to hold its contrast against the text painted on top of it,
   which does not flip — so the `-bg` values are the same in both themes. Making
   them flip too was the first attempt, and in the light theme it put dark text
   on a dark green bar.

   Only the eight are named, and a program that asks for a 256-colour index or
   a direct RGB is not named here at all.

   THAT USED TO BE THE END OF IT: "it chose that colour and it is not ours to
   reinterpret." Good for fidelity, and it shipped `Press ENTER or type command
   to continue` at 1.24:1 — vim's pale green, on the panel, in a figure that
   had just been reviewed. Across the catalogue it was 258 runs of text, none
   of them visible to any check, because nothing reads inside an SVG.

   So the colour is kept where it reads and moved where it does not, by the
   rule `ui/assets/accent.js` already applies to a school's own colour: same
   hue, and as little else as a reader can notice. `fill` in
   `tools/term-capture` does it on the way into the figure and
   `tools/figure-contrast` fails the build when a figure gets past it. */

:root{
  --term-black:#0a0e14;
  --term-red:#ff6b7a;
  --term-green:#3ddc84;
  --term-yellow:#d3e561;
  --term-blue:#5b8cff;
  --term-magenta:#ed61d7;
  --term-cyan:#22d3d3;
  --term-white:#e8e6df;
  --term-grey:#9aa0a8;

  --term-black-bg:#0a0e14;
  --term-red-bg:#e05260;
  --term-green-bg:#31bb71;
  --term-yellow-bg:#d3c161;
  --term-blue-bg:#5b8cff;
  --term-magenta-bg:#ed61d7;
  --term-cyan-bg:#22c3d3;
  --term-white-bg:#e8e6df;
  /* MOVED, AND THE ONLY ONE OF THE NINE THAT HAD TO BE. Text on a captured
     ground is drawn in a fixed value — see `fill` in `tools/term-capture` —
     and at #6b7280 neither black nor white reached AA against it: 4.00:1 and
     3.87:1, a grey sitting almost exactly where the two cross over. Same hue
     and same saturation, lightness from 46% to 50%, which is the smallest
     step that clears it: black text now reads 4.60:1, and the bar itself
     still stands off both panels at better than 4:1. */
  --term-grey-bg:#747c8b;
}

/* The light theme darkens every foreground and leaves the backgrounds alone.
   Yellow and cyan are the two that need the most: at their terminal brightness
   they are illegible on white. */
html[data-theme="light"]{
  --term-black:#20263c;
  --term-red:#c0271f;
  --term-green:#12794a;
  --term-yellow:#8a6a0a;
  --term-blue:#2b52c9;
  --term-magenta:#9b1fa8;
  --term-cyan:#0b6f7a;
  --term-white:#20263c;
  --term-grey:#5a6274;
}
