/* Page transitions: a quick crossfade when moving between pages, with the header held steady.
   Works in Chrome and Edge (cross-document view transitions); other browsers just change pages as normal.

   TO TURN IT OFF: delete the @view-transition block just below (or this file's <link> in each page).
   SPEED: change --page-fade. */

@view-transition { navigation: auto; }

:root { --page-fade: .25s; }

/* The header is its own layer, so it stays put while the page underneath fades */
.site-header { view-transition-name: site-header; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: var(--page-fade); animation-timing-function: ease; }
::view-transition-group(site-header) { animation-duration: var(--page-fade); }

/* People who ask their system for less motion get an instant page change */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
