/* @hifive/tokens 1.4.0 — built 2026-12-04. Edit packages/tokens/src, not this file. */
/* Recruitment Portal — maps its theme variables onto the HiFive tokens.
   Rewritten 9 Nov 2026 against the live portal-v2 code (hifive-recruitment, PortalApp.jsx + index.css).

   How Recruitment themes itself today: <div class="hf-app" data-theme="atomic|blue|…" data-dark="true">
   and index.css sets --acc/--acc2/--acci/--grad/--soft/--soft2/--glow/--glowS/--orb1..3 per
   .hf-app[data-theme=…], with neutrals --bg/--bg2/--ink/--ink2/--muted/--line/--card/--card2/--cb
   flipping on .hf-app[data-theme=dark]. The choice is stored in localStorage hf_theme (default atomic).

   This file wins over those rules by specificity (html[data-skin] .hf-app) WITHOUT touching the app,
   so the app's own look shows if the theme host does not answer. Recruitment stage 1 (13 Nov 2026)
   retires the app's switcher, follows HiFive ID for palette and mode, and has its pop-ups read the
   live values from .hf-app.
   Status chips (Rating overdue / To contact / Welcome post ready) keep semantic colours — never skin colours. */

/* The second selector outranks the app's own dark accents (.hf-app[data-theme=atomic][data-dark="true"],
   which would otherwise put a light cyan gradient under white text in dark: measured 13 Nov). */
html[data-skin] .hf-app, html[data-skin] .hf-app[data-dark] {
  /* Measured 13 Nov 2026 (docs/audits/2026-11-13-recruitment-stage-1-go-no-go.md):
     --acci is TEXT in about 150 places, so it is the token for brand text, never a fill colour;
     --grad carries white text on about 130 buttons, so it stays on the deep brand (800 to 600,
     Sol 900 to 700, the guide's colour-band rule); --acc is the deep brand, a fill under white
     text and dark enough to read as text on a light card. */
  --acc:  rgb(var(--brand-700));
  --acc2: var(--accent);
  --acci: var(--primary-text);
  --grad: linear-gradient(135deg, rgb(var(--brand-800)), rgb(var(--brand-600)));
  --soft:  var(--primary-soft);
  --soft2: var(--accent-soft);
  --glow:  rgb(var(--brand-900) / .28);
  --glowS: rgb(var(--brand-900) / .12);
  --orb1: rgb(var(--brand-500) / .18);
  --orb2: rgb(var(--pop-500) / .16);
  --orb3: rgb(var(--sky-500) / .14);

  --bg:    var(--surface-0);
  --bg2:   var(--surface-2);
  --ink:   var(--text-strong);
  --ink2:  var(--text);
  --muted: var(--text-muted);
  --card:  var(--surface-1);
  --card2: var(--surface-2);
  --line:  rgb(var(--ink-200));   /* the token's value: the app sets its own --line on .hf-app */
  --cb:    rgb(var(--ink-200));
  --search-bg: var(--surface-1); --search-ink: var(--text-strong); --search-muted: var(--text-muted);
  --dp-bg: var(--surface-1);

  --hf-alias: recruitment;   /* lets the app's theme.js tell that this sheet arrived */
  --hifive-hub-accent: var(--primary);
  --hifive-hub-fg: var(--on-primary);
  font-family: var(--font-body);
}
html[data-skin] .hf-app h1, html[data-skin] .hf-app h2, html[data-skin] .hf-app h3 { font-family: var(--font-display); }

/* Status colours as TEXT (Recruitment stage 1, 13 Nov 2026). The screens write the fixed status
   colours (#cf3552, #1f9d63, #d9912a and its darker #b8741a, #2f6fed, and a second set #b91c1c,
   #047857, #92400e) straight into text, where they fall under 4.5:1 on cards and tints in every
   palette, light and dark. Those text uses read these instead (the hex stays as their fallback);
   each is the status hue mixed toward the text colour, as Learning Point's sheet does, so it
   darkens in light and lightens in dark. Set on the page, not .hf-app, so pop-ups get them too. */
html[data-skin] {
  --rc-danger-text: color-mix(in srgb, rgb(var(--danger)) 62%, var(--text-strong));
  --rc-ok-text:     color-mix(in srgb, rgb(var(--ok)) 52%, var(--text-strong));
  --rc-warn-text:   color-mix(in srgb, rgb(var(--warn)) 48%, var(--text-strong));
  --rc-info-text:   color-mix(in srgb, #2f6fed 62%, var(--text-strong));   /* a fixed blue: the sky ramp changes with the palette */
}
/* In dark the mix leans further toward the (light) text colour: measured on the live dashboard,
   62% red read 4.3 on dark cards; 45% clears 4.5 in all eight palettes. */
html[data-skin][data-theme="dark"] {
  --rc-danger-text: color-mix(in srgb, rgb(var(--danger)) 45%, var(--text-strong));
  --rc-ok-text:     color-mix(in srgb, rgb(var(--ok)) 45%, var(--text-strong));
  --rc-warn-text:   color-mix(in srgb, rgb(var(--warn)) 45%, var(--text-strong));
  --rc-info-text:   color-mix(in srgb, #2f6fed 45%, var(--text-strong));
}

/* Air's and Sol's brands are light: their gradient moves deeper so white text keeps 4.5:1, also
   under the dashboard band's translucent white chips (measured 13 Nov: 3.9 at brand 600 / 700). */
html[data-skin="air"] .hf-app, html[data-skin="air"] .hf-app[data-dark] {
  --grad: linear-gradient(135deg, rgb(var(--brand-900)), rgb(var(--brand-700)));
}
html[data-skin="sol"] .hf-app, html[data-skin="sol"] .hf-app[data-dark] {
  --acc:  rgb(var(--brand-900));
  --grad: linear-gradient(135deg, rgb(var(--brand-900)), rgb(var(--brand-800)));
}

/* Dark is the HiFive preference, not the app's "-dark" theme suffix. */
html[data-skin][data-theme="dark"] .hf-app, html[data-skin][data-theme="dark"] .hf-app[data-dark] {
  /* In dark --acc is read mostly as text (stage chips, card labels: 59 on the candidate board),
     so it takes the brand text colour; no fill under white text failed for it (measured 13 Nov). */
  --acc: var(--primary-text);
  --glow: rgb(0 0 0 / .55); --glowS: rgb(0 0 0 / .35);
  --line: rgb(var(--ink-700)); --cb: rgb(var(--ink-700));
}

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