/* ==========================================================================
   Spell UI → VPay (porte para CSS/JS puro)
   Fonte: registro shadcn do Spell UI, https://spell.sh/r/{nome}.json
   (o mesmo que o MCP de https://spell.sh/docs/mcp entrega ao editor).
   O site é HTML estático, então os componentes React/motion foram portados:
     texto      → blur-reveal, words-stagger, shimmer-text, highlighted-text,
                  gradient-wave-text
     movimento  → marquee, logos-carousel, tilt-card (com spotlight)
     botões     → rich-button, flow-button, pop-button, copy-button
     fundo      → light-rays (aproximação em CSS; o original usa three.js)
   Tudo respeita prefers-reduced-motion (regra global do site).
   ========================================================================== */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- blur-reveal (por letra) e words-stagger (por palavra) ---------- */
[data-spell="blur-reveal"] { --sp-stagger: 0.02s; --sp-dur: 0.6s; }
[data-spell="words-stagger"] { --sp-stagger: 0.07s; --sp-dur: 0.5s; }
.sp-w { display: inline-block; white-space: nowrap; }
.sp-u { display: inline-block; }
.sp-ready .sp-u {
  opacity: 0; filter: blur(12px); transform: translateY(10px);
  transition: opacity var(--sp-dur) ease, filter var(--sp-dur) ease, transform var(--sp-dur) ease;
  transition-delay: calc(var(--i, 0) * var(--sp-stagger) + var(--sp-delay, 0s));
}
.sp-ready.sp-in .sp-u { opacity: 1; filter: blur(0); transform: none; }

/* ---------- shimmer-text ---------- */
.shimmer-text {
  --shimmer-contrast: rgba(255, 255, 255, 0.85);
  display: inline-block;
  background: currentColor linear-gradient(to right, currentColor 0%, var(--shimmer-contrast) 40%, var(--shimmer-contrast) 60%, currentColor 100%) no-repeat;
  background-size: 50% 200%;
  background-position-x: 250%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sp-shimmer 3s linear 1.5s infinite;
}
html.dark .shimmer-text { --shimmer-contrast: rgba(0, 0, 0, 0.55); }
.section-head .tag.shimmer-text, .tag.shimmer-text { --shimmer-contrast: rgba(255, 213, 79, 0.95); }
@keyframes sp-shimmer {
  0% { background-position-x: -100%; }
  50%, 100% { background-position-x: 250%; }
}

/* ---------- highlighted-text (marca-texto que entra da esquerda) ---------- */
.hl {
  --hl-bg: var(--accent);
  --hl-fg: var(--accent-fg);
  background-image: linear-gradient(var(--hl-bg), var(--hl-bg));
  background-repeat: no-repeat; background-size: 0% 100%; background-position: 0 0;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  padding: 0 0.18em 0 0.15em; margin: 0 -0.18em 0 -0.15em; border-radius: 0.14em;
  transition: background-size 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.3s ease 0.2s;
}
.hl[data-from="right"] { background-position: 100% 0; }
.hl.in { background-size: 100% 100%; color: var(--hl-fg); }

