/* ==========================================================================
   IRC Design Tokens — Premium & Vibrant Authentic Design System
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* ---- Color Primitives -------------------------------------------- */
  --obsidian-950: #070913;
  --obsidian-900: #0d1127;
  --obsidian-800: #151a36;
  --obsidian-700: #1e264d;
  
  --slate-800: #1e2130;
  --slate-700: #2d334a;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;

  --accent-violet: #7c3aed;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-teal: #00f2fe;
  --accent-blue: #3b82f6;
  --accent-pink: #ff2a85;
  --accent-rose: #f43f5e;
  --accent-amber: #ff7a00;

  --white: #ffffff;

  /* Legacy & compatibility aliases */
  --accent-indigo: var(--accent-violet);
  --navy-950: #070913;
  --navy-900: #0d1127;
  --navy-800: #151a36;
  --navy-700: #1e264d;
  --navy-600: #253366;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-300: #93c5fd;
  --pink-500: #ff2a85;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;

  /* ---- Gradients ---------------------------------------------------- */
  --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #3b82f6 50%, #06b6d4 100%);
  --gradient-accent: linear-gradient(135deg, #ff2a85 0%, #7c3aed 50%, #3b82f6 100%);
  --gradient-text: linear-gradient(135deg, #a855f7 0%, #3b82f6 40%, #00f2fe 100%);
  --gradient-hero: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(59, 130, 246, 0.08) 50%, rgba(6, 182, 212, 0.12) 100%);
  --gradient-card-border: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(6, 182, 212, 0.4));
  --gradient-amber: linear-gradient(135deg, #ff7a00 0%, #f59e0b 100%);

  /* ---- Semantic — Light Mode ----------------------------------------- */
  --color-bg: #f8fafc;
  --color-bg-alt: #ffffff;
  --color-bg-elevated: #ffffff;
  --color-bg-glass: rgba(255, 255, 255, 0.82);
  --color-bg-inverse: var(--obsidian-950);

  --color-text-primary: #0f172a;
  --color-text-secondary: #334155;
  --color-text-muted: #64748b;
  --color-text-inverse: #f8fafc;

  --color-border: rgba(124, 58, 237, 0.12);
  --color-border-glass: rgba(255, 255, 255, 0.6);

  --color-primary: var(--accent-violet);
  --color-primary-hover: #6d28d9;
  --color-primary-soft: rgba(124, 58, 237, 0.1);
  --color-primary-contrast: var(--white);
  
  --color-success: #10b981;
  --color-success-soft: rgba(16, 185, 129, 0.12);
  --color-warning: #ff7a00;
  --color-warning-soft: rgba(255, 122, 0, 0.14);
  --color-danger: #f43f5e;
  --color-danger-soft: rgba(244, 63, 94, 0.12);

  --glow-primary: 0 0 25px rgba(124, 58, 237, 0.35);
  --glow-cyan: 0 0 25px rgba(6, 182, 212, 0.35);
  --glow-pink: 0 0 25px rgba(255, 42, 133, 0.35);

  --shadow-color: 15, 23, 42;
  --shadow-sm: 0 2px 8px rgba(124, 58, 237, 0.06);
  --shadow-md: 0 8px 24px -4px rgba(124, 58, 237, 0.12);
  --shadow-lg: 0 20px 48px -12px rgba(124, 58, 237, 0.18);
  --shadow-glass: 0 8px 32px rgba(124, 58, 237, 0.08);

  --backdrop-blur: blur(20px);

  /* ---- Spacing (4px scale) ------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* ---- Radius ---------------------------------------------------------- */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-pill: 9999px;

  /* ---- Motion (Physics-based easing) ----------------------------------- */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  
  --duration-fast: 200ms;
  --duration-base: 400ms;
  --duration-slow: 700ms;

  /* ---- Z-index scale --------------------------------------------------- */
  --z-header: 100;
  --z-dropdown: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-back-to-top: 90;
  --z-progress: 101;

  /* ---- Typography ------------------------------------------------------ */
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-heading: "Outfit", system-ui, -apple-system, sans-serif;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --font-size-2xl: clamp(2rem, 1.6rem + 1.5vw, 2.75rem);
  --font-size-3xl: clamp(2.5rem, 1.8rem + 2.5vw, 3.75rem);
  --font-size-4xl: clamp(3rem, 2.2rem + 3.5vw, 4.5rem);
  --font-size-5xl: clamp(3.5rem, 2.5rem + 4.5vw, 5.5rem);

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.1;
  --line-height-snug: 1.3;
  --line-height-base: 1.6;

  /* ---- Layout ------------------------------------------------------------ */
  --container-max: 1200px;
  --container-narrow: 800px;
  --container-padding: clamp(1.5rem, 5vw, 4rem);
  --header-height: 80px;
}

/* ---- Dark Mode Remap --------------------------------------------------- */
[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: var(--obsidian-950);
  --color-bg-alt: var(--obsidian-900);
  --color-bg-elevated: var(--obsidian-800);
  --color-bg-glass: rgba(13, 17, 39, 0.75);
  --color-bg-inverse: var(--white);

  --color-text-primary: #f8fafc;
  --color-text-secondary: #cbd5e1;
  --color-text-muted: #94a3b8;
  --color-text-inverse: var(--obsidian-950);

  --color-border: rgba(124, 58, 237, 0.22);
  --color-border-glass: rgba(255, 255, 255, 0.12);

  --color-primary: var(--accent-cyan);
  --color-primary-hover: var(--accent-teal);
  --color-primary-soft: rgba(6, 182, 212, 0.18);
  --color-primary-contrast: var(--obsidian-950);

  --shadow-color: 0, 0, 0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px -4px rgba(6, 182, 212, 0.15);
  --shadow-lg: 0 24px 48px -12px rgba(124, 58, 237, 0.25);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg: var(--obsidian-950);
    --color-bg-alt: var(--obsidian-900);
    --color-bg-elevated: var(--obsidian-800);
    --color-bg-glass: rgba(13, 17, 39, 0.75);
    --color-bg-inverse: var(--white);
    --color-text-primary: #f8fafc;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;
    --color-text-inverse: var(--obsidian-950);
    --color-border: rgba(124, 58, 237, 0.22);
    --color-border-glass: rgba(255, 255, 255, 0.12);
    --color-primary: var(--accent-cyan);
    --color-primary-hover: var(--accent-teal);
    --color-primary-soft: rgba(6, 182, 212, 0.18);
    --color-primary-contrast: var(--obsidian-950);
    --shadow-color: 0, 0, 0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 24px -4px rgba(6, 182, 212, 0.15);
    --shadow-lg: 0 24px 48px -12px rgba(124, 58, 237, 0.25);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.5);
  }
}
