/* ============================================================
   PitchMaster Tools — Design System
   Core tokens, typography, and foundational styles
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ============================================================
   CSS Custom Properties (Design Tokens)
   ============================================================ */
:root {
  /* ---- Color Palette ---- */
  --color-bg:           #0A0A1A;
  --color-bg-alt:       #0D0D1F;
  --color-surface:      #1A1A2E;
  --color-surface-alt:  #16213E;
  --color-surface-hover:#222244;
  --color-border:       rgba(108, 99, 255, 0.15);
  --color-border-hover: rgba(108, 99, 255, 0.35);

  --color-primary:      #6C63FF;
  --color-primary-rgb:  108, 99, 255;
  --color-primary-dark: #5548D9;
  --color-primary-light:#8B84FF;

  --color-accent:       #00D9FF;
  --color-accent-rgb:   0, 217, 255;
  --color-accent-dark:  #00B8D9;

  --color-success:      #00FF88;
  --color-success-rgb:  0, 255, 136;

  --color-warning:      #FFD700;
  --color-warning-rgb:  255, 215, 0;

  --color-error:        #FF6B6B;
  --color-error-rgb:    255, 107, 107;

  --color-text:         #E8E6F0;
  --color-text-muted:   #9B97B0;
  --color-text-dim:     #5C5880;

  /* ---- Gradients ---- */
  --gradient-primary:   linear-gradient(135deg, #6C63FF 0%, #00D9FF 100%);
  --gradient-accent:    linear-gradient(135deg, #00D9FF 0%, #00FF88 100%);
  --gradient-warm:      linear-gradient(135deg, #FF6B6B 0%, #FFD700 100%);
  --gradient-surface:   linear-gradient(135deg, rgba(26,26,46,0.8) 0%, rgba(22,33,62,0.8) 100%);
  --gradient-hero:      radial-gradient(ellipse at 30% 20%, rgba(108,99,255,0.15) 0%, transparent 50%),
                        radial-gradient(ellipse at 70% 80%, rgba(0,217,255,0.08) 0%, transparent 50%);

  /* ---- Typography ---- */
  --font-heading:       'Outfit', system-ui, -apple-system, sans-serif;
  --font-body:          'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:          'JetBrains Mono', 'Fira Code', monospace;

  --text-xs:            clamp(0.625rem,  0.6rem + 0.15vw, 0.75rem);    /* ~10-12px */
  --text-sm:            clamp(0.75rem,   0.7rem + 0.2vw,  0.875rem);   /* ~12-14px */
  --text-base:          clamp(0.875rem,  0.8rem + 0.25vw, 1rem);       /* ~14-16px */
  --text-lg:            clamp(1rem,      0.9rem + 0.35vw, 1.25rem);    /* ~16-20px */
  --text-xl:            clamp(1.25rem,   1.1rem + 0.5vw,  1.5rem);     /* ~20-24px */
  --text-2xl:           clamp(1.5rem,    1.2rem + 0.8vw,  2rem);       /* ~24-32px */
  --text-3xl:           clamp(2rem,      1.5rem + 1.5vw,  3rem);       /* ~32-48px */
  --text-4xl:           clamp(2.5rem,    2rem + 2vw,      4rem);       /* ~40-64px */

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

  --weight-light:       300;
  --weight-regular:     400;
  --weight-medium:      500;
  --weight-semibold:    600;
  --weight-bold:        700;
  --weight-extrabold:   800;

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

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

  /* ---- Shadows ---- */
  --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-xl:          0 12px 40px rgba(0,0,0,0.6);
  --shadow-glow:        0 0 20px rgba(var(--color-primary-rgb), 0.3);
  --shadow-glow-accent: 0 0 20px rgba(var(--color-accent-rgb), 0.3);
  --shadow-glow-success:0 0 20px rgba(var(--color-success-rgb), 0.3);

  /* ---- Transitions ---- */
  --ease-default:       cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:            cubic-bezier(0.4, 0, 1, 1);
  --ease-out:           cubic-bezier(0, 0, 0.2, 1);
  --ease-spring:        cubic-bezier(0.175, 0.885, 0.32, 1.275);

  --duration-fast:      150ms;
  --duration-normal:    250ms;
  --duration-slow:      400ms;
  --duration-slower:    600ms;

  /* ---- Z-index layers ---- */
  --z-base:             0;
  --z-elevated:         10;
  --z-sticky:           100;
  --z-overlay:          200;
  --z-modal:            300;
  --z-toast:            400;

  /* ---- Layout ---- */
  --max-width:          1200px;
  --max-width-narrow:   800px;
  --sidebar-width:      320px;
  --nav-height:         64px;
}

/* ============================================================
   Base Reset & Global Styles
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image: var(--gradient-hero);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h1 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
}

h4 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}

a:hover {
  color: var(--color-primary-light);
  text-decoration: underline;
}

strong {
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-surface);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

/* ---- Lists ---- */
ul, ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

li {
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
}

/* ---- Images & Media ---- */
img, canvas, video, svg {
  display: block;
  max-width: 100%;
}

canvas {
  border-radius: var(--radius-lg);
}

/* ---- Selection ---- */
::selection {
  background: rgba(var(--color-primary-rgb), 0.3);
  color: var(--color-text);
}

/* ---- Focus Visible ---- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-surface-alt);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ============================================================
   Utility Classes
   ============================================================ */

/* Text alignment */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }

/* Text colors */
.text-primary { color: var(--color-primary); }
.text-accent  { color: var(--color-accent); }
.text-muted   { color: var(--color-text-muted); }
.text-dim     { color: var(--color-text-dim); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error   { color: var(--color-error); }

/* Font families */
.font-heading { font-family: var(--font-heading); }
.font-mono    { font-family: var(--font-mono); }

/* Gradient text */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Visibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

/* Flex utilities */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-center{ justify-content: center; }
.justify-between{ justify-content: space-between; }
.gap-1         { gap: var(--space-1); }
.gap-2         { gap: var(--space-2); }
.gap-3         { gap: var(--space-3); }
.gap-4         { gap: var(--space-4); }
.gap-6         { gap: var(--space-6); }
.gap-8         { gap: var(--space-8); }

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container-narrow {
  max-width: var(--max-width-narrow);
}

/* ============================================================
   Keyframe Animations
   ============================================================ */

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

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

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.2);
  }
  50% {
    box-shadow: 0 0 24px rgba(var(--color-primary-rgb), 0.5);
  }
}

