/* ListFlow — intro cinematográfica (primeira visita, rota /) */

#cinematic-intro-root {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: radial-gradient(ellipse 120% 80% at 50% 45%, #0c0e12 0%, #050508 55%, #020203 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear;
  perspective: 1400px;
}

#cinematic-intro-root.is-exiting {
  opacity: 0;
  pointer-events: none;
}

#cinematic-intro-root.is-exiting .cinematic-intro-skip {
  opacity: 0;
  pointer-events: none;
}

/* Background image com blur e transparência — fica sutil, não compete com a logo */
.cinematic-intro-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url('/assets/bg-loading-blur.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  /* Filtros: blur forte + dessaturação leve + brightness baixo para garantir
     que a imagem seja contexto visual e não distração. */
  filter: blur(12px) saturate(0.65) brightness(0.55);
  opacity: 0.22;
  /* Levemente "expandido" para que o blur não revele bordas nítidas */
  transform: scale(1.06);
  animation: cinematic-bg-drift 24s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

@keyframes cinematic-bg-drift {
  0%   { transform: scale(1.06) translate3d(0, 0, 0); }
  100% { transform: scale(1.10) translate3d(-12px, 6px, 0); }
}

#cinematic-intro-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.55;
}

.cinematic-intro-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 50%,
    transparent 0%,
    transparent 42%,
    rgba(0, 0, 0, 0.55) 100%
  );
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.85);
}

/* Aurora vermelha pulsante atrás da logo — reforça o "drama" 3D */
.cinematic-intro-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(70vw, 520px);
  height: min(70vw, 520px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%,
      rgba(241, 44, 76, 0.28) 0%,
      rgba(241, 44, 76, 0.16) 22%,
      rgba(196, 32, 59, 0.08) 40%,
      transparent 65%);
  filter: blur(28px);
  opacity: 0.85;
  animation: cinematic-aura-pulse 4.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  will-change: transform, opacity;
}

@keyframes cinematic-aura-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: 0.55; }
  50%      { transform: translate(-50%, -50%) scale(1.12); opacity: 0.95; }
}

.cinematic-intro-skip {
  position: absolute;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  right: max(1.25rem, env(safe-area-inset-right, 0px));
  z-index: 3;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, opacity 0.4s;
}

.cinematic-intro-skip:hover,
.cinematic-intro-skip:focus-visible {
  color: #fff;
  background: rgba(241, 44, 76, 0.12);
  border-color: rgba(241, 44, 76, 0.35);
  outline: none;
}

.cinematic-intro-logo-shell {
  position: relative;
  z-index: 2;
  width: min(88vw, 240px);
  /* Profundidade simulada: stack de drop-shadows com offset progressivo cria
     ilusão de "espessura" (parece bloco extrudado). drop-shadow é aplicado
     SVG-level: cada peça pinta com sombra independente, preservando os
     transparency cuts entre L/I/S/T/F/O/W. NÃO usar blur nos primeiros layers
     (mantém contorno nítido); blur só na sombra projetada e no halo. */
  filter:
    drop-shadow(1px 1px 0 rgba(180, 30, 50, 0.55))
    drop-shadow(2px 2px 0 rgba(140, 22, 40, 0.45))
    drop-shadow(3px 3px 0 rgba(100, 14, 30, 0.32))
    drop-shadow(5px 6px 10px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 22px rgba(241, 44, 76, 0.28));
  /* Inclinação 3D MAIS sutil — preserva o anti-aliasing do SVG */
  transform-style: preserve-3d;
  transform: rotateX(4deg) rotateY(-3deg);
  animation: cinematic-logo-float 6.4s ease-in-out infinite;
  will-change: transform, filter;
}

@keyframes cinematic-logo-float {
  0%, 100% {
    transform: rotateX(4deg) rotateY(-3deg) translate3d(0, 0, 0);
  }
  50% {
    transform: rotateX(3deg) rotateY(-2deg) translate3d(0, -5px, 0);
  }
}

.cinematic-intro-logo-shell.is-pulse {
  animation: cinematic-logo-pulse-3d 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cinematic-logo-pulse-3d {
  0% {
    filter:
      drop-shadow(1px 1px 0 rgba(180, 30, 50, 0.55))
      drop-shadow(2px 2px 0 rgba(140, 22, 40, 0.45))
      drop-shadow(3px 3px 0 rgba(100, 14, 30, 0.32))
      drop-shadow(0 0 22px rgba(241, 44, 76, 0.28));
    transform: rotateX(4deg) rotateY(-3deg) scale(1);
  }
  45% {
    filter:
      drop-shadow(1px 1px 0 rgba(220, 60, 90, 0.7))
      drop-shadow(2px 2px 0 rgba(180, 40, 70, 0.55))
      drop-shadow(3px 3px 0 rgba(140, 24, 48, 0.4))
      drop-shadow(0 0 55px rgba(241, 44, 76, 0.7))
      drop-shadow(0 0 100px rgba(196, 32, 59, 0.4));
    transform: rotateX(2deg) rotateY(-1.5deg) scale(1.04);
  }
  100% {
    filter:
      drop-shadow(1px 1px 0 rgba(180, 30, 50, 0.55))
      drop-shadow(2px 2px 0 rgba(140, 22, 40, 0.45))
      drop-shadow(3px 3px 0 rgba(100, 14, 30, 0.32))
      drop-shadow(0 0 28px rgba(241, 44, 76, 0.32));
    transform: rotateX(4deg) rotateY(-3deg) scale(1);
  }
}

.cinematic-intro-svg-mount {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cinematic-intro-svg-mount svg {
  width: 100%;
  max-width: 200px;
  height: auto;
  overflow: visible;
}

.cinematic-intro-svg-mount svg g[id^="cinema-"] {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

html.cinematic-intro-active,
body.cinematic-intro-active {
  overflow: hidden !important;
}

@media (prefers-reduced-motion: reduce) {
  .cinematic-intro-logo-shell.is-pulse,
  .cinematic-intro-logo-shell,
  .cinematic-intro-aura,
  .cinematic-intro-bg {
    animation: none !important;
  }

  .cinematic-intro-logo-shell {
    /* Mantém estética 3D mas sem float */
    transform: rotateX(3deg) rotateY(-2deg);
  }

  #cinematic-intro-root {
    transition-duration: 0.35s;
  }
}
