/* Textura de pedra — SVG feTurbulence embutido como data-URI, sem imagem
   raster nenhuma. Aplicada como camada fina por cima da cor sólida, nunca
   como fundo sozinho: pedra tem grão, não é uma foto de pedra. */

.textura-pedra {
  position: relative;
  background-color: var(--cinza-100);
}

.textura-pedra::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.15 0 0 0 0 0.16 0 0 0 0 0.17 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.textura-pedra-escura {
  position: relative;
  background-color: var(--cinza-900);
}

.textura-pedra-escura::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- EFEITO HIPERESPACO / ESTRELAS CADENTES (Dinamico) --- */
.bg-estrelas-wrapper {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  mix-blend-mode: screen;
}

/* Estrela Cadente - Rastro luminoso */
.bg-estrelas-wrapper::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 80%;
  width: 250px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,1), transparent);
  border-radius: 50%;
  box-shadow: 0 0 15px 3px rgba(255,255,255,0.4);
  animation: cadente 6s ease-in-out infinite;
  opacity: 0;
  z-index: 3;
}

/* Efeito de fade nas bordas para as camadas */
.bg-estrelas-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 10%, rgba(0,0,0,0.6) 100%);
  z-index: 1;
}

.bg-estrelas-camada {
  position: absolute;
  width: 150%;
  height: 150%;
  top: -25%;
  left: -25%;
  background-image: 
    radial-gradient(2px 2px at 15% 25%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 35% 65%, rgba(255,255,255,0.6), transparent),
    radial-gradient(3px 3px at 55% 15%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 75% 85%, rgba(255,255,255,0.4), transparent),
    radial-gradient(2px 2px at 85% 45%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 25% 75%, rgba(255,255,255,0.5), transparent),
    radial-gradient(2px 2px at 90% 25%, rgba(255,255,255,0.6), transparent);
  background-size: 200px 200px;
  animation: hiper-rotacao 100s linear infinite;
  opacity: 0.8;
  transform-origin: center;
}

.bg-estrelas-camada.lenta {
  background-size: 300px 300px;
  animation: hiper-rotacao 140s linear infinite reverse;
  opacity: 0.5;
}

.bg-estrelas-camada.fundo {
  background-size: 100px 100px;
  animation: hiper-rotacao 200s linear infinite;
  opacity: 0.3;
}

/* Rotação imersiva do campo estelar */
@keyframes hiper-rotacao {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Disparo da estrela cadente (diagonal) */
@keyframes cadente {
  0% {
    transform: rotate(-35deg) translateX(0);
    opacity: 1;
  }
  15% {
    transform: rotate(-35deg) translateX(-150vw);
    opacity: 0;
  }
  100% {
    transform: rotate(-35deg) translateX(-150vw);
    opacity: 0; /* Permanece escondida até o final do ciclo */
  }
}

@media (max-width: 768px) {
  .bg-estrelas-camada.fundo { display: none; }
  .bg-estrelas-wrapper::before { animation-duration: 9s; /* Menos cadentes no mobile */ }
}
