/* The crossing between the branches and the arrival of a page under its covering ground. Every page that crosses loads this file.
   js/crossing.js and js/doors.js make the layers (.cross); js/arrive.js paints the covering ground (html[data-arrive]); js/crossing.js lifts it. */

.cross {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}
/* Home's doors rise their ground from below the viewport. Home is the page with no data-branch (js/arrive.js). */
html:not([data-branch]) .cross {
  overflow: clip;
  transform: translateY(100%);
}
.cross--music {
  background: var(--vermilion);
}
.cross--biz {
  background: var(--sheet);
}
.cross .string {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1;
}
.cross--lift .string {
  top: auto;
  bottom: 0;
}
.cross--music .string {
  --crest: var(--night-ink);
  --amax: 12;
}
.cross--biz .string {
  --crest: var(--violet-deep);
  --amax: 3;
}

/* Before script runs, an arriving page is painted under the same ground; js/crossing.js swaps it for the real layer.
   If that never happens the ground lets go by itself, so a failed script cannot leave the page covered. */
html[data-arrive]::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  animation: arrive-release 1ms linear 4s forwards;
}
html[data-arrive='music']::after {
  background: var(--vermilion);
}
html[data-arrive='business']::after {
  background: var(--sheet);
}
@keyframes arrive-release {
  to {
    opacity: 0;
    visibility: hidden;
  }
}
