/* Camada de movimento e 3D. Só complementa o layout aprovado: sem JS ou com "reduzir movimento",
   tudo fica como antes (base.css zera animações em prefers-reduced-motion). */

@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

/* ---------- Hero: globo 3D, grade em perspectiva e luz que segue o cursor ---------- */
.hero { --hero-rgb: 106, 69, 245; --hero-rgb-2: 42, 95, 232; }
.t-hero { --hero-rgb: 42, 95, 232; --hero-rgb-2: 106, 69, 245; }
.sob-hero { --hero-rgb: 75, 63, 214; --hero-rgb-2: 42, 95, 232; }
.hero > .container { position: relative; z-index: 2; }
.hero-3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
  -webkit-mask-image: radial-gradient(120% 90% at 70% 40%, #000 45%, transparent 85%);
          mask-image: radial-gradient(120% 90% at 70% 40%, #000 45%, transparent 85%); }
.hero::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(520px circle at var(--px, 72%) var(--py, 30%), rgba(var(--hero-rgb), .09), transparent 62%);
  transition: background .2s linear; }
.hero::after { content: ''; position: absolute; left: -20%; right: -20%; bottom: -2px; height: 46%; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(var(--hero-rgb), .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--hero-rgb), .16) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(520px) rotateX(62deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 85%);
          mask-image: linear-gradient(to top, #000 0%, transparent 85%);
  opacity: .55; animation: grid-run 6s linear infinite; }
@keyframes grid-run { to { background-position: 0 56px, 0 0; } }

/* Título com degradê em movimento suave */
.text-gradient, .t-gradient { background-size: 200% 100%; animation: text-flow 8s ease-in-out infinite alternate; }
.text-gradient { background-image: linear-gradient(100deg, #6A45F5 0%, #2A5FE8 50%, #6A45F5 100%); }
.t-gradient { background-image: linear-gradient(100deg, #2A5FE8 0%, #6A45F5 50%, #2A5FE8 100%); }
@keyframes text-flow { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

/* ---------- Ilustrações do hero em 3D (inclinação pelo cursor + profundidade + flutuação) ---------- */
.hero-visual, .approval-wrap, .hub-wrap, .dash-wrap {
  transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
.hero-visual__glow, .approval-wrap__glow, .hub-wrap__glow, .dash-wrap__glow { translate: 0 0 -60px; }
.mock--site { translate: 0 0 10px; }
.mock--quote { translate: 0 0 70px; animation: float-a 7s ease-in-out infinite; }
.mock--panel { translate: 0 0 50px; animation: float-b 8s ease-in-out infinite; }
.approval, .hub { translate: 0 0 30px; }
.dash { translate: 0 0 10px; }
.dash-int { translate: 0 0 80px; animation: float-a 7s ease-in-out infinite; }
@keyframes float-a { 0%, 100% { translate: 0 0 70px; } 50% { translate: 0 -10px 70px; } }
@keyframes float-b { 0%, 100% { translate: 0 0 50px; } 50% { translate: 0 8px 50px; } }

/* Microanimações dentro das ilustrações */
.mock__chart span, .dash__chart span { transform-origin: 50% 100%; animation: bar-grow 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.mock__chart span:nth-child(2), .dash__chart span:nth-child(2) { animation-delay: .08s; }
.mock__chart span:nth-child(3), .dash__chart span:nth-child(3) { animation-delay: .16s; }
.mock__chart span:nth-child(4), .dash__chart span:nth-child(4) { animation-delay: .24s; }
.mock__chart span:nth-child(5), .dash__chart span:nth-child(5) { animation-delay: .32s; }
.mock__chart span:nth-child(6), .dash__chart span:nth-child(6) { animation-delay: .40s; }
.mock__chart span:nth-child(7), .dash__chart span:nth-child(7) { animation-delay: .48s; }
.mock__chart .is-top, .dash__chart .is-top { animation: bar-grow 1.1s cubic-bezier(.2, .8, .2, 1) .5s both, bar-glow 3s ease-in-out 1.6s infinite; }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes bar-glow { 0%, 100% { filter: none; } 50% { filter: brightness(1.18) drop-shadow(0 0 8px rgba(106, 69, 245, .45)); } }

.approval__line, .approval__text, .mock__site-body .bar--dark {
  background-image: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .38) 50%, transparent 100%);
  background-size: 220% 100%; background-repeat: no-repeat; animation: shimmer 2.8s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 160% 0; } to { background-position: -60% 0; } }

.dash-int__line { background-size: 10px 2px; animation: dash-flow .8s linear infinite; }
@keyframes dash-flow { to { background-position: 10px 0; } }
.dash-int__node--brand { animation: node-pulse 2.4s ease-in-out infinite; }
@keyframes node-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(106, 69, 245, .35); } 50% { box-shadow: 0 0 0 8px rgba(106, 69, 245, 0); } }

.dash-int__ok, .dash__chip, .approval__chip { display: inline-flex; align-items: center; gap: 6px; }
.dash-int__ok::before, .dash__chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: ping 1.8s ease-out infinite; }
@media (min-width: 561px) { .dash__chip { display: none; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(23, 112, 60, .45); } 100% { box-shadow: 0 0 0 7px rgba(23, 112, 60, 0); } }

.hub__tile:not(.hub__tile--soon) .hub__icon { animation: tile-glow 6s ease-in-out infinite; }
.hub__tile--blue .hub__icon { animation-delay: 2s; }
.hub__tile--indigo .hub__icon { animation-delay: 4s; }
@keyframes tile-glow { 0%, 22%, 100% { box-shadow: none; transform: none; } 10% { box-shadow: 0 10px 24px -8px rgba(var(--hero-rgb), .7); transform: translateY(-3px); } }

.tp-meter__bar span { animation: meter 3.2s cubic-bezier(.2, .8, .2, 1) infinite alternate; }
@keyframes meter { from { width: 18%; } to { width: 62%; } }

/* ---------- Cards com inclinação 3D e brilho que segue o cursor (só com mouse) ---------- */
.tilt { position: relative; }
.tilt::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(106, 69, 245, .09), transparent 45%); }
.tilt.is-tilting::after { opacity: 1; }
.tilt.is-tilting { transition: transform .12s linear, box-shadow .22s ease, border-color .22s ease; }

