/* Conjoin · Movimento
   Responsivo e curto (150–250 ms). Único momento coreografado: "Deu match!".
   Com movimento reduzido (sistema ou opção do app), tudo vira troca instantânea ou crossfade. */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes scan { from { top: 22%; } to { top: 76%; } }

/* Entrada de tela: só opacidade e um deslocamento mínimo */
@keyframes screen-in { from { opacity: 0; transform: translateX(var(--screen-shift, 12px)); } to { opacity: 1; transform: none; } }
.screen.is-entering { animation: screen-in 220ms var(--ease-out) both; }
.screen.is-entering[data-dir="back"] { --screen-shift: -12px; }
.screen.is-entering[data-dir="tab"] { --screen-shift: 0px; animation-duration: 160ms; }

/* Momento do match */
@keyframes match-left { from { opacity: 0; transform: translateX(-56px) rotate(-16deg); } to { opacity: 1; transform: rotate(-8deg); } }
@keyframes match-right { from { opacity: 0; transform: translateX(56px) rotate(16deg); } to { opacity: 1; transform: rotate(8deg); } }
@keyframes match-pop { 0% { opacity: 0; transform: translateX(-50%) scale(0.4); } 100% { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes confetti { from { opacity: 0; transform: translateY(18px) rotate(var(--r, 0deg)); } 40% { opacity: 1; } to { opacity: 0.9; transform: translateY(0) rotate(var(--r, 0deg)); } }

.match.is-animated .match-card.is-person { animation: match-left 600ms var(--ease-out-expo) both; }
.match.is-animated .match-card.is-company { animation: match-right 600ms var(--ease-out-expo) both; }
.match.is-animated .match-link { animation: match-pop 420ms var(--ease-out-expo) 360ms both; }
.match.is-animated .match-confetti i { animation: confetti 700ms var(--ease-out) 420ms both; }
.match.is-animated .match-rise { animation: rise 400ms var(--ease-out) both; }
.match.is-animated .match-rise:nth-of-type(2) { animation-delay: 80ms; }
.match.is-animated .match-rise.d1 { animation-delay: 480ms; }
.match.is-animated .match-rise.d2 { animation-delay: 560ms; }
.match.is-animated .match-rise.d3 { animation-delay: 640ms; }

/* Movimento reduzido: sistema */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* Movimento reduzido: opção do app */
:root.reduce-motion *, :root.reduce-motion *::before, :root.reduce-motion *::after {
  animation-duration: 1ms !important;
  animation-delay: 0ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 1ms !important;
  scroll-behavior: auto !important;
}
