/* DediBlaze design tokens. The only file in public/ allowed to contain colour
 * literals (hex or rgb). Every other stylesheet uses var(--token).
 * Spec, contrast ratios and usage rules: docs/design-system.md.
 * Load order: styles.css → tokens.css → shell.css → servers.css → components.css. */
:root {
  color-scheme: dark;

  /* Surfaces: powder-coated rack steel, darkest at the back. */
  --bg: #0b0f14;            /* page */
  --surface: #11161d;       /* panels, tables, nav */
  --surface-2: #181f28;     /* raised: secondary buttons, menus, hover rows */
  --surface-3: #212934;     /* highest: toasts, selected rows, popovers */
  --line: #273140;          /* dividers and panel borders (decorative) */
  --line-strong: #3b4757;   /* emphasised dividers, chip outlines (decorative) */
  --control-border: #667387;/* input, select, checkbox borders: 3:1 or more on every surface */

  /* Text */
  --text: #e6ebf1;
  --muted: #9ba7b6;         /* secondary text: 6:1 or more on every surface */
  --faint: #8592a3;         /* tertiary text (meta, timestamps): 4.6:1 or more on every surface */

  /* Ember: the one action colour. Primary buttons and "your turn". */
  --accent: #f97316;
  --accent-strong: #ea580c; /* primary hover */
  --accent-ink: #1a0a00;    /* text on --accent */
  --accent-text: #fd9a4b;   /* accent used as text on a surface */
  --accent-soft: #2e1d12;   /* selected nav item, selected chip, "your turn" pill */
  --accent-line: #7a3f17;   /* border around --accent-soft */

  /* UID blue: the identify lamp. Links, focus and information. */
  --link: #7cbcff;
  --focus: #5aa9ff;
  --info: #5aa9ff;
  --info-text: #7cbcff;
  --info-soft: #132538;

  /* Front-panel LED states */
  --ok: #3fcf7f;  --ok-text: #5fdc96;  --ok-soft: #10281d;
  --warn: #f4b740; --warn-text: #f6c45f; --warn-soft: #2b2312;
  --danger: #f05252; --danger-text: #ff8a8a; --danger-soft: #2e1517;
  --danger-fill: #c22b2b; --danger-fill-strong: #a32222; --danger-ink: #ffffff;
  --off: #6b7686;           /* unlit LED ring */
  --overlay: rgb(3 5 8 / .72);  /* dialog and sheet backdrop */
  --glow-ok: rgb(63 207 127 / .22);
  --glow-info: rgb(90 169 255 / .25);
  --glow-warn: rgb(244 183 64 / .22);
  --glow-danger: rgb(240 82 82 / .22);
  --hover-row: rgb(255 255 255 / .025);
  --bg-translucent: rgb(11 15 20 / .94);       /* sticky phone top bar */
  --surface-translucent: rgb(17 22 29 / .97);  /* phone bottom nav */
  --code-bg: rgb(0 0 0 / .35);                 /* diff and log blocks */
  --frame-bg: #ffffff;                         /* third-party iframes that expect white (card form) */

  /* Paper: documents that look like print in both themes (invoice sheet, print). */
  --paper: #ffffff; --paper-ink: #18181b; --paper-muted: #52525b; --paper-strong: #3f3f46;
  --paper-line: #e4e4e7; --paper-rule: #a1a1aa; --paper-accent: #c2410c; --paper-note: #fff7ed; --print-ink: #000000;

  /* Charts: categorical series beside the LED colours (ops KPIs, bandwidth). */
  --chart-sky: #38bdf8; --chart-violet: #a78bfa;
  --bw-in: #2f86e8; --bw-out: #e8650f; --bw-p95: var(--muted);

  /* Type */
  --font-sans: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --text-xs: .75rem;      /* 12px  table meta, badges. Never smaller. */
  --text-sm: .8125rem;    /* 13px  labels, table headers, hints */
  --text-base: .875rem;   /* 14px  UI text: tables, buttons, inputs */
  --text-md: 1rem;        /* 16px  reading text, dialogs, section titles */
  --text-lg: 1.125rem;    /* 18px  panel and dialog titles */
  --text-xl: 1.375rem;    /* 22px  detail-page titles on phones, KPI values */
  --text-2xl: 1.625rem;   /* 26px  page titles */
  --text-3xl: 2.25rem;    /* 36px  public store headline only */
  --leading-tight: 1.2;
  --leading: 1.45;
  --leading-loose: 1.6;
  --weight-regular: 400;
  --weight-medium: 550;
  --weight-semibold: 650;
  --weight-bold: 720;

  /* Space: 4 px steps */
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;

  /* Radius: grows with the size of the object */
  --radius-xs: 3px;    /* tags: like a printed rack label */
  --radius-sm: 6px;    /* buttons, inputs, chips' focus box, menus */
  --radius: 10px;      /* panels, tables, tiles */
  --radius-lg: 14px;   /* dialogs, sheets */
  --radius-pill: 999px;/* status pills and filter chips only */

  /* Elevation: panels sit flat on borders; only floating layers cast shadows */
  --shadow-1: 0 6px 18px rgb(0 0 0 / .45);    /* menus, popovers, typeahead */
  --shadow-2: 0 14px 40px rgb(0 0 0 / .55);   /* drawers, toasts */
  --shadow-3: 0 28px 90px rgb(0 0 0 / .65);   /* dialogs */

  /* Layers */
  --z-raised: 1; --z-sticky: 20; --z-menu: 25; --z-topbar: 30; --z-scrim: 35; --z-nav: 40;
  --z-drawer: 45; --z-sheet: 50; --z-popover: 60; --z-toast: 70; --z-skip: 100;

  /* Motion */
  --dur-fast: 120ms; --dur: 180ms; --dur-slow: 260ms;
  --ease: cubic-bezier(.2, 0, 0, 1);

  /* Layout */
  --side-w: 236px;
  --content-max: 1320px;
  --reading-max: 52rem;
  --control-h: 38px;      /* default control height */
  --control-h-sm: 30px;   /* table row actions */
  --control-h-lg: 44px;   /* phone touch target, primary on public pages */
  --nav-phone-h: 60px;

  /* Public site brand (public/site.css only; PUBLIC-SITE-V2). Zinc night, ember, with cyan and
   * violet as the two secondary card accents from the owner's prototype. Contrast pairs are
   * checked in test/site-css.test.js. */
  --site-bg: #09090b; --site-bg-2: #0c0c0e; --site-surface: #111113; --site-surface-2: #18181b; --site-surface-3: #222226;
  --site-line: #27272a; --site-line-strong: #3f3f46;
  --site-text: #f4f4f5; --site-muted: #a1a1aa; --site-faint: #8b8b94;
  --site-ember: #f97316; --site-ember-strong: #ea580c; --site-ember-hot: #ef4444; --site-ember-text: #fb923c; --site-ember-pale: #fdba74; --site-ember-ink: #160800;
  --site-cyan: #22d3ee; --site-cyan-strong: #06b6d4; --site-blue: #3b82f6; --site-cyan-ink: #031418;
  --site-violet: #c084fc; --site-violet-strong: #a855f7; --site-pink: #ec4899; --site-violet-ink: #14051f;
  --site-led-green: #4ade80; --site-led-amber: #facc15; --site-led-off: #3f3f46;
  --site-ember-glow: rgb(249 115 22 / .28); --site-ember-haze: rgb(255 77 0 / .14); --site-ember-line: rgb(255 77 0 / .10);
  --site-cyan-glow: rgb(6 182 212 / .22); --site-cyan-haze: rgb(0 212 255 / .10); --site-violet-glow: rgb(168 85 247 / .22);
  --site-ember-soft: rgb(249 115 22 / .14); --site-cyan-soft: rgb(6 182 212 / .14); --site-violet-soft: rgb(168 85 247 / .14);
  --site-glass: rgb(9 9 11 / .82); --site-shade: rgb(0 0 0 / .5); --site-clear: rgb(0 0 0 / 0);
  --site-cta-warm: #2a1206; --site-cta-cool: #062226;
  /* Light reading surface for the text pages (E8 "bezel"). */
  --site-bezel: #eceef1; --site-bezel-2: #e2e5e9; --site-bezel-line: #c4c8cf; --site-sheet: #f6f7f9; --site-target: #fff3e8;
  --site-ink: #1b1e23; --site-ink-muted: #545a63; --site-ember-ink-dark: #9a3412;

  /* Legacy names still used by styles.css and older page rules. Do not use in new code. */
  --panel: var(--surface); --panel-2: var(--surface-2);
  --border: var(--line); --success: var(--ok); --accent-2: var(--accent-text);
  --radius-legacy: var(--radius);
}

