/**
 * AI Chronicle Design System - Design Tokens
 * Stripe-inspired minimalist design system
 */

:root {
  /* === TYPOGRAPHY === */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Font Sizes - Modular Scale (1.25) */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */
  --text-6xl: 3.75rem;    /* 60px */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line Heights */
  --leading-tight: 1.2;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Letter Spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;

  /* === SPACING === */
  --space-0: 0;
  --space-1: 0.25rem;     /* 4px */
  --space-2: 0.5rem;      /* 8px */
  --space-3: 0.75rem;     /* 12px */
  --space-4: 1rem;        /* 16px */
  --space-5: 1.25rem;     /* 20px */
  --space-6: 1.5rem;      /* 24px */
  --space-8: 2rem;        /* 32px */
  --space-10: 2.5rem;     /* 40px */
  --space-12: 3rem;       /* 48px */
  --space-16: 4rem;       /* 64px */
  --space-20: 5rem;       /* 80px */
  --space-24: 6rem;       /* 96px */
  --space-32: 8rem;       /* 128px */

  /* === LAYOUT === */
  --max-width-xs: 320px;
  --max-width-sm: 480px;
  --max-width-md: 640px;
  --max-width-prose: 720px;
  --max-width-lg: 960px;
  --max-width-xl: 1200px;
  --max-width-2xl: 1400px;

  /* === BORDERS === */
  --radius-none: 0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Border Widths */
  --border-width: 1px;
  --border-width-2: 2px;

  /* === SHADOWS (Stripe-style layered) === */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);

  /* === TRANSITIONS === */
  --ease-linear: linear;
  --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);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --duration-75: 75ms;
  --duration-100: 100ms;
  --duration-150: 150ms;
  --duration-200: 200ms;
  --duration-300: 300ms;
  --duration-500: 500ms;
  --duration-700: 700ms;

  /* === Z-INDEX === */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-nav: 1000;
}

/* === LIGHT THEME (Default) === */
:root,
[data-theme="light"] {
  /* Backgrounds */
  --color-bg: #ffffff;
  --color-bg-subtle: #f7f7f8;
  --color-bg-muted: #f0f0f2;
  --color-bg-emphasis: #e8e8eb;
  --color-bg-inverse: #0a0a0b;

  /* Text */
  --color-text: #1a1a1b;
  --color-text-secondary: #525256;
  --color-text-muted: #8b8b92;
  --color-text-placeholder: #b4b4bb;
  --color-text-inverse: #fafafa;

  /* Borders */
  --color-border: #e5e5e8;
  --color-border-subtle: #f0f0f2;
  --color-border-emphasis: #d1d1d6;

  /* Primary Accent (Stripe Purple) */
  --color-accent: #635bff;
  --color-accent-hover: #7a73ff;
  --color-accent-active: #4f46e5;
  --color-accent-subtle: rgba(99, 91, 255, 0.08);
  --color-accent-muted: rgba(99, 91, 255, 0.15);

  /* Semantic Colors */
  --color-success: #00d4aa;
  --color-success-subtle: rgba(0, 212, 170, 0.1);
  --color-warning: #f59e0b;
  --color-warning-subtle: rgba(245, 158, 11, 0.1);
  --color-error: #ef4444;
  --color-error-subtle: rgba(239, 68, 68, 0.1);
  --color-info: #3b82f6;
  --color-info-subtle: rgba(59, 130, 246, 0.1);

  /* Path-specific accents */
  --color-path-reasoning: #f59e0b;
  --color-path-opensource: #10b981;
  --color-path-agents: #8b5cf6;
  --color-path-infra: #ef4444;

  /* Timeline significance colors */
  --color-breakthrough: #ef4444;
  --color-notable: #f59e0b;
  --color-regular: #6b7280;

  /* Category colors */
  --color-cat-models: #3b82f6;
  --color-cat-tools: #8b5cf6;
  --color-cat-products: #ec4899;
  --color-cat-industry: #f59e0b;
  --color-cat-opensource: #10b981;
}

/* === DARK THEME === */
[data-theme="dark"] {
  /* Backgrounds */
  --color-bg: #0a0a0b;
  --color-bg-subtle: #111113;
  --color-bg-muted: #1a1a1d;
  --color-bg-emphasis: #252529;
  --color-bg-inverse: #ffffff;

  /* Text */
  --color-text: #f5f5f7;
  --color-text-secondary: #a1a1a6;
  --color-text-muted: #636366;
  --color-text-placeholder: #48484a;
  --color-text-inverse: #0a0a0b;

  /* Borders */
  --color-border: #2c2c30;
  --color-border-subtle: #1f1f23;
  --color-border-emphasis: #3a3a3f;

  /* Primary Accent (Lighter for dark mode) */
  --color-accent: #7c73ff;
  --color-accent-hover: #918aff;
  --color-accent-active: #635bff;
  --color-accent-subtle: rgba(124, 115, 255, 0.12);
  --color-accent-muted: rgba(124, 115, 255, 0.2);

  /* Semantic Colors (adjusted for dark) */
  --color-success: #34d399;
  --color-success-subtle: rgba(52, 211, 153, 0.15);
  --color-warning: #fbbf24;
  --color-warning-subtle: rgba(251, 191, 36, 0.15);
  --color-error: #f87171;
  --color-error-subtle: rgba(248, 113, 113, 0.15);
  --color-info: #60a5fa;
  --color-info-subtle: rgba(96, 165, 250, 0.15);

  /* Shadows adjusted for dark mode */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.25);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* === RESPONSIVE BREAKPOINTS (reference) === */
/*
  --breakpoint-sm: 640px
  --breakpoint-md: 768px
  --breakpoint-lg: 1024px
  --breakpoint-xl: 1280px
  --breakpoint-2xl: 1536px
*/