@keyframes pulseGlowAccent {
  0%, 100% {
    box-shadow: 0 0 8px rgba(var(--color-accent-rgb), 0.2);
  }
  50% {
    box-shadow: 0 0 24px rgba(var(--color-accent-rgb), 0.5);
  }
}

@keyframes pulseGlowSuccess {
  0%, 100% {
    box-shadow: 0 0 8px rgba(var(--color-success-rgb), 0.2);
  }
  50% {
    box-shadow: 0 0 24px rgba(var(--color-success-rgb), 0.5);
  }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes beatPulse {
  0%   { transform: scale(1); opacity: 0.6; }
  15%  { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 0.6; }
}

@keyframes ringPulse {
  0%, 100% { filter: drop-shadow(0 0 4px currentColor); }
  50%      { filter: drop-shadow(0 0 16px currentColor); }
}

/* Animation utility classes */
.animate-fade-in      { animation: fadeIn var(--duration-normal) var(--ease-out); }
.animate-fade-in-up   { animation: fadeInUp var(--duration-slow) var(--ease-out); }
.animate-fade-in-scale{ animation: fadeInScale var(--duration-slow) var(--ease-spring); }
.animate-pulse        { animation: pulse 2s var(--ease-default) infinite; }
.animate-pulse-glow   { animation: pulseGlow 2s var(--ease-default) infinite; }

/* Staggered children animation */
.stagger-children > * {
  animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 80ms; }
.stagger-children > *:nth-child(3) { animation-delay: 160ms; }
.stagger-children > *:nth-child(4) { animation-delay: 240ms; }
.stagger-children > *:nth-child(5) { animation-delay: 320ms; }
.stagger-children > *:nth-child(6) { animation-delay: 400ms; }

/* ============================================================
   Responsive Breakpoints (Mobile-First)
   ============================================================ */
/* Tablet: >= 768px — use @media (min-width: 768px) */
/* Desktop: >= 1024px — use @media (min-width: 1024px) */
/* Wide: >= 1200px — use @media (min-width: 1200px) */
