/*
  Design tokens (single source of truth)
  - Light mode is default
  - Dark mode is enabled by setting: html[data-theme="dark"]

  Notes:
  - Keep variables semantic (what) not presentational (how)
  - Prefer using tokens in components/layout files
*/

:root {
  /* Typography */
  --font-sans: Montserrat, Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.2;
  --leading-normal: 1.5;

  /* Spacing (4px base) */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Radius */
  --radius-xs: 0.375rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.625rem;
  --radius-pill: 999px;

  /* Shadows (subtle, corporate) */
  --shadow-xs: 0 1px 0 rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.14);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --dur-quick: 120ms;
  --dur-standard: 180ms;
  --dur-slow: 260ms;

  /* Neutral scale */
  --neutral-0: #ffffff;
  --neutral-25: #fcfcfd;
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1f2937;
  --neutral-900: #0f172a;

  /* Brand + semantic colors */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;

  --success-50: #ecfdf5;
  --success-600: #16a34a;

  --warning-50: #fffbeb;
  --warning-600: #d97706;

  --danger-50: #fef2f2;
  --danger-600: #dc2626;

  --info-50: #ecfeff;
  --info-600: #0891b2;

  /* Accent (enterprise highlight) */
  --accent-500: #f59e0b;
  --accent-600: #d97706;

  /* Surfaces */
  --surface-app: var(--neutral-50);
  --surface-page: var(--neutral-50);
  --surface-card: var(--neutral-0);
  --surface-elevated: var(--neutral-0);

  /* Text */
  --text-strong: var(--neutral-900);
  --text-default: var(--neutral-800);
  --text-muted: var(--neutral-600);
  --text-subtle: var(--neutral-500);
  --text-inverse: var(--neutral-0);

  /* Borders */
  --border: var(--neutral-200);
  --border-strong: var(--neutral-300);

  /* Focus */
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.25);

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-width-collapsed: 72px;
  --topbar-height: 52px;

  /* Component sizing */
  --control-height: 38px;
}

html[data-theme="dark"] {
  /* Slightly lighter navy canvas (premium enterprise) */
  --surface-app: #0b1430;
  --surface-page: #0b1430;
  --surface-card: #0f1b3d;
  --surface-elevated: #121f47;

  --text-strong: #f8fafc;
  --text-default: #e2e8f0;
  --text-muted: #a7b4c6;
  --text-subtle: #8091a8;

  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.24);

  --shadow-xs: 0 1px 0 rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 56px rgba(0, 0, 0, 0.55);

  --focus-ring: 0 0 0 3px rgba(96, 165, 250, 0.28);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-quick: 0ms;
    --dur-standard: 0ms;
    --dur-slow: 0ms;
  }
}