/* ---------- gradient-wave-text (onda de luz atravessando o gradiente) ---------- */
.gradient-wave {
  --gi: -25;
  --gw-a: rgba(255, 255, 255, 0);
  --gw-b: rgba(255, 243, 196, 0.95);
  --gw-c: #ffd54f;
  display: inline-block; padding-inline: 2px; margin-inline: -2px;
  background-image:
    linear-gradient(100deg,
      var(--gw-a) calc(var(--gi) * 1%),
      var(--gw-b) calc((var(--gi) + 6) * 1%),
      var(--gw-c) calc((var(--gi) + 10) * 1%),
      var(--gw-a) calc((var(--gi) + 16) * 1%)),
    linear-gradient(100deg, var(--accent) 10%, var(--accent-strong) 90%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  transform: translateZ(0);
}

/* ---------- marquee (faixa infinita com fade nas bordas e pausa no hover) ---------- */
.marquee {
  --mq-fade: 10%; --mq-dur: 30s; --mq-gap: 12px;
  display: flex; width: 100%; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--mq-fade), #000 calc(100% - var(--mq-fade)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--mq-fade), #000 calc(100% - var(--mq-fade)), transparent 100%);
}
.marquee-track { display: flex; flex-shrink: 0; width: max-content; animation: sp-scroll var(--mq-dur) linear infinite; }
.marquee[data-direction="right"] .marquee-track { animation-direction: reverse; }
.marquee-group { display: flex; flex-shrink: 0; gap: var(--mq-gap); padding-inline-end: var(--mq-gap); }
.marquee[data-pause]:hover .marquee-track { animation-play-state: paused; }
@keyframes sp-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ticker do hero reaproveita o marquee */
.ticker.marquee { --mq-gap: 44px; --mq-dur: 32s; }
.ticker .marquee-group span {
  display: inline-flex; align-items: center; gap: 12px; white-space: nowrap;
  font-size: 0.88rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.ticker .marquee-group .v { color: var(--accent-strong); }

/* mural de integrações em duas faixas */
.logo-marquee { display: grid; gap: 12px; }
.logo-marquee .marquee { --mq-dur: 38s; --mq-gap: 12px; }
.logo-marquee .logo-chip { min-width: 164px; }

/* ---------- logos-carousel (grupos que entram/saem com blur) ---------- */
.logos-carousel { display: grid; place-items: center; width: 100%; }
.logos-group {
  grid-area: 1 / 1; display: flex; flex-wrap: nowrap; justify-content: flex-start;
  gap: 8px 22px; width: 100%; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent);
}
.logos-group.is-visible { pointer-events: auto; }
.logos-carousel .logos-group > * {
  opacity: 0; animation-fill-mode: both; animation-duration: 600ms; animation-timing-function: ease;
  animation-delay: calc(var(--i, 0) * 0.14s);
}
.logos-carousel .logos-group.is-showing > * { opacity: 1; }
.logos-group.enter > * { animation-name: sp-logos-enter; animation-delay: calc(var(--i, 0) * 0.12s + 0.32s); }
.logos-group.exit > * { animation-name: sp-logos-exit; animation-duration: 420ms; animation-delay: calc(var(--i, 0) * 0.08s); }
@keyframes sp-logos-enter {
  0% { transform: translateY(40px); filter: blur(4px); opacity: 0; }
  100% { transform: translateY(0); filter: blur(0); opacity: 1; }
}
@keyframes sp-logos-exit {
  0% { transform: translateY(0); filter: blur(0); opacity: 1; }
  100% { transform: translateY(-40px); filter: blur(4px); opacity: 0; }
}
.hero-logos { margin-top: 26px; display: grid; gap: 8px; }
.hero-logos-label { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.logo-name { font-family: Arial, Helvetica, sans-serif; font-weight: 600; font-size: 1.05rem; color: color-mix(in srgb, var(--fg) 82%, transparent); white-space: nowrap; }

/* ---------- tilt-card (3D que segue o cursor + spotlight) ---------- */
[data-tilt], .bento .b, .card, .step, .tier { position: relative; }
[data-tilt] { transform-style: preserve-3d; will-change: transform; }
[data-tilt].tilting { transition: transform 0.12s ease-out, border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.7s ease; }
.tilt-spot {
  pointer-events: none; position: absolute; inset: 0; z-index: 5; overflow: hidden;
  border-radius: inherit; opacity: 0; transition: opacity 0.3s ease;
}
.tilt-spot::before {
  content: ''; position: absolute; width: 200%; height: 200%; border-radius: 50%;
  left: var(--sx, 50%); top: var(--sy, 50%); transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 193, 7, 0.2) 0%, transparent 40%);
}
html.dark .tilt-spot::before { background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 40%); }
[data-tilt].tilting .tilt-spot { opacity: 1; }