/* ---------- Plano recomendado: borda com degradê girando ---------- */
.plan--featured::before { content: ''; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--angle), #8A6CFA, #2A5FE8, #C9BDF8, #6A45F5, #8A6CFA);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin-border 6s linear infinite; }
@keyframes spin-border { to { --angle: 360deg; } }

/* ---------- Botão principal: reflexo ao passar o mouse ---------- */
.btn--primary { position: relative; overflow: hidden; isolation: isolate; }
.btn--primary::after { content: ''; position: absolute; top: 0; left: -70%; width: 45%; height: 100%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .32), transparent); transform: skewX(-20deg); transition: left .65s ease; }
.btn--primary:hover::after { left: 130%; }

/* ---------- Entrada ao rolar (ativada pelo JS; sem JS tudo aparece normalmente) ---------- */
html.motion .reveal { opacity: 0; translate: 0 22px; transition: opacity .7s cubic-bezier(.2, .8, .2, 1), translate .7s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0ms); }
html.motion .reveal.is-visible { opacity: 1; translate: none; }
/* Elementos com profundidade própria mantêm o deslocamento em Z */
html.motion .hero-visual.reveal, html.motion .approval-wrap.reveal, html.motion .hub-wrap.reveal, html.motion .dash-wrap.reveal { translate: 0 22px; }

