/* =====================================================================
   view-transitions.css — cross-document smooth page transitions
   =====================================================================
   Modern browsers (Chrome 126+, Safari 18+) support the View Transitions
   API for SAME-ORIGIN navigations across multiple HTML documents. Adding
   this single rule gives every link click a smooth crossfade between
   the old page and the new one — no JS, no SPA conversion required.

   On unsupported browsers (older iOS, older Chrome) this rule is
   ignored and pages behave exactly as before. Zero regression risk.

   Tuning:
   - 220ms is the sweet spot — long enough to feel smooth, short enough
     not to feel laggy. iOS native transitions sit around 250ms.
   - `auto` means the browser handles the snapshot/fade automatically;
     pages don't need to opt in per element.
   ===================================================================== */
@view-transition {
  navigation: auto;
}

/* Crossfade timing for the snapshot. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 220ms;
  animation-timing-function: cubic-bezier(.2, .8, .2, 1);
}

/* On low-data / reduced-motion preferences, drop the transition entirely. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0s;
  }
}
