/* Design tokens. The single source of color, type, space, radius, elevation and motion (see DESIGN.md).
   Dark is the default; light applies with data-theme="light", or with the system setting when no theme is chosen. */

@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #07090d;
  --surface: #0d1117;
  --raised: #131922;
  --overlay: #18202b;
  --sunken: #0a0d12;
  --line-subtle: rgba(148, 163, 184, 0.10);
  --line: rgba(148, 163, 184, 0.17);
  --line-strong: rgba(148, 163, 184, 0.30);
  --line-input: rgba(148, 163, 184, 0.58);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  /* Text */
  --text: #edf2f7;
  --text-2: #a6b3c3;
  --text-3: #7f8da0;

  /* Accent (the only interactive color) */
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-ink: #032420;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-line: rgba(45, 212, 191, 0.35);
  --focus: #5eead4;

  /* Semantic (always paired with an icon or label) */
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);
  --neutral-soft: rgba(148, 163, 184, 0.12);

  /* Products: identity and chart series only */
  --p-team: #6ea8fe;
  --p-intel: #a78bfa;
  --p-creator: #e879f9;
  --p-model: #f472b6;
  --p-nexus: #fb923c;
  --p-ready: #a3e635;

  /* Charts */
  --chart-grid: rgba(148, 163, 184, 0.10);
  --chart-1: #8b9bb0;
  /* Categorical series for charts that are neither products nor states: --c1 is the neutral ink, the rest stay off the
     accent and the semantic hues. */
  --c1: var(--chart-1);
  --c2: #7dd3fc;
  --c3: #c4b5fd;
  --c4: #f9a8d4;
  --c5: #fdba74;
  --c6: #bef264;
  --chart-axis: #7f8da0;
  --chart-cursor: rgba(237, 242, 247, 0.35);
  --seq-0: rgba(148, 163, 184, 0.08);
  --seq-1: rgba(45, 212, 191, 0.22);
  --seq-2: rgba(45, 212, 191, 0.42);
  --seq-3: rgba(45, 212, 191, 0.66);
  --seq-4: #2dd4bf;

  /* Elevation */
  --shadow-panel: var(--highlight);
  --shadow-overlay: 0 24px 64px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  --scrim: rgba(3, 5, 8, 0.62);

  /* Type */
  --font-sans: 'Geist', ui-sans-serif, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-display: 2rem;
  --lh-display: 2.25rem;
  --fs-kpi: 2.25rem;
  --fs-xl: 1.375rem;
  --lh-xl: 1.75rem;
  --fs-lg: 1.0625rem;
  --lh-lg: 1.5rem;
  --fs-md: 1rem;
  --lh-md: 1.5rem;
  --fs-sm: 0.875rem;
  --lh-sm: 1.25rem;
  --fs-xs: 0.75rem;
  --lh-xs: 1rem;

  /* Space (4px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-full: 999px;

  /* Motion */
  --t-micro: 120ms;
  --t-short: 200ms;
  --t-medium: 320ms;
  --t-long: 480ms;
  --ease-enter: cubic-bezier(.2, .8, .2, 1);
  --ease-exit: cubic-bezier(.4, 0, 1, 1);
  --ease-move: cubic-bezier(.4, 0, .2, 1);

  /* Layout */
  --sidebar: 256px;
  --sidebar-collapsed: 72px;
  --topbar: 60px;
  --content-max: 1440px;
  --gutter: 24px;
  --z-sticky: 20;
  --z-overlay: 40;
  --z-toast: 60;

  /* Device insets: a notched phone reserves space around the screen and under the home indicator.
     Overridable so a layout can be measured against a simulated inset. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

@media (max-width: 899px) {
  :root { --gutter: 16px; }
}

/* Light theme: an explicit choice, or the system preference when nothing is chosen. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --raised: #f9fafb;
  --overlay: #ffffff;
  --sunken: #eef1f4;
  --line-subtle: rgba(15, 23, 42, 0.07);
  --line: rgba(15, 23, 42, 0.12);
  --line-strong: rgba(15, 23, 42, 0.22);
  --line-input: rgba(15, 23, 42, 0.52);
  --highlight: 0 1px 2px rgba(15, 23, 42, 0.06);
  --text: #0b1220;
  --text-2: #475569;
  --text-3: #5f6b7c;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 118, 110, 0.10);
  --accent-line: rgba(15, 118, 110, 0.35);
  --focus: #0f766e;
  --ok: #166534;
  --ok-soft: rgba(22, 101, 52, 0.10);
  --warn: #854d0e;
  --warn-soft: rgba(133, 77, 14, 0.10);
  --danger: #b91c1c;
  --danger-soft: rgba(185, 28, 28, 0.09);
  --info: #1d4ed8;
  --info-soft: rgba(29, 78, 216, 0.09);
  --neutral-soft: rgba(15, 23, 42, 0.06);
  --p-team: #2563eb;
  --p-intel: #6d28d9;
  --p-creator: #a21caf;
  --p-model: #be185d;
  --p-nexus: #c2410c;
  --p-ready: #4d7c0f;
  --chart-grid: rgba(15, 23, 42, 0.07);
  --chart-1: #64748b;
  --c2: #0369a1;
  --c3: #6d28d9;
  --c4: #be185d;
  --c5: #c2410c;
  --c6: #4d7c0f;
  --chart-axis: #5f6b7c;
  --chart-cursor: rgba(11, 18, 32, 0.3);
  --seq-0: rgba(15, 23, 42, 0.06);
  --seq-1: rgba(15, 118, 110, 0.18);
  --seq-2: rgba(15, 118, 110, 0.38);
  --seq-3: rgba(15, 118, 110, 0.62);
  --seq-4: #0f766e;
  --shadow-panel: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-overlay: 0 24px 64px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
  --scrim: rgba(15, 23, 42, 0.32);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --raised: #f9fafb;
    --overlay: #ffffff;
    --sunken: #eef1f4;
    --line-subtle: rgba(15, 23, 42, 0.07);
    --line: rgba(15, 23, 42, 0.12);
    --line-strong: rgba(15, 23, 42, 0.22);
    --line-input: rgba(15, 23, 42, 0.52);
    --highlight: 0 1px 2px rgba(15, 23, 42, 0.06);
    --text: #0b1220;
    --text-2: #475569;
    --text-3: #5f6b7c;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --accent-ink: #ffffff;
    --accent-soft: rgba(15, 118, 110, 0.10);
    --accent-line: rgba(15, 118, 110, 0.35);
    --focus: #0f766e;
    --ok: #166534;
    --ok-soft: rgba(22, 101, 52, 0.10);
    --warn: #854d0e;
    --warn-soft: rgba(133, 77, 14, 0.10);
    --danger: #b91c1c;
    --danger-soft: rgba(185, 28, 28, 0.09);
    --info: #1d4ed8;
    --info-soft: rgba(29, 78, 216, 0.09);
    --neutral-soft: rgba(15, 23, 42, 0.06);
    --p-team: #2563eb;
    --p-intel: #6d28d9;
    --p-creator: #a21caf;
    --p-model: #be185d;
    --p-nexus: #c2410c;
    --p-ready: #4d7c0f;
    --chart-grid: rgba(15, 23, 42, 0.07);
    --chart-1: #64748b;
    --c2: #0369a1;
    --c3: #6d28d9;
    --c4: #be185d;
    --c5: #c2410c;
    --c6: #4d7c0f;
    --chart-axis: #5f6b7c;
    --chart-cursor: rgba(11, 18, 32, 0.3);
    --seq-0: rgba(15, 23, 42, 0.06);
    --seq-1: rgba(15, 118, 110, 0.18);
    --seq-2: rgba(15, 118, 110, 0.38);
    --seq-3: rgba(15, 118, 110, 0.62);
    --seq-4: #0f766e;
    --shadow-panel: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-overlay: 0 24px 64px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
    --scrim: rgba(15, 23, 42, 0.32);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --t-micro: 0ms;
    --t-short: 0ms;
    --t-medium: 0ms;
    --t-long: 0ms;
  }
}
