/*
  Page-to-page transition, shared by the homepage and the case studies.

  Uses the browser's built-in cross-document view transitions, so links,
  the back button and deep links behave exactly as before. Browsers without
  support, and visitors who prefer reduced motion, get a normal page load.
*/

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root) {
    animation: page-leave 0.26s cubic-bezier(0.4, 0, 1, 1) both;
  }

  ::view-transition-new(root) {
    animation: page-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.14s both;
  }
}

@keyframes page-leave {
  to {
    opacity: 0;
    transform: translate3d(0, -10px, 0);
  }
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
}
