/* Let the browser preserve history, focus and anchor navigation across product pages. */
@view-transition {
  navigation: auto;
}

@media (prefers-reduced-motion: no-preference) {
  header.header, header.pr-hdr {
    view-transition-name: praus-masthead;
  }

  ::view-transition-group(praus-masthead),
  ::view-transition-old(praus-masthead),
  ::view-transition-new(praus-masthead) {
    animation-duration: 300ms;
    animation-timing-function: cubic-bezier(.22, 1, .36, 1);
  }

  /* Fade through, not a cross-fade: the old page clears before the new one arrives,
     so two pages' text never overlap. The header holds still between pages. */
  ::view-transition-old(root) {
    animation: praus-page-out 130ms cubic-bezier(.4, 0, 1, 1) both;
  }
  ::view-transition-new(root) {
    animation: praus-page-in 240ms cubic-bezier(.22, 1, .36, 1) 125ms both;
  }
  @keyframes praus-page-out { to { opacity: 0; } }
  @keyframes praus-page-in { from { opacity: 0; transform: translateY(8px); } }
}

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

  html {
    scroll-behavior: auto !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* The first visit retains its intro. Internal navigation already has a page transition. */
.product-navigation .pg-in,
.product-navigation .hero::before,
.product-navigation .hero > *,
.product-navigation .hero h1 span,
.product-navigation .hero .appwin,
.product-navigation .rise {
  animation: none !important;
}

.product-navigation .hero > .hero-stage.mo-s {
  opacity: 1;
  transform: none;
  transition: none;
}

html.incoming-section {
  scroll-behavior: auto;
}
