/*
 * Copy of assets/brand/tokens.css — keep in sync.
 * (Do not edit here; change assets/brand/tokens.css and copy it over.)
 */

/*
 * IRL StreamGate — design tokens
 * Dark mode is the default. Light mode applies via prefers-color-scheme (unless the page forces
 * data-theme="dark") or explicitly via <html data-theme="light">.
 * The WPF app mirrors these values in XAML (see palette.md for ARGB equivalents).
 * Contrast numbers for every text/UI pair: palette.md.
 */

:root {
  color-scheme: dark;

  /* ---- raw palette (do not use directly in components; use the semantic tokens below) ---- */
  --palette-navy-950: #0B1220;   /* brand navy: icon tile, dark background */
  --palette-navy-900: #111A2C;
  --palette-navy-850: #18233A;
  --palette-navy-800: #26334A;
  --palette-slate-500: #6B7A93;
  --palette-slate-400: #9AA8BC;
  --palette-slate-100: #E6EDF7;
  --palette-teal-300: #5EDFDB;
  --palette-teal-400: #2EC4C2;
  --palette-teal-450: #2BBDBB;
  --palette-teal-500: #0EA5A4;   /* brand teal: gate arch, "IRL" on dark */
  --palette-teal-700: #0F766E;   /* dark teal: "IRL" on light, primary on light */
  --palette-teal-800: #115E59;
  --palette-red-500: #EF4444;    /* brand signal red AND offline status red (same hex today, separate tokens) */
  --palette-red-400: #F87171;
  --palette-red-700: #B91C1C;
  --palette-green-500: #22C55E;
  --palette-green-700: #15803D;
  --palette-amber-500: #F59E0B;
  --palette-amber-700: #B45309;
  --palette-white: #FFFFFF;
  --palette-paper: #F6F8FB;

  /* ---- brand (fixed, mode-independent logo colours) ---- */
  --brand-navy: #0B1220;
  --brand-teal: #0EA5A4;
  --brand-teal-dark: #0F766E;
  --brand-signal: #EF4444;

  /* ---- semantic colours: dark (default) ---- */
  --color-bg: #0B1220;
  --color-surface: #111A2C;
  --color-surface-2: #18233A;
  --color-border: #26334A;          /* decorative dividers / card outlines */
  --color-border-strong: #6B7A93;   /* input and control borders (>= 3:1) */
  --color-text: #E6EDF7;
  --color-text-muted: #9AA8BC;
  --color-primary: #0EA5A4;
  --color-primary-hover: #2BBDBB;
  --color-primary-contrast: #0B1220; /* text/icons on a primary-filled button */
  --color-link: #2EC4C2;
  --color-focus: #5EDFDB;
  --color-signal: #EF4444;          /* brand red: "on air" accents, graphics only (never body text) */

  /* status (app UI: Live / Low / Offline) */
  --color-live: #22C55E;
  --color-low: #F59E0B;
  --color-offline: #F87171;         /* lightened from #EF4444: #EF4444 is only 4.16:1 on surface-2 */
  --color-live-bg: #0F2A1F;
  --color-low-bg: #2E2210;
  --color-offline-bg: #341719;

  /* ---- typography ---- */
  --font-sans: "Rubik", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: clamp(1.75rem, 1.45rem + 1.2vw, 2.25rem);
  --text-4xl: clamp(2.25rem, 1.6rem + 2.8vw, 3.5rem);
  --leading-tight: 1.2;
  --leading-normal: 1.6;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 700;
  --weight-extrabold: 800;

  /* ---- spacing (4px base: --space-n = n x 4px) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-10: 2.5rem;
  --space-11: 2.75rem;
  --space-12: 3rem;
  --space-13: 3.25rem;
  --space-14: 3.5rem;
  --space-15: 3.75rem;
  --space-16: 4rem;

  /* ---- shape & depth ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.35);
  --shadow-md: 0 4px 12px rgb(0 0 0 / 0.35), 0 1px 3px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 16px 40px rgb(0 0 0 / 0.45), 0 4px 12px rgb(0 0 0 / 0.3);

  /* ---- layout & motion ---- */
  --max-width: 72rem;
  --duration-fast: 120ms;
  --duration-normal: 220ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- light mode: follows the OS unless the page forces dark ---- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --color-bg: #F6F8FB;
    --color-surface: #FFFFFF;
    --color-surface-2: #F1F4F8;
    --color-border: #D5DCE6;
    --color-border-strong: #7C8AA0;
    --color-text: #0B1220;
    --color-text-muted: #4A5568;
    --color-primary: #0F766E;          /* #0EA5A4 is only 2.85:1 on light */
    --color-primary-hover: #115E59;
    --color-primary-contrast: #FFFFFF;
    --color-link: #0F766E;
    --color-focus: #0F766E;
    --color-signal: #EF4444;
    --color-live: #15803D;             /* #22C55E is only 2.14:1 on light */
    --color-low: #B45309;              /* #F59E0B is only 2.02:1 on light */
    --color-offline: #B91C1C;
    --color-live-bg: #DCFCE7;
    --color-low-bg: #FEF3C7;
    --color-offline-bg: #FEE2E2;
    --shadow-sm: 0 1px 2px rgb(11 18 32 / 0.08);
    --shadow-md: 0 4px 12px rgb(11 18 32 / 0.1), 0 1px 3px rgb(11 18 32 / 0.08);
    --shadow-lg: 0 16px 40px rgb(11 18 32 / 0.14), 0 4px 12px rgb(11 18 32 / 0.08);
  }
}

/* ---- light mode: explicit opt-in ---- */
:root[data-theme="light"] {
  color-scheme: light;
  --color-bg: #F6F8FB;
  --color-surface: #FFFFFF;
  --color-surface-2: #F1F4F8;
  --color-border: #D5DCE6;
  --color-border-strong: #7C8AA0;
  --color-text: #0B1220;
  --color-text-muted: #4A5568;
  --color-primary: #0F766E;
  --color-primary-hover: #115E59;
  --color-primary-contrast: #FFFFFF;
  --color-link: #0F766E;
  --color-focus: #0F766E;
  --color-signal: #EF4444;
  --color-live: #15803D;
  --color-low: #B45309;
  --color-offline: #B91C1C;
  --color-live-bg: #DCFCE7;
  --color-low-bg: #FEF3C7;
  --color-offline-bg: #FEE2E2;
  --shadow-sm: 0 1px 2px rgb(11 18 32 / 0.08);
  --shadow-md: 0 4px 12px rgb(11 18 32 / 0.1), 0 1px 3px rgb(11 18 32 / 0.08);
  --shadow-lg: 0 16px 40px rgb(11 18 32 / 0.14), 0 4px 12px rgb(11 18 32 / 0.08);
}
