/* ========================================
   Subto.One Design Tokens
   Single source of truth for all visual design decisions
   ======================================== */

:root {
  /* ─── Color Palette ─── */
  /* Primary brand color - Teal */
  --color-primary: #00d4aa;
  --color-primary-hover: #00b894;
  --color-primary-light: rgba(0, 212, 170, 0.1);
  --color-primary-glow: rgba(0, 212, 170, 0.3);

  /* Neutral dark theme */
  --color-bg: #0a0a0f;
  --color-bg-elevated: #111318;
  --color-surface: #1a1d24;
  --color-surface-hover: #22262e;
  --color-border: #2a2d36;
  --color-border-subtle: #1f222a;
  --color-border-focus: var(--color-primary);

  /* Text colors */
  --color-text-primary: #e8e8e8;
  --color-text-secondary: #a0a0a0;
  --color-text-muted: #6b6b6b;
  --color-text-inverse: #0a0a0f;

  /* Semantic colors */
  --color-success: #2ed573;
  --color-success-light: rgba(46, 213, 115, 0.1);
  --color-warning: #ffa502;
  --color-warning-light: rgba(255, 165, 2, 0.1);
  --color-error: #ff4757;
  --color-error-light: rgba(255, 71, 87, 0.1);
  --color-info: #4fc3f7;
  --color-info-light: rgba(79, 195, 247, 0.1);

  /* Score colors (0-100) */
  --color-score-excellent: #2ed573;  /* 90+ */
  --color-score-good: #4fc3f7;       /* 70-89 */
  --color-score-fair: #ffa502;       /* 50-69 */
  --color-score-poor: #ff4757;       /* <50 */

  /* ─── Typography ─── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  --font-display: 'Space Grotesk', var(--font-sans);

  /* Fluid type scale using clamp() */
  --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.75rem);      /* ~11-12px */
  --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.875rem);     /* ~13-14px */
  --text-base: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);       /* ~14-16px */
  --text-lg: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);       /* ~16-18px */
  --text-xl: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);        /* ~18-20px */
  --text-2xl: clamp(1.375rem, 1.25rem + 0.5vw, 1.5rem);     /* ~22-24px */
  --text-3xl: clamp(1.75rem, 1.5rem + 1vw, 2rem);           /* ~28-32px */
  --text-4xl: clamp(2.25rem, 2rem + 1.5vw, 3rem);           /* ~36-48px */

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

  /* Line heights */
  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;

  /* ─── Spacing Scale (4px base) ─── */
  --space-0: 0;
  --space-1: 4px;    /* 0.25rem */
  --space-2: 8px;    /* 0.5rem */
  --space-3: 12px;   /* 0.75rem */
  --space-4: 16px;   /* 1rem */
  --space-5: 20px;   /* 1.25rem */
  --space-6: 24px;   /* 1.5rem */
  --space-8: 32px;   /* 2rem */
  --space-10: 40px;  /* 2.5rem */
  --space-12: 48px;  /* 3rem */
  --space-16: 64px;  /* 4rem */
  --space-20: 80px;  /* 5rem */
  --space-24: 96px;  /* 6rem */

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

  /* ─── Shadows ─── */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px var(--color-primary-glow);
  --shadow-glow-lg: 0 0 48px var(--color-primary-glow);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.3);

  /* ─── Transitions ─── */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-bounce: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ─── Z-Index Scale ─── */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;

  /* ─── Container Widths ─── */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1440px;

  /* ─── Glassmorphism ─── */
  --glass-bg: rgba(26, 29, 36, 0.8);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(20px);
  --glass-blur-strong: blur(40px);

  /* ─── Focus Ring ─── */
  --focus-ring: 0 0 0 3px var(--color-primary-light);
  --focus-ring-offset: 2px;

  /* ─── Animation Durations ─── */
  --duration-instant: 0ms;
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 500ms;
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
    --transition-bounce: 0ms;
    --duration-fast: 0ms;
    --duration-normal: 0ms;
    --duration-slow: 0ms;
    --duration-slower: 0ms;
  }
}

/* ─── High Contrast Mode ─── */
@media (prefers-contrast: high) {
  :root {
    --color-border: #ffffff;
    --color-text-muted: #cccccc;
    --glass-border: #ffffff;
  }
}

/* ─── Print Styles ─── */
@media print {
  :root {
    --color-bg: #ffffff;
    --color-surface: #f5f5f5;
    --color-text-primary: #000000;
    --color-text-secondary: #333333;
  }
}