/* ═══════════════════════════════════════════════════════════════════════
   Football AI Analysis — SpaceX-Inspired Design System
   Palette: Deep Space (#030014) + Purple (#a78bfa) + Cyan (#06b6d4)
   ═══════════════════════════════════════════════════════════════════════ */

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

/* ── Variables ──────────────────────────────────────────────────────── */
:root {
  --bg: #030014;
  --bg-card: rgba(255, 255, 255, 0.03);
  --purple: #a78bfa;
  --purple-dim: rgba(167, 139, 250, 0.15);
  --cyan: #06b6d4;
  --cyan-dim: rgba(6, 182, 212, 0.15);
  --pink: #ec4899;
  --white: #f1f5f9;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --border: rgba(255, 255, 255, 0.06);
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--gray-300);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input {
  font-family: inherit;
}

/* ── Cursor Canvas ──────────────────────────────────────────────────── */
#cursorCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* ── Parallax Orbs ──────────────────────────────────────────────────── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  transition: transform 0.4s ease-out;
}

.orb--purple {
  width: 500px;
  height: 500px;
  background: rgba(167, 139, 250, 0.12);
  top: 15%;
  left: 20%;
}

.orb--cyan {
  width: 400px;
  height: 400px;
  background: rgba(6, 182, 212, 0.10);
  bottom: 20%;
  right: 15%;
}

.orb--pink {
  width: 350px;
  height: 350px;
  background: rgba(236, 72, 153, 0.07);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ── Glass Card ─────────────────────────────────────────────────────── */
.glass {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── Text Gradient ──────────────────────────────────────────────────── */
.text-gradient {
  background: linear-gradient(90deg, var(--purple), var(--cyan), var(--pink));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: text-shimmer 4s linear infinite;
}

/* ── SVG Icons ──────────────────────────────────────────────────────── */
.icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── Logo Image ────────────────────────────────────────────────────── */
.logo-img {
  height: 40px;
  width: auto;
  display: inline-block;
  border-radius: 6px;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.logo-img:hover {
  filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.5));
  transform: scale(1.08);
}

/* ── Nav ────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.5s;
}

.nav.scrolled {
  background: rgba(3, 0, 20, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 32px;
  border-bottom: 1px solid var(--border);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--white);
}

.nav__logo .logo-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  animation: pulse-glow 3s ease-in-out infinite;
  position: relative;
}

.nav__links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav__links a {
  font-size: 0.9rem;
  color: var(--gray-400);
  transition: color 0.3s;
  position: relative;
}

.nav__links a:hover {
  color: var(--white);
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  transition: width 0.3s;
}

.nav__links a:hover::after {
  width: 100%;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(167, 139, 250, 0.3);
  transition: all 0.3s;
}

.btn-nav:hover {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.35), rgba(6, 182, 212, 0.35));
  border-color: var(--purple);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(167, 139, 250, 0.25);
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 120px 32px 80px;
}

.hero__inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.82rem;
  color: var(--purple);
  animation: pulse-glow 3s ease-in-out infinite;
}

.hero__badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple);
  animation: blink 2s infinite;
}

.hero__title {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin: 16px 0;
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--gray-400);
  max-width: 500px;
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(167, 139, 250, 0.4);
}

.hero__cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  opacity: 0;
  transition: opacity 0.3s;
  filter: blur(20px);
}

.hero__cta:hover::before {
  opacity: 0.5;
}

/* Hero Orb Visual */
.hero__visual {
  position: relative;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__orb {
  position: relative;
  width: 280px;
  height: 280px;
  transition: transform 0.4s ease-out;
}

.hero__orb-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.25), rgba(6, 182, 212, 0.25));
  border-radius: 50%;
  filter: blur(30px);
  animation: pulse-glow 3s ease-in-out infinite;
}

.hero__orb-ring {
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 50%;
  animation: rotate-slow 25s linear infinite;
}

.hero__orb-ring::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

/* Floating tech badges */
.float-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--gray-300);
  animation: float 6s ease-in-out infinite;
  transition: transform 0.3s, background 0.3s;
  cursor: default;
}

.float-badge:hover {
  background: rgba(167, 139, 250, 0.2);
  transform: scale(1.1);
}

.float-badge .icon {
  font-size: 1.2rem;
}

/* ── Section Base ───────────────────────────────────────────────────── */
section {
  position: relative;
  z-index: 1;
  padding: 100px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-sep {
  height: 1px;
  max-width: 1200px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--purple), transparent);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--purple);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-label .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple);
  animation: blink 2s infinite;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--gray-400);
  max-width: 650px;
  line-height: 1.7;
}

