/* NBCUni Design System — tokens.
   Every component reads from these.  Never hardcode a hex in a component.
   Light is the base; dark overrides it.  The theme follows the system until the person picks one,
   and theme-boot (in ds.js) sets data-theme on <html> before first paint. */

:root {
  color-scheme: light;

  /* Brand */
  --uphe-purple: #400095;
  --uphe-purple-light: #6e54dc;
  --uphe-purple-dark: #2d0066;
  --nbcu-yellow: #fcb711;
  --nbcu-orange: #f37021;
  --nbcu-red: #cc004c;
  --nbcu-purple: #6460aa;
  --nbcu-blue: #0089d0;
  --nbcu-green: #0db14b;

  /* Surfaces, from the window outward.  Neutrals lean toward the accent, never plain gray. */
  --canvas: #f3f2f8;          /* the window: sidebar, gutters behind content */
  --surface: #ffffff;         /* content panes, cards */
  --surface-2: #f9f8fc;       /* raised areas inside a pane: headers, tile footers */
  --surface-sunken: #eeecf5;  /* wells, tracks, inputs at rest */
  --surface-glass: rgb(246 245 251 / 0.72);  /* sidebar and toolbars over scrolling content */
  --overlay: rgb(20 14 40 / 0.32);           /* behind sheets */

  --line: #e6e3ef;
  --line-strong: #d3cfe2;
  --hover: rgb(64 0 149 / 0.055);
  --press: rgb(64 0 149 / 0.1);

  /* Text */
  --text: #1b1a26;
  --text-2: #5b596e;          /* secondary, 6.6:1 on surface */
  --text-3: #686680;          /* tertiary and placeholders, AA on every light surface */
  --text-on-accent: #ffffff;

  /* Accent */
  --accent: #400095;          /* text, links, headline numbers */
  --accent-fill: #400095;     /* filled controls carrying white text */
  --accent-fill-hover: #5523b0;
  --accent-tint: #efe9fb;     /* selected rows, active nav */
  --accent-tint-strong: #e0d6f7;
  --accent-ring: rgb(110 84 220 / 0.45);

  /* Status.  -fg is for text and icons (AA on surface), -dot for marks and fills, -tint for backgrounds. */
  --ok-fg: #08773a;     --ok-dot: #0db14b;     --ok-tint: #e3f6ea;
  --warn-fg: #8a5a00;   --warn-dot: #f0a800;   --warn-tint: #fff4d6;
  --bad-fg: #b0003f;    --bad-dot: #cc004c;    --bad-tint: #fde6ee;
  --info-fg: #006aa3;   --info-dot: #0089d0;   --info-tint: #e2f2fb;
  --idle-fg: #5b596e;   --idle-dot: #a8a5ba;   --idle-tint: #efeef4;

  /* Categorical series for charts, in order.  Brand purple leads; status hues come last. */
  --series-1: #6e54dc;
  --series-2: #0089d0;
  --series-3: #f37021;
  --series-4: #0db14b;
  --series-5: #c2399a;
  --series-6: #fcb711;
  --series-7: #404569;
  --series-8: #8fa3c7;

  /* Type.  Calibri for now (Adam, 2026-11-05); the system face covers machines without it. */
  --font: Calibri, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-display: var(--font);
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --fs-caption: 11px;
  --fs-small: 12px;
  --fs-control: 13px;
  --fs-body: 14px;
  --fs-h3: 15px;
  --fs-h2: 18px;
  --fs-h1: 24px;
  --fs-figure: 30px;   /* headline numbers in stat tiles */
  --lh-tight: 1.2;
  --lh-body: 1.5;

  /* Space, on a 4px grid */
  --sp-1: 2px;
  --sp-2: 4px;
  --sp-3: 6px;
  --sp-4: 8px;
  --sp-5: 12px;
  --sp-6: 16px;
  --sp-7: 20px;
  --sp-8: 24px;
  --sp-9: 32px;
  --sp-10: 40px;

  /* Shape */
  --r-xs: 4px;    /* menu items, cells */
  --r-sm: 6px;    /* controls */
  --r-md: 8px;    /* inputs, popovers */
  --r-lg: 12px;   /* cards, tiles */
  --r-xl: 14px;   /* sheets, windows */
  --r-pill: 999px;

  /* Size */
  --control-h: 30px;
  --control-h-sm: 24px;
  --control-h-lg: 36px;
  --sidebar-w: 272px;
  --sidebar-min: 220px;
  --sidebar-max: 360px;
  --dock-w: 380px;
  --toolbar-h: 52px;
  --row-h: 34px;

  /* Elevation: a hairline plus a soft shadow, the way macOS layers windows */
  --shadow-1: 0 0 0 0.5px rgb(40 20 80 / 0.08), 0 1px 2px rgb(40 20 80 / 0.06);
  --shadow-2: 0 0 0 0.5px rgb(40 20 80 / 0.08), 0 2px 6px rgb(40 20 80 / 0.07), 0 8px 20px -8px rgb(40 20 80 / 0.12);
  --shadow-pop: 0 0 0 0.5px rgb(40 20 80 / 0.14), 0 10px 30px -6px rgb(40 20 80 / 0.24), 0 2px 6px rgb(40 20 80 / 0.08);
  --shadow-sheet: 0 0 0 0.5px rgb(40 20 80 / 0.14), 0 24px 60px -12px rgb(30 10 70 / 0.38);
  --shadow-lift: 0 0 0 0.5px rgb(40 20 80 / 0.12), 0 14px 28px -6px rgb(40 20 80 / 0.28);

  /* Motion.  Every duration sits in 90–420ms.  Motion explains a change; it never decorates. */
  --t-instant: 90ms;    /* press, toggle knobs */
  --t-fast: 140ms;      /* hover, color, focus */
  --t-base: 220ms;      /* enter and exit, indicators, pills */
  --t-slow: 320ms;      /* layout: reorder, panels, disclosure */
  --t-deliberate: 420ms;/* data: bars growing, numbers counting */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.32, 0.64, 1);  /* a small overshoot for things that land */
  --stagger: 28ms;

  /* Layers */
  --z-sticky: 10;
  --z-dock: 40;
  --z-menu: 1000;
  --z-tooltip: 1100;
  --z-sheet: 100000;
  --z-toast: 100050;
  --z-drag: 100100;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --canvas: #0e0d16;
  --surface: #16151f;
  --surface-2: #1b1a26;
  --surface-sunken: #0b0a12;
  --surface-glass: rgb(22 21 33 / 0.7);
  --overlay: rgb(0 0 0 / 0.5);

  --line: #2a2838;
  --line-strong: #3a3850;
  --hover: rgb(255 255 255 / 0.055);
  --press: rgb(255 255 255 / 0.1);

  --text: #ecebf4;
  --text-2: #a9a7bf;
  --text-3: #8b89a3;

  --accent: #a593f0;
  --accent-fill: #6e54dc;
  --accent-fill-hover: #765be0;   /* white text 4.84:1; lighter than the fill so hover still lifts */
  --accent-tint: rgb(144 124 228 / 0.17);
  --accent-tint-strong: rgb(144 124 228 / 0.28);
  --accent-ring: rgb(165 147 240 / 0.55);

  --ok-fg: #4fd98a;     --ok-dot: #2fc66c;     --ok-tint: rgb(47 198 108 / 0.15);
  --warn-fg: #ffc94d;   --warn-dot: #fcb711;   --warn-tint: rgb(252 183 17 / 0.15);
  --bad-fg: #ff7aa6;    --bad-dot: #ff3d7f;    --bad-tint: rgb(255 61 127 / 0.15);
  --info-fg: #5ec3f5;   --info-dot: #2aa7e8;   --info-tint: rgb(42 167 232 / 0.15);
  --idle-fg: #a9a7bf;   --idle-dot: #5e5c74;   --idle-tint: rgb(255 255 255 / 0.06);

  --series-1: #8f7af0;
  --series-2: #2aa7e8;
  --series-3: #ff8a47;
  --series-4: #2fc66c;
  --series-5: #e35fbd;
  --series-6: #ffc94d;
  --series-7: #8a90c2;
  --series-8: #5d6a8c;

  --shadow-1: 0 0 0 0.5px rgb(255 255 255 / 0.06), 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-2: 0 0 0 0.5px rgb(255 255 255 / 0.07), 0 2px 6px rgb(0 0 0 / 0.35), 0 8px 20px -8px rgb(0 0 0 / 0.5);
  --shadow-pop: 0 0 0 0.5px rgb(255 255 255 / 0.1), 0 12px 32px -6px rgb(0 0 0 / 0.6);
  --shadow-sheet: 0 0 0 0.5px rgb(255 255 255 / 0.1), 0 28px 70px -12px rgb(0 0 0 / 0.7);
  --shadow-lift: 0 0 0 0.5px rgb(255 255 255 / 0.12), 0 16px 32px -6px rgb(0 0 0 / 0.65);
}

/* Reduced motion keeps every state change but drops the travel: fades stay, movement goes. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --t-base: 1ms;
    --t-slow: 1ms;
    --t-deliberate: 1ms;
    --stagger: 0ms;
    --ease-spring: linear;
  }
}
