/* ========================================
   Design tokens: fonts, colors, scales
   Loaded before every other stylesheet (partials/head). Only this file sets theme colors;
   everything else uses the variables. A palette sets --primary (and the neutrals): the
   tints below follow it in both themes.
   ======================================== */

@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;
}

/* Dark (default) */
:root {
  color-scheme: dark;

  /* Neutrals */
  --background: #09090b;
  --foreground: #fafafa;
  --card: #111113;
  --card-foreground: #fafafa;
  --secondary: #1c1c1f;
  --secondary-foreground: #fafafa;
  --muted: #27272a;
  --muted-foreground: #a1a1aa;
  --border: #27272a;
  --border-hover: #3f3f46;
  --input: #18181b;

  /* Accent (palette) */
  --primary: #34d399;
  --primary-foreground: #04120c;
  --ring: var(--primary);

  /* Signals */
  --destructive: #f87171;
  --destructive-foreground: #1a0606;
  --warning: #fbbf24;

  /* Derived: tints of the accent and signals */
  --status-active-bg: color-mix(in srgb, var(--primary) 10%, transparent);
  --status-active-border: color-mix(in srgb, var(--primary) 30%, transparent);
  --status-active-text: var(--primary);
  --status-error-bg: color-mix(in srgb, var(--destructive) 10%, transparent);
  --status-error-border: color-mix(in srgb, var(--destructive) 30%, transparent);
  --status-error-text: var(--destructive);
  --status-warning-bg: color-mix(in srgb, var(--warning) 10%, transparent);
  --status-warning-border: color-mix(in srgb, var(--warning) 30%, transparent);
  --status-warning-text: var(--warning);
  --chart-background: color-mix(in srgb, var(--primary) 4%, transparent);
  --chart-border: color-mix(in srgb, var(--primary) 18%, transparent);
  --chart-text: var(--foreground);
  --chart-muted-text: var(--muted-foreground);
  --chart-data-text: var(--foreground);
  --info-bg: color-mix(in srgb, var(--primary) 5%, transparent);
  --info-border: color-mix(in srgb, var(--primary) 20%, transparent);
  --info-text: var(--muted-foreground);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);

  /* Surfaces */
  --card-background: var(--card);
  --input-background: var(--input);
  --muted-hover: var(--muted);
  --table-header-bg: color-mix(in srgb, var(--secondary) 60%, transparent);
  --table-row-hover: color-mix(in srgb, var(--secondary) 50%, transparent);
  --modal-overlay-bg: rgba(0, 0, 0, 0.7);

  /* Fonts */
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Type scale */
  --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: 1.875rem;
  --text-4xl: 2.25rem;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;

  /* Radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 24px -6px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 24px 48px -12px rgba(0, 0, 0, 0.55);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* Light */
html[data-theme="light"] {
  color-scheme: light;

  --background: #fafafa;
  --foreground: #09090b;
  --card: #ffffff;
  --card-foreground: #09090b;
  --secondary: #f4f4f5;
  --secondary-foreground: #09090b;
  --muted: #e4e4e7;
  --muted-foreground: #71717a;
  --border: #e4e4e7;
  --border-hover: #d4d4d8;
  --input: #ffffff;

  --primary: #047857;
  --primary-foreground: #ffffff;
  --ring: var(--primary);

  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --warning: #b45309;

  --modal-overlay-bg: rgba(9, 9, 11, 0.4);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 24px -6px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 24px 48px -12px rgba(0, 0, 0, 0.12);
}
