/* ==========================================================================
   MOTION: page-load sequence, scroll reveals, hover and tab transitions.
   Everything is gated behind the .js class and switched off for people who
   prefer reduced motion.
   ========================================================================== */

@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
@keyframes riseLine { from { transform: translateY(108%); } to { transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes tileIn { from { opacity: 0; transform: translateY(30px) scale(.94) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes caseIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes caseOut { to { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- Page-load sequence (hero) ---------- */
.js .site-header { animation: fadeDown .7s var(--ease) both; }
.js .hero .status { animation: fadeUp .7s var(--ease) .1s both; }
.js .hero h1 .line > span { display: block; animation: riseLine 1s var(--ease) both; }
.js .hero h1 .line:nth-child(1) > span { animation-delay: .2s; }
.js .hero h1 .line:nth-child(2) > span { animation-delay: .32s; }
.js .hero h1 .line:nth-child(3) > span { animation-delay: .44s; }
.js .hero .lead { animation: fadeUp .8s var(--ease) .7s both; }
.js .hero .cta-row { animation: fadeUp .8s var(--ease) .82s both; }
.js .hero .reassure { animation: fadeUp .8s var(--ease) .94s both; }
.js .hero-visual { animation: tileIn 1.1s var(--ease) .3s both; }
.js .facts li { animation: fadeUp .8s var(--ease) 1.1s both; }
.js .facts li:nth-child(2) { animation-delay: 1.2s; }
.js .facts li:nth-child(3) { animation-delay: 1.3s; }

/* ---------- Scroll reveals ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* Process line draws itself */
.js .steps::before { transform: scaleX(0); transition: transform 1.4s var(--ease-in-out); }
.js .steps.in::before { transform: scaleX(1); }
.js .steps li::before { transform: scale(0); transition: transform .5s var(--ease) calc(var(--i, 0) * 180ms + .2s); }
.js .steps.in li::before { transform: none; }

/* ---------- Work tabs: cards stay hidden until their panel is shown, then rise in one by one ---------- */
.js .panel .work { opacity: 0; }
.js .panel.shown .work { opacity: 1; }
.panel.entering .work { animation: cardIn .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms); }

/* ---------- Mobile menu transition ---------- */
@media (max-width: 980px) {
  .nav { transition: opacity .3s, transform .4s var(--ease), visibility 0s linear .4s; }
  .nav.open { transition: opacity .3s, transform .4s var(--ease), visibility 0s; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .panel .work { opacity: 1; }
  .js .steps::before, .js .steps li::before { transform: none; }
}
