/* Page motion — scroll reveals + ambient loops */

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-section,
  .reveal-stagger > *,
  .anim-float,
  .anim-float-slow,
  .anim-badge-breathe,
  .anim-line-draw,
  .feature-card,
  .chip,
  .avatar-stack img {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* Base reveal */
.reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  filter: blur(4px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform, filter;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

.reveal-left {
  transform: translate3d(-36px, 0, 0);
}
.reveal-right {
  transform: translate3d(36px, 0, 0);
}
.reveal-scale {
  transform: translate3d(0, 18px, 0) scale(0.96);
}
.reveal-left.is-in,
.reveal-right.is-in,
.reveal-scale.is-in {
  transform: none;
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-stagger.is-in > *:nth-child(1) { transition-delay: 0.04s; }
.reveal-stagger.is-in > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.is-in > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger.is-in > *:nth-child(4) { transition-delay: 0.22s; }
.reveal-stagger.is-in > *:nth-child(5) { transition-delay: 0.28s; }
.reveal-stagger.is-in > *:nth-child(6) { transition-delay: 0.34s; }
.reveal-stagger.is-in > *:nth-child(7) { transition-delay: 0.4s; }
.reveal-stagger.is-in > *:nth-child(8) { transition-delay: 0.46s; }
.reveal-stagger.is-in > *:nth-child(9) { transition-delay: 0.52s; }
.reveal-stagger.is-in > *:nth-child(10) { transition-delay: 0.58s; }
.reveal-stagger.is-in > * {
  opacity: 1;
  transform: none;
}

/* Hero entrance cascade */
.hero-motion > * {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-motion.is-in > *:nth-child(1) { transition-delay: 0.05s; }
.hero-motion.is-in > *:nth-child(2) { transition-delay: 0.16s; }
.hero-motion.is-in > *:nth-child(3) { transition-delay: 0.28s; }
.hero-motion.is-in > *:nth-child(4) { transition-delay: 0.4s; }
.hero-motion.is-in > * {
  opacity: 1;
  transform: none;
}

/* Ambient: soft float for mockups (only after reveal) */
.anim-float.is-in,
.reveal.anim-float.is-in {
  animation: floatY 6.5s ease-in-out infinite;
}
.anim-float-slow.is-in,
.reveal.anim-float-slow.is-in {
  animation: floatY 9s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
}

/* Badge soft breathe */
.anim-badge-breathe.is-in {
  animation: badgeBreathe 3.8s ease-in-out infinite;
}
@keyframes badgeBreathe {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(152, 63, 255, 0);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 8px rgba(152, 63, 255, 0.06);
  }
}

/* Feature cards */
.feature-card {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}
.feature-card:hover {
  transform: translate3d(0, -6px, 0);
  box-shadow: 0 14px 28px rgba(152, 63, 255, 0.1);
  border-color: #c9a4ff;
}
.feature-card img,
.feature-card .size-8 {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.feature-card:hover img,
.feature-card:hover .size-8 {
  transform: scale(1.08) rotate(-3deg);
}

/* Chips */
.chip {
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    color 0.3s ease;
}
.chip:hover {
  transform: translate3d(0, -3px, 0) scale(1.02);
  border-color: #983FFF;
  color: #983FFF;
  box-shadow: 0 8px 18px rgba(152, 63, 255, 0.12);
}

/* Avatar cascade continuous after reveal */
.avatar-stack img {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}
.avatar-stack.is-in img {
  animation: avatarPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.avatar-stack.is-in img:nth-child(1) { animation-delay: 0.05s; }
.avatar-stack.is-in img:nth-child(2) { animation-delay: 0.12s; }
.avatar-stack.is-in img:nth-child(3) { animation-delay: 0.19s; }
.avatar-stack.is-in img:nth-child(4) { animation-delay: 0.26s; }
.avatar-stack.is-in img:nth-child(5) { animation-delay: 0.33s; }
.avatar-stack.is-in img:nth-child(6) { animation-delay: 0.4s; }
@keyframes avatarPop {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Process steps: left accent grow */
.process-step {
  position: relative;
  overflow: hidden;
}
.process-step::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #A140FF, #5E34FF);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.process-step.is-in::before {
  transform: scaleY(1);
}

/* CTA glow */
.cta-motion {
  transition: box-shadow 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.cta-motion.is-in {
  animation: ctaGlow 3.5s ease-in-out infinite;
}
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06); }
  50% { box-shadow: 0 8px 28px rgba(152, 63, 255, 0.18); }
}

/* Tech icons subtle spin on hover */
.tech-row {
  transition: transform 0.3s ease;
}
.tech-row:hover {
  transform: translateX(6px);
}
.tech-row img {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.tech-row:hover img {
  transform: rotate(-8deg) scale(1.08);
}

/* Hero background soft drift */
.anim-bg-drift {
  animation: bgDrift 18s ease-in-out infinite alternate;
}
@keyframes bgDrift {
  from { transform: translate3d(-50%, 0, 0) scale(1); }
  to { transform: translate3d(-50%, 12px, 0) scale(1.03); }
}

/* Legal sections stagger already via reveal */
.legal-section.reveal {
  transition-duration: 0.65s;
}
