/* ============ tokens ============ */
:root {
  --bg: #0a0a12;
  --bg-soft: #11111d;
  --line: #23233a;
  --text: #eceaf6;
  --dim: #9a98b5;
  --dimmer: #6c6a85;
  --brand: #6d4aff;
  --brand-2: #ff4ad4;
  --brand-3: #4ad4ff;
  --grad: linear-gradient(110deg, var(--brand), var(--brand-2) 55%, var(--brand-3));
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--brand); color: #fff; }

.noise {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) }
  40% { transform: translate(2%,-3%) } 60% { transform: translate(-2%,-2%) } 80% { transform: translate(3%,3%) }
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
a { color: inherit; }

/* ============ nav ============ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 18, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s;
}
nav.scrolled { border-bottom-color: var(--line); }
.logo { font-family: var(--font-display); font-size: 18px; text-decoration: none; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { font-size: 13.5px; color: var(--dim); text-decoration: none; transition: color 0.25s; }
.nav-links a:hover { color: var(--text); }

/* ============ buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; text-decoration: none;
  border-radius: 100px; cursor: pointer; border: 1px solid var(--line);
  color: var(--text); background: var(--bg-soft);
  transition: transform 0.25s cubic-bezier(.2,.8,.3,1.2), background 0.25s, border-color 0.25s, box-shadow 0.25s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 6px 28px rgba(109, 74, 255, 0.35);
}
.btn-primary:hover { background: #7d5dff; box-shadow: 0 10px 36px rgba(109, 74, 255, 0.5); }
.btn-ghost:hover { border-color: var(--dimmer); }
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-lg { padding: 14px 30px; font-size: 15.5px; }
.btn-xl { padding: 18px 44px; font-size: 18px; }

/* ============ hero ============ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 110px 20px 80px;
}
#stream { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-inner { position: relative; z-index: 2; max-width: 880px; }
.eyebrow {
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 22px;
  display: inline-block; padding: 7px 16px; border: 1px solid var(--line);
  border-radius: 100px; background: rgba(17, 17, 29, 0.6); backdrop-filter: blur(6px);
}
h1 {
  font-size: clamp(44px, 8.5vw, 104px);
  line-height: 1.02; margin-bottom: 26px;
}
h1 .char { display: inline-block; will-change: transform, opacity; }
h1 .line-mask { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.08em; }
h1 .line-mask em { display: inline-block; will-change: transform; }
.hero-sub { font-size: clamp(16px, 2vw, 19px); color: var(--dim); max-width: 580px; margin: 0 auto 36px; }
.hero-sub b { color: var(--text); }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 52px; }
.hero-stats { display: flex; gap: clamp(24px, 5vw, 64px); justify-content: center; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-family: var(--font-display); font-size: clamp(22px, 3vw, 30px); }
.hero-stats span { font-size: 12.5px; color: var(--dimmer); }
.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 36px; border: 1.5px solid var(--dimmer); border-radius: 12px; z-index: 2;
}
.scroll-hint span {
  position: absolute; top: 6px; left: 50%; width: 3px; height: 7px; margin-left: -1.5px;
  background: var(--dim); border-radius: 2px; animation: hint 1.8s ease-in-out infinite;
}
@keyframes hint { 0%,100% { transform: translateY(0); opacity: 1 } 60% { transform: translateY(12px); opacity: 0 } }

/* ============ marquee ============ */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 18px 0; background: var(--bg-soft); }
.marquee-track { display: flex; gap: 36px; width: max-content; align-items: center; }
.marquee-track span {
  font-family: var(--font-display); font-size: clamp(20px, 3vw, 30px); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
}
.marquee-track span:nth-child(8n+3) { -webkit-text-stroke: 1px var(--dim); color: transparent; }
.marquee-track i { color: var(--brand); font-style: normal; font-size: 24px; }

/* ============ sections ============ */
.section { padding: clamp(90px, 12vw, 150px) clamp(20px, 6vw, 72px); max-width: 1180px; margin: 0 auto; }
.section h2 { font-size: clamp(32px, 5vw, 58px); line-height: 1.08; margin-bottom: 22px; }
.center { text-align: center; }
.sub { color: var(--dim); max-width: 560px; margin: 0 auto 56px; }
.section-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(36px, 6vw, 80px); align-items: center; }
.dim { color: var(--dim); }

