/* ================================================
   FLUXFRONT — Voice Demo Section
   Voice zone, orb, stage, spotlight, rings,
   controls, transcript, hint, keyframes
   ================================================ */


/* -- Voice zone (immersive ambient section) -- */

.voice-zone {
  --voiceLevel: 0;
  position: relative;
  padding: 120px 0 100px;
  overflow: hidden;
}

/* Gradient mesh — reacts to voice-speaking class */
.voice-zone__mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 700px at 30% 40%, rgba(0,212,170,0.07), transparent 65%),
    radial-gradient(600px 600px at 70% 60%, rgba(59,130,246,0.05), transparent 60%);
  animation: meshDrift 14s ease-in-out infinite alternate;
  transition: opacity 0.5s ease;
}

body.voice-speaking .voice-zone__mesh {
  animation-duration: 5s;
  opacity: 1;
  background:
    radial-gradient(800px 800px at 30% 40%, rgba(0,212,170,0.18), transparent 65%),
    radial-gradient(700px 700px at 70% 60%, rgba(59,130,246,0.12), transparent 60%);
}

@keyframes meshDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -20px) scale(1.05); }
}

.voice-intro { text-align: center; margin-bottom: 48px; }
.voice-intro__sub { font-size: 17px; color: var(--text-2); margin-top: 8px; }

/* -- Orb stage -- */

.voice-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  margin-bottom: 32px;
}

/* Spotlight glow — scales + brightens with voice */
.voice-spotlight {
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0,212,170,0.14) 0%, transparent 65%);
  filter: blur(40px);
  pointer-events: none;
  transform: scale(calc(1 + var(--voiceLevel, 0) * 0.3));
  opacity: calc(0.6 + var(--voiceLevel, 0) * 0.4);
  transition: transform 120ms linear, opacity 120ms linear;
}
body.voice-speaking .voice-spotlight {
  background: radial-gradient(circle, rgba(0,212,170,0.28) 0%, transparent 65%);
}

/* Outer glow ring — only visible when voice active */
.voice-outer-ring {
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 999px;
  border: 1px solid rgba(0,212,170,0);
  box-shadow: 0 0 0 rgba(0,212,170,0);
  pointer-events: none;
  opacity: 0;
  transform: scale(1);
  transition: opacity 0.4s ease, transform 120ms linear, border-color 0.4s ease, box-shadow 0.4s ease;
}
body.voice-speaking .voice-outer-ring {
  opacity: 1;
  border-color: rgba(0,212,170,0.08);
  box-shadow: 0 0 60px rgba(0,212,170,0.08), 0 0 120px rgba(0,212,170,0.04);
  transform: scale(calc(1 + var(--voiceLevel, 0) * 0.2));
  animation: outerPulse 3s ease-in-out infinite;
}

@keyframes outerPulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* Breathing ring — reacts to voice level */
.voice-breath-ring {
  position: absolute;
  width: 310px; height: 310px;
  border-radius: 999px;
  border: 1px solid rgba(0,212,170,0.12);
  box-shadow: 0 0 30px rgba(0,212,170,0.06);
  pointer-events: none;
  animation: breathe 4s ease-in-out infinite;
  transform: scale(calc(1 + var(--voiceLevel, 0) * 0.2));
  transition: transform 120ms linear;
}
body.voice-speaking .voice-breath-ring {
  animation-duration: 1.8s;
  border-color: rgba(0,212,170,0.25);
  box-shadow: 0 0 60px rgba(0,212,170,0.15);
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 0.9; }
}

/* -- Orb (260px, dramatic voice scaling) -- */

.voice-orb {
  --voiceLevel: 0.08;
  --orbX: 0px;
  --orbY: 0px;
  width: 260px; height: 260px;
  border-radius: 999px;
  position: relative;
  z-index: 2;
  background:
    radial-gradient(130px 130px at 30% 25%, rgba(255,255,255,0.18), transparent 55%),
    radial-gradient(180px 130px at 65% 70%, rgba(0,212,170,0.18), transparent 60%),
    radial-gradient(230px 230px at 70% 25%, rgba(59,130,246,0.18), transparent 65%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 24px 60px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 0 calc(var(--voiceLevel) * 80px) rgba(0,212,170, calc(var(--voiceLevel) * 0.3));
  transform: translate(var(--orbX), var(--orbY)) scale(calc(1 + (var(--voiceLevel) * 0.35)));
  transition: transform 100ms linear, box-shadow 100ms linear;
  animation: orbFloat 6.5s ease-in-out infinite;
}

.voice-orb::after {
  content: "";
  position: absolute; inset: -24px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(0,212,170,0.15), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(59,130,246,0.08), transparent 62%);
  filter: blur(20px);
  opacity: calc(0.6 + var(--voiceLevel) * 0.4);
  transform: scale(calc(1 + (var(--voiceLevel) * 0.5)));
  transition: transform 100ms linear, opacity 100ms linear;
  pointer-events: none;
}

.voice-orb.is-speaking {
  animation: orbFloat 4s ease-in-out infinite, orbPulse 0.9s ease-in-out infinite;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(var(--orbX, 0px), var(--orbY, 0px)) scale(calc(1 + (var(--voiceLevel) * 0.35))); }
  50%      { transform: translate(var(--orbX, 0px), calc(var(--orbY, 0px) - 8px)) scale(calc(1 + (var(--voiceLevel) * 0.35))); }
}
@keyframes orbPulse {
  0%, 100% { filter: saturate(1) brightness(1); }
  50%      { filter: saturate(1.3) brightness(1.15); }
}

/* -- Controls (floating below orb) -- */

.voice-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.voice-start { max-width: 320px; width: 80%; justify-content: center; }
.voice-stop  { max-width: 200px; width: 50%; justify-content: center; font-size: 0.85rem; }

.voice-transcript { display: none !important; }
.voice-hint {
  text-align: center;
  margin-top: 16px;
  color: var(--text-3);
  font-size: 11px;
  opacity: 0.4;
}
