:root {
  /* ===== Default: Dark mode ===== */
  --bg: #0A0A0F;
  --surface: #1A1A24;
  --surface-elevated: #25252F;
  --text-primary: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-tertiary: #71717A;
  --border: #27272A;
  --border-strong: #3F3F46;
  --shadow-color: 0 0 0;
  --shadow-strength: 0.4;

  /* ===== Language colors (mode-agnostic) ===== */
  --lang-en: #3B82F6;
  --lang-es: #F97316;
  --lang-fr: #A855F7;
  --lang-de: #22C55E;
  --lang-it: #EC4899;
  --lang-pt: #EAB308;

  /* ===== Semantic colors (mode-agnostic) ===== */
  --success: #22C55E;
  --warning: #EAB308;
  --danger: #EF4444;
  --info: #3B82F6;

  /* ===== Signature gradient ===== */
  --gradient-rainbow: linear-gradient(
    135deg,
    #22C55E 0%,
    #3B82F6 20%,
    #A855F7 40%,
    #EC4899 60%,
    #EF4444 75%,
    #F97316 88%,
    #EAB308 100%
  );

  /* Subtle glow halo variant */
  --gradient-rainbow-soft: radial-gradient(
    ellipse at center,
    rgba(168, 85, 247, 0.15),
    rgba(59, 130, 246, 0.10),
    transparent 70%
  );

  /* ===== Type ===== */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Type scale (1.25 ratio) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  --text-7xl: 4.5rem;

  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 1.75;

  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* ===== Spacing (4px base) ===== */
  --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;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ===== Radii ===== */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;

  /* ===== Shadows ===== */
  --shadow-sm: 0 1px 2px rgba(var(--shadow-color), 0.1);
  --shadow-md: 0 4px 6px rgba(var(--shadow-color), 0.15);
  --shadow-lg: 0 10px 20px rgba(var(--shadow-color), 0.2);
  --shadow-xl: 0 20px 40px rgba(var(--shadow-color), 0.25);

  /* ===== Layout ===== */
  --container-max: 1280px;
  --container-narrow: 720px;
  --container-prose: 640px;

  --header-height: 72px;

  /* ===== Transitions ===== */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Light mode override ===== */
[data-theme="light"] {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --text-primary: #18181B;
  --text-secondary: #52525B;
  --text-tertiary: #71717A;
  --border: #E4E4E7;
  --border-strong: #D4D4D8;
  --shadow-color: 24 24 27;
  --shadow-strength: 0.08;
}

/* Respect OS preference if user hasn't chosen */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --surface-elevated: #FFFFFF;
    --text-primary: #18181B;
    --text-secondary: #52525B;
    --text-tertiary: #71717A;
    --border: #E4E4E7;
    --border-strong: #D4D4D8;
    --shadow-color: 24 24 27;
    --shadow-strength: 0.08;
  }
}
