/* ==========================================================================
   CORP360 — ANIMAÇÕES E MICROINTERAÇÕES (animations.css)
   --------------------------------------------------------------------------
   • Scroll reveal: adicione data-reveal="up|down|left|right|zoom|fade" em
     qualquer elemento. O atraso opcional vai em style="--d:.2s".
   • Transição entre páginas: entrada suave automática em todo <main>.
   • Tudo é desativado automaticamente para quem prefere menos movimento
     (configuração de acessibilidade do sistema: prefers-reduced-motion).
   ========================================================================== */

/* ===== 1. Transição entre páginas (entrada e saída) ===== */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .22s ease both; }
::view-transition-new(root) { animation: vt-in .38s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* body: só opacidade (não usar transform no body para não deslocar o menu fixo) */
.js body { animation: page-fade-in .45s ease both; }
.js main { animation: page-in .6s var(--ease) both; }
.js.is-leaving body { animation: page-fade-out .22s ease forwards; }
@keyframes page-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes page-fade-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ===== 2. Scroll reveal (IntersectionObserver em js/main.js) ===== */
.js [data-reveal] { opacity: 0; transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); will-change: opacity, transform; }
.js [data-reveal="up"] { transform: translateY(34px); }
.js [data-reveal="down"] { transform: translateY(-34px); }
.js [data-reveal="left"] { transform: translateX(-44px); }
.js [data-reveal="right"] { transform: translateX(44px); }
.js [data-reveal="zoom"] { transform: scale(.92); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ===== 3. Efeitos contínuos ===== */
.float { animation: float 6s ease-in-out infinite; }
.float--slow { animation-duration: 8s; animation-delay: -2s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.spin-slow { animation: spin 22s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pulse-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 0 rgba(34, 197, 94, .7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* Brilho que atravessa o botão principal */
.btn--shine::after { content: ""; position: absolute; top: 0; left: -70%; z-index: -1; width: 45%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .6), transparent); transform: skewX(-20deg); animation: shine 3.6s ease-in-out infinite; }
@keyframes shine { 0%, 60% { left: -70%; } 100% { left: 140%; } }

/* Faixa de clientes rolando */
.marquee__track { animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Sino de notícias */
.ring { animation: ring 3.5s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ring { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(14deg); } 88% { transform: rotate(-12deg); } 92% { transform: rotate(8deg); } 96% { transform: rotate(-4deg); } }

/* Gradiente animado no destaque do título */
.text-gradient { background: linear-gradient(90deg, var(--c-yellow-500), #FFE27A, var(--c-cyan-400), var(--c-yellow-500)); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: grad 8s ease infinite; }
@keyframes grad { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Brilho em cards ao passar o mouse (segue o cursor via --mx/--my no JS) */
.glow { position: relative; }
.glow::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(253, 197, 10, .14), transparent 45%); opacity: 0; transition: opacity .3s; }
.glow:hover::before { opacity: 1; }

/* Entrada dos painéis de abas */
.tabs__panel.is-entering { animation: tab-in .45s var(--ease) both; }
@keyframes tab-in { from { opacity: 0; transform: translateY(10px); } }

/* Resultado do diagnóstico */
.pop-in { animation: pop-in .5s var(--ease) both; }
@keyframes pop-in { from { opacity: 0; transform: scale(.96) translateY(10px); } }

/* ===== 4. Acessibilidade: menos movimento ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .marquee__track { animation: none; flex-wrap: wrap; width: auto; }
  @view-transition { navigation: none; }
}

/* ===== 5. Celular: entradas laterais viram verticais (evita página mais larga que a tela) ===== */
main { overflow-x: clip; }
@media (max-width: 760px) {
  .js [data-reveal="left"], .js [data-reveal="right"] { transform: translateY(28px); }
}
