/* 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; } }
/* Members: the list rises in when it first loads, and a profile's parts rise in one after another when you open someone. */
.mblist.enter li { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 28ms); }
.mbprofile.swap .mbhead, .mbprofile.swap .stats > div, .mbprofile.swap .mbsec {
  animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms);
}
@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); } }
/* A tab (or block) glows gold for a moment when its coin activity makes a sound. */
nav button.glow, .block.glow { animation: tab-glow 1.6s ease-out; }
@keyframes tab-glow {
  20% { box-shadow: 0 0 0 1px var(--gold-fill), 0 0 18px 3px var(--gold-glow); color: var(--ink); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.kindfeed { max-height: 420px; }
@media (prefers-reduced-motion: reduce) {
  nav button.glow, .block.glow { animation: none; }
  main > section:not([hidden]), main > section.entering .panel, main > section.entering .stats > div, .stats b.landed,
  .mblist.enter li, .mbprofile.swap .mbhead, .mbprofile.swap .stats > div, .mbprofile.swap .mbsec { animation: none; }
  .nav-ind, #toast, .btn, .switch span::after { transition: none; }
}
