/* Hero: logo animada Teacher Jenni (porta de brand/logo-live.html). Sem inline/CDN por causa da CSP. */
.stage {
  position: relative;
  width: min(440px, 92vw);
  aspect-ratio: 1;
  border-radius: 32px;
  background: linear-gradient(165deg, #2a1848 0%, #1e1633 55%, #14213d 100%);
  box-shadow:
    0 30px 60px rgba(30, 22, 51, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.stage.light { background: none; box-shadow: none; border-radius: 0; overflow: visible; }
.stage.light::before { content: ""; position: absolute; inset: -8%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .7), rgba(196, 181, 253, .35) 55%, transparent 100%); }
.stage.light .orb, .stage.light .particles { z-index: 0; }
.stage.light .logo { z-index: 1; filter: drop-shadow(0 26px 40px rgba(109, 40, 217, .22)); }

.logo { position: absolute; inset: 0; width: 100%; height: 100%; }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  animation: orbFloat 5s ease-in-out infinite;
}
.orb-a { width: 12%; height: 12%; left: 8%; top: 12%; background: rgba(56, 189, 248, 0.22); }
.orb-b { width: 14%; height: 14%; right: 7%; bottom: 14%; background: rgba(255, 107, 157, 0.18); animation-delay: 1.2s; }

@keyframes orbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.journal { transform-origin: 50% 58%; animation: journalBreathe 4.2s ease-in-out infinite; }
.page-right { transform-origin: 50% 50%; animation: pageFlip 5s ease-in-out infinite; }
.ribbon { transform-origin: 50% 0%; animation: ribbonSway 2.8s ease-in-out infinite; }
.spark { animation: twinkle 2.2s ease-in-out infinite; }
.spark-2 { animation: twinkle 2.6s ease-in-out infinite 0.7s; }
.ink-line {
  stroke-dasharray: 90;
  stroke-dashoffset: 90;
  animation: drawLine 4s ease-in-out infinite;
}
.ink-line:nth-child(2) { animation-delay: 0.15s; }
.ink-line:nth-child(3) { animation-delay: 0.3s; }
.ink-line:nth-child(4) { animation-delay: 0.45s; }

@keyframes journalBreathe {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(-1.2deg) translateY(-2px); }
}
@keyframes pageFlip {
  0%, 100% { transform: rotate(0deg); }
  45% { transform: rotate(-3deg); }
}
@keyframes ribbonSway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(4deg) translateY(3px); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.12); }
}
@keyframes drawLine {
  0%, 15% { stroke-dashoffset: 90; }
  45%, 70% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 90; }
}

.bubble-anchor {
  transform-box: view-box;
  transform-origin: 256px 104px;
  animation: bubbleBob 3.4s ease-in-out infinite;
}
.bubble-group {
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.4));
}
@keyframes bubbleBob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}
.bubble-shell {
  transform-origin: 50% 80%;
  animation: bubblePop 3.2s cubic-bezier(0.34, 1.45, 0.64, 1) infinite;
}
@keyframes bubblePop {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.04); }
}

.phrase {
  font-family: Poppins, sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  fill: #0c4a6e;
  text-anchor: middle;
  dominant-baseline: middle;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.phrase.is-on { opacity: 1; }
.phrase.is-exit { opacity: 0; }

.page-name {
  font-family: Caveat, cursive;
  fill: #5B21B6;
  text-anchor: start;
}
.page-name.teacher {
  font-weight: 500;
  font-size: 26px;
}
.page-name.jenni {
  font-weight: 700;
  font-size: 34px;
}

/* replies orbit the main bubble; this layer only pops the scale */
.reply {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.55);
  transition: opacity 0.32s ease, transform 0.38s cubic-bezier(0.34, 1.4, 0.64, 1);
  filter: drop-shadow(0 3px 6px rgba(30, 22, 51, 0.14));
  pointer-events: none;
}
.reply.is-on {
  opacity: 1;
  transform: scale(1);
}
.reply text {
  font-family: Poppins, sans-serif;
  font-weight: 700;
  font-size: 12px;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.particles span {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  animation: lrise 4.5s linear infinite;
  opacity: 0;
}
.particles span:nth-child(1) { left: 16%; background: var(--sun); }
.particles span:nth-child(2) { left: 40%; background: var(--sky); animation-delay: 0.8s; }
.particles span:nth-child(3) { left: 70%; background: var(--coral); animation-delay: 1.5s; }
.particles span:nth-child(4) { left: 55%; background: #c4b5fd; animation-delay: 2.4s; }
.particles span:nth-child(5) { left: 82%; background: var(--mint); animation-delay: 3.2s; }
.particles span:nth-child(6) { left: 25%; background: var(--sun); animation-delay: 3.8s; width: 4px; height: 4px; }

@keyframes lrise {
  0% { transform: translateY(80%) scale(0.5); opacity: 0; }
  15% { opacity: 0.9; }
  100% { transform: translateY(8%) scale(1); opacity: 0; }
}

.stage.paused *, .stage.paused { animation-play-state: paused !important; }
.stage { margin-inline: auto; max-width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .orb, .journal, .page-right, .ribbon, .spark, .spark-2, .ink-line, .bubble-anchor, .bubble-shell, .particles span, .reply {
    animation: none !important;
    transition: none !important;
  }
  .ink-line { stroke-dashoffset: 0; }
  .phrase, .reply { opacity: 1 !important; transform: none !important; }
}
