/* Every animation on the page. Only transform, opacity and (for the scan reveal) clip-path animate.
   States that hide content are scoped to .fx, which the script sets once it runs, so the page is
   complete without JavaScript. prefers-reduced-motion turns the motion off at the end of this file. */

/* Hero entrance, in CSS so it never waits for the script: the copy rises in, the clock fades in,
   then the Live Activity springs up; the phone floats. */
.hero__copy > * { animation: rise-in 0.9s var(--ease-out) both; }
.hero__copy > :nth-child(2) { animation-delay: 0.1s; }
.hero__copy > :nth-child(3) { animation-delay: 0.2s; }
.hero__copy > :nth-child(4) { animation-delay: 0.3s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } }
.lock__date { animation: fade-in 0.8s ease-out 0.2s both; }
.lock__time { animation: clock-in 1s var(--ease-out) 0.35s both; }
.lock__activity { animation: activity-up 1s var(--ease-spring) 1.1s both; }
.phone--float { animation: float 6s ease-in-out 2s infinite alternate; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes clock-in { from { opacity: 0; transform: scale(0.94); } }
@keyframes activity-up { from { opacity: 0; transform: translateY(70%); } }
@keyframes float { to { transform: translateY(-12px); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-10px); } }

/* Reveal on scroll, staggered by --i inside each [data-reveal-group]. */
.fx [data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.8s var(--ease-out), transform 0.9s var(--ease-out), translate 0.45s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms), calc(var(--i, 0) * 90ms), 0s;
}
.fx [data-reveal].is-visible { opacity: 1; transform: none; }

/* Timeline markers: a glow pulse when reached, then a soft standing glow. */
.marker.is-lit::after { animation: marker-pulse 1.3s ease-out both; }
@keyframes marker-pulse {
  0% { opacity: 0; transform: scale(0.5); }
  35% { opacity: 1; transform: scale(1.25); }
  100% { opacity: 0.4; transform: scale(1); }
}

/* Noon: a mint beam sweeps the box, then the review screen appears top to bottom. */
.scan-beam {
  position: absolute; top: -6%; bottom: -6%; left: 0; width: 22%; opacity: 0;
  background: linear-gradient(90deg, transparent, rgb(141 230 220 / 0.9) 45%, #fff 50%, rgb(141 230 220 / 0.9) 55%, transparent);
  box-shadow: 0 0 28px rgb(61 187 176 / 0.8);
}
.scene--noon.is-active .scan-beam { animation: beam 1.2s ease-in-out 0.25s both; }
@keyframes beam {
  0% { opacity: 0; transform: translateX(-60%); }
  20%, 80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(460%); }
}
.scan-sweep {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent calc(100% - 26px), rgb(61 187 176 / 0.35) calc(100% - 3px), #8de6dc 100%);
}
.fx .screen-reveal { clip-path: inset(0 0 100% 0); }
.fx .scene--noon.is-active .screen-reveal { clip-path: inset(0); transition: clip-path 1.3s var(--ease-out) 1.2s; }
.scene--noon.is-active .scan-sweep { animation: sweep 1.3s var(--ease-out) 1.2s both; }
@keyframes sweep {
  0% { opacity: 1; transform: translateY(-100%); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateY(0); }
}

/* Evening: the PDF slides and turns out from the phone's edge to rest over its corner, then bobs. */
.fx .prop--pdf { opacity: 0; transform: translateX(-60px) rotate(-14deg) scale(0.86); }
.fx .scene--evening.is-active .prop--pdf {
  opacity: 1; transform: none;
  transition: opacity 0.6s ease-out 0.3s, transform 1.1s var(--ease-spring) 0.3s;
}
.prop--pdf img { animation: bob 4.5s ease-in-out 1.5s infinite alternate; }
.prop--box img { animation: bob 6s ease-in-out infinite alternate; }

/* Night: the halo breathes; the badges drift in, then bob. */
.phone--halo::before { animation: halo 4.5s ease-in-out infinite alternate; }
@keyframes halo {
  from { opacity: 0.55; transform: translate(-50%, -50%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}
.fx .badge { opacity: 0; transform: translate(var(--dx, 0), 24px); }
.badge--data { --dx: -30px; --i: 0; }
.badge--ads { --dx: 30px; --i: 1; }
.badge--account { --dx: 30px; --i: 2; }
.fx .scene--night.is-active .badge {
  opacity: 1; transform: none;
  transition: opacity 0.8s ease-out, transform 1.2s var(--ease-out);
  transition-delay: calc(0.4s + var(--i) * 0.18s);
}
.badge__glass { animation: bob 5s ease-in-out infinite alternate; }
.badge--ads .badge__glass { animation-duration: 4.2s; animation-delay: -1.5s; }
.badge--account .badge__glass { animation-duration: 5.6s; animation-delay: -3s; }

/* Night sky: two star layers twinkle out of phase. */
.stars--a { animation: twinkle 3.4s ease-in-out infinite alternate; }
.stars--b { animation: twinkle 4.9s ease-in-out -2s infinite alternate; }
@keyframes twinkle { from { opacity: 1; } to { opacity: 0.35; } }

/* Pricing: the Pro ring turns slowly. */
.plan--pro::before { animation: spin 9s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .fx [data-reveal], .fx .prop--pdf, .fx .badge { opacity: 1; transform: none; transition: none; }
  .fx .screen-reveal { clip-path: none; transition: none; }
  .phone__body, .plan, .plan__sheen::before, .nav a::after { transition: none; }
  .plan:hover { translate: none; }
  .scan-beam, .scan-sweep, .shooting-star { display: none; }
  .marker.is-lit::after { opacity: 0.4; }
}
