/* ─────────────────────────────────────────────────────────────────────────────
   tokens.css — Design tokens for all Sentinel themes
   Default :root = legacy theme (current production look, unchanged)
   [data-theme="phosphor"]  = Phosphor Dark (matrix green)
   [data-theme="blueprint"] = Blueprint Light (engineering drawing)
   [data-theme="auto"]      = follows prefers-color-scheme (phosphor dark / blueprint light)
───────────────────────────────────────────────────────────────────────────── */

/* ── Legacy (default, unchanged) ── */
:root {
  /* Surfaces */
  --bg-base:    #0e1015;
  --bg-surface: #15181e;
  --bg-el:      #1c1f28;
  --bg-ov:      #242836;
  --bg-hov:     rgba(74,140,199,.06);
  --bg-sel:     rgba(74,140,199,.15);

  /* Text */
  --txt:   #d4d8e8;
  --txt-s: #9ba1b5;
  --txt-m: #5c6378;

  /* Brand */
  --brand:   #4a8cc7;
  --brand-h: #3d7ab5;
  --brand-d: rgba(74,140,199,.12);

  /* Borders */
  --bdr:   #252938;
  --bdr-a: #3a4060;
  --foc:   rgba(74,140,199,.5);

  /* Semantic */
  --crit: #e55561;
  --warn: #e5a941;
  --info: #5499e8;
  --acc:  #3db882;
  --fp:   #e55561;
  --def:  #7c849b;

  /* Roles */
  --jr:  #a78bfa;
  --sr:  #5499e8;
  --own: #e5a941;

  /* Shell */
  --sb-bg: #0a0c10;
  --ab-bg: #0e1015;

  /* Layout */
  --ab-w:   40px;
  --sb-w:   260px;
  --bp-h:   280px;
  --stat-h: 24px;

  /* Typography */
  --font: 'Segoe UI', -apple-system, sans-serif;
  --mono: 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;

  /* Effects (all off in legacy) */
  --effect-bloom:     none;
  --effect-scanlines: none;
  --radius:           4px;
}

/* ── Phosphor Dark — matrix/terminal green ── */
[data-theme="phosphor"] {
  /* Surfaces */
  --bg-void:    #05070a;
  --bg-base:    #0a0e0c;
  --bg-surface: #0f1512;
  --bg-el:      #141b17;
  --bg-ov:      #1a231e;
  --bg-hov:     rgba(95,255,159,.04);
  --bg-sel:     rgba(95,255,159,.10);

  /* Text */
  --txt:       #c8e6d4;
  --txt-s:     #7a9a87;
  --txt-m:     #4a6354;
  --txt-ghost: #2a3a30;

  /* Brand → phosphor green */
  --brand:   #5fff9f;
  --brand-h: #3de080;
  --brand-d: rgba(95,255,159,.08);

  /* Borders */
  --bdr:   #1f2a23;
  --bdr-a: #2d4034;
  --foc:   rgba(95,255,159,.35);

  /* Semantic */
  --crit: #ff5555;
  --warn: #ffb454;
  --info: #5ce1ff;
  --acc:  #5fff9f;
  --fp:   #ff5555;
  --def:  #7a9a87;

  /* Roles */
  --jr:  #c58cff;
  --sr:  #5ce1ff;
  --own: #ffb454;

  /* Shell */
  --sb-bg: #05070a;
  --ab-bg: #0a0e0c;

  /* Typography — go full mono */
  --font: 'IBM Plex Mono', 'JetBrains Mono', Consolas, monospace;
  --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

  /* Effects */
  --effect-bloom:     0 0 6px currentColor;
  --effect-scanlines: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0,0,0,.08) 2px 3px
  );
  --radius: 0px;
}

