/* @hifive/tokens 1.4.0 — built 2026-11-29. Edit packages/tokens/src, not this file. */
/* HiFive Learning Point (hifive-lms, static HTML) — maps its variables onto the HiFive tokens.
   Checked 9 Nov 2026 against lms/public/styles.css and nav.js; reworked 12 Nov 2026 when the app
   adopted the theme (Part T, stage 1), measured on every page in light and dark.

   Every page's <head> gets, after styles.css:
     <script src="https://hifive-design.pages.dev/theme/v1/boot.js"></script>
     <link rel="stylesheet" href="https://hifive-design.pages.dev/theme/v1/theme.css">
     <link rel="stylesheet" href="https://hifive-design.pages.dev/theme/v1/alias-learning-point.css">
     <script src="/theme.js"></script>

   Light or dark is HiFive ID's (D-030): the app's own data-dark switch and its dark colour table
   were retired in the same release, so dark here is the token sheet's data-theme="dark".

   The app names a colour by what it is used for, and several are used as TEXT on a tint or on a
   card. A status colour or a ramp step that is right as a fill is too faint, or in dark too deep,
   as text, so the text ones are mixed toward the text colour, the way @hifive/ui's status chips do:
     fills, bars, rings : --teal --deep --brand --gold --gold-deep --blue --green2 --red (light) --sun --coral --sky --leaf
     text               : --accent --green --red-deep --amber --blue-deep and every *-fg
     text on a fill     : --on-fill on --teal, --on-gold on --gold */

html[data-skin] {
  /* text-safe versions; the dark block below re-mixes them toward white */
  --lp-ok-text: color-mix(in srgb, rgb(var(--ok)) 55%, var(--text-strong));
  --lp-warn-text: color-mix(in srgb, rgb(var(--warn)) 50%, var(--text-strong));
  --lp-danger-text: color-mix(in srgb, rgb(var(--danger)) 65%, var(--text-strong));
  --lp-info-text: color-mix(in srgb, rgb(var(--sky-500)) 50%, var(--text-strong));
  --lp-attention-text: color-mix(in srgb, var(--attention) 60%, var(--text-strong));

  /* The brand fill and the text on it are the token sheet's own pair, --primary and --on-primary,
     which is checked for every palette in light and dark. Until 1.2.5 the fill was brand-600 with
     the app's hard-wired white text: 3.1:1 in Sol, whose brand colour takes dark text. */
  --teal:  var(--primary);
  --deep:  rgb(var(--brand-700));     /* the darker rim under a button */
  --on-fill: var(--on-primary);       /* text on a --teal fill */
  --brand: var(--primary);            /* rings and bars */
  --accent: var(--primary-text);      /* the brand colour as text and links */
  /* "Gold" is the reward colour: top ranks, points, the quiz pips. A light fill from the skin's
     third ramp with dark text on it (--on-gold), which reads the same in light and dark. */
  --gold: rgb(var(--sky-200));
  --gold-deep: rgb(var(--sky-400));
  --on-gold: rgb(var(--ink-950));
  --blue: rgb(var(--sky-500));
  --blue-deep: var(--lp-info-text);
  --sun: rgb(var(--warn));
  --coral: rgb(var(--coral-500));
  --sky: rgb(var(--sky-400));
  --leaf: rgb(var(--ok));

  --t-sun-bg: rgb(var(--warn) / .14);    --t-sun-fg: var(--lp-warn-text);
  --t-coral-bg: var(--attention-soft);   --t-coral-fg: var(--lp-attention-text);
  --t-sky-bg: rgb(var(--sky-500) / .14); --t-sky-fg: var(--lp-info-text);
  --t-leaf-bg: rgb(var(--ok) / .12);     --t-leaf-fg: var(--lp-ok-text);
  --t-teal-bg: var(--primary-soft);      --t-teal-fg: var(--primary-text);

  /* status: fixed across skins */
  --green: var(--lp-ok-text); --green2: rgb(var(--ok));
  --red: rgb(var(--danger)); --red-deep: var(--lp-danger-text);
  --amber: var(--lp-warn-text);
  --ok-bg: rgb(var(--ok) / .12);      --ok-fg: var(--lp-ok-text);
  --bad-bg: rgb(var(--danger) / .12); --bad-fg: var(--lp-danger-text);
  --warn-bg: rgb(var(--warn) / .14);  --warn-fg: var(--lp-warn-text);
  --mand-bg: rgb(var(--warn) / .14);  --mand-fg: var(--lp-warn-text);
  --info-bg: rgb(var(--sky-500) / .14); --info-fg: var(--lp-info-text);
  --opt-bg: rgb(var(--sky-500) / .14);  --opt-fg: var(--lp-info-text);
  --neutral-bg: var(--surface-2);     --neutral-fg: var(--text-muted);

  /* surfaces & text */
  --bg: var(--surface-0); --card: var(--surface-1); 
  --field: var(--surface-1); --field-alt: var(--surface-2);
  --hair: var(--line-strong); --track: var(--surface-2);
  --ink: var(--text-strong); --muted: var(--text-muted);
  --on-teal: var(--on-primary);       /* second-line text on a --teal fill. Not faded: the pair has no contrast to spare */
  --teal-tint: var(--primary-soft);

  --e1: var(--shadow-card); --shadow: var(--shadow-card);

  --hifive-hub-accent: var(--primary);
  --hifive-hub-fg: var(--on-primary);
  --font-head: var(--font-display);
}
html[data-skin] body { font-family: var(--font-body); }
html[data-skin] h1, html[data-skin] h2, html[data-skin] h3, html[data-skin] .brand { font-family: var(--font-display); }

/* Dark (the token sheet's data-theme="dark", or the .dark class boot.js also sets). Text colours
   are mixed toward white, and --red is used as text on cards as well as for bars, so it lightens. */
html[data-skin][data-theme="dark"], html[data-skin].dark {
  --lp-ok-text: color-mix(in srgb, rgb(var(--ok)) 60%, white);
  --lp-warn-text: color-mix(in srgb, rgb(var(--warn)) 65%, white);
  --lp-danger-text: color-mix(in srgb, rgb(var(--danger)) 50%, white);
  --lp-info-text: color-mix(in srgb, rgb(var(--sky-400)) 45%, white);
  --lp-attention-text: color-mix(in srgb, var(--attention) 55%, white);
  --red: var(--lp-danger-text);
}

/* Tables and lists stay flat under Soft (Part B). */
html[data-skin][data-style="soft"] table, html[data-skin][data-style="soft"] .list { box-shadow: none; background: var(--surface-1); }
