/* transitions.css — View Transition API assignments and keyframes */

/* Enable native cross-document view transitions in supported browsers (Chrome 126+) */
@view-transition {
  navigation: auto;
}

/* Default transition for the root (page content) */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.8s;
  animation-timing-function: cubic-bezier(0.19, 1, 0.22, 1); /* expo.out */
  animation-fill-mode: both;
}

::view-transition-old(root) {
  animation-name: fade-drift-out;
  animation-duration: 0.4s;
}

::view-transition-new(root) {
  animation-name: fade-drift-in;
}

/* Exclude the nav capsule from the root transition */
::view-transition-old(nav-capsule),
::view-transition-new(nav-capsule) {
  animation: none;
  mix-blend-mode: normal;
}

/* Keyframes */
@keyframes fade-drift-in {
  from {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
  }
}

@keyframes fade-drift-out {
  from {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
    filter: blur(4px);
  }
}

/* Accessibility: Disable transitions if reduced motion is preferred */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}