/* ---------- rich-button → .btn-primary ---------- */
.btn-primary {
  background: linear-gradient(to bottom, #ffdd73 0%, var(--accent) 58%, #ffb300 100%);
  border-color: rgba(10, 10, 10, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 6px -1px rgba(10, 10, 10, 0.2), 0 6px 22px rgba(255, 193, 7, 0.3);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 10px -2px rgba(10, 10, 10, 0.22), 0 10px 30px rgba(255, 193, 7, 0.45); }
.btn-primary:active { filter: brightness(0.95); transform: translateY(0); }
html.dark .btn-primary { background: linear-gradient(to top, #ffb300 0%, var(--accent) 55%, #ffdd73 100%); border-color: rgba(0, 0, 0, 0.55); }

/* ---------- flow-button → .btn-flow (borda tracejada que corre no hover) ---------- */
.btn-flow { position: relative; }
.btn-flow .flow-svg {
  position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  pointer-events: none; opacity: 0; transform: scale(0.97);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}
.btn-flow .flow-svg path { fill: none; stroke: var(--flow-color, var(--accent-strong)); stroke-width: 1.5; stroke-dasharray: 6 4; }
.btn-flow:hover .flow-svg { opacity: 1; transform: scale(1); }
.btn-flow:hover .flow-svg path { animation: sp-dash-flow 1s linear infinite; }
.btn-flow:hover { border-color: transparent; }
@keyframes sp-dash-flow { to { stroke-dashoffset: -10; } }

/* ---------- pop-button → .btn-wpp (botão "físico" que afunda ao clicar) ---------- */
.btn-wpp {
  border: 2px solid #128c4a; border-bottom-width: 4px; transform-origin: bottom;
  transition: transform 0.15s ease, border-bottom-width 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn-wpp:hover { background: #22c95d; }
.btn-wpp:active { border-bottom-width: 2px; transform: translateY(1px) scaleY(0.95); box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3); }

/* ---------- copy-button (na janela de código) ---------- */
.copy-btn {
  margin-left: auto; position: relative; display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent; color: rgba(247, 246, 244, 0.72); cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.copy-btn:active { transform: scale(0.97); }
.copy-btn:disabled { opacity: 1; pointer-events: none; }
.copy-btn svg { width: 15px; height: 15px; grid-area: 1 / 1; transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease; }
.copy-btn .ic-check { opacity: 0; transform: scale(0.7); filter: blur(2px); color: #4ade80; }
.copy-btn.copied .ic-check { opacity: 1; transform: none; filter: none; }
.copy-btn.copied .ic-copy { opacity: 0; transform: scale(0); filter: blur(2px); }

/* ---------- light-rays (feixes de luz do hero; aproximação CSS) ---------- */
.hero-rays {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 45%, transparent 85%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 45%, transparent 85%);
}
.hero-rays i {
  position: absolute; top: -40%; left: var(--x); width: var(--w, 10vw); height: 170%;
  transform-origin: top center; transform: rotate(var(--r)) translateX(0);
  background: linear-gradient(to right, rgba(255, 193, 7, 0), rgba(255, 193, 7, var(--a, 0.22)) 50%, rgba(255, 193, 7, 0));
  animation: sp-ray 11s ease-in-out infinite alternate; animation-delay: var(--d, 0s);
}
html.dark .hero-rays i { --a: 0.09; }
@keyframes sp-ray {
  from { opacity: 0.55; transform: rotate(var(--r)) translateX(-2.5vw); }
  to { opacity: 1; transform: rotate(var(--r)) translateX(2.5vw); }
}

/* ---------- identificação da empresa no rodapé ---------- */
.footer-id { margin-top: 14px; font-size: 0.82rem; line-height: 1.6; color: var(--muted); }
.footer-id b { font-weight: 600; color: var(--fg); }

/* ---------- movimento reduzido / celular ---------- */
@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { width: auto; flex-wrap: wrap; }
  .marquee-group { flex-wrap: wrap; }
  .marquee-group[aria-hidden="true"] { display: none; }
  .logos-group > * { opacity: 1; }
  .shimmer-text { animation: none; }
  .hl { background-size: 100% 100%; color: var(--hl-fg); }
}
@media (max-width: 720px) {
  .hero-rays { display: none; }
  .logo-name { font-size: 0.95rem; }
  .logos-group { gap: 8px 16px; }
}

/* ---------- animated-gradient (WebGL2, js/spell-gradient.js) ---------- */
.spell-bg {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; border-radius: inherit;
}
.spell-bg canvas { display: block; width: 100%; height: 100%; opacity: var(--spell-bg-opacity, 1); }
.spell-bg .noise {
  position: absolute; inset: 0; background-repeat: repeat; background-size: 180px; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEUAAAAAAAAAAAAAAAAAAAAAAADgKxmiAAAABnRSTlMCCgkGBAVJOAVJAAAASklEQVQ4y2NgGAWjYBSMglEwCgY/YGRgZBQUYmJiZGQEkYwMjIyMgoKCjIyMIJKBgRFIMjIyAklGRkYGRkFBYEcwMDIyMjAOUQAA1I4HwVwZAkYAAAAASUVORK5CYII=");
}
html.dark .spell-bg .noise { opacity: 0.12; mix-blend-mode: soft-light; }
.hero .spell-bg {
  --spell-bg-opacity: 0.9;
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, rgba(0, 0, 0, 0.5) 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 45%, rgba(0, 0, 0, 0.5) 75%, transparent 100%);
}
html.dark .hero .spell-bg { --spell-bg-opacity: 0.6; }
/* véu sobre a coluna do texto para manter a leitura; o brilho fica do lado do mockup */
.hero .spell-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 38%, transparent 62%);
}
.hero .ticker { position: relative; }
.final-cta > .spell-bg { position: absolute; z-index: 0; --spell-bg-opacity: 0.8; }
.final-cta > .spell-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.55) 0%, rgba(10, 10, 10, 0.25) 45%, transparent 80%);
}
.final-cta::before { z-index: 1; }
.final-cta > * { z-index: 2; }