/* ── Blueprint Light — ink on engineering paper ── */
[data-theme="blueprint"] {
  /* Surfaces */
  --bg-base:    #E8EEF4;
  --bg-surface: #DCE5EF;
  --bg-el:      #CDD9E8;
  --bg-ov:      #C4D2E3;
  --bg-hov:     rgba(14,78,138,.06);
  --bg-sel:     rgba(14,78,138,.12);

  /* Text */
  --txt:       #0B1F3A;
  --txt-s:     #2a4a6a;
  --txt-m:     #4A6076;
  --txt-ghost: rgba(11,31,58,.2);

  /* Brand → drafting blue */
  --brand:   #0E4E8A;
  --brand-h: #0a3d6e;
  --brand-d: rgba(14,78,138,.10);

  /* Borders */
  --bdr:   rgba(11,31,58,.18);
  --bdr-a: rgba(11,31,58,.35);
  --foc:   rgba(14,78,138,.4);

  /* Semantic */
  --crit: #A12727;
  --warn: #B8860B;
  --info: #0E4E8A;
  --acc:  #1F6F4A;
  --fp:   #A12727;
  --def:  #4A6076;

  /* Roles */
  --jr:  #6B21A8;
  --sr:  #0E4E8A;
  --own: #B44A00;

  /* Shell */
  --sb-bg: #D5E0EC;
  --ab-bg: #DCE5EF;

  /* Typography */
  --font: 'IBM Plex Mono', 'JetBrains Mono', Consolas, monospace;
  --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

  /* Effects (none in light mode) */
  --effect-bloom:     none;
  --effect-scanlines: none;
  --radius: 2px;
}

/* ── Auto mode: follow prefers-color-scheme ── */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    /* Inherit phosphor dark */
    --bg-void:    #05070a;
    --bg-base:    #0a0e0c;
    --bg-surface: #0f1512;
    --bg-el:      #141b17;
    --bg-ov:      #1a231e;
    --bg-hov:     rgba(95,255,159,.04);
    --bg-sel:     rgba(95,255,159,.10);
    --txt:        #c8e6d4;
    --txt-s:      #7a9a87;
    --txt-m:      #4a6354;
    --brand:      #5fff9f;
    --brand-h:    #3de080;
    --brand-d:    rgba(95,255,159,.08);
    --bdr:        #1f2a23;
    --bdr-a:      #2d4034;
    --foc:        rgba(95,255,159,.35);
    --crit:       #ff5555;
    --warn:       #ffb454;
    --info:       #5ce1ff;
    --acc:        #5fff9f;
    --fp:         #ff5555;
    --def:        #7a9a87;
    --jr:         #c58cff;
    --sr:         #5ce1ff;
    --own:        #ffb454;
    --sb-bg:      #05070a;
    --ab-bg:      #0a0e0c;
    --font:       'IBM Plex Mono', 'JetBrains Mono', Consolas, monospace;
    --mono:       'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
    --effect-bloom:     0 0 6px currentColor;
    --effect-scanlines: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,.08) 2px 3px);
    --radius: 0px;
  }
}

@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    /* Inherit blueprint light */
    --bg-base:    #E8EEF4;
    --bg-surface: #DCE5EF;
    --bg-el:      #CDD9E8;
    --bg-ov:      #C4D2E3;
    --bg-hov:     rgba(14,78,138,.06);
    --bg-sel:     rgba(14,78,138,.12);
    --txt:        #0B1F3A;
    --txt-s:      #2a4a6a;
    --txt-m:      #4A6076;
    --brand:      #0E4E8A;
    --brand-h:    #0a3d6e;
    --brand-d:    rgba(14,78,138,.10);
    --bdr:        rgba(11,31,58,.18);
    --bdr-a:      rgba(11,31,58,.35);
    --foc:        rgba(14,78,138,.4);
    --crit:       #A12727;
    --warn:       #B8860B;
    --info:       #0E4E8A;
    --acc:        #1F6F4A;
    --fp:         #A12727;
    --def:        #4A6076;
    --jr:         #6B21A8;
    --sr:         #0E4E8A;
    --own:        #B44A00;
    --sb-bg:      #D5E0EC;
    --ab-bg:      #DCE5EF;
    --font:       'IBM Plex Mono', 'JetBrains Mono', Consolas, monospace;
    --mono:       'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
    --effect-bloom:     none;
    --effect-scanlines: none;
    --radius: 2px;
  }
}
