/* ============================================================
   Desafio das Estrelas — animações discretas
   Todas desativadas sob prefers-reduced-motion.
   ============================================================ */

/* Scanline / flicker CRT sutil sobre toda a tela */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.06) 3px
  );
  animation: piscar-tela 6s infinite steps(60);
  opacity: 0.5;
}

@keyframes piscar-tela {
  0%, 96%, 100% { opacity: 0.5; }
  97% { opacity: 0.28; }
  98% { opacity: 0.6; }
}

/* Notificações surgindo */
.notificacao {
  animation: slide-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.notificacao--saindo { animation: slide-out 0.3s ease forwards; }

@keyframes slide-in {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slide-out {
  to { transform: translateX(120%); opacity: 0; }
}

/* Modal abrindo (documentos abrindo) */
.modal:not([hidden]) .modal__caixa {
  animation: abrir-doc 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes abrir-doc {
  from { transform: scale(0.94) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal:not([hidden]) .modal__fundo { animation: aparecer 0.25s ease; }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }

/* Máquina de escrever: cursor ao final do texto sendo digitado */
.digitando::after {
  content: "▋";
  color: var(--verde-terminal);
  animation: piscar-cursor 0.8s steps(1) infinite;
}

/* Pulso do status "em investigação" */
.status--investigando { animation: pulso-alerta 2.2s ease-in-out infinite; }
@keyframes pulso-alerta { 50% { opacity: 0.55; } }

/* Destaque ao revelar dígito/pista */
.revelar { animation: revelar-flash 0.6s ease; }
@keyframes revelar-flash {
  0% { transform: scale(1.4); filter: brightness(2); }
  100% { transform: scale(1); filter: brightness(1); }
}

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; opacity: 0.35; }
  .notificacao, .notificacao--saindo,
  .modal:not([hidden]) .modal__caixa,
  .modal:not([hidden]) .modal__fundo,
  .status--investigando, .revelar { animation: none !important; }
  html { scroll-behavior: auto; }
}
