/* ==========================================================
   Opening page (index.html): only the opening film, full screen, on the
   film's own paper colour. It is a page of its own, so nothing of the
   home page exists behind it — iOS Safari's see-through bars can only
   show this colour.
   ========================================================== */
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #faf8f3;
}

.opening {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #faf8f3;
  cursor: pointer;
}

/* Desktop / landscape: the film fills the screen */
.opening__video {
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  max-width: none;
  object-fit: cover;
}

/* Portrait (phones): full width, so the cat and the room stay in view
   (cropping to fill a tall screen would cut them away). The film is a bit
   wider than the screen, and a grid item that overflows sits flush left, so
   it is centred by hand — on the girl at the desk, who sits at 50.9% of the
   frame (977px of 1920), not on the frame itself */
@media (max-aspect-ratio: 1/1) {
  .opening__video {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 106.4vw;
    height: auto;
    aspect-ratio: 16 / 9;
    transform: translate(-50.9%, -50%);
  }
}

/* The page fades to paper before the home page opens */
.opening.is-leaving .opening__video {
  opacity: 0;
  transition: opacity 0.35s ease-in;
}
