/* ═══════════════════════════════════════════
   DNI Sports — Hero Cinema (3 cenas, dolly zoom)
═══════════════════════════════════════════ */

:root {
  --ease-apple: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-zoom:  cubic-bezier(0.65, 0, 0.35, 1);
}

#hero-cinema {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--dark, #080F1F);
  z-index: 1;
}

body.hero-done #hero-cinema {
  position: relative;
  height: 100vh;
}

/* ─── Stage que contém as 3 cenas ─── */
.cinema-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  perspective: 1200px;
}

/* ─── Cada cena ─── */
.cinema-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1) translate3d(0, 0, 0);
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  backface-visibility: hidden;
  pointer-events: none;
  /* Default: sem transição (estado inerte). Transições são definidas por classe. */
}

/* ─── ACTIVE: estado de chegada / estável.
   Quando uma cena vira active vindo de .entering, esta transição roda. */
.cinema-layer.active {
  opacity: 1;
  transform: scale(1) translate3d(0, 0, 0);
  pointer-events: auto;
  transition:
    opacity 0.5s cubic-bezier(0.3, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.2, 0, 0.2, 1);  /* microzoom out 1.06 → 1 estabiliza */
}

/* ─── LEAVING: dolly-zoom AGRESSIVO no vulto + TRANSLATE.
   Sai de scale 1 → 7 (zoom dramático), e SIMULTANEAMENTE faz translate
   pra "voar" o vulto até o ponto onde o personagem da próxima cena vai estar.
   Curva extra-agressiva: começa lento, dispara no fim — sensação de "puxão" cinematográfico. */
.cinema-layer.leaving {
  opacity: 0;
  transform:
    translate(var(--dolly-tx, 0vw), var(--dolly-ty, 0vh))
    scale(var(--dolly-scale, 7))
    translate3d(0, 0, 0);
  transition:
    transform 1.1s cubic-bezier(0.4, 0, 0.75, 0.25),     /* acelera continuamente até o corte */
    opacity 0.3s 0.8s linear;                             /* fade no fim */
}

/* ─── ENTERING: estado intermediário enquanto a outra ainda faz dolly-out.
   Cena começa invisível, com microzoom de scale 1.06 (cobre tela inteira → NUNCA mostra borda).
   Vira .active depois do delay do JS, daí pra scale 1 + opacity 1 com transição suave. */
.cinema-layer.entering {
  opacity: 0;
  transform: scale(1.06) translate3d(0, 0, 0);
  /* Sem transition: é só o estado de partida, sem animação dele mesmo */
}

/* ─── Imagem dentro da cena ─── */
.cinema-layer img,
.cinema-layer .cinema-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
  background: var(--dark, #080F1F);
  transform: scale(1.15);
  transform-origin: center center;
}

/* Placeholders (Sprint 1, antes das imagens reais) */
.cinema-bg {
  background-size: cover;
  background-position: center;
}
.cinema-bg.placeholder-a {
  background: linear-gradient(135deg, #0C2340 0%, #1a3a6e 50%, #080F1F 100%);
}
.cinema-bg.placeholder-b {
  background: linear-gradient(180deg, #0C2340 0%, #4EC3E0 50%, #080F1F 100%);
}
.cinema-bg.placeholder-c {
  background: radial-gradient(circle at center, #6DEC94 0%, #0C2340 60%, #080F1F 100%);
}

/* (overlay individual por cena removido — agora é global no .cinema-stage) */

/* ─── Overlay GLOBAL sobre TODAS as camadas (imagens E vídeos) ───
   Garante legibilidade do texto + tratamento de cor uniforme entre
   imagens estáticas e vídeo de transição. */
.cinema-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 7;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.25) 60%,
    rgba(0, 0, 0, 0.65) 100%
  );
  pointer-events: none;
}

/* ─── Container dos textos (FORA do .cinema-stage, NÃO sofre zoom) ─── */
.cinema-copies {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* ─── Cada texto de cena ─── */
.cinema-copy {
  position: absolute;
  left: 8vw;
  bottom: 14vh;
  max-width: min(60ch, 80vw);
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  /* Default (cenas inativas): some rápido (0.4s, sem delay) */
  transition:
    opacity 0.4s 0s var(--ease-apple),
    transform 0.4s 0s var(--ease-apple);
  pointer-events: none;
}

/* Cena ativa: aparece APÓS o dolly zoom da imagem estabilizar
   (anim do zoom = 1.8s, então delay 1.6s + duração 0.7s = entra "depois do zoom") */
.cinema-copy.active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  /* Texto entra DEPOIS do match cut (1.1s do dolly + estabilização) */
  transition:
    opacity 0.5s 0.95s var(--ease-apple),
    transform 0.5s 0.95s var(--ease-apple);
  pointer-events: auto;
}

/* No load inicial (sem transição prévia), texto da Cena A aparece imediato com small fade */
.cinema-copies.boot .cinema-copy.active {
  transition:
    opacity 0.8s 0.3s var(--ease-apple),
    transform 0.8s 0.3s var(--ease-apple);
}

