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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

/* ── Scene: fixed to viewport, explicit stacking context ── */
.scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* overrides above on browsers that support dvh */
  isolation: isolate; /* own stacking context */
}

/* ── Layer 0: full-screen movie still ── */
.scene-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
  display: block;
}

/* ── Layer 1: vignette ── */
.vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.65) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, transparent 25%, transparent 65%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
}

/* ── Layer 10: quote bubble, always on top ── */
.quote.vader-head {
  position: absolute;
  z-index: 10;
  left: 2%;
  top: 2%;
  max-width: min(320px, 54vw);
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid rgba(200, 30, 30, 0.8);
  border-radius: 12px;
  padding: 0.8rem 1.1rem 1rem;
  box-shadow:
    0 0 24px rgba(192, 57, 43, 0.45),
    0 0 70px rgba(192, 57, 43, 0.18),
    inset 0 0 16px rgba(192, 57, 43, 0.06);
}

/* Speech bubble tail pointing down-right toward Vader */
.pointer {
  position: absolute;
  bottom: -18px;
  right: 26px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid rgba(200, 30, 30, 0.8);
}

.pointer::after {
  content: '';
  position: absolute;
  top: -20px;
  left: -8px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 16px solid rgba(0, 0, 0, 0.85);
}

/* ── Quote text ── */
.quote-text {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: clamp(1rem, 2.2vw, 1.45rem);
  font-style: italic;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  text-shadow: 0 1px 8px rgba(0,0,0,0.95);
  white-space: nowrap;
}

.word {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px) scale(0.88);
  animation: word-in 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  animation-delay: calc(0.9s + var(--i) * 0.26s);
  margin-right: 0.18em;
}

.word.accent {
  color: #e74c3c;
  font-size: 1.12em;
  text-shadow:
    0 0 14px rgba(231, 76, 60, 0.95),
    0 0 35px rgba(231, 76, 60, 0.55),
    0 1px 8px rgba(0,0,0,0.95);
}

@keyframes word-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Bubble fades+scales in, then words drop */
.quote.animate-in {
  opacity: 0;
  animation: bubble-appear 0.45s ease forwards;
  animation-delay: 0.4s;
}

@keyframes bubble-appear {
  from { opacity: 0; transform: scale(0.82) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .quote.vader-head {
    left: 3%;
    top: 3%;
    max-width: 78vw;
    padding: 0.65rem 0.85rem 0.85rem;
  }

  .quote-text {
    font-size: 0.9rem;
    white-space: normal;
  }
}