/* ── Pipeline Cards ─────────────────────────────────────────────────── */
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.pipeline-card {
  padding: 28px 24px;
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}

.pipeline-card:hover {
  transform: translateY(-6px);
  border-color: rgba(167, 139, 250, 0.3);
  box-shadow: 0 8px 30px rgba(167, 139, 250, 0.08);
}

.pipeline-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  opacity: 0;
  transition: opacity 0.4s;
}

.pipeline-card:hover::before {
  opacity: 1;
}

.pipeline-card__num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--purple);
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.pipeline-card__icon {
  font-size: 1.6rem;
  margin-bottom: 14px;
  color: var(--cyan);
  display: block;
}

.pipeline-card__title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
}

.pipeline-card__desc {
  font-size: 0.88rem;
  color: var(--gray-400);
  line-height: 1.65;
  margin-bottom: 14px;
}

.pipeline-card__tech {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 100px;
  background: var(--purple-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--purple);
}

/* ── How It Works / Explanation ──────────────────────────────────────  */
.explain-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 48px;
}

.explain-card {
  padding: 32px;
  transition: all 0.4s;
}

.explain-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.3);
}

.explain-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--cyan-dim);
  color: var(--cyan);
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.explain-card__title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
}

.explain-card__text {
  font-size: 0.88rem;
  color: var(--gray-400);
  line-height: 1.65;
}

/* ── Tech Carousel ──────────────────────────────────────────────────── */
.carousel-wrapper {
  position: relative;
  overflow: hidden;
  padding: 16px 0;
  margin-top: 48px;
}

.carousel-wrapper::before,
.carousel-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}

.carousel-wrapper::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg), transparent);
}

.carousel-wrapper::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg), transparent);
}

.carousel-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: scroll 30s linear infinite;
}

.carousel-track:hover {
  animation-play-state: paused;
}

.tech-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-300);
  white-space: nowrap;
  transition: all 0.4s;
  cursor: default;
}

.tech-pill:hover {
  background: rgba(167, 139, 250, 0.2);
  color: var(--white);
  transform: scale(1.08) translateY(-4px);
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.2);
}

.tech-pill .icon {
  font-size: 1.3rem;
}

/* ── Output Explained Section ───────────────────────────────────────── */
.output-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.output-card {
  padding: 28px 24px;
  text-align: center;
  transition: all 0.4s;
}

.output-card:hover {
  transform: translateY(-4px);
  border-color: rgba(236, 72, 153, 0.3);
}

.output-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin: 0 auto 16px;
  font-size: 1.5rem;
}

.output-card__title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}

.output-card__text {
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* ── Demo Section ───────────────────────────────────────────────────── */
.demo-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
}

.upload-panel {
  padding: 32px;
}

.upload-zone {
  border: 2px dashed rgba(167, 139, 250, 0.25);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 20px;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--purple);
  background: var(--purple-dim);
}

.upload-zone__icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
  display: block;
  color: var(--purple);
}

.upload-zone__text {
  font-weight: 600;
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 4px;
}

.upload-zone__hint {
  font-size: 0.82rem;
  color: var(--gray-500);
}

.api-config {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.api-config label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  align-self: center;
}

.api-config input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.3s;
}

.api-config input:focus {
  border-color: var(--purple);
}

/* Analyze Button */
.btn-analyze {
  width: 100%;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
}

.btn-analyze:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(167, 139, 250, 0.35);
}

.btn-analyze:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Results Panel ──────────────────────────────────────────────────── */
.results-panel {
  padding: 0;
}

.results-card {
  padding: 24px;
  margin-bottom: 16px;
}

.results-card__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--white);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.results-card__title .icon {
  color: var(--cyan);
}

/* Possession Bar */
.possession-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 12px;
}

.possession-bar__team {
  transition: flex 0.6s ease;
  min-width: 4px;
}

.possession-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.possession-labels span {
  font-weight: 500;
}

/* Stats Table */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.stats-table thead {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stats-table th {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.stats-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--gray-300);
}

.stats-table tbody tr:hover {
  background: rgba(167, 139, 250, 0.04);
}

.team-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* Download button */
.btn-download {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  padding: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  transition: all 0.3s;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(167, 139, 250, 0.3);
}

/* ── Full-Screen Loader Overlay ─────────────────────────────────────── */
#loaderOverlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 0, 20, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.4s;
}

#loaderOverlay.hidden {
  display: none;
}

.loader-container {
  text-align: center;
  max-width: 420px;
  width: 90%;
}

/* Progress Ring */
.ring-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 32px;
}

.ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(167, 139, 250, 0.1);
  stroke-width: 6;
}

.ring-fill {
  fill: none;
  stroke: url(#ringGradient);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 502;
  stroke-dashoffset: 502;
  transition: stroke-dashoffset 0.5s ease-out;
}

.ring-pct {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-pct__value {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--white);
}

.ring-pct__eta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.loader-step {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--purple);
  margin-bottom: 24px;
  letter-spacing: 1px;
}

/* Terminal Log */
.terminal-box {
  text-align: left;
  border-radius: var(--radius);
  padding: 16px;
  max-height: 200px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.7;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
}

.terminal-box::-webkit-scrollbar {
  width: 4px;
}

.terminal-box::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-box::-webkit-scrollbar-thumb {
  background: var(--purple-dim);
  border-radius: 2px;
}

.log-line {
  margin-bottom: 2px;
}

.log-time {
  color: var(--gray-500);
  margin-right: 8px;
}

.log-msg {
  color: var(--gray-300);
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.footer {
  padding: 40px 32px;
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--gray-500);
  max-width: 1200px;
  margin: 0 auto;
}

.footer a {
  color: var(--purple);
  transition: color 0.3s;
}

.footer a:hover {
  color: var(--cyan);
}

/* ═══════════════════════════════════════════════════════════════════════
   Animations
   ═══════════════════════════════════════════════════════════════════════ */
@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 15px rgba(167, 139, 250, 0.2);
  }

  50% {
    box-shadow: 0 0 35px rgba(167, 139, 250, 0.5);
  }
}

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

  100% {
    background-position: 200% 0;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-14px);
  }
}

@keyframes gradient-shift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes rotate-slow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-33.333%);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ── Scroll Reveal ──────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav__links {
    display: none;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__visual {
    height: 300px;
  }

  .hero__subtitle {
    margin: 0 auto 32px;
  }

  .pipeline-grid {
    grid-template-columns: 1fr;
  }

  .explain-grid {
    grid-template-columns: 1fr;
  }

  .output-grid {
    grid-template-columns: 1fr;
  }

  .demo-layout {
    grid-template-columns: 1fr;
  }

  section {
    padding: 60px 20px;
  }

  .section-title {
    font-size: 2rem;
  }
}

/* ── Utility ────────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

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

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

/* ── Before/After Comparison Slider ─────────────────────────────────── */
.comparison {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 2rem auto;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
  cursor: col-resize;
  user-select: none;
  background: #000;
}

.comparison__video-wrap {
  position: absolute;
  inset: 0;
}

.comparison__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comparison__overlay {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0);
  overflow: hidden;
}

.comparison__overlay .comparison__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comparison__slider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: rgba(255, 255, 255, 0.8);
  cursor: col-resize;
  z-index: 10;
  transform: translateX(-50%);
}

.comparison__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.9);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  color: #fff;
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
  transition: box-shadow 0.3s;
}

.comparison__handle:hover {
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.8);
}

.comparison__label {
  position: absolute;
  bottom: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 5;
  pointer-events: none;
}

.comparison__label--before {
  left: 12px;
  background: rgba(167, 139, 250, 0.8);
  color: #fff;
}

.comparison__label--after {
  right: 12px;
  background: rgba(6, 182, 212, 0.8);
  color: #fff;
}

.btn-play-compare {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1.5rem auto;
  padding: 12px 28px;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s;
}

.btn-play-compare:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(167, 139, 250, 0.4);
}

.btn-play-compare .icon {
  width: 1.2em;
  height: 1.2em;
}

/* ── Error Modal ────────────────────────────────────────────────────── */
.error-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.error-modal__card {
  position: relative;
  max-width: 560px;
  width: 90%;
  padding: 2.5rem;
  border-radius: var(--radius);
  text-align: center;
}

.error-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.8rem;
  color: var(--gray-400);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.error-modal__close:hover {
  color: var(--pink);
}

.error-modal__icon {
  margin-bottom: 1rem;
}

.error-modal__title {
  font-family: var(--font-head);
  color: var(--white);
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.error-modal__text {
  color: var(--gray-300);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.error-modal__steps {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.error-modal__step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--gray-300);
  line-height: 1.5;
}

.error-modal__step code {
  background: rgba(167, 139, 250, 0.1);
  color: var(--purple);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  word-break: break-all;
}

.error-modal__num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--purple-dim);
  color: var(--purple);
  font-weight: 700;
  font-size: 0.8rem;
}

.error-modal__hint {
  color: var(--gray-400);
  font-size: 0.85rem;
  font-style: italic;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}