/* Between pages (js/curtain.js): a white sheet rises over the page being left, and slides down off the
   page that opens. */
:root { --curtain: #fff; --curtain-ease: cubic-bezier(.77, 0, .175, 1); }

/* .curtain is the sheet over the page being left; html::after is the one over the page that opens,
   there from its first frame */
.curtain, html.curtain-hold::after, html.curtain-drop::after {
  position: fixed;
  z-index: 2147483647;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100lvh; /* phones: also what the browser's bars slide away from */
  background: var(--curtain);
}
html.curtain-hold::after, html.curtain-drop::after { content: ""; }
/* a popover, so that it also stands over the open menu, search or cart */
.curtain { margin: 0; padding: 0; border: 0; max-width: none; max-height: none; overflow: hidden; animation: curtain-rise .55s var(--curtain-ease) both; }
.curtain.is-dropping, html.curtain-drop::after { animation: curtain-drop .75s var(--curtain-ease) both; }
/* the page's own entrances wait under the sheet and play as it leaves */
html.curtain-hold body *, html.curtain-hold body *::before, html.curtain-hold body *::after { animation-play-state: paused !important; }

@keyframes curtain-rise { from { transform: translate3d(0, 100%, 0); } to { transform: translate3d(0, 0, 0); } }
@keyframes curtain-drop { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, 100%, 0); } }

/* less motion asked for: the sheet only fades */
@media (prefers-reduced-motion: reduce) {
  .curtain { animation: curtain-in .25s ease both; }
  .curtain.is-dropping, html.curtain-drop::after { animation: curtain-out .25s ease both; }
}
@keyframes curtain-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes curtain-out { from { opacity: 1; } to { opacity: 0; } }
