// Hero.jsx — motion-first hook
const { useState, useEffect: useEffectHero, useRef: useRefHero } = React;
/* ─── keyframes global (injected once) ─── */
const HERO_CSS = `
@keyframes heroOrbPulse {
0%, 100% { transform: scale(1); opacity: 0.65; }
50% { transform: scale(1.1); opacity: 0.9; }
}
@keyframes heroOrbPulse2 {
0%, 100% { transform: scale(1); opacity: 0.45; }
50% { transform: scale(1.08); opacity: 0.65; }
}
@keyframes cardFloat {
0%, 100% { transform: translateY(0px) rotate(0deg); }
33% { transform: translateY(-8px) rotate(0.3deg); }
66% { transform: translateY(-4px) rotate(-0.2deg); }
}
@keyframes badgePulse {
0%, 100% { box-shadow: 0 0 0 0 rgba(201,106,59,0); }
50% { box-shadow: 0 0 0 8px rgba(201,106,59,0.18); }
}
@keyframes sheenLine {
0% { transform: translateX(-100%); }
100% { transform: translateX(100%); }
}
@keyframes slideUp {
from { opacity: 0; transform: translateY(32px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes scaleIn {
from { opacity: 0; transform: scale(0.92) translateY(16px); }
to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes badgePop {
0% { opacity: 0; transform: translate(50%, -50%) scale(0.6); }
70% { transform: translate(50%, -50%) scale(1.08); }
100% { opacity: 1; transform: translate(50%, -50%) scale(1); }
}
@keyframes sweep {
from { transform: translateX(-120px); }
to { transform: translateX(100vw); }
}
@keyframes dotBlink {
0%, 100% { opacity: 1; }
50% { opacity: 0.3; }
}
.hero-word {
display: inline-block;
opacity: 0;
animation: slideUp 0.7s cubic-bezier(.22,1,.36,1) forwards;
padding-top: 0.1em;
padding-bottom: 0.14em;
}
.hero-sub-line {
opacity: 0;
animation: slideUp 0.6s cubic-bezier(.22,1,.36,1) forwards;
}
.hero-kpi {
opacity: 0;
animation: slideUp 0.6s cubic-bezier(.22,1,.36,1) forwards;
}
.hero-card-wrap {
opacity: 0;
animation: scaleIn 0.8s cubic-bezier(.22,1,.36,1) forwards;
}
.q1-opt:hover { border-color: var(--signal) !important; background: var(--signal-dim) !important; }
.q1-opt:hover .arrow { transform: translateX(4px); color: var(--signal); }
.q1-opt { transition: border-color .2s, background .2s; }
@media (max-width: 980px) {
.hero-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
}
@media (max-width: 640px) {
.hero-kpi { grid-template-columns: 1fr 1fr !important; }
.hero-kpi > div { border-right: none !important; border-bottom: 1px solid var(--border); }
.hero-kpi > div:nth-child(odd) { border-right: 1px solid var(--border) !important; }
.hero-kpi > div:last-child { border-bottom: none; }
.hero-kpi > div:nth-last-child(2) { border-bottom: none; }
}
`;
/* ─── KPI counter animado no scroll ─── */
function KpiNum({ target, suffix = '', prefix = '', duration = 1200 }) {
const ref = useRefHero(null);
const [v, setV] = useState(0);
const [seen, setSeen] = useState(false);
useEffectHero(() => {
const el = ref.current; if (!el) return;
const io = new IntersectionObserver(([e]) => { if (e.isIntersecting) { setSeen(true); io.disconnect(); } }, { threshold: 0.5 });
io.observe(el);
return () => io.disconnect();
}, []);
useEffectHero(() => {
if (!seen) return;
const t0 = performance.now(); let raf;
const step = (t) => {
const p = Math.min(1, (t - t0) / duration);
setV(Math.round(target * (1 - Math.pow(1 - p, 3))));
if (p < 1) raf = requestAnimationFrame(step);
};
raf = requestAnimationFrame(step);
return () => cancelAnimationFrame(raf);
}, [seen]);
return {prefix}{v}{suffix};
}
function Hero({ heroStyle = 'embed', onStartDiagnostic }) {
useEffectHero(() => {
if (!document.getElementById('hero-styles')) {
const s = document.createElement('style');
s.id = 'hero-styles';
s.textContent = HERO_CSS;
document.head.appendChild(s);
}
}, []);
return (
Você está pagando impostos que não deve.
A gente prova isso.
Diagnóstico tributário gratuito para empresários que querem parar de pagar a mais e recuperar o que já saiu.
{/* KPI row */}Começamos pelo básico. 3 minutos no total.
Diagnóstico tributário gratuito. Em 15 anos, reduzimos a carga fiscal de centenas de empresas, dentro da lei, sem atalhos.
Diagnóstico tributário para empresários que querem parar de pagar a mais.
{/* live ticker */}