/* First-visit Cube intro film on the homepage: a small square pop-up in the
   corner that the visitor can close at any time. The page stays usable
   behind it. */
.cube-intro {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 2147483600;
  width: min(380px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.cube-intro.is-open {
  opacity: 1;
}

.cube-intro.is-closing {
  opacity: 0;
  pointer-events: none;
}

.cube-intro video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}

.cube-intro-close,
.cube-intro-sound {
  position: absolute;
  top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 0;
  background: #000;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cube-intro-close {
  right: 10px;
  width: 32px;
  font-size: 13px;
}

.cube-intro-sound {
  left: 10px;
  padding: 0 12px;
}

.cube-intro-close:hover,
.cube-intro-sound:hover {
  background: #fff;
  color: #000;
}

.cube-intro-close:focus-visible,
.cube-intro-sound:focus-visible,
.cube-intro-play:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cube-intro-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border: 1px solid #fff;
  border-radius: 0;
  background: #000;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.cube-intro-play[hidden] {
  display: none;
}

@media (max-width: 600px) {
  .cube-intro {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: min(300px, calc(100vw - 32px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .cube-intro,
  .cube-intro.is-closing {
    transition: opacity 0.2s ease;
  }
}
