/* Design tokens.
 *
 * The navy and blue are taken from the project's own slide palette so the web
 * document reads as a continuation of the deck. Chart colours are categorical
 * slots assigned to schedulers as entities (see backend/config.py) and reused
 * identically in every figure, so a scheduler's colour never shifts between
 * charts and no filter repaints the survivors.
 *
 * Light is the default because this artifact has to print to PDF cleanly, so the
 * light palette is the one tuned for paper as well as screen.
 */

:root {
  /* Brand */
  --brand-navy:        #1a2744;
  --brand-navy-deep:   #0d1f4e;
  --brand-blue:        #1e6bd3;
  --brand-blue-soft:   #e8f0fc;
  --brand-gold:        #ffd54f;

  /* Surfaces */
  --page:              #f8f9ff;
  --surface-1:         #ffffff;
  --surface-2:         #f3f4fa;
  --surface-sunken:    #eef0f7;

  /* Ink */
  --text-primary:      #0b0b0b;
  --text-secondary:    #52514e;
  --text-muted:        #898781;
  --text-on-navy:      #ffffff;
  --text-on-navy-dim:  #aaccff;

  /* Lines */
  --gridline:          #e1e0d9;
  --baseline:          #c3c2b7;
  --border:            rgba(11, 11, 11, 0.10);
  --border-strong:     rgba(11, 11, 11, 0.18);

  /* Categorical series slots, fixed order */
  --series-1:          #2a78d6;  /* Round-Robin */
  --series-2:          #eb6834;  /* Random */
  --series-3:          #1baf7a;  /* Adaptive UCB */
  --series-4:          #eda100;  /* Q-Learning */
  --series-5:          #e87ba4;  /* Q-Learning + SmartDwell */
  --series-6:          #008300;  /* SmartDwell + Dual-Band */
  --series-neutral:    #52514e;  /* bands and marks outside the scheduler palette */

  /* Status colours, reserved and never reused as a series colour */
  --status-good:       #0ca30c;
  --status-warning:    #fab219;
  --status-serious:    #ec835a;
  --status-critical:   #d03b3b;
  --delta-good-text:   #006300;

  /* Spectrum waterfall: status encoding, not categorical */
  --wf-truth:          #c8d4e4;  /* a band is transmitting */
  --wf-surface:        #fbfcfe;
  --wf-dwell:          #8fa3bd;  /* receiver looked here, found nothing */
  --wf-hit:            #d03b3b;  /* intercept */
  --wf-false-alarm:    #fab219;  /* receiver reported a hit; nothing was there */
  --wf-cursor:         #1a2744;

  /* Type */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;

  /* Space and shape */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap:    16px;
  --gap-lg: 28px;
  --gap-xl: 48px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow:    0 2px 8px rgba(16, 24, 40, 0.08);
  --measure:   72ch;

  color-scheme: light;
}

/* Dark mode. Selected rather than an automatic flip: each series slot is
 * re-stepped for the dark surface and checked against it.
 */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --page:             #0d0d0d;
    --surface-1:        #1a1a19;
    --surface-2:        #232322;
    --surface-sunken:   #141413;

    --text-primary:     #ffffff;
    --text-secondary:   #c3c2b7;
    --text-muted:       #898781;

    --gridline:         #2c2c2a;
    --baseline:         #383835;
    --border:           rgba(255, 255, 255, 0.10);
    --border-strong:    rgba(255, 255, 255, 0.18);

    --series-1:         #3987e5;
    --series-2:         #d95926;
    --series-3:         #199e70;
    --series-4:         #c98500;
    --series-5:         #d55181;
    --series-6:         #008300;
    --series-neutral:   #c3c2b7;

    --delta-good-text:  #0ca30c;

    --wf-truth:         #3a4658;
    --wf-surface:       #141413;
    --wf-dwell:         #6b7c95;
    --wf-cursor:        #ffffff;

    --brand-blue-soft:  #16243a;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --page:             #0d0d0d;
  --surface-1:        #1a1a19;
  --surface-2:        #232322;
  --surface-sunken:   #141413;

  --text-primary:     #ffffff;
  --text-secondary:   #c3c2b7;
  --text-muted:       #898781;

  --gridline:         #2c2c2a;
  --baseline:         #383835;
  --border:           rgba(255, 255, 255, 0.10);
  --border-strong:    rgba(255, 255, 255, 0.18);

  --series-1:         #3987e5;
  --series-2:         #d95926;
  --series-3:         #199e70;
  --series-4:         #c98500;
  --series-5:         #d55181;
  --series-6:         #008300;
  --series-neutral:   #c3c2b7;

  --delta-good-text:  #0ca30c;

  --wf-truth:         #3a4658;
  --wf-surface:       #141413;
  --wf-dwell:         #6b7c95;
  --wf-cursor:        #ffffff;

  --brand-blue-soft:  #16243a;

  color-scheme: dark;
}
