/* DM ORIGINALS: the intro film before the catalog, set full screen like a studio's opening.
   The film is 16:9. On a wide screen it covers the stage; on a tall one it keeps at least its
   central 56% (the whole head, the whole closing title) and feathers into the deep above and below. */

.intro {
  position: relative;
  z-index: var(--z-content);
}
.intro__stage {
  position: relative;
  height: 100svh;
  min-height: 380px;
  overflow: hidden;
  isolation: isolate;
}

/* width = max(cover, min(cover by height, 56% window)): cover on landscape, the central 56% on portrait */
.intro__frame {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: max(100vw, min(177.78svh, 178vw));
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}
/* on a tall screen the film is a band across the middle: a longer feather lets it dissolve into the deep */
@media (max-aspect-ratio: 1 / 1) {
  .intro__frame {
    -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.35) 8%, #000 22%, #000 78%, rgba(0, 0, 0, 0.35) 92%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.35) 8%, #000 22%, #000 78%, rgba(0, 0, 0, 0.35) 92%, transparent 100%);
  }
}
.intro__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--navy-800);
}

/* ------------------------------------------------------------------ controls */

.intro__controls {
  position: absolute;
  z-index: 2;
  inset-inline: var(--gutter);
  bottom: calc(var(--tabbar-space) + 14px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  pointer-events: none;
}
.intro__controls > * { pointer-events: auto; }

/* glass over a moving picture: the controls carry their own dark so they read on any frame */
.intro__sound,
.intro__skip {
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.intro__sound {
  width: 48px;
  height: 48px;
  background: rgba(5, 9, 20, 0.52);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--ink-2);
}
.intro__sound:hover { background: rgba(5, 9, 20, 0.7); color: var(--paper); }
.intro__sound.is-on { color: var(--paper); }
.intro__sound svg { width: 22px; height: 22px; }

.intro__skip { --btn-bg: rgba(5, 9, 20, 0.52); }
.intro__skip:hover { --btn-bg: rgba(5, 9, 20, 0.7); }
@media (hover: hover) and (pointer: fine) {
  .intro__skip:hover .btn__icon { transform: translateY(2px) scale(1.06); }
  .intro.is-ended .intro__skip:hover .btn__icon { transform: rotate(-30deg) scale(1.06); }
}

/* the play button: under reduced motion before anything plays, when autoplay was refused, or when paused */
.intro__play {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  color: var(--paper);
}
.intro__play-disc {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--abyss);
  box-shadow: 0 18px 40px -16px rgba(2, 5, 14, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: background-color var(--t-micro) var(--ease-out), transform 160ms var(--ease-out);
}
.intro__play-disc svg { width: 30px; height: 30px; fill: currentColor; translate: 2px 0; }
.intro__play-label {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: rgba(5, 9, 20, 0.52);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-weight: 500;
  line-height: 1.2;
}
.intro__play:hover .intro__play-disc,
.intro__play:focus-visible .intro__play-disc { background: var(--tungsten); }
.intro__play:active .intro__play-disc { transform: scale(0.95); }
.intro__play:focus-visible { outline: none; }
.intro__play:focus-visible .intro__play-disc { outline: 2px solid var(--tungsten); outline-offset: 4px; }

.intro.is-blocked .intro__play,
.intro.is-paused .intro__play,
.intro.is-rest:not(.is-started) .intro__play,
html:not(.js-motion) .intro:not(.is-started) .intro__play { display: flex; }

/* while the film holds the screen, the chapter bar steps back: skip is the one way on */
.tabbar { transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out); }
html.is-cinema .tabbar { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; }
@media (min-width: 1200px) {
  html.is-cinema .tabbar { transform: translate(16px, -50%); }
}
html.is-cinema .intro__controls { bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); }

@media (forced-colors: active) {
  .intro__play-disc { border: 2px solid ButtonText; }
}
