/* Flora's dark palette: the colour tokens of tokens.css, redefined on the same
 * bare :root, and nothing else. Linked by base.html and login.html AFTER
 * tokens.css behind media="(prefers-color-scheme: dark)", so the system
 * preference decides and there is no toggle. Equal specificity plus later
 * document order is what makes these values win; do not add a selector here.
 * tests/flora/test_tokens_dark.py holds this file's custom property names equal
 * to the colour tokens in tokens.css and pins the deuteranopia
 * sentences below; tests/flora/test_control_contrast.py (TestEveryQuotedRatioIsTheMeasuredOne)
 * recomputes every ratio quoted in this file.
 *
 * The scale, spacing, radius, font and dock-size tokens are structural, are
 * not repeated here, and keep their tokens.css values. `--lift` is a shadow
 * made of colours, so it is a colour token and is redefined (a shadow on a dark
 * ground needs to be darker and heavier to read at all).
 *
 * Moved here from two blocks at the foot of tokens.css on 2026-10-15, with two
 * changes. `--ink-3` and `--muted` rose from #857C92 to #A096AE: the old value
 * measured 4.19:1 on `--card` and 3.46:1 on `--card-3`, under the 4.5:1 that
 * SC 1.4.3 asks of small text, and the card is where `fine` text sits.
 *
 * Contrast, WCAG 2.1 relative luminance (ink on surface, then each state on its
 * own tint):
 *   --ink    #EFEAF4  15.66:1 ground  14.88:1 paper  14.05:1 card
 *   --ink-2  #B4ABC2   8.42:1 ground   8.01:1 paper   7.56:1 card
 *   --ink-3  #A096AE   6.59:1 ground   6.26:1 paper   5.91:1 card  4.88:1 card-3
 *   --violet #B79BE0   7.75:1 ground   (link text on the page surface)
 *   Okabe-Ito roles on --ground: ok 7.51, warn 9.45, alert 6.68, muted 6.59.
 *
 * COLOUR IS NEVER THE ONLY CHANNEL, and dark mode changes no markup, so every
 * glyph and word that pairs with a colour in light still pairs with it here.
 *
 * DEUTERANOPIA, the pairs that could collide for a blue-green reader, and what
 * carries the difference when hue does not. Lightness separates only one of
 * these pairs; the rest are separated by role and markup, and say so:
 *   --ok #5CADE0 beside --violet #B79BE0: 1.03:1 in lightness, so lightness does NOT separate them. --ok colours state tags that carry a glyph (.g) and a word (.w); --violet colours links and the brand mark, which are read as text.
 *   --warn #E7B04A beside --alert #F07A42: 1.41:1 in lightness, 9.45:1 for warn against 6.68:1 for alert on --ground, so lightness separates them. Every state tag also draws a glyph (.g) and a word (.w) in app.css's .st-* rules, for instance the cross and "failed" of .st-conflict, so the state is read from text.
 *   --ok #5CADE0 against --alert #F07A42: 1.12:1 in lightness, so hue alone separates them. Blue against orange is the pair Okabe-Ito was built to keep apart, and every state tag also carries its glyph (.g) and word (.w).
 *   --muted #A096AE against --ok #5CADE0: 1.14:1 in lightness, so lightness only weakly separates them. Role separates them: muted states carry a neutral mark and their word, and --muted is a grey-violet where --ok is a saturated blue.
 * Green is absent as a state colour in both themes, which removes the
 * red-versus-green collision altogether. */

:root {
  /* The sheet is media-gated to a dark preference, so the bare :root is
     right: native widgets (select popups, scrollbars, date and file pickers)
     render dark here and light under tokens.css. */
  color-scheme: dark;

  --ground:  #15121A;
  --paper:   #1B1722;
  --card:    #211C29;
  --card-2:  #282232;
  --card-3:  #312A3D;
  --ink:     #EFEAF4;
  --ink-2:   #B4ABC2;
  --ink-3:   #A096AE;
  --rule:    #352E42;
  --rule-2:  #443B53;
  --hair:    #2A2434;
  /* A control's edge, by luminance. 6.11:1 on --ground, 5.81:1 on --paper,
     5.49:1 on --card, 5.08:1 on --card-2, 4.53:1 on --card-3. --rule on
     --card is only 1.28:1, which is why the two are different tokens. */
  --edge:    #9A90A8;
  --violet:     #B79BE0;
  --violet-w:   #2A2137;
  --on-violet:  #17131F;

  /* States, Okabe-Ito lightened for a dark ground. Same roles, same pairing
     with a word and a glyph as in light. */
  --ok:      #5CADE0;  --ok-w:    #15303F;
  --warn:    #E7B04A;  --warn-w:  #332812;
  --muted:   #A096AE;  --muted-w: #272130;
  --alert:   #F07A42;  --alert-w: #351C11;

  --lift: 0 1px 1px rgba(0, 0, 0, .5), 0 10px 26px -20px rgba(0, 0, 0, .9);
}
