/* ============================================================
   LA EcoExplorers — motion for index, stories, about, contact
   Every rule sits under an m-<name> class that js/motion.js puts on
   <html>. No class, no motion: reduced motion and no-JS get the
   static design in home.css untouched. The stories never load this.
   ============================================================ */

/* --- icons: each topic's icon acts out its topic --------------------- */
@keyframes m-paw  { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(10deg); } }
@keyframes m-sway { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-7deg); } 70% { transform: rotate(6deg); } }
@keyframes m-hop  { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-9px); } 60% { transform: translateY(0); } 75% { transform: translateY(-3px); } }
.m-icons .topic svg { transform-origin: 50% 85%; }
.m-icons .topic--green:hover svg  { animation: m-paw .7s ease-in-out; }
.m-icons .topic--blue:hover svg   { animation: m-sway 1.4s ease-in-out infinite; }
.m-icons .topic--yellow:hover svg { animation: m-hop .7s ease-out; }
.m-icons .pill:hover svg { animation: m-hop .5s ease-out; }
.m-icons .avatar { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.m-icons .profile:hover .avatar { transform: scale(1.08) rotate(-6deg); }

/* --- spotlight: a soft glow follows the cursor, under the content -- */
.m-spotlight .topic,
.m-spotlight .profile,
.m-spotlight .story a { position: relative; isolation: isolate; overflow: hidden; }
.m-spotlight .topic::before,
.m-spotlight .profile::before,
.m-spotlight .story a::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), var(--glow, rgba(255, 255, 255, .7)), transparent 65%);
    opacity: 0; transition: opacity .3s ease;
}
.m-spotlight .profile,
.m-spotlight .story a { --glow: rgba(58, 163, 95, .14); }
.m-spotlight .topic:hover::before,
.m-spotlight .profile:hover::before,
.m-spotlight .story a:hover::before { opacity: 1; }

/* --- pagefade: the header holds still while the page cross-fades -- */
.m-pagefade .topbar { view-transition-name: topbar; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .35s; }

/* --- reveal: sections rise in on scroll ---------------------------- */
.m-reveal [data-reveal] {
    transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
    transition-delay: calc(var(--i, 0) * 90ms);
}
.m-reveal [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(28px); }
