/* ============================================ CSS Variables / Theme ============================================ */
:root {
  /* LIGHT THEME AS DEFAULT (matching HTML data-theme="light") */
  
  /* Backgrounds - Clean white/slate palette with better contrast */
  --bg-primary: #ffffff;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-tag: #e2e8f0;
  --bg-elevated: #ffffff;
  
  /* Text - High contrast slate palette with better readability */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  --text-code-comment: #64748b;
  
  /* Accents - More vibrant emerald with sky blue secondary */
  --accent-primary: #10b981;
  --accent-secondary: #3b82f6;
  --accent-tertiary: #8b5cf6;
  /* Purple for tertiary actions */
  --accent-warning: #f59e0b;
  /* Amber for warnings/highlights */
  
  --border-light: #cbd5e1;
  --border-dark: #3a4046;
  
  /* Progress bars - Visible in light theme */
  --progress-bar-bg: #cbd5e1;
  --progress-bar-fill: #10b981;
  
  /* Legacy variables for compatibility - map to new palette */
  --bg: var(--bg-primary);
  --bg-surface: var(--bg-secondary);
  --text: var(--text-primary);
  --text-inverted: var(--text-inverse);
  --accent: var(--accent-primary);
  --accent-light: #34d399;
  --accent-dark: #059669;
  --accent-glow: rgba(16, 185, 129, 0.25);
  --accent-soft: rgba(16, 185, 129, 0.15);
  --accent-2: var(--accent-secondary);
  --accent-2-light: #60a5fa;
  --accent-2-glow: rgba(59, 130, 246, 0.25);
  --success: var(--accent-primary);
  --warning: var(--accent-warning);
  --error: #dc2626;
  --info: var(--accent-secondary);
  --border: var(--border-light);
  --border-hover: #94a3b8;
  --border-active: rgba(16, 185, 129, 0.3);
  
  /* Gradients - Use strategic gradients for modern look */
  --gradient-primary: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  --gradient-secondary: linear-gradient(135deg, var(--accent-secondary), var(--accent-tertiary));
  --gradient-accent: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
  
  /* Shadows - softer, more natural (light theme) */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.03);
  --shadow-2xl: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.2);
  --shadow-glow-secondary: 0 0 20px rgba(59, 130, 246, 0.2);
  
  /* Layout & spacing */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  /* ============================================
     TYPOGRAPHY - Enhanced for 2026
     ============================================ */
  
  /* Font Families - Modern stack with Manrope */
  --font-main: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-headline: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', Consolas, monospace;
  
  /* Type Scale - Enhanced for 2026 with better fluid typography */
  --text-xs: 0.75rem;        /* 12px */
  --text-sm: 0.875rem;       /* 14px */
  --text-base: clamp(1rem, 1vw + 0.875rem, 1.125rem);  /* 16-18px */
  --text-lg: 1.125rem;       /* 18px */
  --text-xl: 1.25rem;        /* 20px */
  --text-2xl: 1.5rem;        /* 24px */
  --text-3xl: clamp(1.875rem, 4vw, 2.25rem);   /* 30-36px */
  --text-4xl: clamp(2.25rem, 6vw, 3rem);      /* 36-48px */
  --text-5xl: clamp(2.75rem, 8vw, 3.75rem);   /* 44-60px */
  --text-6xl: clamp(3.5rem, 10vw, 4.5rem);    /* 56-72px */
  --text-7xl: clamp(4.5rem, 12vw, 6rem);     /* 72-96px */
  
  /* Letter Spacing - Enhanced scale for 2026 */
  --tracking-tighter: -0.05em;   /* For large headlines */
  --tracking-tight: -0.025em;    /* For headings */
  --tracking-normal: 0em;        /* For body */
  --tracking-wide: 0.025em;      /* For labels, captions */
  --tracking-wider: 0.05em;      /* For UI text */
  --tracking-widest: 0.1em;      /* For monospace, code */
  
  /* Line Height Scale - Optimized for readability */
  --leading-none: 1;
  --leading-tight: 1.15;        /* For large headlines */
  --leading-snug: 1.25;         /* For subheadings */
  --leading-normal: 1.5;        /* For body (optimal readability) */
  --leading-relaxed: 1.65;      /* For large body text */
  --leading-loose: 1.8;         /* For lists, testimonials */
  
  /* Font Weights - Semantic naming for 2026 */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  
  /* Vertical Rhythm System */
  --space-unit: 1rem;
  --space-xxs: calc(var(--space-unit) * 0.25);
  --space-xs: calc(var(--space-unit) * 0.5);
  --space-sm: calc(var(--space-unit) * 0.75);
  --space-md: calc(var(--space-unit) * 1);
  --space-lg: calc(var(--space-unit) * 1.25);
  --space-xl: calc(var(--space-unit) * 1.5);
  --space-2xl: calc(var(--space-unit) * 2);
  --space-3xl: calc(var(--space-unit) * 3);
  
  /* Text emphasis colors */
  --text-emphasis: var(--accent-primary);
  --text-subtle: var(--text-muted);
  
  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Navigation */
  --nav-height: 64px;
  
  /* Code syntax highlighting - Light theme */
  --syntax-keyword: #a64242;
  --syntax-func: #4a6fa5;
  --syntax-variable: #b68d40;
  --syntax-string: #8b7355;
  --syntax-comment: #7a8288;
  --syntax-field: #2c5f2d;
  --syntax-operator: #8b7355;
  
  /* Rainbow cursor colors */
  --cursor-emerald: #10b981;
  --cursor-sky: #3b82f6;
  --cursor-amber: #f59e0b;
  --cursor-violet: #8b5cf6;
}

[data-theme="dark"] {
  /* DARK THEME OVERRIDES - Rich blacks with vibrant accents */
  --bg-primary: #09090b;
  --bg-secondary: #18181b;
  --bg-card: #27272a;
  --bg-tag: #3f3f46;
  --bg-elevated: #1c1c1e;
  
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-inverse: #09090b;
  --text-code-comment: #71717a;
  
  --accent-primary: #34d399;
  --accent-secondary: #38bdf8;
  --accent-tertiary: #a855f7;
  --accent-warning: #fbbf24;
  
  --border-light: #27272a;
  --border-dark: #3f3f46;
  
  --progress-bar-bg: #27272a;
  --progress-bar-fill: #34d399;
  
  /* Dark theme shadows - deeper blacks for OLED-friendly contrast */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(52, 211, 153, 0.25);
  --shadow-glow-secondary: 0 0 20px rgba(56, 189, 248, 0.25);
  
  /* Dark theme typography tweaks */
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;
  
  /* Code syntax highlighting - Dark theme */
  --syntax-keyword: #f87171;
  --syntax-func: #60a5fa;
  --syntax-variable: #fbbf24;
  --syntax-string: #a78bfa;
  --syntax-comment: #9ca3af;
  --syntax-field: #4ade80;
  --syntax-operator: #c084fc;
}