.cinema-copy .eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.35em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-cyan, #4EC3E0);
  margin-bottom: 18px;
  opacity: 0.95;
}

.cinema-copy .display {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6.5vw, 5.5rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: #fff;
  margin: 0 0 24px 0;
  text-transform: none;
}

.cinema-copy .display em {
  font-style: normal;
  background: linear-gradient(135deg, var(--color-cyan, #4EC3E0) 0%, var(--color-mint, #6DEC94) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* (Progress dots removidos — visual mais limpo, sem distrações) */

/* ─── MOTION BLUR natural na cena que sai (fallback quando NÃO há vídeo) ───
   Pares de cenas que NÃO têm vídeo de transição (data-no-video) usam blur. */
.cinema-layer.leaving.no-video {
  filter: blur(0px);
  animation: cinema-motion-blur 1.1s cubic-bezier(0.4, 0, 0.75, 0.25) forwards;
}
@keyframes cinema-motion-blur {
  0%   { filter: blur(0px); }
  50%  { filter: blur(0px); }
  100% { filter: blur(12px); }
}
@media (prefers-reduced-motion: reduce) {
  .cinema-layer.leaving { animation: none !important; filter: none !important; }
}

/* ─── VÍDEO DE TRANSIÇÃO (Kling) ─── */
.cinema-transition {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  transform: translate3d(-50%, -50%, 0) scale(1.15);
  object-fit: cover;
  object-position: center 40%;
  display: block;
  background: var(--dark, #080F1F);
  opacity: 0;
  pointer-events: none;
  z-index: 4;                    /* acima das cenas estáticas durante a transição */
  transition: opacity 0.7s ease; /* fade-in/out suave (sem corte abrupto) */
}

.cinema-transition.playing {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .cinema-transition.playing { opacity: 0 !important; }
}

/* ─── DEBUG markers (ativados via ?debug=1 na URL) ─── */
body.debug-hero .cinema-debug-marker {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin: -15px 0 0 -15px;
  border: 3px solid #fff;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 0 20px rgba(0,0,0,0.8);
  font-family: var(--font-display);
  font-size: 11px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
body.debug-hero .cinema-debug-marker.bg { background: #ff3b30; }
body.debug-hero .cinema-debug-marker.fg { background: #4EC3E0; }
body.debug-hero .cinema-debug-marker::after {
  content: attr(data-label);
  position: absolute;
  top: 100%;
  margin-top: 6px;
  white-space: nowrap;
  background: rgba(0,0,0,0.8);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
}

/* ─── Skip button ─── */
.hero-skip {
  position: absolute;
  top: 96px;
  right: 32px;
  z-index: 20;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  padding: 10px 22px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.3s var(--ease-apple);
}

.hero-skip:hover {
  color: var(--color-cyan, #4EC3E0);
  border-color: var(--color-cyan, #4EC3E0);
  background: rgba(78, 195, 224, 0.1);
}

/* Hide skip quando hero termina */
body.hero-done .hero-skip {
  opacity: 0;
  pointer-events: none;
}

/* ─── Hint de scroll (subtle) ─── */
.cinema-scroll-hint {
  position: absolute;
  bottom: 10vh;
  right: 4vw;
  z-index: 10;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  opacity: 0;
  animation: hint-fade-in 1s 1.5s var(--ease-apple) forwards;
  pointer-events: none;
}

.cinema-scroll-hint::after {
  content: '↓';
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 1.2rem;
  animation: hint-bounce 2s ease-in-out infinite;
}

body.hero-done .cinema-scroll-hint {
  opacity: 0;
}

@keyframes hint-fade-in {
  to { opacity: 0.7; }
}
@keyframes hint-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(8px); }
}

/* ─── Body lock state ─── */
body.hero-active {
  overflow: hidden;
  height: 100vh;
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .cinema-layer,
  .cinema-copy,
  .cinema-progress .dot {
    transition: none !important;
    animation: none !important;
  }
  .cinema-layer {
    transform: scale(1) !important;
  }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .cinema-copy {
    left: 6vw;
    right: 6vw;
    bottom: 18vh;
    max-width: 100%;
  }
  .cinema-copy .display {
    font-size: clamp(2rem, 9vw, 3.5rem);
  }
  .hero-skip {
    top: 80px;
    right: 16px;
    padding: 8px 16px;
  }

  /* Scroll hint abaixo do texto, sem sobreposição */
  .cinema-scroll-hint {
    bottom: 4vh;
    right: 50%;
    transform: translateX(50%);
    text-align: center;
  }

  /* Cena A: coach à esquerda → ancora pelo lado esquerdo */
  .cinema-layer[data-scene="0"] img { object-position: 20% center; }
  /* Cenas B e C: foco central */
  .cinema-layer[data-scene="1"] img { object-position: center center; }
  .cinema-layer[data-scene="2"] img { object-position: center center; }
}
