.brand-opener[hidden] {
  display: none;
}

.brand-opener {
  position: absolute;
  z-index: 10;
  inset-inline: 0;
  inset-block-start: var(--masthead-height, 69px);
  height: calc(100vh - var(--masthead-height, 69px));
  height: calc(100svh - var(--masthead-height, 69px));
  display: grid;
  align-items: end;
  pointer-events: none;
}

.brand-opener__screen {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
  opacity: 0;
  background: linear-gradient(#ccc4b6, #fcfdf2);
}

.brand-opener__screen[data-cut="portrait"] {
  background: linear-gradient(#eeede4, #e7e4d7);
}

.brand-opener[data-playing] .brand-opener__screen {
  opacity: var(--film-opacity, 1);
  pointer-events: auto;
}

@supports (mask-image: linear-gradient(90deg, black, transparent)) or (-webkit-mask-image: linear-gradient(90deg, black, transparent)) {
  .brand-opener[data-playing] .brand-opener__screen {
    /* Follow the direction of the Blender dissolve while its remaining letters stay on the studio plate. */
    --film-mask: linear-gradient(90deg, black var(--film-edge, 100%), transparent calc(var(--film-edge, 100%) + 76%));
    -webkit-mask-image: var(--film-mask);
    mask-image: var(--film-mask);
    opacity: clamp(0, calc(var(--film-opacity, 1) * 4), 1);
  }
}

.brand-opener[data-handoff] .brand-opener__screen {
  pointer-events: none;
}

.brand-opener video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  /* Cap the crop on very shallow displays. The surrounding paint is the studio plate. */
  max-width: calc((100svh - var(--masthead-height, 69px)) * 3.1);
  max-height: 82vw;
}

.brand-opener__screen[data-cut="portrait"] video {
  /* Keep a visible margin around both ends of the portrait wordmark on tall phones. */
  max-width: none;
  max-height: 188vw;
}

.masthead {
  position: relative;
}

.brand-opener__screen[data-sound-target] { cursor: pointer; }
.brand-opener__screen[data-sound-target]:focus-visible {
  outline: 2px solid var(--color-lime);
  outline-offset: -4px;
}
