/* ===================================================================
   LANTERN — lightweight motion (all pages)
   Rules: only transform-type properties (translate / scale / transform) and opacity,
   150–450ms, no looping animations, no JavaScript. Animations use `translate` / `scale`
   so they stack with the existing hover lifts (which use `transform`) instead of cancelling them.
   =================================================================== */

:root { --motion-ease: var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)); }

@keyframes lcFadeUp   { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
@keyframes lcPopIn    { from { opacity: 0; scale: .98; }        to { opacity: 1; scale: 1; } }
@keyframes lcDrawerIn { from { translate: 100% 0; }              to { translate: 0 0; } }
@keyframes lcToastUp  { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }

/* ---------- landing: scroll reveal of child blocks (never whole sections) ----------
   Only in browsers with scroll-driven animations. Elsewhere — and after anchor jumps —
   everything is simply visible: there is no opacity:0 outside this block. */
@supports (animation-timeline: view()) {
  .landing .section-head,
  .landing .step-card,
  .landing .cat-card,
  .landing .pillar,
  .landing .split-media,
  .landing .safety-item {
    animation: lcFadeUp linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
}

/* ---------- page load ---------- */
.auth-shell, .admin-main { animation: lcFadeUp 300ms var(--motion-ease) both; }

/* ---------- chat ---------- */
.chat-panel.open { animation: lcDrawerIn 320ms var(--motion-ease); }
.chat-msg { animation: lcPopIn 200ms var(--motion-ease) both; }

/* toasts slide up (listed last so it wins over the existing fade-out for the first 300ms) */
.toast.show, .lc-toast.show { animation: lcToastFade 5s ease forwards, lcToastUp 300ms var(--motion-ease); }

/* ---------- buttons: a small press ---------- */
.btn, .btn-danger, .btn-soft, .attach-btn { transition-property: background, border-color, color, box-shadow, transform, scale, opacity; }
.btn:active, .btn-danger:active, .btn-soft:active, .attach-btn:active { scale: .98; }

/* ---------- respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
