/* Velli motion (11/16/2026, Zak: "the best animations and motion when refreshing and everything"). One file for every public page.

   Rule 1: everything here is keyed on html.mo. A line in each page's <head> sets that class only when the visitor has NOT asked
           their device to reduce motion. Those visitors get the same page with no movement.
   Rule 2: nothing is hidden unless a script that is already running hid it. Page-load motion is plain CSS that always ends
           visible. Scroll motion hides a block only after motion.js is running and watching it. No script = a normal page.
   Rule 3: opacity, translate and scale only. They never move the layout and never fight an element's own transform.

   To see it on a Mac that has Reduce Motion switched on (local preview only, never on velli.cc): add ?motion=1 to the address.
   ?motion=0 turns that off again. */
:root { --mo-ease: cubic-bezier(0.2, 0.7, 0.2, 1); }

@keyframes mo-rise { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@keyframes mo-in { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
@keyframes mo-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mo-band { from { opacity: 0; translate: 0 100%; } to { opacity: 1; translate: 0 0; } }
@keyframes mo-pop { from { opacity: 0; scale: 0.9; } to { opacity: 1; scale: 1; } }
@keyframes mo-menu { from { opacity: 0; translate: 0 -8px; } to { opacity: 1; translate: 0 0; } }

/* ---- 1. Page to page: the old page fades into the new one, with the header held still, instead of a white flash.
        Safari 18.2+ and Chrome 126+. Anything older just navigates as before. */
@view-transition { navigation: auto; types: mo-page; }
html:active-view-transition-type(mo-page)::view-transition-old(root) { animation: mo-fade 0.16s ease reverse both; }
html:active-view-transition-type(mo-page)::view-transition-new(root) { animation: mo-fade 0.26s ease both; }
html.mo .nav, html.mo header.vh-nav { view-transition-name: mo-nav; }
@media (prefers-reduced-motion: reduce) {
  html:not(.mo-force)::view-transition-group(*), html:not(.mo-force)::view-transition-old(*), html:not(.mo-force)::view-transition-new(*) { animation: none !important; }
}

/* ---- 2. Page load. Home hero: background, logo, each headline line, the sub line, then the band and its four names. */
html.mo .fx-hero canvas { animation: mo-fade 1.1s ease both; }
html.mo .fx-hero .fx-logo { animation: mo-rise 0.7s var(--mo-ease) 0.04s both; }
html.mo .fx-hero h1 .mo-l { display: inline-block; animation: mo-rise 0.8s var(--mo-ease) 0.12s both; }
html.mo .fx-hero h1 .mo-l ~ .mo-l { animation-delay: 0.22s; }
html.mo .fx-hero .fx-sub { animation: mo-rise 0.8s var(--mo-ease) 0.34s both; }
html.mo .fx-hero .fx-band { animation: mo-band 0.7s var(--mo-ease) 0.44s both; }
html.mo .fx-hero .fx-band .fx-eng { animation: mo-pop 0.5s var(--mo-ease) 0.7s both; }
html.mo .fx-hero .fx-band .fx-eng:nth-of-type(3) { animation-delay: 0.76s; }
html.mo .fx-hero .fx-band .fx-eng:nth-of-type(4) { animation-delay: 0.82s; }
html.mo .fx-hero .fx-band .fx-eng:nth-of-type(5) { animation-delay: 0.88s; }

/* Every other page: the page head comes in piece by piece, the body follows. */
html.mo .crumbs { animation: mo-fade 0.6s ease both; }
html.mo .bl-hero > div:first-child > *, html.mo .art-head > *, html.mo main > .hero > * { animation: mo-rise 0.7s var(--mo-ease) 0.04s both; }
html.mo .bl-hero > div:first-child > :nth-child(2), html.mo .art-head > :nth-child(2), html.mo main > .hero > :nth-child(2) { animation-delay: 0.12s; }
html.mo .bl-hero > div:first-child > :nth-child(3), html.mo .art-head > :nth-child(3), html.mo main > .hero > :nth-child(3) { animation-delay: 0.2s; }
html.mo .bl-hero > div:first-child > :nth-child(n+4), html.mo .art-head > :nth-child(n+4), html.mo main > .hero > :nth-child(n+4) { animation-delay: 0.28s; }
html.mo .bl-hero-art { animation: mo-fade 1s ease 0.2s both; }
html.mo .art-col > .article-cover, html.mo .art-col > .article, html.mo .art-col > .short, html.mo .art-grid > aside { animation: mo-rise 0.8s var(--mo-ease) 0.3s both; }
html.mo .post-grid > :nth-child(-n+6) { animation: mo-rise 0.7s var(--mo-ease) 0.3s both; }
html.mo .post-grid > :nth-child(2) { animation-delay: 0.36s; }
html.mo .post-grid > :nth-child(3) { animation-delay: 0.42s; }
html.mo .post-grid > :nth-child(4) { animation-delay: 0.48s; }
html.mo .post-grid > :nth-child(5) { animation-delay: 0.54s; }
html.mo .post-grid > :nth-child(6) { animation-delay: 0.6s; }

/* ---- 3. Scroll. motion.js puts mo-rv on a block that is still below the screen, then mo-in when it arrives, then removes both. */
html.mo .mo-rv { opacity: 0; translate: 0 26px; transition: opacity 0.7s var(--mo-ease), translate 0.7s var(--mo-ease); will-change: opacity, translate; }
html.mo .mo-rv.mo-in { opacity: 1; translate: 0 0; }
@media print { html.mo .mo-rv { opacity: 1 !important; translate: none !important; } }

/* ---- 4. Touch and click. A quick squeeze on anything button-shaped, an answer that eases open, a menu that drops in. */
html.mo :is(button, a.pill, a.btn, a.cta, .st-btn, .fx-band, .foot-cta, .art-end-btn, .load-more, [role="button"]):active:not(:disabled) { scale: 0.97; }
html.mo details[open] > :not(summary) { animation: mo-in 0.32s var(--mo-ease) both; }
html.mo .mm-panel:not([hidden]) { animation: mo-menu 0.24s var(--mo-ease) both; }
html.mo .mm-panel:not([hidden]) > a { animation: mo-in 0.3s var(--mo-ease) 0.04s both; }
html.mo .mm-panel:not([hidden]) > a:nth-child(2) { animation-delay: 0.07s; }
html.mo .mm-panel:not([hidden]) > a:nth-child(3) { animation-delay: 0.1s; }
html.mo .mm-panel:not([hidden]) > a:nth-child(4) { animation-delay: 0.13s; }
html.mo .mm-panel:not([hidden]) > a:nth-child(n+5) { animation-delay: 0.16s; }
