/* =========================================================
   Movimento, hover, foco e estados da página da Aira.
   Discreto de propósito: entrada curta (js/motion.js), hovers sutis
   e os estados do formulário. O CSS estático já é o estado final.
   ========================================================= */

:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --focus-ring: 0 0 0 3px #f7f7f7, 0 0 0 5px var(--color-green);
}

/* ---------- Sem piscar no carregamento ----------
   A classe js-motion entra no <head> antes da primeira pintura; o motion.js
   cria as animações e a remove no mesmo instante (trava de 2,5 s se falhar). */
.js-motion .eyebrow,
.js-motion .hero__title,
.js-motion .hero__lead,
.js-motion .waitlist,
.js-motion .showcase__item {
  opacity: 0;
}

/* ---------- Foco pelo teclado ---------- */
:focus-visible {
  outline: none;
}

a:focus-visible,
button:focus-visible {
  box-shadow: var(--focus-ring);
}

.nav__link:focus-visible {
  color: var(--color-forest);
  background: rgba(20, 75, 32, 0.06);
}

.button--ghost:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(20, 75, 32, 0.22), var(--focus-ring);
}

.button--primary:focus-visible {
  box-shadow: var(--shadow-inset-light), 0 0 0 3px #f5f5f5, 0 0 0 5px var(--color-leaf);
}

.button--lime:focus-visible {
  box-shadow: inset 0 4.62px 4.735px rgba(255, 255, 255, 0.41), 0 0 0 3px #ffffff, 0 0 0 5px var(--color-green);
}

.announce:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-lime);
}

/* ---------- Faixa de novidade ---------- */
.announce__arrow img {
  transition: translate 0.3s var(--ease-out);
}

.announce:hover .announce__arrow img {
  translate: 2px 0;
}

/* ---------- Navegação: pílula que segue o link ---------- */
.nav__links {
  position: relative;
}

.nav__links::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: var(--iw, 0px);
  height: 28px;
  border-radius: 955px;
  background: rgba(20, 75, 32, 0.05);
  translate: var(--ix, 0px) 0;
  opacity: var(--io, 0);
  transition: translate 0.35s var(--ease-out), width 0.35s var(--ease-out), opacity 0.2s var(--ease-soft);
  pointer-events: none;
}

.nav__links.has-indicator .nav__link:hover {
  background: transparent;
}

.nav__link img {
  transition: rotate 0.3s var(--ease-out);
}

.nav__link:hover img,
.nav__link:focus-visible img {
  rotate: 180deg;
}

/* ---------- Botões ---------- */
.button {
  transition:
    background-color 0.25s var(--ease-soft),
    box-shadow 0.25s var(--ease-soft),
    translate 0.3s var(--ease-out),
    scale 0.15s var(--ease-out);
}

.button:hover {
  translate: 0 -1px;
}

.button:active {
  scale: 0.98;
  translate: 0 0;
}

.button-ring {
  transition: border-color 0.25s var(--ease-soft);
}

.button-ring:hover {
  border-color: rgba(20, 75, 32, 0.4);
}

/* ---------- Mascote ---------- */
.hero__mascot {
  transition: scale 0.35s var(--ease-out);
}

.hero__mascot:hover {
  scale: 1.04;
}

/* ---------- Lista de espera: foco, erro, carregando, sucesso ---------- */
.waitlist {
  z-index: 3;
  transition: border-color 0.3s var(--ease-soft), box-shadow 0.3s var(--ease-soft);
}

.waitlist__input::placeholder {
  transition: opacity 0.25s var(--ease-soft);
}

.waitlist:focus-within {
  border-color: rgba(140, 207, 91, 0.9);
  box-shadow: 0 0 0 5px rgba(182, 251, 130, 0.25);
}

.waitlist:focus-within .waitlist__input::placeholder {
  opacity: 0.5;
}

.waitlist__input:focus-visible {
  box-shadow: none;
}

.waitlist__status {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 8px;
  border-radius: 99px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(20, 75, 32, 0.08);
  color: var(--color-green-text);
  font-size: 14px;
  line-height: 18px;
  white-space: nowrap;
  translate: -50% -4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-soft), translate 0.3s var(--ease-out);
}

.waitlist__status.is-visible {
  opacity: 1;
  translate: -50% 0;
}

.waitlist__status-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-lime);
  color: var(--color-forest);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.waitlist__status-icon::before {
  content: "✓";
}

