/* bala-effects.css — sistema de ambiência ritualística AST0EST · Bala 1 3 · 8 · 4
   Compartilhado entre /, /conversar, /preencher.
   Aplica: estrelas animadas, cursor sigilo, loader místico, glow ritualístico,
   fade-in scroll, transições com easing ritual, hover de portal. */

/* ===== LOADER INICIAL ===== */
.bala-loader {
  position: fixed;
  inset: 0;
  background: #0F0B08;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.bala-loader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.bala-loader-sigil {
  width: 80px;
  height: 80px;
  border: 1px solid #b8860b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #b8860b;
  animation: bala-rotate 4s linear infinite, bala-pulse 2s ease-in-out infinite;
  position: relative;
}
.bala-loader-sigil::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(184,134,11,0.3);
  border-radius: 50%;
  animation: bala-pulse-ring 2.5s ease-in-out infinite;
}
.bala-loader-text {
  margin-top: 2em;
  color: #6b4a25;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.3em;
  animation: bala-fade-cycle 2.5s ease-in-out infinite;
}
.bala-loader-selo {
  position: absolute;
  bottom: 3em;
  color: #4a3520;
  letter-spacing: 0.4em;
  font-size: 10px;
  font-weight: 600;
}

@keyframes bala-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes bala-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(184,134,11,0.2); }
  50% { box-shadow: 0 0 40px rgba(184,134,11,0.5); }
}
@keyframes bala-pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.4); opacity: 0; }
}
@keyframes bala-fade-cycle {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ===== ESTRELAS ANIMADAS ===== */
.bala-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bala-star {
  position: absolute;
  background: #f4efe3;
  border-radius: 50%;
  pointer-events: none;
  animation: bala-twinkle ease-in-out infinite;
}
@keyframes bala-twinkle {
  0%, 100% { opacity: 0.1; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ===== POEIRA CÓSMICA SUBINDO ===== */
.bala-dust {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.bala-dust-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(184, 134, 11, 0.4);
  border-radius: 50%;
  animation: bala-rise linear infinite;
}
@keyframes bala-rise {
  from { transform: translateY(100vh) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  to { transform: translateY(-10vh) translateX(40px); opacity: 0; }
}

/* ===== HALO DOURADO QUE SEGUE O CURSOR (sem substituir cursor nativo) ===== */
/* Cursor nativo permanece visível; isso é só um halo decorativo */
@media (hover: hover) and (pointer: fine) {
  .bala-cursor-halo {
    position: fixed;
    width: 80px;
    height: 80px;
    pointer-events: none;
    z-index: 9997;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(184,134,11,0.18) 0%, rgba(184,134,11,0.04) 40%, transparent 70%);
    border-radius: 50%;
    transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
  }
  body:hover .bala-cursor-halo {
    opacity: 1;
  }
  .bala-cursor-halo.hover {
    width: 140px;
    height: 140px;
  }
}

/* ===== FADE IN ON SCROLL ===== */
.bala-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.bala-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== GLOW RITUALÍSTICO (botões e elementos importantes) ===== */
@keyframes bala-glow-breath {
  0%, 100% { box-shadow: 0 0 8px rgba(184,134,11,0.2), 0 0 0 1px rgba(184,134,11,0.3); }
  50% { box-shadow: 0 0 24px rgba(184,134,11,0.4), 0 0 0 1px rgba(184,134,11,0.6); }
}
.bala-glow {
  animation: bala-glow-breath 4s ease-in-out infinite;
}

/* ===== TEXTO REVELADO LETRA POR LETRA ===== */
.bala-typing {
  display: inline-block;
  position: relative;
}
.bala-typing::after {
  content: '|';
  color: #b8860b;
  animation: bala-cursor-blink 0.8s ease-in-out infinite;
  margin-left: 2px;
}
.bala-typing.done::after {
  display: none;
}
@keyframes bala-cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ===== TOGGLE DE ÁUDIO AMBIENTE ===== */
.bala-audio-toggle {
  position: fixed;
  bottom: 1.5em;
  right: 1.5em;
  width: 44px;
  height: 44px;
  background: rgba(15,11,8,0.85);
  border: 1px solid rgba(184,134,11,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  color: #b8860b;
  font-size: 18px;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}
.bala-audio-toggle:hover {
  background: rgba(184,134,11,0.15);
  border-color: #b8860b;
  transform: scale(1.08);
}
.bala-audio-toggle.playing {
  border-color: #b8860b;
  animation: bala-glow-breath 3s ease-in-out infinite;
}

/* ===== TRANSIÇÕES RITUAIS NOS BOTÕES E LINKS ===== */
.cta-btn, button[type="submit"], .option-btn, .bala-btn {
  position: relative;
  overflow: hidden;
}
.cta-btn::before, .bala-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.cta-btn:hover::before, .bala-btn:hover::before {
  transform: translateX(100%);
}

/* ===== CARDS COM TILT SUTIL ===== */
.bala-tilt {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
}

/* ===== EFEITO DE CHEGADA NO ARQUÉTIPO (revelação) ===== */
.bala-arquetipo-reveal {
  animation: bala-arquetipo-arise 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes bala-arquetipo-arise {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

/* ===== RIPPLE NO CLICK ===== */
.bala-ripple {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #b8860b;
  border-radius: 50%;
  pointer-events: none;
  animation: bala-ripple-expand 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9998;
}
@keyframes bala-ripple-expand {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(60); opacity: 0; }
}

/* ===== MOBILE: desabilita efeitos pesados ===== */
@media (hover: none) and (pointer: coarse) {
  .bala-stars, .bala-dust { display: none; }
  .bala-cursor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bala-stars, .bala-dust, .bala-loader-sigil { animation: none; }
  .bala-reveal { opacity: 1; transform: none; transition: none; }
}
