/* ═══════════════════════════════════════════════════
   BASE.CSS — Design Tokens, Reset, Typography
   ═══════════════════════════════════════════════════ */

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

/* ─── CSS Custom Properties (Design Tokens) ─── */
:root {
  /* Colors */
  --clr-bg-primary:    #09090b;
  --clr-bg-secondary:  #111114;
  --clr-bg-tertiary:   #18181c;
  --clr-bg-glass:      rgba(255, 255, 255, 0.03);
  --clr-bg-glass-hover: rgba(255, 255, 255, 0.06);

  --clr-text-primary:   #f0f0f2;
  --clr-text-secondary: #a0a0ae;
  --clr-text-muted:     #606070;

  --clr-accent:        #4f8fff;
  --clr-accent-dim:    #3a6cd4;
  --clr-accent-glow:   rgba(79, 143, 255, 0.15);
  --clr-accent-violet: #7c5cfc;
  --clr-accent-violet-glow: rgba(124, 92, 252, 0.10);

  --clr-border:        rgba(255, 255, 255, 0.06);
  --clr-border-hover:  rgba(255, 255, 255, 0.12);

  --clr-gradient-start: #4f8fff;
  --clr-gradient-end:   #7c5cfc;

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

  --fs-xs:     0.75rem;
  --fs-sm:     0.875rem;
  --fs-base:   1rem;
  --fs-md:     1.125rem;
  --fs-lg:     1.25rem;
  --fs-xl:     1.5rem;
  --fs-2xl:    2rem;
  --fs-3xl:    2.5rem;
  --fs-4xl:    3.25rem;
  --fs-5xl:    4rem;
  --fs-hero:   5.5rem;

  --lh-tight:    1.1;
  --lh-snug:     1.25;
  --lh-normal:   1.5;
  --lh-relaxed:  1.7;

  --ls-tight:   -0.03em;
  --ls-normal:   0;
  --ls-wide:     0.08em;
  --ls-wider:    0.15em;

  /* Spacing */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;
  --space-4xl:  6rem;
  --space-5xl:  8rem;

  /* Borders & Radii */
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --radius-full:  9999px;

  /* Shadows */
  --shadow-subtle: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-medium: 0 4px 16px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-heavy:  0 12px 48px rgba(0,0,0,0.5), 0 6px 16px rgba(0,0,0,0.4);
  --shadow-glow:   0 0 30px var(--clr-accent-glow);

  /* Transitions */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);

  --dur-fast:    150ms;
  --dur-normal:  300ms;
  --dur-slow:    500ms;
  --dur-slower:  800ms;
  --dur-cinematic: 1200ms;

  /* Z-indices */
  --z-base:      1;
  --z-content:   10;
  --z-nav:       100;
  --z-modal:     200;
  --z-overlay:   300;
  --z-intro:     1000;
}

/* ─── Modern Reset ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--clr-text-primary);
  background-color: var(--clr-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Film grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

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

ul, ol {
  list-style: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* ─── Selection ─── */
::selection {
  background: var(--clr-accent);
  color: var(--clr-bg-primary);
}

/* ─── Focus Styles ─── */
:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--clr-bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--clr-text-muted);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--clr-text-secondary);
}

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--clr-text-primary);
}

.text-gradient {
  background: linear-gradient(135deg, var(--clr-gradient-start), var(--clr-gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--clr-accent);
}

.label-muted {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--clr-text-muted);
}

/* ─── Utility ─── */
.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;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-lg);
  }
}
