/* 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: var(--ink);
  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 var(--ink) stage. */
#splash video {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  background: var(--ink);
}
@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));
  min-height: 44px; min-width: 44px;
  padding: 12px 18px;
  border: 1px solid rgba(226,220,202,.34); border-radius: 2px;
  background: rgba(8,10,12,.72); color: var(--cream-800);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: .22em; text-transform: uppercase;
  cursor: pointer; pointer-events: auto;
  opacity: 0;
  box-shadow: inset 0 1px 0 rgba(255,240,215,.1), 0 8px 22px rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity .4s var(--ease-out, ease),
    color var(--dur-fast, .12s), border-color var(--dur-fast, .12s),
    background var(--dur-fast, .12s), transform var(--dur-fast, .12s);
}
#splash.can-skip #splash-skip { opacity: 1; }
#splash-skip:hover {
  color: var(--paper-bright); border-color: var(--tone-b89a68); background: rgba(16,18,20,.84);
  transform: translateY(-1px);
}
#splash-skip:focus-visible {
  color: var(--paper-bright); border-color: var(--amber);
  outline: 1px solid var(--focus-ring, var(--amber));
  outline-offset: 2px;
}
#splash-skip:active { filter: brightness(.9); color: var(--tone-ddd4bc); transform: none; }

@media (prefers-reduced-motion: reduce) {
  #splash-skip:hover { transform: none; }
}

/* Build stamp chrome lives in menu.css (#build-tag as a filed plate). */
