/* ==================== ENTRADA EMOJI (celular e desktop) ==================== */
/* ~5 s, obrigatória a cada carregamento: Memoji em alta entra com mola, troca de expressão,
   balões de fala e emojis flutuando. */
.intro-emoji {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  height: 100%;
  text-align: center;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: #f8f1ea;
  overflow: hidden;
}
/* Fundo quente com luz que "respira" */
.intro-emoji::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(40% 35% at 50% 42%, rgba(255, 122, 51, .22), transparent 70%),
    radial-gradient(60% 50% at 50% 110%, rgba(245, 158, 11, .12), transparent 70%);
  animation: intro-respira 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes intro-respira { 50% { transform: scale(1.06); opacity: .85; } }

/* Fórmulas correndo em faixas curvas (js/formula-stream.js), atrás do rosto e dos textos.
   O centro fica mais apagado para o rosto e o título continuarem legíveis. */
.intro-emoji > .formula-stream {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: 0;
  animation: intro-formulas 1.6s .15s ease forwards;
  -webkit-mask-image: radial-gradient(ellipse 30% 34% at 50% 48%, rgba(0, 0, 0, .18), #000 100%);
  mask-image: radial-gradient(ellipse 30% 34% at 50% 48%, rgba(0, 0, 0, .18), #000 100%);
}
@keyframes intro-formulas { to { opacity: 1; } }
@media (max-width: 639px) {
  .intro-emoji > .formula-stream {
    -webkit-mask-image: radial-gradient(ellipse 52% 30% at 50% 48%, rgba(0, 0, 0, .15), #000 100%);
    mask-image: radial-gradient(ellipse 52% 30% at 50% 48%, rgba(0, 0, 0, .15), #000 100%);
  }
}

.intro-emoji__palco { position: relative; width: 220px; height: 220px; }
.intro-emoji__halo {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 140, 60, .4), rgba(255, 90, 31, 0) 68%);
  opacity: 0;
  animation: intro-halo 1.6s .3s cubic-bezier(.25, .1, .25, 1) forwards, intro-halo-pulso 3.8s 1.9s ease-in-out infinite;
}
@keyframes intro-halo { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes intro-halo-pulso { 50% { transform: scale(1.08); opacity: .75; } }

/* Rosto: sobe, passa um pouco e assenta (mola), depois balança de leve */
.intro-emoji__rosto {
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 172px;
  height: 172px;
  transform: translate(-50%, 60px) scale(.35);
  opacity: 0;
  transform-origin: 50% 90%;
  animation: intro-entra 1.4s .25s cubic-bezier(.22, 1.12, .36, 1) forwards, intro-balanca 4s 1.65s ease-in-out infinite;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45));
}
.intro-emoji__rosto img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.intro-emoji__sorriso { opacity: 0; transition: opacity .45s ease; }
.intro-emoji__sorriso.is-visivel { opacity: 1; }
@keyframes intro-entra {
  0% { opacity: 0; transform: translate(-50%, 60px) scale(.35); }
  55% { opacity: 1; transform: translate(-50%, -10px) scale(1.05); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes intro-balanca {
  0%, 100% { transform: translate(-50%, 0) rotate(0); }
  30% { transform: translate(-50%, -4px) rotate(-2.5deg); }
  65% { transform: translate(-50%, -2px) rotate(2deg); }
}

/* Balão de fala */
.intro-emoji__bolha {
  position: absolute;
  left: -34px;
  top: 6px;
  padding: 8px 14px;
  border-radius: 18px 18px 18px 6px;
  background: #fff;
  color: #2E221B;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 10px 22px -8px rgba(0, 0, 0, .55);
  opacity: 0;
  transform: translateY(8px) scale(.8);
  transform-origin: 20% 100%;
  transition: opacity .45s ease, transform .6s cubic-bezier(.22, 1.2, .36, 1);
}
.intro-emoji__bolha.is-visivel { opacity: 1; transform: none; }

/* Emojis flutuando em volta */
.intro-emoji__flutua {
  position: absolute;
  bottom: 30px;
  font-size: 22px;
  opacity: 0;
  animation: intro-flutua 4.4s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35));
}
.intro-emoji__flutua:nth-child(2) { left: -6px; animation-delay: 1.5s; }
.intro-emoji__flutua:nth-child(3) { right: -8px; animation-delay: 2.2s; font-size: 18px; }
.intro-emoji__flutua:nth-child(4) { left: 30px; animation-delay: 2.9s; font-size: 16px; }
.intro-emoji__flutua:nth-child(5) { right: 26px; animation-delay: 3.6s; }
@keyframes intro-flutua {
  0% { opacity: 0; transform: translateY(0) scale(.6) rotate(-8deg); }
  20% { opacity: 1; }
  80% { opacity: .9; }
  100% { opacity: 0; transform: translateY(-150px) scale(1.05) rotate(10deg); }
}

/* Textos sobem com calma */
.intro-emoji__titulo, .intro-emoji__sub, .intro-emoji__barra, .intro-emoji__pular {
  position: relative;
  opacity: 0;
  transform: translateY(12px);
  animation: intro-texto 1s cubic-bezier(.25, .1, .25, 1) forwards;
}
.intro-emoji__titulo { font-size: 30px; font-weight: 800; letter-spacing: -.01em; animation-delay: 1.1s; }
.intro-emoji__titulo span { color: #FF7A33; }
.intro-emoji__sub { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #FFB347; animation-delay: 1.45s; margin-top: -10px; }
@keyframes intro-texto { to { opacity: 1; transform: none; } }

.intro-emoji__barra {
  width: 160px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
  animation-delay: 1.7s;
}
.intro-emoji__barra i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #FF5A1F, #FFB347);
  transform: scaleX(0);
  transform-origin: left;
  animation: intro-barra 4.7s .3s cubic-bezier(.45, 0, .25, 1) forwards;
}
@keyframes intro-barra { to { transform: scaleX(1); } }
.intro-emoji__pular { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(248, 241, 234, .55); animation-delay: 2s; }

/* Saída: palco cresce um pouco e tudo se dissolve */
.intro-saindo { opacity: 0 !important; transition: opacity 1s cubic-bezier(.4, 0, .2, 1) .1s !important; pointer-events: none; }
.intro-saindo .intro-emoji__palco { transform: scale(1.1); transition: transform 1.2s cubic-bezier(.4, 0, .2, 1); }
.intro-saindo .intro-emoji__titulo, .intro-saindo .intro-emoji__sub { filter: blur(4px); transition: filter .9s ease; }

@media (max-width: 380px) {
  .intro-emoji__palco { width: 190px; height: 190px; }
  .intro-emoji__rosto { width: 150px; height: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-emoji *, .intro-emoji::before { animation: none !important; opacity: 1 !important; transform: none !important; }
  .intro-emoji__sorriso:not(.is-visivel) { opacity: 0 !important; }
}
