/** Sequential white page fades; the shared navigation remains visually stationary. */
@view-transition {
  navigation: auto;
}

body > header#home,
body > header#masthead {
  view-transition-name: cfa-site-header;
}

/* A white stage sits behind the page snapshots, below the named header layer. */
::view-transition {
  background: #fff;
}

::view-transition-group(root) {
  animation: none;
  z-index: 0;
}

::view-transition-image-pair(root) {
  isolation: isolate;
}

::view-transition-old(root) {
  animation: cfa-page-out 280ms ease-in-out both;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  animation: cfa-page-in 440ms ease-out 280ms both;
  mix-blend-mode: normal;
}

/* Ease the compact header back to the arriving header's height during the
   outgoing page fade. Keep the browser-generated geometry animation. */
::view-transition-group(cfa-site-header) {
  animation-duration: 280ms;
  animation-timing-function: ease-in-out;
  animation-fill-mode: both;
  z-index: 1;
}

::view-transition-old(cfa-site-header) {
  display: none;
  animation: none;
}

::view-transition-new(cfa-site-header) {
  animation: none;
  block-size: 100%;
  mix-blend-mode: normal;
  opacity: 1;
}

@keyframes cfa-page-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes cfa-page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}
