/* Animations: page blur-in, staggered panels, springy tab highlight, button squish, toasts, stat count-up flash. */
/* ---- Motion (trial, 2026-11-16) ----------------------------------------- */
/* Opening a tab: the page fades in from a soft blur, then its panels and stat boxes rise in one after another. */
main > section:not([hidden]) { animation: page-in .35s cubic-bezier(.2, .8, .2, 1); }
main[data-dir="up"] > section:not([hidden]) { animation-name: page-in; }
@keyframes page-in { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: none; } }
main > section.entering .panel, main > section.entering .stats > div {
  animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms);
}
main[data-dir="up"] > section.entering .panel, main[data-dir="up"] > section.entering .stats > div { animation-name: rise-down; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes rise-down { from { opacity: 0; transform: translateY(-14px) scale(.985); } to { opacity: 1; transform: none; } }
/* The tab highlight springs to its new spot with a little overshoot. */
.nav-ind { transition: transform .45s cubic-bezier(.34, 1.45, .55, 1), height .35s cubic-bezier(.34, 1.3, .55, 1), width .35s, opacity .2s; }
nav button { transition: color .2s, transform .15s; }
nav button:active { transform: scale(.97); }
/* Buttons squish when pressed; switches snap with a bounce. */
.btn { transition: border-color .15s, filter .15s, transform .12s cubic-bezier(.3, 1.6, .5, 1); }
.btn:active:not(:disabled) { transform: scale(.96); }
.switch span::after { transition: transform .35s cubic-bezier(.34, 1.6, .5, 1), background .2s, width .15s; }
.switch input:active + span::after { width: 28px; }
.switch input:checked:active + span::after { transform: translateX(16px); }
/* Toasts pop up from below instead of just fading. */
#toast { transform: translate(-50%, 16px) scale(.96); transition: opacity .2s, transform .35s cubic-bezier(.34, 1.5, .55, 1); }
#toast.show { transform: translate(-50%, 0) scale(1); }
/* Stat numbers that count up get a quick gold flash when they land. */
.stats b.landed { animation: landed .6s ease-out; }
@keyframes landed { 30% { text-shadow: 0 0 22px var(--gold-fill); } }
@media (prefers-reduced-motion: reduce) {
  main > section:not([hidden]), main > section.entering .panel, main > section.entering .stats > div, .stats b.landed { animation: none; }
  .nav-ind, #toast, .btn, .switch span::after { transition: none; }
}
