/* ------------------------------------------------------------------
 * Cross-document (MPA) page transitions.
 *
 * On a same-origin link navigation the incoming page slides up from the
 * bottom while the outgoing page eases up slightly and dims. Pure CSS via
 * the View Transitions API — no JS. Browsers without support just navigate
 * normally (graceful fallback). Disabled under reduced-motion.
 * ------------------------------------------------------------------ */
@view-transition {
  navigation: auto;
}

::view-transition-group(root) {
  animation-duration: 0.52s;
}

/* Outgoing page: hold, lift a touch and dim so the new page reads on top. */
::view-transition-old(root) {
  animation: pt-old-out 0.42s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Incoming page: slide up from the bottom edge. */
::view-transition-new(root) {
  animation: pt-new-in 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pt-new-in {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes pt-old-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-4%);
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}
