/* =====================================================================
   ANTAEUS · motion for the homepage. EVERY rule here that moves a thing
   away from its final state lives inside the no-preference block below;
   only @keyframes sit outside it (siteIntegrity §10 pins exactly that,
   by filename). Delete this file and the page is complete at rest.

   The one orchestrated moment is the hero (fragments settle, phone
   rises), played once on load under html.js. Everything else is a
   single `.in` reveal per block, a 420ms crossfade in the pinned phone,
   and the try-it phone's rest band. Nothing is scroll-linked.
   ===================================================================== */

@keyframes frag-settle {
  from { opacity: 0; transform: translate3d(var(--dx), var(--dy), 0) rotate(calc(var(--rot) * 1deg)); }
  to { opacity: 1; transform: none; }
}
@keyframes phone-rise { from { opacity: 0; transform: translateY(28px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes copy-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes band-sweep { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes rise-step { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  /* ---------- hero: the one orchestrated moment (JS present only, so a
     blocked script never leaves the page waiting) ---------- */
  html.js .hero .frag { animation: frag-settle 820ms cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(140ms + var(--i, 0) * 90ms); }
  html.js .hero-phone { animation: phone-rise 760ms cubic-bezier(0.2, 0.7, 0.2, 1) 60ms both; }
  html.js .hero-copy > * { animation: copy-rise 560ms cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }

  /* ---------- the pinned phone: a crossfade with a small settle ---------- */
  .story-phone .shot { transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out); }
  html.js .story-phone .shot:not(.on) { transform: translateY(10px); }
  .rail-line i { transition: height 420ms var(--ease-out); }

  /* ---------- reveals: once, when a block reaches the viewport.
     html.io is set by story-1.js only when an IntersectionObserver is
     available, so nothing is hidden that cannot be revealed. ---------- */
  html.io .reveal { opacity: 0; transform: translateY(14px); transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out); }
  html.io .reveal.in { opacity: 1; transform: none; }
  html.io .grid3 > .blk, html.io .how-list > li, html.io .out-list > li, html.io .faq-list > div, html.io .spec > .lrow, html.io .tier {
    opacity: 0; transform: translateY(12px);
    transition: opacity 480ms var(--ease-out), transform 480ms var(--ease-out);
    transition-delay: calc(var(--i, 0) * 60ms);
  }
  html.io .in :is(.grid3 > .blk, .how-list > li, .out-list > li, .faq-list > div, .spec > .lrow, .tier) { opacity: 1; transform: none; }

  /* ---------- receipt tabs replay their three steps on change ---------- */
  .rcpt.replay .r-step { animation: rise-step 420ms var(--ease-out) backwards; }
  .rcpt.replay .r-step:nth-child(2) { animation-delay: 160ms; }
  .rcpt.replay .r-step:nth-child(3) { animation-delay: 320ms; }

  /* ---------- step 4's band sweeps once when its step arrives ---------- */
  html.io .set-scene .sweep { transform: scaleX(1); }
  html.io .step.in .set-scene .sweep { animation: band-sweep 6s linear 300ms both; }

  /* ---------- the try-it phone ---------- */
  .tr-set b { transition: color 400ms ease; }
  .tr-complete { transition: background-color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out); }
  .tr-complete:active { transform: scale(0.94); }
  .tr-band.run .tr-sweep { animation: band-sweep 8s linear both; }
  .tr-band.run.held .tr-sweep { animation-play-state: paused; }
  .tr-receipt, .tr-q, .tr-chips { transition: opacity 220ms ease; }
  .tabbar button { transition: background-color 180ms ease, color 180ms ease; }
  .bm-m { transition: fill 220ms ease; }
  .r-tabs button, .tr-chips button { transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease; }
  .btn { transition: transform 140ms var(--ease-out), opacity 140ms ease; }
}