.waitlist.is-error {
  border-color: rgba(214, 84, 56, 0.55);
  box-shadow: 0 0 0 5px rgba(214, 84, 56, 0.08);
}

.waitlist.is-error .waitlist__input {
  color: #a4351f;
}

.waitlist.is-error .waitlist__status {
  color: #a4351f;
  box-shadow: inset 0 0 0 1px rgba(214, 84, 56, 0.22);
}

.waitlist.is-error .waitlist__status-icon {
  background: #fde3dc;
  color: #a4351f;
}

.waitlist.is-error .waitlist__status-icon::before {
  content: "!";
}

.waitlist.is-shaking {
  animation: shake 0.35s var(--ease-soft);
}

@keyframes shake {
  0%, 100% { translate: 0 0; }
  25% { translate: -4px 0; }
  50% { translate: 3px 0; }
  75% { translate: -2px 0; }
}

.waitlist__btn-content,
.waitlist__btn-loading,
.waitlist__btn-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13.86px;
  transition: opacity 0.25s var(--ease-soft), translate 0.3s var(--ease-out);
}

.waitlist__btn-loading,
.waitlist__btn-done {
  position: absolute;
  inset: 0;
  opacity: 0;
  translate: 0 6px;
}

.waitlist__btn-done {
  gap: 8px;
  color: var(--color-forest);
}

.waitlist.is-loading .waitlist__btn-content,
.waitlist.is-success .waitlist__btn-content {
  opacity: 0;
  translate: 0 -6px;
}

.waitlist.is-loading .waitlist__btn-loading,
.waitlist.is-success .waitlist__btn-done {
  opacity: 1;
  translate: 0 0;
}

.waitlist.is-success .button--lime {
  pointer-events: none;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.2px solid rgba(44, 118, 60, 0.22);
  border-top-color: var(--color-green-text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { rotate: 360deg; }
}

/* ---------- Vitrine: hover sutil, sem mudar a inclinação ---------- */
.showcase__stage .word-card,
.showcase__pill-ai,
.showcase__pill-vocab,
.showcase__pill-realtime,
.showcase__ai-card,
.showcase__tag-verbos {
  transition: translate 0.35s var(--ease-out);
}

.showcase__stage .word-card:hover,
.showcase__pill-ai:hover,
.showcase__pill-vocab:hover,
.showcase__pill-realtime:hover,
.showcase__ai-card:hover,
.showcase__tag-verbos:hover {
  translate: 0 -3px;
}

/* ---------- Rodapé: holofote suave no logotipo grande ---------- */
.footer__wordmark-wrap {
  position: relative;
}

.footer__spotlight {
  position: absolute;
  inset: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(140, 207, 91, 0.35), transparent 70%);
  -webkit-mask: url("../assets/images/aira-wordmark-mask.svg") center / 100% 100% no-repeat;
  mask: url("../assets/images/aira-wordmark-mask.svg") center / 100% 100% no-repeat;
  opacity: 0;
  transition: opacity 0.4s var(--ease-soft);
  pointer-events: none;
}

.footer__wordmark-wrap:hover .footer__spotlight {
  opacity: 1;
}

@media (max-width: 480px) {
  .waitlist__status {
    white-space: normal;
    width: max-content;
    max-width: calc(100vw - 32px);
  }
}

@media (hover: none) {
  .showcase__stage .word-card:hover,
  .showcase__pill-ai:hover,
  .showcase__pill-vocab:hover,
  .showcase__pill-realtime:hover,
  .showcase__ai-card:hover,
  .showcase__tag-verbos:hover {
    translate: none;
  }
}

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}

/* =========================================================
   Vida nos cartões e na tela do app
   ========================================================= */

/* Flutuação lenta dos cartões (a inclinação de cada um é preservada) */
.showcase.is-alive .showcase__float-card {
  animation: drift var(--drift-dur, 9s) ease-in-out var(--drift-delay, 0s) infinite alternate;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(var(--drift-amp, -6px)); }
}

.showcase__card-accomplish { --drift-dur: 10s; --drift-amp: -7px; --drift-delay: 0.9s; }
.showcase__card-challenge { --drift-dur: 8.5s; --drift-amp: -5px; --drift-delay: 0s; }
.showcase__card-brilliant { --drift-dur: 11s; --drift-amp: -8px; --drift-delay: 1.6s; }
.showcase__pill-ai { --drift-dur: 7s; --drift-amp: -5px; --drift-delay: 0.4s; }
.showcase__pill-vocab { --drift-dur: 7.8s; --drift-amp: -5px; --drift-delay: 1.2s; }
.showcase__pill-realtime { --drift-dur: 8.2s; --drift-amp: -6px; --drift-delay: 2s; }
.showcase__ai-card { --drift-dur: 9.5s; --drift-amp: -4px; --drift-delay: 0.7s; }
.showcase__tag-verbos { --drift-dur: 7.4s; --drift-amp: -7px; --drift-delay: 1.4s; }

