/* ==========================================================================
   G Apps · Site Principal — animações
   Só animações automáticas (nada para a pessoa mexer). Tudo some com
   "reduzir movimento" do sistema (bloco no fim).
   ========================================================================== */

@property --ang {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* Troca de tema com revelação circular (View Transitions) */
:root.vt-tema::view-transition-old(root),
:root.vt-tema::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------------------------------------------------------------- Revelação ao rolar
   ".fx" é colocado pelo tema.js (só com movimento liberado). Sem JS, tudo aparece normal. */
.fx [data-reveal],
.fx [data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(8px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease);
}
.fx [data-reveal-stagger] > * { transition-delay: calc(var(--i, 0) * 90ms); }
.fx [data-reveal].is-in,
.fx [data-reveal-stagger] > .is-in { opacity: 1; transform: none; filter: none; }

/* Palavras dos títulos */
.w { display: inline-block; }
.fx .is-split .w {
  opacity: 0;
  transform: translateY(0.42em) rotate(3deg);
  filter: blur(10px);
  transition: opacity 0.8s var(--ease), transform 0.9s var(--ease), filter 0.8s var(--ease);
  transition-delay: calc(var(--i, 0) * 75ms + 80ms);
}
.fx .is-split.is-in .w { opacity: 1; transform: none; filter: none; }
.is-split em { background: none; color: inherit; }
.is-split em .w {
  background: var(--em-grad, var(--text-grad));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}

/* Conversa do robô (G Delivery): mensagens entram uma por uma quando a seção aparece */
.fx .vis-delivery .msg { opacity: 0; transform: translateY(10px) scale(0.96); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease-bounce); }
.fx .vis-delivery.is-in .msg { opacity: 1; transform: none; }
.fx .vis-delivery.is-in .msg:nth-of-type(2) { transition-delay: 0.5s; }
.fx .vis-delivery.is-in .msg:nth-of-type(3) { transition-delay: 1.1s; }
.fx .vis-delivery.is-in .msg:nth-of-type(4) { transition-delay: 1.7s; }
.fx .vis-delivery .vd-pedido { opacity: 0; transform: translateY(24px) rotate(2.5deg); transition: opacity 0.6s var(--ease) 2.2s, transform 0.8s var(--ease-bounce) 2.2s; }
.fx .vis-delivery.is-in .vd-pedido { opacity: 1; transform: rotate(2.5deg); }

/* Agenda do G Post: itens entram em sequência */
.fx .vis-post .vp-lista li { opacity: 0; transform: translateX(16px); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.fx .vis-post.is-in .vp-lista li { opacity: 1; transform: none; }
.fx .vis-post.is-in .vp-lista li:nth-child(2) { transition-delay: 0.15s; }
.fx .vis-post.is-in .vp-lista li:nth-child(3) { transition-delay: 0.3s; }
.fx .vis-post.is-in .vp-lista li:nth-child(4) { transition-delay: 0.45s; }
.fx .vis-post .vp-post { opacity: 0; transform: translateY(24px) rotate(-3deg); transition: opacity 0.6s var(--ease) 0.7s, transform 0.8s var(--ease-bounce) 0.7s; }
.fx .vis-post.is-in .vp-post { opacity: 1; transform: rotate(-3deg); }

/* ---------------------------------------------------------------- Entrada da página */
.fx .topo-in { animation: desce 0.9s var(--ease) both; }

/* ---------------------------------------------------------------- Fundo vivo */
.orb-a { animation: orb-a 26s ease-in-out infinite alternate; }
.orb-b { animation: orb-b 32s ease-in-out infinite alternate; }
.orb-c { animation: orb-c 30s ease-in-out infinite alternate; }
.marquee-trilho { animation: marquee 42s linear infinite; }

/* Bordas e anéis giratórios */
.plano::before,
.login-anel { animation: gira 5s linear infinite; }

/* Cena do hero */
.hv-chip-d { animation: flutua 5s ease-in-out infinite; }
.hv-chip-p { animation: flutua 5.6s ease-in-out -2s infinite; }
.hv-chip.pulsou { animation: chip-pulsa 0.6s var(--ease-bounce), flutua 5s ease-in-out 0.6s infinite; }
.gp-phone { animation: flutua-leve 7s ease-in-out infinite; }

/* Chamada final */
.cta-logos img:first-child { animation: balanca-a 6s ease-in-out infinite; }
.cta-logos img:last-child { animation: balanca-b 6s ease-in-out infinite; }

/* Login */
.login[open] .login-card { animation: login-entra 0.6s var(--ease-bounce); }
.login[open]::backdrop { animation: fade 0.35s ease; }
.girando { animation: spin 0.8s linear infinite; }

/* Avisos */
.aviso { animation: aviso-entra 0.55s var(--ease-bounce) both; }
.aviso.sai { animation: aviso-sai 0.35s var(--ease) forwards; }

/* Painel de demonstração */
.dpc.entra { animation: dpc-entra 0.65s var(--ease-bounce) both; }
.dpc.sai { animation: dpc-sai 0.45s var(--ease) forwards; }

/* ---------------------------------------------------------------- Keyframes */
@keyframes gira { to { --ang: 360deg; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes desce { from { opacity: 0; transform: translateY(-14px); } }
@keyframes pulso {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70%, 100% { box-shadow: 0 0 0 8px transparent; }
}
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes orb-a { to { transform: translate3d(12vmax, 8vmax, 0) scale(1.12); } }
@keyframes orb-b { to { transform: translate3d(-10vmax, 12vmax, 0) scale(0.9); } }
@keyframes orb-c { to { transform: translate3d(8vmax, -10vmax, 0) scale(1.15); } }
@keyframes flutua { 50% { transform: translateY(-8px); } }
@keyframes flutua-leve { 50% { transform: translateY(-6px) rotate(0.6deg); } }
@keyframes balanca-a { 50% { transform: rotate(-12deg) translateY(-4px); } }
@keyframes balanca-b { 50% { transform: rotate(12deg) translateY(2px); } }
@keyframes chip-pulsa { 0% { transform: scale(0.9); } 60% { transform: scale(1.06); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-8px) scale(0.94); } }
@keyframes folha-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes login-entra { from { opacity: 0; transform: translateY(24px) scale(0.94); } }
@keyframes aviso-entra { from { opacity: 0; transform: translateY(-16px) scale(0.92); } }
@keyframes aviso-sai { to { opacity: 0; transform: translateY(-12px) scale(0.96); } }
@keyframes numero-pulsa { 40% { transform: scale(1.08); color: var(--accent-bright); } }
@keyframes dpc-entra { from { opacity: 0; transform: translateY(-14px) scale(0.9); filter: blur(4px); } }
@keyframes dpc-sai { to { opacity: 0; transform: translateX(24px) scale(0.9); filter: blur(4px); } }
@keyframes gp-entra { from { opacity: 0; transform: translateY(18px) scale(0.92); } }
@keyframes gp-sai { to { opacity: 0; transform: translateY(-14px) scale(0.95); max-height: 0; margin-top: -8px; padding: 0; } }

/* ---------------------------------------------------------------- Movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .marquee-trilho { animation: none !important; }
  .marquee { overflow-x: auto; }
}
