/* ==========================================================================
   DEVIUM — DESIGN TOKENS & SYSTEM VARIABLES
   Luxury Tech + Editorial Minimalism
   Color Escalation: Black, White, Blue (#2563eb) & Purple (#7c3aed)
   ========================================================================== */

:root {
  /* Brand Core Palette (Blue -> Purple Escalation) */
  --brand-blue: #2563eb;
  --brand-blue-light: #3b82f6;
  --brand-blue-glow: rgba(37, 99, 235, 0.35);
  
  --brand-purple: #7c3aed;
  --brand-purple-light: #8b5cf6;
  --brand-purple-glow: rgba(124, 58, 237, 0.35);
  --brand-violet: #7c3aed;

  /* Primary Accent Gradient: Pure Blue to Purple */
  --brand-gradient: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
  --brand-gradient-hover: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
  --brand-gradient-vertical: linear-gradient(180deg, #2563eb 0%, #7c3aed 100%);
  --brand-gradient-subtle: linear-gradient(90deg, rgba(37, 99, 235, 0.12) 0%, rgba(124, 58, 237, 0.12) 100%);
  --brand-gradient-border: linear-gradient(90deg, rgba(37, 99, 235, 0.6) 0%, rgba(124, 58, 237, 0.6) 100%);

  --brand-glow: 0 0 30px rgba(37, 99, 235, 0.28), 0 0 50px rgba(124, 58, 237, 0.22);
  --brand-glow-lg: 0 0 80px rgba(37, 99, 235, 0.35), 0 0 120px rgba(124, 58, 237, 0.25);

  /* Typography */
  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-logo: 'Space Grotesk', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Font Scale (Fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.8438rem, 0.8rem + 0.25vw, 0.9063rem);
  --text-base: clamp(0.9375rem, 0.9rem + 0.25vw, 1.0313rem);
  --text-lg: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.4375rem);
  --text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
  --text-3xl: clamp(1.875rem, 1.65rem + 1.1vw, 2.375rem);
  --text-4xl: clamp(2.25rem, 1.95rem + 1.5vw, 3.125rem);
  --text-5xl: clamp(2.75rem, 2.3rem + 2.25vw, 4.25rem);
  --text-hero: clamp(3.25rem, 2.6rem + 3.2vw, 5.5rem);

  /* Font Weights */
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* Line Heights */
  --lh-tight: 1.1;
  --lh-snug: 1.25;
  --lh-normal: 1.5;
  --lh-relaxed: 1.68;

  /* Letter Spacing */
  --tracking-tighter: -0.04em;
  --tracking-hero: -0.025em;
  --tracking-tight: -0.02em;
  --tracking-normal: 0em;
  --tracking-wide: 0.03em;
  --tracking-widest: 0.12em;
  --tracking-logo: 0.22em;

  /* 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;
  --space-32: 8rem;

  /* Layout Containers */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1240px;
  --container-2xl: 1400px;
  --header-height: 80px;
  --header-height-scrolled: 68px;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 450ms;
  --duration-enter: 600ms;

  /* Z-Index Hierarchy */
  --z-base: 1;
  --z-card: 10;
  --z-header: 100;
  --z-drawer: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* ==========================================================================
   THEME: DARK MODE (Default Identity)
   ========================================================================== */
[data-theme="dark"],
:root:not([data-theme="light"]) {
  color-scheme: dark;

  /* Backgrounds */
  --bg-body: #070709;
  --bg-surface: #0e0e13;
  --bg-surface-raised: #14141c;
  --bg-surface-hover: #1b1b26;
  --bg-glass: rgba(14, 14, 19, 0.78);
  --bg-glass-heavy: rgba(7, 7, 9, 0.92);
  --bg-input: #121218;
  --bg-badge: rgba(255, 255, 255, 0.05);

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.24);
  --border-active: rgba(37, 99, 235, 0.55);
  --border-active-purple: rgba(124, 58, 237, 0.55);

  /* Typography */
  --text-primary: #f8f8fc;
  --text-secondary: #9ea0b6;
  --text-tertiary: #676982;
  --text-muted: #484a5e;
  --text-inverse: #070709;

  /* Brand Symbol Colors */
  --bar-mono-color: #f8f8fc;

  /* Shadows */
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.65);
  --shadow-elevated: 0 20px 40px -15px rgba(0, 0, 0, 0.85);
  --shadow-border: 0 0 0 1px var(--border-subtle);

  /* Status Colors */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-info: #2563eb;
  --color-danger: #ef4444;
}

/* ==========================================================================
   THEME: LIGHT MODE (Harmonious Adaptation)
   ========================================================================== */
[data-theme="light"] {
  color-scheme: light;

  /* Backgrounds */
  --bg-body: #fafafc;
  --bg-surface: #ffffff;
  --bg-surface-raised: #f2f4f8;
  --bg-surface-hover: #e6e9f2;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-heavy: rgba(250, 250, 252, 0.95);
  --bg-input: #ffffff;
  --bg-badge: rgba(0, 0, 0, 0.04);

  /* Borders & Dividers */
  --border-subtle: rgba(15, 23, 42, 0.12);
  --border-medium: rgba(15, 23, 42, 0.18);
  --border-strong: rgba(0, 0, 0, 0.22);
  --border-active: rgba(37, 99, 235, 0.55);
  --border-active-purple: rgba(124, 58, 237, 0.55);

  /* Typography */
  --text-primary: #0c0d12;
  --text-secondary: #545668;
  --text-tertiary: #82849c;
  --text-muted: #a4a6be;
  --text-inverse: #ffffff;

  /* Brand Symbol Colors */
  --bar-mono-color: #0c0d12;

  /* Shadows */
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
  --shadow-elevated: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
  --shadow-border: 0 0 0 1px var(--border-subtle);

  /* Status Colors */
  --color-success: #059669;
  --color-warning: #d97706;
  --color-info: #2563eb;
  --color-danger: #dc2626;
}

/* Light Mode Specific Surface & Typography Refinements */
[data-theme="light"] .eyebrow {
  color: #475569;
}

[data-theme="light"] .project-card {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .card {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
}

[data-theme="light"] .option-card:not(.selected) {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.12);
}
