/* The sheet change between the pages: the printed sheet is pulled off the stone, and the next sheet lies under it.
   One motion: the old sheet sticks for a moment (the tack of the ink), then comes off toward the upper left.
   The hand holds the upper left corner, so the lower right corner comes off last.
   Cross-document view transitions: Chrome and Edge 126, Safari 18.2. Other browsers load the page as before.
   Only transform animates, so the compositor runs it. With reduced motion the page loads without it. */

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

::view-transition-old(root),
::view-transition-new(root) {
  /* no cross-fade: the two sheets are paper, they do not mix */
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  animation: none;
}

::view-transition-old(root) {
  z-index: 1;
  transform-origin: 0 0;
  /* the lifted edge throws a soft shadow on the new sheet */
  box-shadow: 0 2px 3px rgb(42 29 10 / 0.28), 0 16px 34px rgb(42 29 10 / 0.3);
  animation: sheet-off 440ms both;
}

@keyframes sheet-off {
  0% {
    transform: none;
    animation-timing-function: cubic-bezier(0.3, 0, 0.6, 1);
  }
  24% {
    transform: translate(-0.4%, -3%) rotate(0.5deg);
    animation-timing-function: cubic-bezier(0.45, 0, 0.8, 0.45);
  }
  100% {
    transform: translate(-5%, -118%) rotate(3.5deg);
  }
}
