/* Studio splash.
 *
 * Shown before the title screen. Two rules govern everything here:
 *
 *  - It must never be able to trap the player. The video is 10 seconds, which is
 *    a long time on a second launch, so any input skips it and any failure to
 *    play at all falls straight through to the title.
 *  - It must not delay the game. The splash sits on top while the rest of the
 *    page boots underneath, so the 3MB download overlaps with loading rather
 *    than adding to it.
 */

#splash {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: #000;
  opacity: 1;
  transition: opacity .6s ease;
}
#splash.gone { opacity: 0; pointer-events: none; }

/* Full-bleed. `cover` fills the viewport edge to edge at every size instead of
   letterboxing, and the crop is safe because of how the clip is composed: the
   Altstead mark and wordmark sit dead centre, occupying about 34% of the frame
   width and 62% of its height, and everything outside that is abstract texture
   with nothing to read. So there is roughly a third of the width and a fifth of
   the height of slack on each side before the crop reaches the logo.

   Measured limits of that slack, keeping a margin:
     - narrower than 4:5, a horizontal crop starts eating the wordmark
     - wider  than 5:2, a vertical crop starts eating the mark
   Outside that band it falls back to `contain`. The letterbox is invisible in
   practice anyway, because the clip's own background is already near-black
   against a #000 stage. */
#splash video {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  background: #000;
}
@media (max-aspect-ratio: 4/5) { #splash video { object-fit: contain; } }
@media (min-aspect-ratio: 5/2) { #splash video { object-fit: contain; } }

#splash-skip {
  position: absolute;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  padding: 10px 16px;
  border: 1px solid rgba(226,220,202,.28); border-radius: 3px;
  background: rgba(10,12,14,.5); color: #b9b2a2;
  font: 700 10px/1 "Courier New", monospace;
  letter-spacing: .22em; text-transform: uppercase;
  cursor: pointer; pointer-events: auto;
  opacity: 0; transition: opacity .4s ease;
}
#splash.can-skip #splash-skip { opacity: 1; }
#splash-skip:hover { color: #e6dcc4; border-color: #9c8b62; }

/* Studio credit on the title screen. */
/* In flow under the best-line rather than absolutely positioned — pinned to the
   bottom it collided with it and the two strings interleaved into gibberish. */
#studio-credit {
  margin-top: 6px;
  z-index: 3;
  font: 700 9px/1 "Courier New", monospace;
  letter-spacing: .34em; text-transform: uppercase;
  color: #5f5a52;
  pointer-events: none;
}
