/* Design tokens — colors, typography, spacing, motion, layout breakpoints. */
:root {
  /* Colors — tech palette */
  --color-bg: #f8fafc;
  --color-bg-subtle: #f1f5f9;
  --color-bg-elevated: #ffffff;
  --color-surface-dark: #0b1120;
  --color-surface-dark-2: #111827;
  --color-text: #1e293b;
  /* Darkened from #64748b so muted text still clears WCAG AA on --color-bg-subtle */
  --color-text-muted: #5a6b82;
  --color-heading: #0f172a;
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  /* AA-contrast variant of --color-primary for text on light backgrounds (6.3:1) */
  --color-primary-text: #1d4ed8;
  --color-primary-text-hover: #1e3f9e;
  --color-primary-glow: rgba(59, 130, 246, 0.45);
  --color-accent: #06b6d4;
  --color-accent-glow: rgba(6, 182, 212, 0.35);
  --color-secondary: #64748b;
  --color-success: #10b981;
  --color-error: #ef4444;
  --color-border: #e2e8f0;
  --color-border-glow: rgba(59, 130, 246, 0.25);
  --color-focus-ring: #38bdf8;

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #0b1120 0%, #0f172a 40%, #1e1b4b 100%);
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --gradient-card: linear-gradient(145deg, rgba(59, 130, 246, 0.06) 0%, rgba(6, 182, 212, 0.04) 100%);
  --gradient-text: linear-gradient(135deg, #60a5fa 0%, #22d3ee 50%, #818cf8 100%);

  /* Typography */
  --font-family-display: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* English-first stack: system UI fonts lead, CJK faces only as fallback so the
     browser never downloads a full CJK webfont for an English page. */
  --font-family-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-family-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.75rem;
  --font-size-5xl: 3.5rem;
  --line-height-normal: 1.7;
  --line-height-tight: 1.15;
  --line-height-snug: 1.35;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Spacing */
  --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;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Radius & shadow */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 24px var(--color-primary-glow);
  --shadow-glow-accent: 0 0 32px var(--color-accent-glow);

  /* Motion */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-slower: 700ms;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-sm: 540px;
  --container-md: 720px;
  --container-lg: 960px;
  --container-xl: 1140px;
  --container-xxl: 1320px;
  --touch-target-min: 48px;
  --touch-target-aa: 24px;
  --header-height: 64px;
  --z-header: 100;
  --z-overlay: 200;
  --z-back-to-top: 900;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-normal: 0ms;
    --duration-slow: 0ms;
  }
}
