*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: grid;
  place-items: center;
  height: 100dvh;
  font-family: "Anton", Impact, "Arial Narrow Bold", sans-serif;
}

/* Blurred fill around the 9:16 stage (desktop / tall phones). */
.bg {
  position: fixed;
  inset: -10%;
  background: #000 url("/media/main-poster.jpg") center / cover no-repeat;
  filter: blur(40px) brightness(0.55) saturate(1.2);
  transition: background-image 0.4s;
}
.bg.is-offer {
  background-image: url("/media/offer-poster.jpg");
}

/* Largest 9:16 box that fits the viewport. Overlay positions are % of this box. */
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: min(
    108vw,
    100dvh * 9 / 16
  ); /* tall phones: crop up to ~4% per side instead of big bars */
  aspect-ratio: 9 / 16;
  overflow: hidden;
  container-type: inline-size;
  background: #000;
  cursor: pointer;
}

.video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.15s;
}
.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ---- Controls ---- */
.unmute {
  position: absolute;
  top: 4cqw;
  left: 50%;
  transform: translateX(-50%);
  padding: 2.4cqw 4.4cqw;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font:
    600 3.8cqw/1 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  cursor: pointer;
  animation: nudge 1.8s ease-in-out infinite;
}
@keyframes nudge {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.06);
  }
}

.play {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 22cqw;
  height: 22cqw;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 9cqw;
  padding-left: 1.5cqw;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .is-offer .plate {
    animation: none;
    transform: none;
  }
  .plate-shine,
  .unmute {
    animation: none;
  }
}

/* ---- Captions (main clip only, TikTok-style word highlight) ---- */
.captions {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 63%;
  text-align: center;
  pointer-events: none;
  font-family: "Anton", Impact, sans-serif;
  font-size: 9.5cqw;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: #fff;
  /* outline via shadows: text-stroke + paint-order is unreliable on HTML text */
  --o: 0.55cqw;
  text-shadow:
    var(--o) 0 0 #000, calc(-1 * var(--o)) 0 0 #000, 0 var(--o) 0 #000, 0 calc(-1 * var(--o)) 0 #000,
    var(--o) var(--o) 0 #000, calc(-1 * var(--o)) var(--o) 0 #000, var(--o) calc(-1 * var(--o)) 0 #000,
    calc(-1 * var(--o)) calc(-1 * var(--o)) 0 #000, 0 1cqw 2cqw rgba(0, 0, 0, 0.7);
}
.cap-word {
  display: inline-block;
  transition: transform 0.08s ease-out, color 0.08s;
}
.cap-word.is-active {
  color: #ffd400;
  transform: scale(1.12);
}
.is-offer .captions { display: none; }
