/* ===========================
   INTRO PRELOADER — Sardanelli Produções
   Abertura de Efeitos Especiais (5 Segundos de Revelação)
   Sem pessoas | Efeitos: Fumaça Roxa/Dourada, Fogo Frio Prata, Serpentina & Papel Picado Dourado
   =========================== */

html.intro-lock,
html.intro-lock body {
  overflow: hidden !important;
  height: 100%;
}

#intro-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, var(--color-bg-3) 0%, var(--color-bg-2) 45%, var(--color-bg) 100%);
  overflow: hidden;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

#intro-preloader.intro-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#intro-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Grid futurista sutil no fundo */
.intro-grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(255, 186, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 42, 135, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  transform: perspective(600px) rotateX(55deg) scale(1.6);
  transform-origin: center 30%;
  animation: intro-grid-move 8s linear infinite;
  opacity: 0.4;
  z-index: 0;
}

@keyframes intro-grid-move {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 84px, 84px 0; }
}

/* Conteúdo central */
.intro-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  z-index: 3;
}

.intro-rings {
  position: relative;
  width: min(46vw, 300px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border-style: solid;
  border-color: transparent;
  opacity: 0;
  animation-fill-mode: forwards;
}

.intro-ring-1 {
  border-width: 2px;
  border-top-color: var(--color-gold);
  border-right-color: var(--color-gold);
  animation: intro-ring-in 1s ease-out 0.2s forwards, intro-spin 4.5s linear 0.2s infinite;
}

.intro-ring-2 {
  inset: 12%;
  border-width: 1.5px;
  border-bottom-color: var(--color-purple-light);
  border-left-color: var(--color-purple-light);
  animation: intro-ring-in 1s ease-out 0.4s forwards, intro-spin-rev 3.5s linear 0.4s infinite;
}

.intro-ring-3 {
  inset: 24%;
  border-width: 1px;
  border-top-color: #ffffff;
  border-left-color: #e0e0e0;
  opacity: 0;
  animation: intro-ring-in 1s ease-out 0.6s forwards, intro-spin 6s linear 0.6s infinite;
}

@keyframes intro-ring-in {
  0% { opacity: 0; transform: scale(0.6); }
  100% { opacity: 0.95; transform: scale(1); }
}

@keyframes intro-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes intro-spin-rev {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

/* Logo com pulso radiante */
.intro-logo-wrap {
  position: relative;
  width: 65%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  animation: intro-logo-in 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

@keyframes intro-logo-in {
  0% { opacity: 0; transform: scale(0.75); filter: blur(10px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

.intro-logo-img {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  z-index: 2;
  filter: drop-shadow(0 0 24px rgba(255, 186, 0, 0.45));
  animation: intro-logo-pulse 2.5s ease-in-out 1.5s infinite;
}

@keyframes intro-logo-pulse {
  0%, 100% { filter: drop-shadow(0 0 16px rgba(255, 186, 0, 0.4)) drop-shadow(0 0 30px rgba(123, 42, 135, 0.3)); }
  50% { filter: drop-shadow(0 0 35px rgba(255, 186, 0, 0.75)) drop-shadow(0 0 50px rgba(123, 42, 135, 0.5)); }
}

.intro-logo-glow {
  position: absolute;
  inset: -35%;
  z-index: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 186, 0, 0.28) 0%, rgba(123, 42, 135, 0.2) 45%, transparent 75%);
  filter: blur(8px);
  animation: intro-glow-pulse 2.5s ease-in-out 1.5s infinite;
}

@keyframes intro-glow-pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.12); }
}

/* Animação de Saída Triunfal aos 5s */
#intro-preloader.intro-exit .intro-content {
  animation: intro-exit-content 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#intro-preloader.intro-exit .intro-ring {
  animation: intro-exit-rings 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

@keyframes intro-exit-content {
  0% { opacity: 1; transform: scale(1); filter: blur(0); }
  100% { opacity: 0; transform: scale(1.15); filter: blur(12px); }
}

@keyframes intro-exit-rings {
  0% { opacity: 0.95; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.8); }
}

@media (max-width: 640px) {
  .intro-rings { width: 60vw; }
}

@media (prefers-reduced-motion: reduce) {
  #intro-preloader,
  .intro-ring,
  .intro-logo-wrap,
  .intro-logo-img,
  .intro-logo-glow,
  .intro-grid {
    animation: none !important;
  }
  .intro-logo-wrap {
    opacity: 1;
    transform: none;
  }
}
