/* ============================================================
   Site polish layer — cursor spotlight, magnetic CTAs, counters,
   smooth scroll, view transitions, sticky-scroll storytelling
   ============================================================ */

/* --- Smooth scroll (item 6) --- */
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* --- View Transitions API (item 4) --- */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.32s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
::view-transition-old(root) {
  animation-name: pnl-vt-fade-out;
}
::view-transition-new(root) {
  animation-name: pnl-vt-fade-in;
}
@keyframes pnl-vt-fade-out {
  to { opacity: 0; transform: translateY(-6px); }
}
@keyframes pnl-vt-fade-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* Cursor spotlight removed — particle rocket now anchors the right-side focal area */

/* --- 2. Magnetic CTAs --- */
.btn-primary,
.nav-cta,
.footer-support-cta,
.partner-cta {
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}

/* --- 3. Stats counter section --- */
.stats-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  padding: 36px 28px;
  margin-top: 0;
  border-radius: 18px 4px 18px 4px;
  background:
    linear-gradient(180deg, rgba(12, 26, 58, 0.96) 0%, rgba(8, 18, 38, 0.98) 100%);
  border: 1px solid rgba(89, 175, 240, 0.18);
  position: relative;
}
.stats-band::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 26px;
  right: 26px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(89, 175, 240, 0.55) 25%,
    rgba(89, 175, 240, 0.85) 50%,
    rgba(89, 175, 240, 0.55) 75%,
    transparent 100%
  );
  pointer-events: none;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff 0%, #c4d4ec 50%, #59aff0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}
.stat-suffix {
  display: inline-block;
  margin-left: 2px;
  font-family: var(--font-display);
  background: linear-gradient(135deg, #ffffff 0%, #c4d4ec 50%, #59aff0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- 5. Sticky-scroll storytelling section ("How It Works" v2) --- */
.story-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
  margin-top: 42px;
  padding: 0;
}
.story-rail {
  display: flex;
  flex-direction: column;
  gap: 80px;
  padding: 60px 0;
}
.story-step {
  opacity: 0.4;
  transition: opacity 0.4s ease;
  padding: 8px 4px;
}
.story-step.is-active {
  opacity: 1;
}
.story-step h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin: 8px 0 12px;
  letter-spacing: -0.02em;
}
.story-step .panel-kicker {
  color: var(--brand-blue-bright);
}
.story-step p {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.65;
  margin: 0;
}
.story-stage {
  position: sticky;
  top: 100px;
  height: 460px;
  border-radius: 18px 4px 18px 4px;
  border: 1px solid rgba(89, 175, 240, 0.18);
  background:
    linear-gradient(180deg, rgba(12, 26, 58, 0.96) 0%, rgba(8, 18, 38, 0.98) 100%);
  overflow: hidden;
  display: grid;
  place-items: center;
  position: -webkit-sticky;
  position: sticky;
}
.story-frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px;
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.45s ease;
  transform: translateY(20px);
}
.story-frame.is-active {
  opacity: 1;
  transform: translateY(0);
}
.story-frame .frame-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-blue-bright);
  margin-bottom: 18px;
}
.story-frame .frame-glyph {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(89, 175, 240, 0.5), rgba(37, 99, 235, 0.2) 60%, transparent 80%);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 22px;
  border: 1px solid rgba(89, 175, 240, 0.35);
  box-shadow: 0 0 30px rgba(89, 175, 240, 0.25), inset 0 0 30px rgba(89, 175, 240, 0.18);
}
.story-frame h4 {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.story-frame p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

@media (max-width: 880px) {
  .story-section {
    grid-template-columns: 1fr;
  }
  .story-stage {
    position: relative;
    top: 0;
    height: 320px;
    margin-bottom: 24px;
  }
  .story-rail {
    padding: 0;
    gap: 40px;
  }
  .story-step {
    opacity: 1;
  }
}
