/* =========================================================
   Sahara Cup · motion
   Content is only hidden for reveal when JS runs AND motion is allowed
   (html.js.motion-ok), so nothing disappears without JS or with reduced motion.
   ========================================================= */

.motion-ok .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
}
.motion-ok .reveal.is-visible { opacity: 1; transform: none; }

/* Stagger siblings in grids */
.motion-ok .promises .reveal:nth-child(2), .motion-ok .days .reveal:nth-child(2), .motion-ok .stats .reveal:nth-child(2), .motion-ok .tiers .reveal:nth-child(2), .motion-ok .depts .reveal:nth-child(2) { transition-delay: .06s; }
.motion-ok .promises .reveal:nth-child(3), .motion-ok .days .reveal:nth-child(3), .motion-ok .stats .reveal:nth-child(3), .motion-ok .tiers .reveal:nth-child(3), .motion-ok .depts .reveal:nth-child(3) { transition-delay: .12s; }
.motion-ok .promises .reveal:nth-child(4), .motion-ok .days .reveal:nth-child(4), .motion-ok .stats .reveal:nth-child(4), .motion-ok .tiers .reveal:nth-child(4), .motion-ok .depts .reveal:nth-child(4) { transition-delay: .18s; }
.motion-ok .promises .reveal:nth-child(5), .motion-ok .days .reveal:nth-child(5), .motion-ok .depts .reveal:nth-child(5) { transition-delay: .24s; }

/* Roadmap bars grow when the chart is revealed */
.motion-ok .roadmap .roadmap__bar { transform: scaleY(0); transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.motion-ok .roadmap.is-visible .roadmap__bar { transform: scaleY(1); }
.motion-ok .roadmap.is-visible .roadmap__item:nth-child(2) .roadmap__bar { transition-delay: .12s; }
.motion-ok .roadmap.is-visible .roadmap__item:nth-child(3) .roadmap__bar { transition-delay: .24s; }
.motion-ok .roadmap.is-visible .roadmap__item:nth-child(4) .roadmap__bar { transition-delay: .36s; }

/* Hero scroll cue: a gentle bob */
.motion-ok .hero__cue svg { animation: cue-bob 2.2s ease-in-out infinite; }
@keyframes cue-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* Milestone pulse when the ball reaches it */
.motion-ok .milestone.is-reached .milestone__dot { animation: milestone-pop .5s ease-out; }
@keyframes milestone-pop { 0% { transform: scale(.9); } 60% { transform: scale(1.22); } 100% { transform: scale(1.08); } }

/* ---------- Goal celebration (triggered by scroll reaching the goal) ---------- */
.motion-ok .final.is-scored .penalty__goal { animation: net-bulge .6s ease-out; }
@keyframes net-bulge { 0% { transform: scaleY(1); } 35% { transform: scaleY(1.12); } 100% { transform: scaleY(1); } }

.motion-ok .penalty__tree { transition: transform .8s cubic-bezier(.3, 1.5, .5, 1) .25s; }
.motion-ok .final.is-scored .penalty__tree { transform: scale(1); }

.motion-ok .penalty__toast { transition: opacity .45s ease .15s, transform .45s ease .15s; transform: translate(-50%, 10px); }
.motion-ok .final.is-scored .penalty__toast { opacity: 1; transform: translate(-50%, 0); }

.motion-ok .final.is-scored .penalty__ripple { animation: ripple 1s ease-out; }
@keyframes ripple { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(5); } }

.motion-ok .final.is-scored .penalty__leaves i { animation: leaf 1.1s ease-out forwards; }
.penalty__leaves i:nth-child(1) { --dx: -70px; --dy: -60px; --r: -40deg; }
.penalty__leaves i:nth-child(2) { --dx: 60px; --dy: -80px; --r: 50deg; background: #4E8257; }
.penalty__leaves i:nth-child(3) { --dx: -110px; --dy: -20px; --r: -80deg; background: var(--dune-gold); }
.penalty__leaves i:nth-child(4) { --dx: 100px; --dy: -30px; --r: 70deg; }
.penalty__leaves i:nth-child(5) { --dx: -30px; --dy: -110px; --r: 20deg; background: #4E8257; }
.penalty__leaves i:nth-child(6) { --dx: 30px; --dy: -120px; --r: -20deg; background: var(--dune-gold); }
@keyframes leaf {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)); }
}

/* ---------- Reduced motion: everything visible, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .roadmap__bar { transform: none !important; }
}
