/* Site-wide motion (see static/js/motion-fx.js): calm and professional.
 * Never put a transform or a lasting animation on <body> — that turns it
 * into the containing block for position:fixed elements (lesson rails,
 * confetti, toasts) and they stop sticking to the screen. */

/* ---- page enter: opacity only, no fill-mode ---- */
@keyframes fx-fade { from { opacity: 0; } to { opacity: 1; } }
html.fx body { animation: fx-fade .35s ease-out; }
html.fx.fx-leaving body { opacity: 0; transition: opacity .15s ease; }

/* ---- scroll reveal: a gentle fade-up ---- */
.fx-reveal { opacity: 0; transform: translateY(14px); }
.fx-reveal.fx-in { opacity: 1; transform: none;
  transition: opacity .7s ease, transform .8s cubic-bezier(.22,1,.36,1); transition-delay: var(--fx-delay, 0ms); }

/* ---- hover: slow, smooth lift ---- */
.fx-lift { transition: transform .45s cubic-bezier(.22,1,.36,1), box-shadow .45s ease, border-color .45s ease; }
.fx-lift:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -20px rgba(15, 23, 42, .28); }
.fx-row { transition: background-color .3s ease, transform .45s cubic-bezier(.22,1,.36,1); }
.fx-row:hover { transform: translateX(3px); }

/* ---- buttons: soft press ---- */
.fx-press { transition: transform .2s ease, box-shadow .3s ease, filter .3s ease; }
.fx-press:hover { filter: brightness(1.04); }
.fx-press:active { transform: scale(.97); }

/* ---- leaderboard score bars ---- */
.fx-board-row { position: relative; }
.fx-board-row > * { position: relative; z-index: 1; }
.fx-score-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(20,184,166,.14), rgba(20,184,166,.03));
  transition: width 1.4s cubic-bezier(.22,1,.36,1); transition-delay: var(--fx-delay, 0ms); }

@media not all {
  html.fx body { animation: none; }
  .fx-reveal { opacity: 1 !important; transform: none !important; }
  .fx-lift:hover, .fx-row:hover { transform: none; }
}

/* the student's own switch (menu: Animations off) */
html.no-motion *, html.no-motion *::before, html.no-motion *::after { animation: none !important; transition: none !important; }
html.no-motion .fx-reveal, html.no-motion .landing-scroll-reveal { opacity: 1 !important; transform: none !important; }
.motion-off-label { display: none; } html.no-motion .motion-off-label { display: inline; } html.no-motion .motion-on-label { display: none; }
