/* Motion shared by every page of oyami.app (landing, blog, legal): the vocabulary and the page transitions. */
:root{
  /* Arrivals decelerate long and soft (expo out); things that travel across the screen ease both ends. No overshoot. */
  --expo:cubic-bezier(.16,1,.3,1);
  --smooth:cubic-bezier(.65,0,.35,1);
}

/* Page navigations (same origin; every page opts in): the old page lifts away, softly blurred, and the new one rises
   in after it; going back plays the same in reverse (site.js marks a back navigation "back"). The header holds still.
   A blog card and its post share names (set inline per slug): the card grows into the post's header and its title
   into the post's title, and back. Browsers without cross-document view transitions (Firefox today) just change page.
   Off with reduced motion. */
@view-transition{navigation:auto}
header{view-transition-name:site-header}
::view-transition-group(site-header){animation:none}
::view-transition-old(site-header){display:none}
::view-transition-new(site-header){animation:none}
::view-transition-old(root){animation:vt-out .6s var(--smooth) both}
::view-transition-new(root){animation:vt-in .9s var(--expo) .12s both}
html:active-view-transition-type(back)::view-transition-old(root){animation-name:vt-out-back}
html:active-view-transition-type(back)::view-transition-new(root){animation-name:vt-in-back}
@keyframes vt-out{to{opacity:0;transform:translateY(-40px) scale(.98);filter:blur(6px)}}
@keyframes vt-in{from{opacity:0;transform:translateY(64px)}}
@keyframes vt-out-back{to{opacity:0;transform:translateY(40px) scale(.98);filter:blur(6px)}}
@keyframes vt-in-back{from{opacity:0;transform:translateY(-64px)}}
::view-transition-group(*.post-band),::view-transition-group(*.post-title){animation-duration:.85s;animation-timing-function:var(--smooth)}
::view-transition-old(*.post-band),::view-transition-new(*.post-band){height:100%}
::view-transition-old(*.post-title),::view-transition-new(*.post-title){object-fit:contain;object-position:0 0;height:auto}
/* Two titles wrapped differently would ghost over each other: the old one leaves before the new one arrives. */
::view-transition-old(*.post-title){animation:vt-leave .3s var(--smooth) both}
::view-transition-new(*.post-title){animation:vt-arrive .5s var(--expo) .3s both}
@keyframes vt-leave{to{opacity:0}}
@keyframes vt-arrive{from{opacity:0}}
@media (prefers-reduced-motion:reduce){@view-transition{navigation:none}}
