/* Wolf-Rayet interior-dark -> davidpaterni.com dark mode (site chrome).
 *
 * Hand-authored. This file and bridge-portfolio.css are the only files in
 * assets/wolf-rayet/ that may be edited; interior-dark.css and
 * interior-dark.tokens.json are generated output vendored verbatim from r136
 * and are replaced wholesale on re-sync.
 *
 * Applies to the three pages that share the brand ramp token block:
 *   index.html   resume/index.html   design-engineer/index.html
 * portfolio/ themes off Bootstrap instead — see bridge-portfolio.css.
 *
 * Specificity note: the site's brand rules are
 *   :root[data-brand="mono"][data-mode="dark"]        -> (0,3,0)
 * design-engineer's is weaker still
 *   :root[data-mode="dark"]                           -> (0,2,0)
 * and this rule leads with the element name to reach
 *   html:root[data-wr-theme=...][data-mode="dark"]    -> (0,3,1)
 * so it wins on specificity rather than on load order. The <link> can sit
 * anywhere after the inline <style> without the mapping going quiet.
 */

@layer tokens{
  html:root[data-wr-theme="interior-dark"][data-mode="dark"]{
    /* surfaces — substrate, one step off, nested inside.
       Measured against the mono dark ramp this lifts the ground +0.035 OKLab
       L (0.154 -> 0.189) and turns it cool (hue 250). That lift is the change
       worth having on these pages. */
    --bg:        var(--wr-surface-page);
    --surface:   var(--wr-surface-raised);
    --surface-2: var(--wr-surface-inset);

    /* inks — the site wants four steps, interior-dark carries three text-side
       roles. text/read/dim map cleanly. */
    --text:     var(--wr-text-primary);
    --read:     var(--wr-text-secondary);
    --text-dim: var(--wr-emitter-ambient);

    /* UNMAPPED, on purpose — these keep coming from the active brand:

       --hairline / --hairline-2
         interior-dark's border roles sit far brighter than the site's:
         border-subtle 0.415 vs --hairline 0.292, and border-strong 0.631 vs
         --hairline-2 0.377. That is correct for an instrument panel where
         structure must be legible, and too loud for a portfolio — it makes
         every rule, card edge and outline button assert itself. Verified on
         index.html before deciding. Raise these deliberately or not at all.

       --text-faint
         The fourth step of a four-step ink ramp; interior-dark has three
         text-side roles. --wr-border-strong sits near the right lightness but
         is a border role, so the brand value stays.

       --accent-text  --accent-fill  --accent-ink  --tint  --sel-bg  --sel-text
         interior-dark has no accent-fill role, no ink-on-accent role and no
         tint/selection pair, so there is nothing honest to point them at.
         emitter-marked / emitter-directed are foreground emission levels, not
         fills — using one as --accent-fill would put light text on light
         ground. The brand rules in the page must stay; deleting them would
         leave these undefined. */
  }

  /* ---------- brand-tinted substrates ----------
   *
   * The rule above has no [data-brand], so on its own it flattened all three
   * brands onto one neutral ground -- sand lost its warm ground and ink lost
   * its cool one, which is most of what made those themes read as themes.
   * These two rules put the tint back. (0,4,1) beats (0,3,1) on specificity.
   *
   * Derivation, so this can be regenerated rather than eyeballed: take
   * Wolf-Rayet's LIGHTNESS ladder -- 0.19 / 0.22 / 0.2601 -- which is what
   * puts every page on one substrate level and what widens the card-to-page
   * separation. Keep each brand's OWN hue and chroma, measured from its
   * existing dark ramp:
   *
   *   sand  h 88.8 / 87.5 / 84.5    C 0.0104 / 0.0140 / 0.0158
   *   ink   h 255.5 / 258.3 / 256.5 C 0.0174 / 0.0206 / 0.0245
   *
   * So the palette contributes the level and the brand contributes the
   * colour. Nothing here is invented. All six are in sRGB gamut.
   *
   * mono is deliberately absent: it takes the rule above unchanged, because
   * Wolf-Rayet's own substrate IS the white-label ground.
   *
   * Hex first, then oklch, matching interior-dark.css's own pattern: browsers
   * with oklch support take the second declaration, older ones keep the hex.
   */

  /* sand — warm ground */
  html:root[data-wr-theme="interior-dark"][data-brand="sand"][data-mode="dark"]{
    --bg:        #16140f;
    --bg:        oklch(0.19 0.0104 88.8);
    --surface:   #1d1a13;
    --surface:   oklch(0.22 0.0140 87.5);
    --surface-2: #28241b;
    --surface-2: oklch(0.2601 0.0158 84.5);

    /* warm inks — Wolf-Rayet's COMPRESSED lightness ladder
       (0.96 / 0.9525 / 0.8742) with sand's own hue and chroma. Keeping the
       compression is the point: the brand's own ramp fanned 0.965 -> 0.814,
       and that fan is exactly what interior-dark replaces. */
    --text:     #f6f1e7;
    --text:     oklch(0.96 0.0143 84.6);
    --read:     #f7eede;
    --read:     oklch(0.9525 0.0232 84.6);
    --text-dim: #dfd4c1;
    --text-dim: oklch(0.8742 0.0283 83.5);
  }

  /* ink — cool ground */
  html:root[data-wr-theme="interior-dark"][data-brand="ink"][data-mode="dark"]{
    --bg:        #0f141c;
    --bg:        oklch(0.19 0.0174 255.5);
    --surface:   #151b24;
    --surface:   oklch(0.22 0.0206 258.3);
    --surface-2: #1c2530;
    --surface-2: oklch(0.2601 0.0245 256.5);

    /* cool inks — same ladder, ink's own hue and chroma. */
    --text:     #edf3f9;
    --text:     oklch(0.96 0.0103 247.9);
    --read:     #e6f1fd;
    --read:     oklch(0.9525 0.0203 250.4);
    --text-dim: #c9d7e7;
    --text-dim: oklch(0.8742 0.0263 250.0);
  }
}
