/* O dock segura os dois elementos: o panda (avança seção a seção) e o
   balão de convite (leva ao formulário). São alvos separados de propósito —
   um balão que dissesse "vem se cadastrar" e levasse para outro lugar
   estaria mentindo sobre o próprio clique. */
.mascot-dock {
  position: fixed;
  right: clamp(.75rem, 3vw, 1.75rem);
  bottom: clamp(.75rem, 3vw, 1.75rem);
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .55rem;
}

.mascot {
  position: relative;
  display: block;
  width: clamp(64px, 9vw, 92px);
  height: clamp(64px, 9vw, 92px);
  text-decoration: none;
  opacity: 1;
  transition: opacity .25s ease;
}
.mascot:focus-visible { outline: 3px solid var(--lanterna-600); outline-offset: 6px; border-radius: 50%; }
.mascot.mascot--hide { opacity: 0; pointer-events: none; }

.mascot__float {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 22px rgba(10, 31, 27, .5));
  animation: mascot-float 4.5s ease-in-out infinite;
}

.mascot__scale {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transition: transform .25s ease;
}
.mascot:hover .mascot__scale, .mascot:focus-visible .mascot__scale, .mascot.is-talking .mascot__scale { transform: scale(1.08) rotate(-3deg); }

.mascot__face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  transition: opacity .25s ease, transform .25s ease;
}
.mascot__face--peek { opacity: 0; transform: scale(.9); }
.mascot:hover .mascot__face--idle, .mascot:focus-visible .mascot__face--idle, .mascot.is-talking .mascot__face--idle { opacity: 0; }
.mascot:hover .mascot__face--peek, .mascot:focus-visible .mascot__face--peek, .mascot.is-talking .mascot__face--peek { opacity: 1; transform: none; }

/* ── Balão de comentário: só narra a seção, não é clicável ── */
.mascot__bubble {
  position: absolute;
  right: calc(100% + .65rem);
  bottom: 60%;
  transform: translateY(50%) translateX(6px);
  padding: .5rem .9rem;
  border-radius: 999px 999px 4px 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 12px 26px -8px rgba(10, 31, 27, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.mascot:hover .mascot__bubble, .mascot:focus-visible .mascot__bubble, .mascot.is-talking .mascot__bubble { opacity: 1; transform: translateY(50%) translateX(0); }

/* ── Balão de convite: é um link para o formulário, e parece um ──
   visibility (e não só opacity) para sair da árvore de acessibilidade
   enquanto está escondido — leitor de tela não anuncia convite invisível */
.mascot__call {
  max-width: min(15rem, calc(100vw - 2.5rem));
  padding: .6rem 1rem;
  border-radius: 1.1rem 1.1rem .25rem 1.1rem;
  background: var(--lanterna-600);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: right;
  text-decoration: none;
  box-shadow: 0 14px 30px -12px rgba(214, 64, 10, .95);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(.92);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2, .8, .3, 1), visibility 0s linear .28s;
}
.mascot__call.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .28s ease, transform .28s cubic-bezier(.2, .8, .3, 1), visibility 0s;
}
.mascot__call:hover { background: var(--lanterna-700); }
.mascot__call:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.mascot__call span { display: inline-block; animation: mascot-call-seta 2.4s ease-in-out infinite; }

@keyframes mascot-call-seta {
  0%, 100% { transform: translateY(-1px); }
  50%      { transform: translateY(2px); }
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

@media (max-width: 640px) {
  .mascot { width: 58px; height: 58px; }
  /* O comentário some no celular (barulho), mas o convite fica: é ele que converte */
  .mascot__bubble { display: none; }
  .mascot__call { font-size: .76rem; padding: .55rem .85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .mascot__float { animation: none; }
  .mascot__scale, .mascot__face, .mascot__bubble, .mascot__call { transition: none; }
  .mascot__call { transform: none; }
  .mascot__call span { animation: none; }
}