/* problem */
.problem-copy p { margin-bottom: 16px; max-width: 460px; }
.dead-cards { position: relative; min-height: 300px; }
.dead-card {
  position: absolute; left: 10%; width: 78%;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 24px; font-family: var(--font-display); font-size: 15px;
  display: flex; justify-content: space-between; align-items: center;
  filter: grayscale(0.9); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.dead-card i { font-style: normal; font-size: 11.5px; color: var(--dimmer); border: 1px solid var(--line); padding: 3px 10px; border-radius: 20px; }
.dead-card:nth-child(1) { top: 8%; transform: rotate(-4deg); }
.dead-card:nth-child(2) { top: 38%; transform: rotate(2.5deg); }
.dead-card:nth-child(3) { top: 68%; transform: rotate(-1.5deg); }

/* pipeline */
.pipe-wrap { position: relative; max-width: 760px; margin: 0 auto; }
.pipe-line {
  position: absolute; left: 23px; top: 10px; bottom: 10px; width: 2px;
  background: var(--line); border-radius: 2px;
}
.pipe-progress { width: 100%; height: 0%; background: var(--grad); border-radius: 2px; }
.pipe-steps { list-style: none; display: flex; flex-direction: column; gap: clamp(40px, 6vw, 64px); }
.pipe-step { position: relative; padding-left: 76px; opacity: 0.25; transition: opacity 0.5s; }
.pipe-step.lit { opacity: 1; }
.pipe-dot {
  position: absolute; left: 0; top: 0;
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  background: var(--bg-soft); border: 1px solid var(--line);
  transition: all 0.5s;
}
.pipe-step.lit .pipe-dot {
  border-color: transparent;
  background: linear-gradient(var(--bg-soft), var(--bg-soft)) padding-box, var(--grad) border-box;
  border: 2px solid transparent;
  box-shadow: 0 0 24px rgba(109, 74, 255, 0.35);
}
.pipe-step h3 { font-size: 21px; margin-bottom: 6px; }
.pipe-step h3 b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pipe-step p { color: var(--dim); font-size: 15px; max-width: 480px; }

/* gemini mock */
.mock-card {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.mock-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.mock-head span { font-family: var(--font-display); font-weight: 600; }
.mock-gemini {
  font-family: var(--font-display); font-size: 13px; color: #e2d9ff;
  padding: 8px 16px; border-radius: 100px; cursor: default;
  border: 2px solid transparent;
  background: linear-gradient(var(--bg-soft), var(--bg-soft)) padding-box,
              linear-gradient(120deg, #6d4aff, #ff4ad4, #4ad4ff, #6d4aff) border-box;
  background-size: 100% 100%, 300% 300%;
}
.mock-gemini.thinking { animation: borderflow 1.6s linear infinite; }
@keyframes borderflow { to { background-position: 0 0, 300% 50%; } }
.mock-card label { display: block; font-size: 12px; color: var(--dimmer); margin-bottom: 12px; }
.mock-field {
  margin-top: 5px; background: #0d0d18; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 13px; font-size: 13.5px; color: var(--text); min-height: 40px;
}
.mock-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#tw-primary { min-height: 58px; }

/* safety */
.safety-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 56px; }
.tilt-card {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 18px;
  padding: 32px 26px; transition: transform 0.2s ease-out, border-color 0.3s;
  transform-style: preserve-3d; will-change: transform;
}
.tilt-card:hover { border-color: #3a3a5c; }
.tilt-icon { font-size: 30px; margin-bottom: 18px; }
.tilt-card h3 { font-size: 19px; margin-bottom: 10px; }
.tilt-card p { color: var(--dim); font-size: 14.5px; }

/* demo */
.video-frame {
  max-width: 860px; margin: 0 auto; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 1px rgba(109, 74, 255, 0.15), 0 40px 110px rgba(0, 0, 0, 0.6);
}
.video-frame video { display: block; width: 100%; }

/* final */
.final { text-align: center; padding-bottom: 120px; }
.final h2 { font-size: clamp(64px, 14vw, 190px); line-height: 1; margin-bottom: 20px; }
.final p { color: var(--dim); margin-bottom: 36px; }
.final p a { color: var(--text); }

footer {
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding: 26px clamp(20px, 6vw, 72px); font-size: 13px; color: var(--dimmer);
}
footer div { display: flex; gap: 22px; }
footer a { color: var(--dim); text-decoration: none; }
footer a:hover { color: var(--text); }

/* reveal helpers (GSAP sets final state; safe default = visible) */
.reveal-up { opacity: 1; }

/* ============ responsive ============ */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .section-grid { grid-template-columns: 1fr; }
  .dead-cards { min-height: 240px; }
  .safety-cards { grid-template-columns: 1fr; }
  .mock-row { grid-template-columns: 1fr; }
  .hero-stats { gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .noise, .scroll-hint, .marquee-track { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}
