/* ─────────────────────────────────────────────
   Bhāṣā — Animations & Transitions
   Keyframes and motion only. No layout or colour.
───────────────────────────────────────────── */

/* ── Screen transitions ── */
@keyframes screen-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes screen-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

.screen-entering {
  animation: screen-in var(--transition-normal) ease both;
}

.screen-exiting {
  animation: screen-out var(--transition-fast) ease both;
}

/* ── Mic ring animations ── */
@keyframes ring-pulse {
  0%   { opacity: 0.85; transform: scale(1);    }
  50%  { opacity: 1;    transform: scale(1.06); }
  100% { opacity: 0.85; transform: scale(1);    }
}

@keyframes ring-idle-breathe {
  0%   { opacity: 0.22; }
  50%  { opacity: 0.35; }
  100% { opacity: 0.22; }
}

.mic-rings .mic-arc {
  transform-origin: 80px 80px;
  animation: ring-idle-breathe 3.2s ease-in-out infinite;
  transition: opacity var(--transition-normal);
}

.mic-rings.listening .mic-arc {
  animation: ring-pulse 1.1s ease-in-out infinite;
}

.mic-rings.listening .mic-arc:nth-child(3n+2) {
  animation-delay: 0.18s;
}

.mic-rings.listening .mic-arc:nth-child(3n+3) {
  animation-delay: 0.36s;
}

/* ── Tutor thinking dots ── */
@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: 0.4; }
  40%            { transform: translateY(-5px); opacity: 1;   }
}

.thinking-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--color-text-3);
  margin: 0 2px;
  animation: dot-bounce 1.2s ease-in-out infinite;
}

.thinking-dot:nth-child(2) { animation-delay: 0.16s; }
.thinking-dot:nth-child(3) { animation-delay: 0.32s; }

/* ── Toast ── */
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) translateX(-50%); }
  to   { opacity: 1; transform: translateY(0)    translateX(-50%); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0)    translateX(-50%); }
  to   { opacity: 0; transform: translateY(8px)  translateX(-50%); }
}

.toast.visible {
  animation: toast-in 200ms ease both;
}

.toast.hiding {
  animation: toast-out 180ms ease both;
}

/* ── Onboarding step fade ── */
@keyframes step-in {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}

.onboarding-step.active {
  animation: step-in 320ms ease both;
}

/* ── Logo breathe on home ── */
@keyframes logo-breathe {
  0%   { opacity: 0.82; }
  50%  { opacity: 1; }
  100% { opacity: 0.82; }
}

.app-bar-logo {
  animation: logo-breathe 4s ease-in-out infinite;
}

/* ── Mic hint nudge ── */
@keyframes hint-nudge {
  0%, 100% { transform: translateY(0); }
  30%       { transform: translateY(-4px); }
  60%       { transform: translateY(0); }
}

.mic-btn.hint {
  animation: hint-nudge 1s ease 1;
}

/* ── Button press feedback ── */
.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.97);
  transition: transform 80ms ease;
}

.icon-btn:active {
  transform: scale(0.90);
  transition: transform 80ms ease;
}

/* ── Unlock screen fade in ── */
@keyframes unlock-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.unlock-container {
  animation: unlock-in 360ms ease both;
}
