/* ============================================
   TOC Design Tokens — CSS Custom Properties
   Single source of truth for all visual design
   ============================================ */

/* ── Color Palette ── */
:root {
  /* Brand */
  --color-brand-50: #ede9fe;
  --color-brand-100: #ddd6fe;
  --color-brand-200: #c4b5fd;
  --color-brand-300: #a78bfa;
  --color-brand-400: #8b5cf6;
  --color-brand-500: #7c3aed;
  --color-brand-600: #6d28d9;
  --color-brand-700: #5b21b6;

  /* Accent */
  --color-accent-400: #f59e0b;
  --color-accent-500: #d97706;

  /* Semantic */
  --color-success-400: #34d399;
  --color-success-500: #10b981;
  --color-warning-400: #fbbf24;
  --color-warning-500: #f59e0b;
  --color-error-400: #f87171;
  --color-error-500: #ef4444;

  /* Surface */
  --color-surface-0: #ffffff;
  --color-surface-1: #f9fafb;
  --color-surface-2: #f3f4f6;
  --color-surface-3: #e5e7eb;

  /* Text */
  --color-text-primary: #111827;
  --color-text-secondary: #4b5563;
  --color-text-tertiary: #9ca3af;
  --color-text-inverse: #ffffff;

  /* Border */
  --color-border-100: #e5e7eb;
  --color-border-200: #d1d5db;

  /* Focus */
  --color-focus-400: #a78bfa;

  /* Neutral */
  --color-neutral-0: #ffffff;
  --color-neutral-50: #f9fafb;
  --color-neutral-100: #f3f4f6;
  --color-neutral-200: #e5e7eb;
  --color-neutral-300: #d1d5db;
  --color-neutral-400: #9ca3af;
  --color-neutral-500: #6b7280;
  --color-neutral-600: #4b5563;
  --color-neutral-700: #374151;
  --color-neutral-800: #1f2937;
  --color-neutral-900: #111827;
}

/* ── Dark Mode ── */
@media (prefers-color-scheme: dark) {
  :root {
    --color-surface-0: #111827;
    --color-surface-1: #1f2937;
    --color-surface-2: #374151;
    --color-surface-3: #4b5563;

    --color-text-primary: #f9fafb;
    --color-text-secondary: #d1d5db;
    --color-text-tertiary: #9ca3af;
    --color-text-inverse: #111827;

    --color-border-100: #374151;
    --color-border-200: #4b5563;

    --color-neutral-100: #374151;
    --color-neutral-200: #4b5563;
    --color-neutral-300: #6b7280;
    --color-neutral-400: #9ca3af;
    --color-neutral-500: #d1d5db;
    --color-neutral-600: #e5e7eb;
    --color-neutral-700: #f3f4f6;
    --color-neutral-800: #f9fafb;
    --color-neutral-900: #ffffff;
  }
}

/* ── Spacing Scale ── */
:root {
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
  --space-xxxl: 64px;
}

/* ── Typography ── */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 24px;
  --text-2xl: 36px;

  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  --leading-tight: 1.2;
  --leading-snug: 1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --tracking-tight: -0.025em;
  --tracking-wide: 0.025em;
  --tracking-widest: 0.05em;
  --tracking-wider: 0.0375em;
}

/* ── Radii ── */
:root {
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
}

/* ── Shadows ── */
:root {
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
}

/* ── Motion ── */
:root {
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
    --ease-in-out: linear;
  }
}

/* ── Layout ── */
:root {
  --max-width: 1100px;
  --header-height: 64px;
}
