/* ============================================
   DESIGN TOKENS + RESET + BASE
   Single source of truth for all design values
   ============================================ */

@layer reset {
  *,
  *::before,
  *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
}

@layer tokens {
  :root {
    /* ── Background colors ── */
    --bg-primary: #0a0a0a;
    --bg-black: #0a0a0a;
    --bg-panel: #111111;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --bg-card: #1a1a1a;
    --bg-hover: #252525;
    --bg-active: rgba(220, 20, 20, 0.12);

    /* ── Neon red theme ── */
    --neon-red: #e01515;
    --neon-red-bright: #ff2a2a;
    --neon-red-dark: #a00e0e;
    --neon-red-dim: rgba(220, 20, 20, 0.08);
    --neon-glow: rgba(220, 20, 20, 0.5);

    /* ── Text colors ── */
    --text-primary: #ffffff;
    --text-white: #ffffff;
    --text-light: #cccccc;
    --text-secondary: #888888;
    --text-muted: #666666;
    --text-dim: #444444;

    /* ── Borders ── */
    --border: #1a1a1a;
    --border-primary: #1a1a1a;
    --border-light: #222222;

    /* ── Status colors ── */
    --status-idle: #666666;
    --status-social: #4ade80;
    --status-buzzed: #fbbf24;
    --status-overstimulated: #ff2a2a;
    --status-blackout: #333333;

    /* ── Archetype colors ── */
    --hedonist: #ec4899;
    --strategist: #3b82f6;
    --gambler: #f59e0b;
    --artist: #8b5cf6;
    --nihilist: #ef4444;
    --conservative: #10b981;
    --socialite: #f472b6;
    --drifter: #0ea5e9;

    /* ── Accent colors ── */
    --accent-primary: #dc2020;
    --accent-hover: #c91919;
    --accent-secondary: #2a9d8f;
    --accent-observer: #6366f1;

    /* ── Semantic colors ── */
    --success: #4ade80;
    --error: #ef4444;
    --warning: #fbbf24;

    /* ── Layout ── */
    --content-width: 1280px;

    /* ── Spacing scale (4px base) ── */
    --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;

    /* ── Typography ── */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Monaco', 'Menlo', 'Courier New', monospace;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-md: 1.0625rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;

    --font-bold: 700;
    --font-semibold: 600;

    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;
    --weight-black: 900;

    --leading-tight: 1.2;
    --leading-normal: 1.45;
    --leading-relaxed: 1.7;

    /* ── Border radius ── */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 50%;

    /* ── Shadows & Glows ── */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-elevated: 0 25px 50px rgba(0, 0, 0, 0.5);

    --glow-sm: 0 0 10px var(--neon-glow);
    --glow-md: 0 0 20px var(--neon-glow);
    --glow-lg: 0 0 30px var(--neon-glow);
    --glow-xl: 0 0 60px var(--neon-glow);

    --glow-idle: 0 0 20px rgba(102, 102, 102, 0.5);
    --glow-social: 0 0 20px rgba(74, 222, 128, 0.5);
    --glow-buzzed: 0 0 20px rgba(251, 191, 36, 0.5);
    --glow-overstimulated: 0 0 20px rgba(255, 42, 42, 0.5);
    --glow-blackout: 0 0 20px rgba(51, 51, 51, 0.5);

    /* ── Transitions ── */
    --transition-fast: 0.1s ease;
    --transition-base: 0.15s ease;
    --transition-slow: 0.2s ease;
    --transition-slower: 0.3s ease;

    /* ── Z-index scale ── */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 500;
    --z-modal: 1000;
    --z-toast: 1100;
  }
}

@layer base {
  html,
  body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-white);
    min-height: 100vh;
    line-height: var(--leading-normal);
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  img {
    max-width: 100%;
    display: block;
  }

  button {
    font-family: inherit;
    cursor: pointer;
  }

  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  ::-webkit-scrollbar-track {
    background: var(--bg-primary);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-sm);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
  }
}
