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

/* Base */
html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--primary);
  color: white;
}

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

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

ul, ol {
  list-style: none;
}

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

h1 {
  font-size: var(--text-3xl);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-tight);
}

h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p {
  color: var(--text-secondary);
  max-width: 65ch;
}

/* Gradient text utility */
.gradient-text {
  background: linear-gradient(135deg, #818CF8, #06B6D4, #F472B6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-16) 0;
}

/* Buttons — Large pill with cinematic glow */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 18px 44px;
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all var(--duration-slow) var(--ease-out);
  min-height: 58px;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: var(--ring-offset);
}

/* Primary CTA — indigo with dramatic glow */
.btn-primary {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 700;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow:
    0 0 20px rgba(99, 102, 241, 0.6),
    0 0 50px rgba(99, 102, 241, 0.3),
    0 0 100px rgba(99, 102, 241, 0.15);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background-color: var(--glass-bg);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.06);
}

/* CTA variant — cyan/teal accent with dramatic glow */
.btn-cta {
  background-color: var(--cta);
  color: var(--cta-text);
  border-color: var(--cta);
  font-weight: 700;
}

.btn-cta:hover {
  background-color: var(--cta-hover);
  border-color: var(--cta-hover);
  box-shadow:
    0 0 20px rgba(6, 182, 212, 0.6),
    0 0 50px rgba(6, 182, 212, 0.3),
    0 0 100px rgba(6, 182, 212, 0.15);
}

/* Focus ring utility */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: var(--ring-offset);
}

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

.sr-only:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: var(--space-3) var(--space-6);
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--primary);
  color: white;
  font-weight: 600;
  z-index: var(--z-toast);
}

/* Scroll animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--duration-cinematic) var(--ease-out),
    transform var(--duration-cinematic) var(--ease-out);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Cinematic slide animations */
.animate-slide-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity var(--duration-cinematic) var(--ease-out), transform var(--duration-cinematic) var(--ease-out);
}

.animate-slide-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity var(--duration-cinematic) var(--ease-out), transform var(--duration-cinematic) var(--ease-out);
}

.animate-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity var(--duration-cinematic) var(--ease-out), transform var(--duration-cinematic) var(--ease-out);
}

.animate-slide-left.visible,
.animate-slide-right.visible,
.animate-scale.visible {
  opacity: 1;
  transform: none;
}

/* Stagger delays */
.animate-on-scroll[data-delay="50"],
.animate-slide-left[data-delay="50"],
.animate-slide-right[data-delay="50"],
.animate-scale[data-delay="50"] { transition-delay: 50ms; }

.animate-on-scroll[data-delay="100"],
.animate-slide-left[data-delay="100"],
.animate-slide-right[data-delay="100"],
.animate-scale[data-delay="100"] { transition-delay: 100ms; }

.animate-on-scroll[data-delay="150"],
.animate-slide-left[data-delay="150"],
.animate-slide-right[data-delay="150"],
.animate-scale[data-delay="150"] { transition-delay: 150ms; }

.animate-on-scroll[data-delay="200"],
.animate-slide-left[data-delay="200"],
.animate-slide-right[data-delay="200"],
.animate-scale[data-delay="200"] { transition-delay: 200ms; }

.animate-on-scroll[data-delay="250"],
.animate-slide-left[data-delay="250"],
.animate-slide-right[data-delay="250"],
.animate-scale[data-delay="250"] { transition-delay: 250ms; }

.animate-on-scroll[data-delay="300"],
.animate-slide-left[data-delay="300"],
.animate-slide-right[data-delay="300"],
.animate-scale[data-delay="300"] { transition-delay: 300ms; }

.animate-on-scroll[data-delay="350"] { transition-delay: 350ms; }
.animate-on-scroll[data-delay="400"] { transition-delay: 400ms; }
.animate-on-scroll[data-delay="500"] { transition-delay: 500ms; }
.animate-on-scroll[data-delay="600"] { transition-delay: 600ms; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .animate-on-scroll,
  .animate-slide-left,
  .animate-slide-right,
  .animate-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Responsive typography */
@media (max-width: 768px) {
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  h3 { font-size: var(--text-lg); }
  h4 { font-size: var(--text-base); }
}

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