/* Optional light theme: specified and contrast-checked, not yet switched on in
 * the console (legacy styles.css still hard-codes dark colours). The design
 * system page previews it with data-theme="light". */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fa; --surface: #ffffff; --surface-2: #eef1f5; --surface-3: #e3e8ee;
  --line: #d5dbe3; --line-strong: #b8c1cd; --control-border: #7c8899;
  --text: #111820; --muted: #4b5768; --faint: #5f6b7c;
  --accent: #c2410c; --accent-strong: #a8380a; --accent-ink: #ffffff; --accent-text: #b13a08; --accent-soft: #fdebdc; --accent-line: #f0b48a;
  --link: #0a5fc2; --focus: #0a5fc2; --info: #0a5fc2; --info-text: #0a5fc2; --info-soft: #e1edfb;
  --ok: #137a3c; --ok-text: #137a3c; --ok-soft: #e0f3e7;
  --warn: #8a5800; --warn-text: #8a5800; --warn-soft: #fbf0d9;
  --danger: #c22b2b; --danger-text: #c22b2b; --danger-soft: #fbe3e3;
  --danger-fill: #c22b2b; --danger-fill-strong: #a32222; --danger-ink: #ffffff;
  --off: #7c8899;
  --overlay: rgb(17 24 32 / .45);
  --hover-row: rgb(0 0 0 / .03);
  --shadow-1: 0 6px 18px rgb(17 24 32 / .12);
  --shadow-2: 0 14px 40px rgb(17 24 32 / .16);
  --shadow-3: 0 28px 90px rgb(17 24 32 / .22);
}
