/* Os botzinhos da equipe (bots.js desenha; aqui eles se mexem). Cada boneco tem data-estado:
   parado (flutua devagar e pisca), pensando (inclina a cabeça, a antena pulsa, três pontinhos), trabalhando (mais
   rápido, o olhar varre), falando (a boca abre e fecha) e desligado (apagado e quieto).
   Quem pede menos movimento (prefers-reduced-motion) fica sem animação: a regra é da casca (tok.css). */

.bot-boneco { display: inline-block; flex: none; line-height: 0; vertical-align: middle; }
.bot-boneco svg { display: block; overflow: visible; }
.bot-boneco :is(.bot-b-tudo, .bot-b-rosto, .bot-b-antena, .bot-b-pisca, .bot-b-boca, .bot-b-luz) { transform-box: fill-box; transform-origin: center; }
.bot-boneco .bot-b-tudo { transform-origin: 50% 90%; }
.bot-boneco .bot-b-antena { transform-origin: 50% 100%; }
.bot-boneco .bot-b-pontos { display: none; }

/* parado: respira e pisca */
.bot-boneco .bot-b-tudo { animation: bot-flutua 4.2s ease-in-out infinite; }
.bot-boneco .bot-b-chao { animation: bot-chao 4.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.bot-boneco .bot-b-pisca { animation: bot-pisca 3.6s infinite; }
.bot-boneco .bot-b-varre { animation: bot-varre 3.2s ease-in-out infinite; }
@keyframes bot-flutua { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes bot-chao { 0%, 100% { transform: scaleX(1); opacity: .14; } 50% { transform: scaleX(.86); opacity: .09; } }
@keyframes bot-pisca { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes bot-varre { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(22px); } }

/* pensando: a cabeça pende, a antena pulsa, os pontinhos aparecem no lugar da boca */
.bot-boneco[data-estado="pensando"] .bot-b-tudo { animation: bot-pensa 2.4s ease-in-out infinite; }
.bot-boneco[data-estado="pensando"] .bot-b-luz { animation: bot-luz 1.1s ease-in-out infinite; }
.bot-boneco:is([data-estado="pensando"], [data-estado="trabalhando"]) .bot-b-boca { display: none; }
.bot-boneco:is([data-estado="pensando"], [data-estado="trabalhando"]) .bot-b-pontos { display: inline; }
.bot-boneco:is([data-estado="pensando"], [data-estado="trabalhando"]) .bot-b-pontos circle { animation: bot-ponto 1.2s ease-in-out infinite; }
.bot-boneco .bot-b-pontos circle:nth-child(2) { animation-delay: .15s !important; }
.bot-boneco .bot-b-pontos circle:nth-child(3) { animation-delay: .3s !important; }
@keyframes bot-pensa { 0%, 100% { transform: rotate(-5deg) translateY(0); } 50% { transform: rotate(5deg) translateY(-2px); } }
@keyframes bot-luz { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes bot-ponto { 0%, 70%, 100% { opacity: .3; } 35% { opacity: 1; } }

/* trabalhando: pula ligeiro, o olhar varre de um lado ao outro */
.bot-boneco[data-estado="trabalhando"] .bot-b-tudo { animation: bot-trabalha .9s ease-in-out infinite; }
.bot-boneco[data-estado="trabalhando"] .bot-b-olhos { animation: bot-olha 1.4s ease-in-out infinite; }
.bot-boneco[data-estado="trabalhando"] .bot-b-luz { animation: bot-luz .5s ease-in-out infinite; }
.bot-boneco[data-estado="trabalhando"] .bot-b-antena { animation: bot-antena .9s ease-in-out infinite; }
@keyframes bot-trabalha { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-5px) scaleY(1.02); } }
@keyframes bot-olha { 0%, 100% { transform: translateX(-2.5px); } 50% { transform: translateX(2.5px); } }
@keyframes bot-antena { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }

/* falando: a boca abre e fecha */
.bot-boneco[data-estado="falando"] .bot-b-boca { animation: bot-fala .42s ease-in-out infinite; }
.bot-boneco[data-estado="falando"] .bot-b-tudo { animation: bot-flutua 1.6s ease-in-out infinite; }
@keyframes bot-fala { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(.7, 3.2); } }

/* desligado: sem cor, sem movimento */
.bot-boneco[data-estado="desligado"] { filter: grayscale(1); opacity: .5; }
.bot-boneco[data-estado="desligado"] :is(.bot-b-tudo, .bot-b-chao, .bot-b-pisca, .bot-b-varre) { animation: none; }
.bot-boneco[data-estado="desligado"] .bot-b-pisca { transform: scaleY(.12); }

/* Com o ponteiro em cima de um cartão de agente, o boneco acorda. */
:is(a, button, .eq-cartao):hover > .bot-boneco[data-estado="parado"] .bot-b-tudo,
.eq-cartao:hover .bot-boneco[data-estado="parado"] .bot-b-tudo { animation: bot-trabalha .9s ease-in-out infinite; }
