/* Back Lot Music — page transitions. Goes with library/page-transitions.php
   and library/js/page-transitions.js. */


/* ---- 1. Pages cross-fade into one another ------------------------------
   The floating phone nav and the header sit in the same place on every page,
   so they hold still while the page changes behind them. */

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .26s;
  animation-timing-function: ease;
}

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


/* ---- 2. A thin line across the top while the next page is on its way --- */

.blm-progress {
  position: fixed;
  z-index: 2147482000;
  top: 0; left: 0;
  width: 100%; height: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}

.blm-progress::before {
  content: "";
  display: block;
  width: 100%; height: 100%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, .55);
  transform: scaleX(0);
  transform-origin: left center;
}

.blm-progress.is-on {
  opacity: 1;
}

/* quick to two thirds, then creeping: it never claims to be done before the page is */
.blm-progress.is-on::before {
  animation: blm-progress 9s cubic-bezier(.08, .7, .2, 1) forwards;
}

@keyframes blm-progress {
  0%   { transform: scaleX(0); }
  18%  { transform: scaleX(.62); }
  100% { transform: scaleX(.94); }
}

@media (prefers-reduced-motion: reduce) {
  .blm-progress.is-on::before {
    animation: none;
    transform: scaleX(.6);
  }
}