@media (max-width: 860px) {
  .hero::after { height: 32%; opacity: .4; }
  .hero-3d { opacity: .55; -webkit-mask-image: radial-gradient(60% 260px at 100% 0%, #000 35%, transparent 100%); mask-image: radial-gradient(60% 260px at 100% 0%, #000 35%, transparent 100%); }
}
/* Celular: sem profundidade em Z (evita que a perspectiva amplie as peças além da tela), só flutuação leve */
@media (max-width: 560px) {
  .hero-visual, .approval-wrap, .hub-wrap, .dash-wrap { transform: none; }
  .hero-visual__glow, .approval-wrap__glow, .hub-wrap__glow, .dash-wrap__glow, .mock--site, .approval, .hub, .dash { translate: none; }
  .mock--quote, .dash-int { animation-name: float-sm; }
  .mock--panel { animation-name: float-sm; animation-direction: reverse; }
  html.motion .hero-visual.reveal, html.motion .approval-wrap.reveal, html.motion .hub-wrap.reveal, html.motion .dash-wrap.reveal { translate: 0 22px; }
}
@keyframes float-sm { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }

/* Vídeo demo: entra "deitado" em 3D e se endireita ao aparecer; peças flutuam em camadas */
html.motion .demo-stage:not(.is-in) .demo-frame { transform: rotateX(22deg) scale(.92) translateY(30px); box-shadow: 0 30px 60px -40px rgba(42,30,110,.4); }
.demo-stage { transform-style: preserve-3d; }
.demo-tile--a { animation: float-a2 6s ease-in-out infinite; }
.demo-tile--b { animation: float-a2 7s ease-in-out -2s infinite; }
.demo-tile--c { animation: float-a2 8s ease-in-out -4s infinite; }
@keyframes float-a2 { 0%, 100% { translate: 0 0 60px; rotate: 0deg; } 50% { translate: 0 -12px 60px; rotate: -4deg; } }
.demo-stage__glow { animation: glow-breathe 6s ease-in-out infinite; }
@keyframes glow-breathe { 0%, 100% { opacity: .75; scale: 1; } 50% { opacity: 1; scale: 1.04; } }


/* ---------- VERO Social e Alcança ---------- */
.social-visual { transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.social-visual__glow { translate: 0 0 -60px; }
.sv-phone { translate: 0 0 20px; animation: float-c 9s ease-in-out infinite; }
.sv-card--strategy { translate: 0 0 80px; animation: float-a 7s ease-in-out infinite; }
.sv-card--radar { translate: 0 0 60px; animation: float-b 8s ease-in-out -3s infinite; }
@keyframes float-c { 0%, 100% { translate: 0 0 20px; rotate: 0deg; } 50% { translate: 0 -8px 20px; rotate: -1deg; } }
.sv-radar__sweep, .radar3d__sweep { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sv-pin, .radar3d__blip { animation: blip 4s ease-out infinite; animation-delay: var(--d, 0s); }
@keyframes blip { 0%, 100% { opacity: .25; box-shadow: 0 0 0 0 rgba(42, 95, 232, .5); } 8% { opacity: 1; box-shadow: 0 0 0 10px rgba(42, 95, 232, 0); } 40% { opacity: .8; } }
.sv-grid span { animation: tile-shimmer 5s ease-in-out infinite; }
.sv-grid span:nth-child(2n) { animation-delay: .6s; } .sv-grid span:nth-child(3n) { animation-delay: 1.2s; }
@keyframes tile-shimmer { 0%, 100% { filter: none; } 50% { filter: brightness(1.06) saturate(1.2); } }
.sv-list li { animation: list-in 6s ease-in-out infinite; }
.sv-list li:nth-child(2) { animation-delay: .4s; } .sv-list li:nth-child(3) { animation-delay: .8s; }
@keyframes list-in { 0%, 8% { opacity: .35; translate: -4px 0; } 16%, 85% { opacity: 1; translate: 0 0; } 100% { opacity: .35; } }

.so-orbit__ring { animation: ring-spin 14s linear infinite; }
.so-orbit__ring--2 { animation-duration: 10s; animation-direction: reverse; }
@keyframes ring-spin { from { rotate: z 0deg; } to { rotate: z 360deg; } }
.so-orbit__sat { animation: orbit 16s linear infinite; }
@keyframes orbit { from { transform: rotate(var(--a)) translateX(150px) rotate(calc(-1 * var(--a))); } to { transform: rotate(calc(var(--a) + 360deg)) translateX(150px) rotate(calc(-1 * var(--a) - 360deg)); } }
.so-orbit__core { animation: core-pulse 4s ease-in-out infinite; }
@keyframes core-pulse { 0%, 100% { box-shadow: 0 30px 60px -20px rgba(106, 69, 245, .6), inset -10px -14px 30px rgba(22, 19, 58, .25), 0 0 0 0 rgba(106, 69, 245, .25); } 50% { box-shadow: 0 30px 60px -20px rgba(106, 69, 245, .6), inset -10px -14px 30px rgba(22, 19, 58, .25), 0 0 0 22px rgba(106, 69, 245, 0); } }

.exp-chart__line { animation: dash-run 2.5s linear infinite; }
@keyframes dash-run { to { stroke-dashoffset: -24; } }
.experiment__dot { animation: ping-amber 1.8s ease-out infinite; }
@keyframes ping-amber { 0% { box-shadow: 0 0 0 0 rgba(217, 119, 6, .5); } 100% { box-shadow: 0 0 0 8px rgba(217, 119, 6, 0); } }

.radar3d { transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.radar3d__disk { animation: disk-tilt 12s ease-in-out infinite; }
@keyframes disk-tilt { 0%, 100% { transform: perspective(900px) rotateX(58deg) rotateZ(-12deg); } 50% { transform: perspective(900px) rotateX(54deg) rotateZ(8deg); } }
.radar3d__card--a { translate: 0 0 60px; animation: float-r 7s ease-in-out infinite; }
.radar3d__card--b { translate: 0 0 80px; animation: float-r 8s ease-in-out -2s infinite; }
.radar3d__card--c { translate: 0 0 40px; animation: float-r 9s ease-in-out -4s infinite; }
@keyframes float-r { 0%, 100% { translate: 0 0 60px; } 50% { translate: 0 -10px 60px; } }
.alc-trial { overflow: hidden; }
.alc-trial::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--angle), #8A6CFA, #2A5FE8, #C9BDF8, #6A45F5, #8A6CFA);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin-border 8s linear infinite; }

@media (max-width: 560px) {
  .social-visual { transform: none; }
  .sv-phone, .sv-card--strategy, .sv-card--radar, .radar3d__card--a, .radar3d__card--b, .radar3d__card--c { translate: none; animation-name: float-sm; }
  .so-orbit__sat { animation-name: orbit-sm; }
  @keyframes orbit-sm { from { transform: rotate(var(--a)) translateX(118px) rotate(calc(-1 * var(--a))); } to { transform: rotate(calc(var(--a) + 360deg)) translateX(118px) rotate(calc(-1 * var(--a) - 360deg)); } }
}
