/* ==========================================================================
   Sappsworld Programming - Design Tokens & Custom Properties
   WCAG 2.1 AA Compliant Dark & Light Themes
   ========================================================================== */

:root {
   /* Typography Stacks */
   --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
   --font-display: 'Outfit', 'Inter', -apple-system, sans-serif;
   --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

   /* Font Scaling (Fluid Typography via clamp) */
   --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
   --text-sm: clamp(0.875rem, 0.82rem + 0.3vw, 0.9375rem);
   --text-base: clamp(1rem, 0.95rem + 0.35vw, 1.0625rem);
   --text-lg: clamp(1.125rem, 1.05rem + 0.45vw, 1.25rem);
   --text-xl: clamp(1.25rem, 1.15rem + 0.6vw, 1.45rem);
   --text-2xl: clamp(1.5rem, 1.35rem + 0.85vw, 1.85rem);
   --text-3xl: clamp(1.875rem, 1.65rem + 1.2vw, 2.35rem);
   --text-4xl: clamp(2.25rem, 1.95rem + 1.8vw, 3.15rem);
   --text-5xl: clamp(2.75rem, 2.3rem + 2.5vw, 4rem);

   /* Spacing Scale */
   --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;

   /* Layout Boundaries */
   --container-max: 1280px;
   --container-pad: clamp(1rem, 4vw, 2rem);
   --radius-sm: 6px;
   --radius-md: 10px;
   --radius-lg: 16px;
   --radius-xl: 24px;
   --radius-full: 9999px;

   /* Motion Timing */
   --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
   --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
   --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);

   /* Brand Accents (Shared) */
   --cyan-400: #38bdf8;
   --cyan-500: #0ea5e9;
   --cyan-600: #0284c7;
   --indigo-400: #818cf8;
   --indigo-500: #6366f1;
   --indigo-600: #4f46e5;
   --emerald-400: #34d399;
   --emerald-500: #10b981;
   --rose-400: #fb7185;
   --rose-500: #f43f5e;
   --amber-400: #fbbf24;

   /* ========================================================================
     DEFAULT THEME: DARK MODE
     Contrast Ratios > 13:1 on Primary Surface
     ======================================================================== */
   --bg-primary: #070b13;
   --bg-secondary: #0d1322;
   --bg-surface: #121a2d;
   --bg-surface-elevated: #17223b;
   --bg-glass: rgba(18, 26, 45, 0.75);
   --bg-glass-elevated: rgba(23, 34, 59, 0.85);

   --border-subtle: rgba(255, 255, 255, 0.08);
   --border-medium: rgba(255, 255, 255, 0.15);
   --border-hover: rgba(56, 189, 248, 0.45);

   --text-primary: #f8fafc;
   --text-secondary: #94a3b8;
   --text-muted: #64748b;
   --text-accent: #38bdf8;

   --accent-primary: #38bdf8;
   --accent-secondary: #818cf8;
   --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
   --accent-glow: 0 0 25px rgba(56, 189, 248, 0.25);
   --card-glow: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);

   --focus-ring: 2px solid #38bdf8;
   --focus-ring-offset: 3px;
   --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
   --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
   --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.6);

   --code-bg: #090e1a;
   --status-success: #34d399;
   --status-error: #f43f5e;
   --status-warning: #fbbf24;
}

/* ========================================================================
   LIGHT THEME OVERRIDES
   Contrast Ratios > 14:1 on Primary Surface
   ======================================================================== */
[data-theme="light"] {
   --bg-primary: #f8fafc;
   --bg-secondary: #f1f5f9;
   --bg-surface: #ffffff;
   --bg-surface-elevated: #f8fafc;
   --bg-glass: rgba(255, 255, 255, 0.85);
   --bg-glass-elevated: rgba(255, 255, 255, 0.95);

   --border-subtle: rgba(15, 23, 42, 0.08);
   --border-medium: rgba(15, 23, 42, 0.16);
   --border-hover: rgba(2, 132, 199, 0.5);

   --text-primary: #0f172a;
   --text-secondary: #475569;
   --text-muted: #64748b;
   --text-accent: #0284c7;

   --accent-primary: #0284c7;
   --accent-secondary: #6366f1;
   --accent-gradient: linear-gradient(135deg, #0284c7 0%, #6366f1 100%);
   --accent-glow: 0 0 20px rgba(2, 132, 199, 0.18);
   --card-glow: 0 8px 24px -4px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.06);

   --focus-ring: 2px solid #0284c7;
   --focus-ring-offset: 3px;
   --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
   --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
   --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.12);

   --code-bg: #e2e8f0;
   --status-success: #059669;
   --status-error: #e11d48;
   --status-warning: #d97706;
}