/* Nexus Design System - CSS Custom Properties (Tokens) */
/* Phase 2: Design System */
/* Spec: architect-approved 2026-10-07 */
/* Theme: Dark, Premium Technology-Laboratory Aesthetic */

/* -------------------------------------------- */
/* COLOR TOKENS */
/* -------------------------------------------- */

:root {
  /* Primary Colors */
  --color-black: #000000;
  --color-purple: #8B5CF6;
  --color-lavender: #D3D4E5;
  --color-off-white: #F5F6F5;
  --color-gold: #FFD700;
  --color-green: #39FF14;
  --color-red: #B71C1C;
  --color-pink: #FF80AB;

  /* Semantic Colors */
  --color-primary: var(--color-purple);
  --color-secondary: var(--color-gold);
  --color-accent: var(--color-green);
  --color-error: var(--color-red);
  --color-warning: var(--color-pink);
  --color-info: var(--color-lavender);

  /* Background Colors */
  --bg-primary: var(--color-black);
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --bg-elevated: #222222;
  --bg-glass: rgba(34, 34, 34, 0.8);
  --bg-overlay: rgba(0, 0, 0, 0.9);

  /* Text Colors */
  --text-primary: var(--color-off-white);
  --text-secondary: var(--color-lavender);
  --text-tertiary: #888888;
  --text-inverse: var(--color-black);

  /* Border Colors */
  --border-primary: #333333;
  --border-secondary: #444444;
  --border-glow: var(--color-purple);

  /* Glass/Metal Effects */
  --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  --metal-gradient: linear-gradient(180deg, #333333 0%, #1a1a1a 100%);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Network/Constellation Motifs */
  --network-color: var(--color-purple);
  --network-opacity: 0.15;
  --constellation-color: var(--color-gold);
  --constellation-opacity: 0.1;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--color-purple) 0%, var(--color-gold) 100%);
  --gradient-chrome: linear-gradient(180deg, #ffffff 0%, #d4d4d4 30%, #8a8a8a 55%, #e8e8e8 75%, #b0b0b0 100%);
  --gradient-gold-metal: linear-gradient(180deg, #fff3c4 0%, var(--color-gold) 45%, #b8860b 75%, var(--color-gold) 100%);
  --gradient-dark: linear-gradient(180deg, #000000 0%, #111111 100%);
  --gradient-elevated: linear-gradient(180deg, #222222 0%, #111111 100%);

  /* Hover/Focus States */
  --hover-primary: var(--color-lavender);
  --focus-ring: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

/* -------------------------------------------- */
/* Auto-correct mapping: cool-family colors resolve to lavender #D3D4E5 */

/* -------------------------------------------- */
/* TYPOGRAPHY TOKENS */
/* -------------------------------------------- */

:root {
  /* Font Families */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-secondary: 'JetBrains Mono', 'Fira Code', monospace;
  --font-display: 'Manrope', var(--font-primary);

  /* Font Sizes - Large Typography */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */
  --text-6xl: 3.75rem;   /* 60px */
  --text-7xl: 4.5rem;    /* 72px */
  --text-8xl: 6rem;      /* 96px */

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

  /* Line Heights */
  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Letter Spacing */
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* Headings */
  --h1-size: var(--text-5xl);
  --h1-weight: var(--font-bold);
  --h1-leading: var(--leading-tight);
  --h1-tracking: var(--tracking-tight);

  --h2-size: var(--text-4xl);
  --h2-weight: var(--font-bold);
  --h2-leading: var(--leading-tight);
  --h2-tracking: var(--tracking-tight);

  --h3-size: var(--text-3xl);
  --h3-weight: var(--font-semibold);
  --h3-leading: var(--leading-snug);

  --h4-size: var(--text-2xl);
  --h4-weight: var(--font-semibold);
  --h4-leading: var(--leading-snug);

  --h5-size: var(--text-xl);
  --h5-weight: var(--font-medium);

  --h6-size: var(--text-lg);
  --h6-weight: var(--font-medium);
}

/* -------------------------------------------- */
/* SPACING TOKENS */
/* -------------------------------------------- */

:root {
  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */
  --space-40: 10rem;    /* 160px */
  --space-48: 12rem;    /* 192px */
  --space-64: 16rem;    /* 256px */
}

/* -------------------------------------------- */
/* LAYOUT TOKENS */
/* -------------------------------------------- */

:root {
  /* Container */
  --container-max: 1280px;
  --container-padding: var(--space-6);

  /* Grid */
  --grid-gap: var(--space-8);
  --grid-gap-sm: var(--space-4);

  /* Border Radius */
  --radius-none: 0;
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;

  /* Border Width */
  --border-0: 0;
  --border-1: 1px;
  --border-2: 2px;
  --border-4: 4px;

  /* Box Shadow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.6);
  --shadow-glow-purple: 0 0 20px rgba(139, 92, 246, 0.3);
  --shadow-glow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
  --shadow-glow-green: 0 0 20px rgba(57, 255, 20, 0.3);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-notification: 800;
  --z-max: 9999;
}

/* -------------------------------------------- */
/* EFFECTS & ANIMATIONS */
/* -------------------------------------------- */

:root {
  /* Glass Effect */
  --glass-blur: blur(12px);
  --glass-saturation: saturate(180%);

  /* Metal Effect */
  --metal-reflect: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);

  /* Network/Constellation Background */
  --network-bg: 
    radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(57, 255, 20, 0.03) 0%, transparent 70%);

  /* Animations */
  --animation-fade-in: fadeIn 0.5s ease forwards;
  --animation-slide-up: slideUp 0.5s ease forwards;
  --animation-pulse: pulse 2s ease-in-out infinite;
  --animation-float: float 3s ease-in-out infinite;
  --animation-glow: glow 2s ease-in-out infinite alternate;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes glow {
  from { box-shadow: 0 0 20px rgba(139, 92, 246, 0.3); }
  to { box-shadow: 0 0 40px rgba(139, 92, 246, 0.6); }
}

/* -------------------------------------------- */
/* MOBILE-FIRST RESPONSIVE BREAKPOINTS */
/* -------------------------------------------- */

:root {
  --breakpoint-xs: 360px;
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}

/* Mobile-first media queries */
@media (min-width: 640px) {
  :root {
    --container-padding: var(--space-8);
  }
}

@media (min-width: 768px) {
  :root {
    --text-base: 1.125rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --container-padding: var(--space-10);
  }
}

/* -------------------------------------------- */
/* ACCESSIBILITY TOKENS */
/* -------------------------------------------- */

:root {
  /* Focus styles */
  --focus-outline: 2px solid var(--color-purple);
  --focus-outline-offset: 2px;

  /* Reduced motion */
  --transition-disabled: 0ms;
  --animation-disabled: none;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-normal: var(--transition-disabled);
    --transition-slow: var(--transition-disabled);
    --transition-spring: var(--transition-disabled);
    --animation-fade-in: var(--animation-disabled);
    --animation-slide-up: var(--animation-disabled);
    --animation-pulse: var(--animation-disabled);
    --animation-float: var(--animation-disabled);
    --animation-glow: var(--animation-disabled);
  }
}

/* -------------------------------------------- */