.showcase.is-paused .showcase__float-card {
  animation-play-state: paused;
}

/* Cartão de palavra: o botão de pronúncia acende no hover */
.showcase__stage .word-card__listen,
.showcase__stage .word-card__listen-icon {
  transition: background-color 0.3s var(--ease-soft), color 0.3s var(--ease-soft);
}

.showcase__stage .word-card:hover .word-card__listen {
  background: var(--color-forest-2);
  color: #ffffff;
}

.showcase__stage .word-card:hover .word-card__listen-icon {
  color: var(--color-lime);
}

/* Cartão da IA: digitação e envio */
.ai-card__typing.is-typing::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 10px;
  margin-left: 1.5px;
  vertical-align: -1.5px;
  border-radius: 1px;
  background: #23923b;
  animation: caret 1s steps(1) infinite;
}

@keyframes caret {
  50% { opacity: 0; }
}

.ai-card__send span {
  transition: scale 0.18s var(--ease-out), background-color 0.25s var(--ease-soft);
}

.ai-card.is-sending .ai-card__send span {
  scale: 0.88;
  background: var(--color-forest-2);
}

/* ---------- Quiz do app ---------- */
.quiz__count {
  margin-left: 4px;
  font-weight: 400;
  color: rgba(22, 79, 34, 0.5);
  font-variant-numeric: tabular-nums;
}

.quiz__title img {
  transition: opacity 0.25s var(--ease-soft);
}

.quiz__progress {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(22, 79, 34, 0.07);
}

.quiz__progress span {
  display: block;
  width: 33.4%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-leaf), var(--color-lime));
  transition: width 0.8s var(--ease-out);
}

.quiz__toast {
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--color-forest-2);
  color: #ffffff;
  font-size: 8.4px;
  line-height: 10px;
  white-space: nowrap;
  opacity: 0;
  translate: 0 4px;
  scale: 0.9;
  transition: opacity 0.3s var(--ease-soft), translate 0.4s var(--ease-out), scale 0.4s var(--ease-out);
}

.quiz__toast b {
  font-weight: 600;
  color: var(--color-lime);
}

.quiz.is-correct .quiz__toast {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}

.quiz__option {
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.3s var(--ease-soft),
    color 0.3s var(--ease-soft),
    box-shadow 0.3s var(--ease-soft),
    opacity 0.3s var(--ease-soft),
    scale 0.2s var(--ease-out);
}

.quiz__check {
  flex: none;
  width: 0;
  margin-right: 0;
  opacity: 0;
  color: var(--color-lime);
  transition: width 0.3s var(--ease-out), margin 0.3s var(--ease-out), opacity 0.25s var(--ease-soft);
}

.quiz__option.is-pressed {
  scale: 0.95;
}

.quiz__option.is-correct {
  background: var(--color-forest-2);
  color: #ffffff;
  box-shadow: none;
}

.quiz__option.is-correct .quiz__check {
  width: 12px;
  margin-right: 4px;
  opacity: 1;
}

.quiz__option.is-dim {
  opacity: 0.5;
}

.quiz__listen {
  position: relative;
}

.quiz__listen::before,
.quiz__listen::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1.5px solid rgba(240, 205, 20, 0.7);
  opacity: 0;
  pointer-events: none;
}

.quiz__listen.is-speaking::before {
  animation: wave 1.2s var(--ease-out);
}

.quiz__listen.is-speaking::after {
  animation: wave 1.2s var(--ease-out) 0.25s;
}

@keyframes wave {
  from { opacity: 1; scale: 1; }
  to { opacity: 0; scale: 1.75; }
}

/* Sequência (foguinho) sobe depois do acerto */
.phone__streak-count {
  display: inline-block;
  height: 16.1px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.phone__streak-count span {
  display: block;
}

.phone__chip--streak img {
  transform-origin: 50% 85%;
}

.phone__chip--streak.is-bumped img {
  animation: flame 0.7s var(--ease-out);
}

@keyframes flame {
  0% { scale: 1; }
  40% { scale: 1.25; rotate: -6deg; }
  100% { scale: 1; rotate: 0deg; }
}
