MarcoCarola1 commited on
Commit
223c0df
·
verified ·
1 Parent(s): 263406c

atualizacao automatica dos dados da CVM

Browse files
.gitattributes CHANGED
@@ -1,3 +1,6 @@
1
  *.parquet filter=lfs diff=lfs merge=lfs -text
2
  *.duckdb filter=lfs diff=lfs merge=lfs -text
3
  *.zip filter=lfs diff=lfs merge=lfs -text
 
 
 
 
1
  *.parquet filter=lfs diff=lfs merge=lfs -text
2
  *.duckdb filter=lfs diff=lfs merge=lfs -text
3
  *.zip filter=lfs diff=lfs merge=lfs -text
4
+ media/home_captacao.mp4 filter=lfs diff=lfs merge=lfs -text
5
+ media/home_credito.mp4 filter=lfs diff=lfs merge=lfs -text
6
+ media/home_retornos.mp4 filter=lfs diff=lfs merge=lfs -text
app.js CHANGED
@@ -2107,8 +2107,10 @@ function sair() {
2107
  * pergunta por sessao (guardada por usuario na sessionStorage); sem conta, sem
2108
  * medicao ou com qualquer erro, o link fica escondido. */
2109
  async function marcaAdmin() {
2110
- const el = document.getElementById('menuAdmin');
2111
- if (!el) return;
 
 
2112
  el.hidden = true;
2113
  const base = globalThis.__ACESSOS__;
2114
  if (!temConta() || !base) return;
@@ -2817,6 +2819,7 @@ function rotear() {
2817
 
2818
  const paginas = {
2819
  gestoras: pageGestoras, gestora: () => pageGestora(arg),
 
2820
  rankings: pageRankings, retornos: pageRetornos, encerradas: pageEncerradas,
2821
  insights: () => (arg ? pageInsight(decodeURIComponent(arg)) : pageInsights()),
2822
  titulos: pageTitulos, titulo: () => pageTitulo(arg),
@@ -15794,3 +15797,781 @@ async function blocoDocumentos(elId, cnpj) {
15794
  desenhar();
15795
  }
15796
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2107
  * pergunta por sessao (guardada por usuario na sessionStorage); sem conta, sem
2108
  * medicao ou com qualquer erro, o link fica escondido. */
2109
  async function marcaAdmin() {
2110
+ const els = [...document.querySelectorAll('#menuAdmin, .so-dono')];
2111
+ if (!els.length) return;
2112
+ // um objeto que se comporta como o link unico de antes, para os dois
2113
+ const el = { set hidden(v) { els.forEach(x => { x.hidden = v; }); } };
2114
  el.hidden = true;
2115
  const base = globalThis.__ACESSOS__;
2116
  if (!temConta() || !base) return;
 
2819
 
2820
  const paginas = {
2821
  gestoras: pageGestoras, gestora: () => pageGestora(arg),
2822
+ inicio: () => pageInicio(arg),
2823
  rankings: pageRankings, retornos: pageRetornos, encerradas: pageEncerradas,
2824
  insights: () => (arg ? pageInsight(decodeURIComponent(arg)) : pageInsights()),
2825
  titulos: pageTitulos, titulo: () => pageTitulo(arg),
 
15797
  desenhar();
15798
  }
15799
  }
15800
+
15801
+ // ------------------------------------------------------------- pagina: inicio --
15802
+ //
15803
+ // A PORTA DE ENTRADA (18/11/2026, pedido dele): "uma home bem tech, com
15804
+ // elementos bem digitais, diferente do resto do site, que e mais pragmatico --
15805
+ // fundos que arrastam com sensacao 3D, bastante grafico e ate videozinhos
15806
+ // explicativos". E logo depois: "me de mais de uma opcao (pode deixar varias no
15807
+ // site como teste)". Entao sao TRES VERSOES em `#/inicio/a|b|c`, com um seletor
15808
+ // fixo para comparar; a pagina padrao do site continua sendo a de gestoras ate
15809
+ // ele escolher.
15810
+ //
15811
+ // A Constelacao cada fundo vivo e um ponto numa galaxia 3D que gira
15812
+ // B Cidade as 100 maiores gestoras viram predios: altura = PL, cor =
15813
+ // captacao liquida em 12 meses
15814
+ // C Fluxo tunel de particulas na proporcao do PL por classe, uma
15815
+ // narrativa que se monta na rolagem e os videos num "cinema"
15816
+ //
15817
+ // TUDO O QUE E DESENHADO E DADO DE VERDADE e diz o que encoda; o que e arranjo
15818
+ // (os bracos da galaxia, a ordem dos predios) a legenda diz que e arranjo. Cor
15819
+ // de classe: so tres cores e cinza para o resto -- a paleta validada so separa
15820
+ // TRES cores num grafico de pontos para quem tem daltonismo. Canvas 2D com a
15821
+ // perspectiva feita aqui, sem three.js: a vitrine nao pode custar 600 KB a quem
15822
+ // so quer chegar nas gestoras. `prefers-reduced-motion` desliga giro, faixa,
15823
+ // paralaxe e video tocando sozinho.
15824
+
15825
+ const HOME_CLASSES = [
15826
+ { nome: 'Renda fixa', cor: '#3987e5' },
15827
+ { nome: 'Multimercado', cor: '#d95926' },
15828
+ { nome: 'Ações', cor: '#199e70' },
15829
+ { nome: 'Previdência e outras', cor: '#8d8c83' },
15830
+ ];
15831
+ function homeClasse(c) {
15832
+ const s = String(c || '').toLowerCase();
15833
+ if (s.startsWith('renda')) return 0;
15834
+ if (s.startsWith('multi')) return 1;
15835
+ if (s.startsWith('aç') || s.startsWith('ac')) return 2;
15836
+ return 3;
15837
+ }
15838
+ const homeMovimento = () => !(window.matchMedia && matchMedia('(prefers-reduced-motion: reduce)').matches);
15839
+ const HOME_VERSOES = [['a', 'Constelação'], ['b', 'Cidade'], ['c', 'Fluxo']];
15840
+
15841
+ // Os videos sao gravacoes do proprio site (Playwright + ffmpeg), sem audio, em
15842
+ // `site/media/`. Video que nao existe some em vez de deixar caixa vazia.
15843
+ const HOME_VIDEOS = [
15844
+ { arq: 'home_captacao', rota: 'gestoras', titulo: 'Quem está captando',
15845
+ passos: ['A lista das gestoras com a captação líquida de 5 dias a 12 meses',
15846
+ 'Ordene por qualquer coluna e troque a janela no topo',
15847
+ 'Na página da casa: captação, retorno e o gráfico acumulado'] },
15848
+ { arq: 'home_credito', rota: 'titulos', titulo: 'Crédito privado, título a título',
15849
+ passos: ['Todas as debêntures do SND, CRIs e CRAs, com rating e fonte',
15850
+ 'Na página do título: quem ficou com a oferta e os coordenadores',
15851
+ 'Depois da oferta: quanto o mercado negociou do que ficou com os bancos'] },
15852
+ { arq: 'home_retornos', rota: 'retornos', titulo: 'Retornos lado a lado',
15853
+ passos: ['Retorno de cada fundo de 1 mês a 10 anos',
15854
+ 'Filtre por classe e por casa, e ordene pela janela que quiser',
15855
+ 'Cada número vem da cota que o fundo informa à CVM'] },
15856
+ ];
15857
+
15858
+ const HOME_PORTAS = [
15859
+ ['gestoras', 'Gestoras', 'Quem capta e quem perde dinheiro, de 5 dias a 12 meses, sem dupla contagem.', 'M3 17l5-6 4 3 6-8 3 3'],
15860
+ ['retornos', 'Retornos', 'O retorno de cada fundo e de cada casa, de 1 mês a 10 anos.', 'M3 18c4-1 5-9 9-9s5 5 9 3'],
15861
+ ['sobreposicao', 'Sobreposição', 'Quanto dois fundos ou duas casas carregam dos mesmos papéis.', 'M8 12a5 5 0 1 0 0.1 0M16 12a5 5 0 1 0 0.1 0'],
15862
+ ['titulos', 'Crédito privado', 'Debêntures, CRIs e CRAs: preço, rating com fonte, a oferta e quem tem.', 'M4 6h16M4 12h16M4 18h10'],
15863
+ ['conteudo', 'Conteúdo', 'Milhares de conversas com gestores, por assunto e por ativo.', 'M5 5h14v10H9l-4 4z'],
15864
+ ['fatos', 'Fatos e processos', 'Fatos relevantes, processos na CVM e votos em assembleia.', 'M12 3l9 16H3z'],
15865
+ ];
15866
+
15867
+ async function pageInicio(arg) {
15868
+ const app = document.getElementById('app');
15869
+ const ep = _epoca;
15870
+ const v = HOME_VERSOES.some(([k]) => k === arg) ? arg : 'a';
15871
+ const celular = window.matchMedia && matchMedia('(max-width: 760px)').matches;
15872
+ const base = `from dim_fundo d where coalesce(d.pl_atual, 0) > 0 and ${vivoSql('d')}`;
15873
+ const [tot, casas, porClasse] = await Promise.all([
15874
+ q1(`select count(*)::int n, count(distinct grupo_id)::int g,
15875
+ sum(pl_atual * (1 - coalesce(w_int, 0))) pl ${base}`),
15876
+ q(`select g.grupo_id, g.grupo_nome nome, sum(d.pl_atual * (1 - coalesce(d.w_int, 0))) pl
15877
+ from dim_fundo d join dim_gestora g using (grupo_id)
15878
+ where coalesce(d.pl_atual, 0) > 0 and ${vivoSql('d')} and g.grupo_id >= 0
15879
+ group by 1, 2 order by 3 desc limit 24`),
15880
+ q(`select d.classe_anbima classe, sum(d.pl_atual * (1 - coalesce(d.w_int, 0))) pl ${base} group by 1`),
15881
+ ]);
15882
+ const extra = v === 'a'
15883
+ ? await q(`select d.cnpj, d.nome, d.classe_anbima classe, d.pl_atual pl, g.grupo_nome gestora
15884
+ from dim_fundo d left join dim_gestora g using (grupo_id)
15885
+ where coalesce(d.pl_atual, 0) > 0 and ${vivoSql('d')}
15886
+ order by d.pl_atual desc limit ${celular ? 900 : 1800}`)
15887
+ : v === 'b'
15888
+ ? await q(`with ${cteFundos()}
15889
+ select g.grupo_id, g.grupo_nome nome, sum(coalesce(f.pl_atual, 0) * f.fx) pl,
15890
+ sum(coalesce(x.net, 0) * f.fx) net
15891
+ from f join dim_gestora g using (grupo_id)
15892
+ left join ${fonteJanelas(['12m'])} x on x.cnpj = f.cnpj and x.janela = '12m'
15893
+ where g.grupo_id >= 0
15894
+ group by 1, 2 having sum(coalesce(f.pl_atual, 0) * f.fx) > 0
15895
+ order by pl desc limit ${celular ? 64 : 100}`)
15896
+ : null;
15897
+ if (!epocaAtual(ep)) return;
15898
+
15899
+ // PL por classe (as 4 faixas da legenda), para a versao C e o rodape de todas
15900
+ const fat = [0, 0, 0, 0];
15901
+ for (const r of porClasse) fat[homeClasse(r.classe)] += Number(r.pl) || 0;
15902
+ const totFat = fat.reduce((a, b) => a + b, 0) || 1;
15903
+ const comum = { tot, casas, fat, totFat, dtRef: estado.meta?.dt_referencia ? dataBR(estado.meta.dt_referencia) : '' };
15904
+
15905
+ app.innerHTML = `<div class="home home-v${v}">
15906
+ ${v === 'a' ? homeHtmlA(comum) : v === 'b' ? homeHtmlB(comum) : homeHtmlC(comum)}
15907
+ <nav class="home-versoes" aria-label="Versões da página inicial em teste">
15908
+ <span>versão em teste</span>${HOME_VERSOES.map(([k, t]) =>
15909
+ `<a href="#/inicio/${k}" class="${k === v ? 'on' : ''}">${k.toUpperCase()} · ${t}</a>`).join('')}
15910
+ </nav>
15911
+ </div>`;
15912
+
15913
+ if (v === 'a') homeCeu(document.getElementById('homeCeu'), extra, document.getElementById('homeTip'), ep);
15914
+ if (v === 'b') { homeCidade(document.getElementById('homeCidade'), extra, document.getElementById('homeTip'), ep);
15915
+ homeAnel(document.getElementById('homeAnel'), ep); }
15916
+ if (v === 'c') { homeTunel(document.getElementById('homeTunel'), fat, ep); homeHistoria(ep); homeCinema(); }
15917
+ homeEfeitos(ep);
15918
+ }
15919
+
15920
+ // ---------------------------------------------------------- pedacos comuns --
15921
+ function homeStatsHtml(c) {
15922
+ return `<div class="home-stats">
15923
+ <div class="home-stat"><b data-alvo="${Number(c.tot?.n) || 0}" data-fmt="n">0</b><span>fundos vivos</span></div>
15924
+ <div class="home-stat"><b data-alvo="${Number(c.tot?.g) || 0}" data-fmt="n">0</b><span>gestoras</span></div>
15925
+ <div class="home-stat"><b data-alvo="${Number(c.tot?.pl) || 0}" data-fmt="brl">0</b><span>em patrimônio, sem dupla contagem</span></div>
15926
+ </div>`;
15927
+ }
15928
+ function homeKicker(c) {
15929
+ return `<div class="home-kicker"><span class="home-pulso"></span>PRUMO FS · DADOS ABERTOS DA CVM${c.dtRef ? ` · ATÉ ${esc(c.dtRef)}` : ''}</div>`;
15930
+ }
15931
+ function homeFaixaHtml(c) {
15932
+ const t = c.casas.map(x => `<a class="home-casa" href="#/gestora/${x.grupo_id}">
15933
+ <span class="home-casa-n">${esc(x.nome)}</span><span class="home-casa-v">${brl(Number(x.pl), { sinal: false })}</span></a>`).join('');
15934
+ return `<section class="home-faixa" aria-label="As maiores gestoras por patrimônio">
15935
+ <div class="home-faixa-rot">MAIORES CASAS · PL</div>
15936
+ <div class="home-trilho"><div class="home-trilho-in">${t}${t}</div></div></section>`;
15937
+ }
15938
+ function homePortaHtml([r, t, d, path], i) {
15939
+ return `<a class="home-porta home-rev" href="#/${r}" style="--i:${i}">
15940
+ <span class="home-porta-luz" aria-hidden="true"></span>
15941
+ <svg viewBox="0 0 24 24" class="home-porta-ic" aria-hidden="true"><path d="${path}"/></svg>
15942
+ <span class="home-porta-t">${t}</span><span class="home-porta-d">${d}</span>
15943
+ <span class="home-porta-ir">abrir <span aria-hidden="true">→</span></span></a>`;
15944
+ }
15945
+ function homeVideosGradeHtml(num) {
15946
+ return `<section class="home-sec home-videos">
15947
+ <div class="home-sec-cab home-rev"><span class="home-num">${num}</span><h2>Veja em 20 segundos</h2>
15948
+ <p>Gravações do próprio site: é isso que você encontra do outro lado.</p></div>
15949
+ <div class="home-vgrade">
15950
+ ${HOME_VIDEOS.map((v, i) => `<figure class="home-video home-rev" style="--i:${i}">
15951
+ <div class="home-tela">
15952
+ <video muted loop playsinline preload="none" poster="media/${v.arq}.jpg" data-src="media/${v.arq}.mp4"></video>
15953
+ <button type="button" class="home-play" aria-label="tocar">▶</button>
15954
+ <div class="home-vbarra"><i></i></div>
15955
+ </div>
15956
+ <figcaption><span class="home-vt">${v.titulo}</span>
15957
+ <ol>${v.passos.map(p => `<li>${p}</li>`).join('')}</ol>
15958
+ <a href="#/${v.rota}" class="home-vir">ir para a tela <span aria-hidden="true">→</span></a></figcaption>
15959
+ </figure>`).join('')}
15960
+ </div></section>`;
15961
+ }
15962
+ function homeFimHtml() {
15963
+ return `<section class="home-fim home-rev">
15964
+ <h2>Comece por uma gestora.</h2>
15965
+ <p>Ou digite qualquer fundo, gestora ou papel na busca do menu.</p>
15966
+ <a class="home-btn" href="#/gestoras">Abrir a lista de gestoras <span aria-hidden="true">→</span></a>
15967
+ <div class="home-fonte">Fonte: CVM (informe diário, carteiras, cadastro, ofertas), ANBIMA, SND e B3 — só dado público.</div>
15968
+ </section>`;
15969
+ }
15970
+ const homeLegendaClasses = obs => `<div class="home-legenda">
15971
+ ${HOME_CLASSES.map(c => `<span><i style="background:${c.cor}"></i>${c.nome}</span>`).join('')}
15972
+ <span class="home-legenda-obs">${obs}</span></div>`;
15973
+
15974
+ // ------------------------------------------------------------------ versao A --
15975
+ function homeHtmlA(c) {
15976
+ return `
15977
+ <section class="home-hero" id="homeHero">
15978
+ <canvas id="homeCeu" class="home-canvas" aria-label="Constelação dos fundos: cada ponto é um fundo, o tamanho é o patrimônio"></canvas>
15979
+ <div class="home-chao" aria-hidden="true"></div>
15980
+ <div class="home-hero-txt" data-vel="-0.18">
15981
+ ${homeKicker(c)}
15982
+ <h1 class="home-h1">O mapa vivo dos <span class="home-grad">fundos brasileiros</span></h1>
15983
+ <p class="home-lead">Captação, retorno, carteira, crédito privado e o que os gestores dizem —
15984
+ tudo o que a CVM publica, cruzado e posto em gráfico.</p>
15985
+ <div class="home-ctas">
15986
+ <a class="home-btn" href="#/gestoras">Explorar gestoras <span aria-hidden="true">→</span></a>
15987
+ <a class="home-btn home-btn-2" href="#/titulos">Crédito privado</a>
15988
+ </div>
15989
+ ${homeStatsHtml(c)}
15990
+ </div>
15991
+ ${homeLegendaClasses('cada ponto é um fundo · tamanho = patrimônio · a posição é só arranjo · arraste para girar')}
15992
+ <div class="home-tip" id="homeTip" hidden></div>
15993
+ <div class="home-desca" aria-hidden="true">role <span>↓</span></div>
15994
+ </section>
15995
+ ${homeFaixaHtml(c)}
15996
+ <section class="home-sec home-portas">
15997
+ <div class="home-camada home-camada-1" data-vel="0.25" aria-hidden="true"></div>
15998
+ <div class="home-camada home-camada-2" data-vel="0.5" aria-hidden="true"></div>
15999
+ <div class="home-sec-cab home-rev"><span class="home-num">01</span><h2>Seis portas para os mesmos dados</h2>
16000
+ <p>Cada tela responde uma pergunta. Todas leem o mesmo banco, refeito toda madrugada.</p></div>
16001
+ <div class="home-grade">${HOME_PORTAS.map(homePortaHtml).join('')}</div>
16002
+ </section>
16003
+ <section class="home-sec home-numeros" aria-label="Escala">
16004
+ <div class="home-gigante" data-vel="-0.35" aria-hidden="true">CVM</div>
16005
+ <div class="home-numeros-in home-rev">
16006
+ <div><b>2000</b><span>o histórico começa aqui</span></div>
16007
+ <div><b>24 h</b><span>entre a CVM publicar e o site mostrar</span></div>
16008
+ <div><b>0</b><span>planilhas para baixar</span></div>
16009
+ </div>
16010
+ </section>
16011
+ ${homeVideosGradeHtml('02')}
16012
+ ${homeFimHtml()}`;
16013
+ }
16014
+
16015
+ // ------------------------------------------------------------------ versao B --
16016
+ function homeHtmlB(c) {
16017
+ return `
16018
+ <section class="home-hero home-hero-b">
16019
+ <canvas id="homeCidade" class="home-canvas" aria-label="Cidade das gestoras: altura é o patrimônio, cor é a captação em 12 meses"></canvas>
16020
+ <div class="home-hero-txt home-hero-txt-b">
16021
+ ${homeKicker(c)}
16022
+ <h1 class="home-h1">Cada prédio é <span class="home-grad">uma gestora</span></h1>
16023
+ <p class="home-lead">A altura é o patrimônio. A cor diz se ela ganhou ou perdeu dinheiro de cotistas
16024
+ nos últimos 12 meses. Arraste para girar a cidade; passe o mouse para ler.</p>
16025
+ <div class="home-ctas">
16026
+ <a class="home-btn" href="#/gestoras">Ver todas as gestoras <span aria-hidden="true">→</span></a>
16027
+ </div>
16028
+ </div>
16029
+ <div class="home-legenda">
16030
+ <span><i style="background:#4fb07a"></i>captou em 12 meses</span>
16031
+ <span><i style="background:#e0705c"></i>perdeu em 12 meses</span>
16032
+ <span class="home-legenda-obs">altura = patrimônio (sem dupla contagem) · a ordem na cidade é só arranjo, do maior no centro</span>
16033
+ </div>
16034
+ <div class="home-tip" id="homeTip" hidden></div>
16035
+ </section>
16036
+ <section class="home-sec home-b-stats home-rev">${homeStatsHtml(c)}</section>
16037
+ <section class="home-sec home-anel-sec">
16038
+ <div class="home-sec-cab home-rev"><span class="home-num">01</span><h2>Gire e escolha uma porta</h2>
16039
+ <p>Arraste o anel. Cada cartão leva a uma tela do site.</p></div>
16040
+ <div class="home-anel-palco" id="homeAnel">
16041
+ <div class="home-anel">${HOME_PORTAS.map((p, i) => homePortaHtml(p, i).replace('home-porta home-rev"', 'home-porta home-anel-item" draggable="false"')).join('')}</div>
16042
+ </div>
16043
+ </section>
16044
+ ${homeFaixaHtml(c)}
16045
+ ${homeVideosGradeHtml('02')}
16046
+ ${homeFimHtml()}`;
16047
+ }
16048
+
16049
+ // ------------------------------------------------------------------ versao C --
16050
+ function homeHtmlC(c) {
16051
+ const pc = k => `${nf(100 * c.fat[k] / c.totFat, 0)}%`;
16052
+ return `
16053
+ <section class="home-hero home-hero-c">
16054
+ <canvas id="homeTunel" class="home-canvas" aria-label="Partículas na proporção do patrimônio por classe"></canvas>
16055
+ <div class="home-hero-txt home-hero-txt-c">
16056
+ ${homeKicker(c)}
16057
+ <h1 class="home-h1 home-h1-c">Siga o <span class="home-grad">dinheiro</span>.</h1>
16058
+ <p class="home-lead">Para onde vai o patrimônio dos fundos brasileiros, quem capta, quem rende e quem
16059
+ carrega o quê — direto dos dados da CVM.</p>
16060
+ <div class="home-ctas"><a class="home-btn" href="#/gestoras">Começar <span aria-hidden="true">→</span></a></div>
16061
+ </div>
16062
+ ${homeLegendaClasses('cada partícula vem de uma classe na proporção do patrimônio dela · mexa o mouse')}
16063
+ </section>
16064
+ <section class="home-historia" id="homeHistoria">
16065
+ <div class="home-historia-palco">
16066
+ <div class="home-historia-num" id="homeHistNum">0</div>
16067
+ <div class="home-historia-rot" id="homeHistRot"></div>
16068
+ <div class="home-barras" id="homeBarras">
16069
+ ${HOME_CLASSES.map((cl, k) => `<div class="home-barra"><span>${cl.nome}</span>
16070
+ <i style="--w:${(100 * c.fat[k] / c.totFat).toFixed(1)}%;background:${cl.cor}"></i><b>${pc(k)}</b></div>`).join('')}
16071
+ </div>
16072
+ </div>
16073
+ <div class="home-historia-passos">
16074
+ <div class="home-passo" data-alvo="${Number(c.tot?.n) || 0}" data-fmt="n" data-rot="fundos vivos, cada um com o informe diário na CVM"></div>
16075
+ <div class="home-passo" data-alvo="${Number(c.tot?.g) || 0}" data-fmt="n" data-rot="gestoras, cada fundo atribuído à casa que o gere hoje"></div>
16076
+ <div class="home-passo" data-alvo="${Number(c.tot?.pl) || 0}" data-fmt="brl" data-rot="em patrimônio, sem contar duas vezes o fundo que investe em outro" data-barras="1"></div>
16077
+ </div>
16078
+ </section>
16079
+ <section class="home-sec home-portas">
16080
+ <div class="home-sec-cab home-rev"><span class="home-num">01</span><h2>Seis perguntas, seis telas</h2></div>
16081
+ <div class="home-grade">${HOME_PORTAS.map(homePortaHtml).join('')}</div>
16082
+ </section>
16083
+ <section class="home-sec home-cinema-sec">
16084
+ <div class="home-sec-cab home-rev"><span class="home-num">02</span><h2>Assista antes de entrar</h2>
16085
+ <p>Gravações do próprio site, em loop e sem som.</p></div>
16086
+ <div class="home-cinema" id="homeCinema">
16087
+ <div class="home-cinema-tela home-tela">
16088
+ <video muted loop playsinline preload="none" poster="media/${HOME_VIDEOS[0].arq}.jpg" data-src="media/${HOME_VIDEOS[0].arq}.mp4"></video>
16089
+ <button type="button" class="home-play" aria-label="tocar">▶</button>
16090
+ <div class="home-vbarra"><i></i></div>
16091
+ </div>
16092
+ <div class="home-capitulos">
16093
+ ${HOME_VIDEOS.map((v, i) => `<button type="button" class="home-cap${i === 0 ? ' on' : ''}" data-i="${i}">
16094
+ <span class="home-cap-n">0${i + 1}</span><span class="home-cap-t">${v.titulo}</span>
16095
+ <span class="home-cap-d">${v.passos[0]}</span></button>`).join('')}
16096
+ </div>
16097
+ </div>
16098
+ </section>
16099
+ ${homeFaixaHtml(c)}
16100
+ ${homeFimHtml()}`;
16101
+ }
16102
+
16103
+ /** Numero "contando" ate o valor, quando entra na tela. */
16104
+ function homeConta(el, alvo = Number(el.dataset.alvo) || 0, fmtNome = el.dataset.fmt) {
16105
+ const fmt = x => (fmtNome === 'brl'
16106
+ ? (alvo >= 1e12 ? `R$ ${nf(x / 1e12, 1)} tri` : brl(x, { sinal: false })) : nf(x, 0));
16107
+ if (!homeMovimento()) { el.textContent = fmt(alvo); return; }
16108
+ const t0 = performance.now(), dur = 1300;
16109
+ const passo = t => {
16110
+ const k = Math.min(1, (t - t0) / dur);
16111
+ el.textContent = fmt(alvo * (1 - Math.pow(1 - k, 3)));
16112
+ if (k < 1 && el.isConnected) requestAnimationFrame(passo);
16113
+ };
16114
+ requestAnimationFrame(passo);
16115
+ }
16116
+
16117
+ /** Paralaxe, entrada em 3D, cartoes que inclinam com o mouse e os videos da grade. */
16118
+ function homeEfeitos(ep) {
16119
+ const raiz = document.querySelector('.home');
16120
+ if (!raiz) return;
16121
+ const mexe = homeMovimento();
16122
+ raiz.classList.toggle('home-quieta', !mexe);
16123
+ const contou = new WeakSet();
16124
+ const ioN = new IntersectionObserver(es => es.forEach(e => {
16125
+ if (e.isIntersecting && !contou.has(e.target)) { contou.add(e.target); homeConta(e.target); }
16126
+ }), { threshold: 0.4 });
16127
+ raiz.querySelectorAll('.home-stat b').forEach(el => ioN.observe(el));
16128
+
16129
+ const io = new IntersectionObserver(es => es.forEach(e => {
16130
+ if (e.isIntersecting) { e.target.classList.add('home-vis'); io.unobserve(e.target); }
16131
+ }), { threshold: 0.12 });
16132
+ raiz.querySelectorAll('.home-rev').forEach(el => io.observe(el));
16133
+
16134
+ const camadas = [...raiz.querySelectorAll('[data-vel]')];
16135
+ let pedido = 0;
16136
+ const rola = () => {
16137
+ pedido = 0;
16138
+ if (!raiz.isConnected) { window.removeEventListener('scroll', aoRolar); return; }
16139
+ const vh = window.innerHeight;
16140
+ for (const el of camadas) {
16141
+ const r = el.parentElement.getBoundingClientRect();
16142
+ el.style.transform = `translate3d(0, ${((r.top + r.height / 2 - vh / 2) * Number(el.dataset.vel)).toFixed(1)}px, 0)`;
16143
+ }
16144
+ };
16145
+ const aoRolar = () => { if (!pedido) pedido = requestAnimationFrame(rola); };
16146
+ if (mexe && camadas.length) { window.addEventListener('scroll', aoRolar, { passive: true }); rola(); }
16147
+
16148
+ if (mexe) {
16149
+ raiz.querySelectorAll('.home-porta:not(.home-anel-item), .home-tela').forEach(c => {
16150
+ c.addEventListener('pointermove', ev => {
16151
+ const r = c.getBoundingClientRect();
16152
+ const x = (ev.clientX - r.left) / r.width - 0.5, y = (ev.clientY - r.top) / r.height - 0.5;
16153
+ c.style.setProperty('--rx', `${(-y * 10).toFixed(2)}deg`);
16154
+ c.style.setProperty('--ry', `${(x * 12).toFixed(2)}deg`);
16155
+ c.style.setProperty('--mx', `${((x + 0.5) * 100).toFixed(1)}%`);
16156
+ c.style.setProperty('--my', `${((y + 0.5) * 100).toFixed(1)}%`);
16157
+ });
16158
+ c.addEventListener('pointerleave', () => { c.style.setProperty('--rx', '0deg'); c.style.setProperty('--ry', '0deg'); });
16159
+ });
16160
+ }
16161
+
16162
+ const vios = new IntersectionObserver(es => es.forEach(e => {
16163
+ const v = e.target;
16164
+ if (e.isIntersecting) { if (!v.src) v.src = v.dataset.src; if (mexe) v.play().catch(() => {}); }
16165
+ else v.pause();
16166
+ }), { threshold: 0.35 });
16167
+ raiz.querySelectorAll('.home-video, .home-cinema').forEach(fig => {
16168
+ const v = fig.querySelector('video');
16169
+ const b = fig.querySelector('.home-play');
16170
+ const barra = fig.querySelector('.home-vbarra i');
16171
+ if (fig.classList.contains('home-video')) v.addEventListener('error', () => fig.remove(), { once: true });
16172
+ v.addEventListener('timeupdate', () => {
16173
+ if (v.duration) barra.style.width = `${(100 * v.currentTime / v.duration).toFixed(1)}%`;
16174
+ });
16175
+ v.addEventListener('play', () => fig.classList.add('tocando'));
16176
+ v.addEventListener('pause', () => fig.classList.remove('tocando'));
16177
+ const alterna = () => { if (!v.src) v.src = v.dataset.src; if (v.paused) v.play().catch(() => {}); else v.pause(); };
16178
+ b.addEventListener('click', alterna);
16179
+ v.addEventListener('click', alterna);
16180
+ vios.observe(v);
16181
+ });
16182
+ }
16183
+
16184
+ /** Utilitario dos tres canvas: tamanho com DPR, laco que para fora da tela. */
16185
+ function homeCanvas(canvas, ep, desenha) {
16186
+ const ctx = canvas.getContext('2d');
16187
+ const st = { W: 0, H: 0, dpr: 1, visivel: true, rolagem: 0 };
16188
+ const medir = () => {
16189
+ st.dpr = Math.min(2, window.devicePixelRatio || 1);
16190
+ st.W = canvas.clientWidth; st.H = canvas.clientHeight;
16191
+ canvas.width = Math.round(st.W * st.dpr); canvas.height = Math.round(st.H * st.dpr);
16192
+ };
16193
+ medir();
16194
+ const ro = new ResizeObserver(medir); ro.observe(canvas);
16195
+ new IntersectionObserver(es => { st.visivel = es[0].isIntersecting; }).observe(canvas);
16196
+ const hero = canvas.parentElement;
16197
+ const aoRolar = () => {
16198
+ if (!canvas.isConnected) { window.removeEventListener('scroll', aoRolar); return; }
16199
+ const r = hero.getBoundingClientRect();
16200
+ st.rolagem = homeMovimento() ? Math.max(0, Math.min(1, -r.top / Math.max(1, r.height))) : 0;
16201
+ };
16202
+ window.addEventListener('scroll', aoRolar, { passive: true });
16203
+ const quadro = t => {
16204
+ if (!canvas.isConnected || !epocaAtual(ep)) { ro.disconnect(); return; }
16205
+ requestAnimationFrame(quadro);
16206
+ if (!st.visivel || document.hidden) return;
16207
+ ctx.setTransform(st.dpr, 0, 0, st.dpr, 0, 0);
16208
+ ctx.clearRect(0, 0, st.W, st.H);
16209
+ desenha(ctx, st, t);
16210
+ };
16211
+ requestAnimationFrame(quadro);
16212
+ return st;
16213
+ }
16214
+ const homeSemente = s => { let h = 2166136261; for (const ch of String(s)) { h ^= ch.charCodeAt(0); h = Math.imul(h, 16777619); } return h >>> 0; };
16215
+ const homeRnd = h => () => { h = Math.imul(h ^ (h >>> 15), 2246822507) ^ Math.imul(h ^ (h >>> 13), 3266489909); return ((h ^= h >>> 16) >>> 0) / 4294967296; };
16216
+
16217
+ /** Arrastar para girar (com inercia), comum a A e B. */
16218
+ function homeArrasto(canvas, cam, aoClicar) {
16219
+ let arr = false, ux = 0, uy = 0, moveu = 0;
16220
+ canvas.style.cursor = 'grab';
16221
+ canvas.addEventListener('pointerdown', ev => {
16222
+ arr = true; moveu = 0; ux = ev.clientX; uy = ev.clientY; canvas.setPointerCapture(ev.pointerId);
16223
+ canvas.style.cursor = 'grabbing'; cam.arrastando = true;
16224
+ });
16225
+ canvas.addEventListener('pointermove', ev => {
16226
+ if (!arr) return;
16227
+ const dx = ev.clientX - ux, dy = ev.clientY - uy;
16228
+ ux = ev.clientX; uy = ev.clientY; moveu += Math.abs(dx) + Math.abs(dy);
16229
+ cam.yaw += dx * 0.0055; cam.pitch = Math.max(cam.pmin, Math.min(cam.pmax, cam.pitch + dy * 0.004));
16230
+ cam.vy = dx * 0.0011;
16231
+ });
16232
+ canvas.addEventListener('pointerup', ev => {
16233
+ arr = false; cam.arrastando = false; canvas.style.cursor = 'grab';
16234
+ if (moveu < 6) aoClicar(ev);
16235
+ });
16236
+ }
16237
+
16238
+ /** VERSAO A: o ceu de fundos. */
16239
+ function homeCeu(canvas, pts, tip, ep) {
16240
+ if (!canvas || !pts || !pts.length) return;
16241
+ const mexe = homeMovimento();
16242
+ const BRACOS = [0, 2.09, 4.19];
16243
+ const maxPl = Number(pts[0].pl) || 1;
16244
+ const N = pts.length;
16245
+ const P = pts.map((p, i) => {
16246
+ const r0 = homeRnd(homeSemente(p.cnpj || i));
16247
+ const g = () => (r0() + r0() + r0() - 1.5) / 1.5;
16248
+ const k = homeClasse(p.classe), rank = i / N;
16249
+ const raio = 50 + 430 * Math.sqrt(rank) + g() * 22;
16250
+ const ang = (k < 3 ? BRACOS[k] + raio * 0.0072 + g() * 0.32 : r0() * Math.PI * 2);
16251
+ return { x: raio * Math.cos(ang), y: g() * (14 + 46 * (1 - rank)), z: raio * Math.sin(ang),
16252
+ s: 1.1 + 5.2 * Math.sqrt(Number(p.pl) / maxPl), k, p };
16253
+ });
16254
+ const sprites = HOME_CLASSES.map(c => {
16255
+ const o = document.createElement('canvas'); o.width = o.height = 64;
16256
+ const g = o.getContext('2d');
16257
+ const gr = g.createRadialGradient(32, 32, 0, 32, 32, 32);
16258
+ gr.addColorStop(0, '#ffffff'); gr.addColorStop(0.18, c.cor); gr.addColorStop(0.5, `${c.cor}55`); gr.addColorStop(1, `${c.cor}00`);
16259
+ g.fillStyle = gr; g.fillRect(0, 0, 64, 64);
16260
+ return o;
16261
+ });
16262
+ const cam = { yaw: 0.6, pitch: 0.42, vy: 0, pmin: 0.05, pmax: 1.3, arrastando: false };
16263
+ let hover = -1;
16264
+ const proj = new Float32Array(N * 3);
16265
+ const ordem = new Uint16Array(N);
16266
+ const st = homeCanvas(canvas, ep, (ctx, st) => {
16267
+ if (!cam.arrastando) { cam.yaw += cam.vy; cam.vy *= 0.94; if (mexe) cam.yaw += 0.0011; }
16268
+ const W = st.W, H = st.H;
16269
+ const pit = Math.max(0.08, Math.min(1.25, cam.pitch + st.rolagem * 0.55));
16270
+ const D = 900 - st.rolagem * 260, F = Math.min(W, H * 1.6) * 0.82;
16271
+ const cx = W * (W > 900 ? 0.68 : 0.5), cy = H * 0.5;
16272
+ const c0 = Math.cos(cam.yaw), s0 = Math.sin(cam.yaw), cp = Math.cos(pit), sp = Math.sin(pit);
16273
+ ctx.lineWidth = 1;
16274
+ for (const rr of [140, 280, 420, 560]) {
16275
+ ctx.beginPath();
16276
+ for (let a = 0; a <= 64; a++) {
16277
+ const t = (a / 64) * Math.PI * 2, x = rr * Math.cos(t), z = rr * Math.sin(t);
16278
+ const x1 = x * c0 - z * s0, z1 = x * s0 + z * c0, f = F / (D + z1 * cp);
16279
+ if (a) ctx.lineTo(cx + x1 * f, cy - z1 * sp * f); else ctx.moveTo(cx + x1 * f, cy - z1 * sp * f);
16280
+ }
16281
+ ctx.strokeStyle = 'rgba(79,176,122,0.10)'; ctx.stroke();
16282
+ }
16283
+ for (let i = 0; i < N; i++) {
16284
+ const q = P[i];
16285
+ const x1 = q.x * c0 - q.z * s0, z1 = q.x * s0 + q.z * c0;
16286
+ const y2 = q.y * cp - z1 * sp, z2 = q.y * sp + z1 * cp, f = F / (D + z2);
16287
+ proj[i * 3] = cx + x1 * f; proj[i * 3 + 1] = cy + y2 * f; proj[i * 3 + 2] = f; ordem[i] = i;
16288
+ }
16289
+ ordem.sort((a, b) => proj[a * 3 + 2] - proj[b * 3 + 2]);
16290
+ ctx.globalCompositeOperation = 'lighter';
16291
+ for (let j = 0; j < N; j++) {
16292
+ const i = ordem[j], f = proj[i * 3 + 2];
16293
+ const tam = Math.max(1.2, P[i].s * f * 2.6) * (i === hover ? 2.4 : 1);
16294
+ ctx.globalAlpha = Math.min(1, 0.35 + f * 0.7);
16295
+ ctx.drawImage(sprites[P[i].k], proj[i * 3] - tam, proj[i * 3 + 1] - tam, tam * 2, tam * 2);
16296
+ }
16297
+ ctx.globalAlpha = 1; ctx.globalCompositeOperation = 'source-over';
16298
+ if (hover >= 0) {
16299
+ ctx.beginPath();
16300
+ ctx.arc(proj[hover * 3], proj[hover * 3 + 1], 9 + P[hover].s * proj[hover * 3 + 2] * 2, 0, Math.PI * 2);
16301
+ ctx.strokeStyle = 'rgba(236,234,228,0.85)'; ctx.lineWidth = 1.2; ctx.stroke();
16302
+ }
16303
+ });
16304
+ const perto = (mx, my) => {
16305
+ let best = -1, bd = 14 * 14;
16306
+ for (let i = 0; i < N; i++) {
16307
+ const dx = proj[i * 3] - mx, dy = proj[i * 3 + 1] - my, d = dx * dx + dy * dy;
16308
+ if (d < bd) { bd = d; best = i; }
16309
+ }
16310
+ return best;
16311
+ };
16312
+ const mostra = (i, mx, my) => {
16313
+ hover = i;
16314
+ if (i < 0) { tip.hidden = true; return; }
16315
+ const p = P[i].p;
16316
+ tip.innerHTML = `<b>${esc(p.nome || p.cnpj)}</b><span>${esc(p.gestora || '')}</span>
16317
+ <span><i style="background:${HOME_CLASSES[P[i].k].cor}"></i>${esc(p.classe || 'sem classe')} · PL ${brl(Number(p.pl), { sinal: false })}</span>
16318
+ <a href="#/fundo/${esc(p.cnpj)}">abrir o fundo →</a>`;
16319
+ homePoeTip(tip, canvas, mx, my);
16320
+ };
16321
+ canvas.addEventListener('pointermove', ev => {
16322
+ if (cam.arrastando) { tip.hidden = true; hover = -1; return; }
16323
+ const r = canvas.getBoundingClientRect();
16324
+ mostra(perto(ev.clientX - r.left, ev.clientY - r.top), ev.clientX - r.left, ev.clientY - r.top);
16325
+ });
16326
+ canvas.addEventListener('pointerleave', () => { if (!cam.arrastando) mostra(-1); });
16327
+ homeArrasto(canvas, cam, ev => {
16328
+ const r = canvas.getBoundingClientRect();
16329
+ const i = perto(ev.clientX - r.left, ev.clientY - r.top);
16330
+ if (i < 0) return;
16331
+ if (ev.pointerType === 'mouse' || hover === i) location.hash = `#/fundo/${P[i].p.cnpj}`;
16332
+ else mostra(i, ev.clientX - r.left, ev.clientY - r.top);
16333
+ });
16334
+ return st;
16335
+ }
16336
+
16337
+ function homePoeTip(tip, canvas, mx, my) {
16338
+ tip.hidden = false;
16339
+ const r = canvas.getBoundingClientRect();
16340
+ tip.style.left = `${Math.max(8, Math.min(r.width - 290, mx + 16))}px`;
16341
+ tip.style.top = `${Math.max(8, Math.min(r.height - 120, my - 20))}px`;
16342
+ }
16343
+
16344
+ /** VERSAO B: a cidade das gestoras. Predios em grade, o maior no centro; altura
16345
+ * pela raiz do PL (o maior teria 50 vezes a altura do 50o pela escala linear, e
16346
+ * a cidade virava uma torre e um estacionamento). */
16347
+ function homeCidade(canvas, casas, tip, ep) {
16348
+ if (!canvas || !casas || !casas.length) return;
16349
+ const mexe = homeMovimento();
16350
+ const n = casas.length, lado = Math.ceil(Math.sqrt(n));
16351
+ // posicoes em espiral quadrada a partir do centro
16352
+ const cel = [];
16353
+ for (let r = 0; cel.length < n; r++) {
16354
+ for (let x = -r; x <= r; x++) for (let z = -r; z <= r; z++) {
16355
+ if (Math.max(Math.abs(x), Math.abs(z)) === r) cel.push([x, z]);
16356
+ }
16357
+ }
16358
+ cel.sort((a, b) => (Math.hypot(...a) - Math.hypot(...b)) || (Math.atan2(a[1], a[0]) - Math.atan2(b[1], b[0])));
16359
+ const maxPl = Math.max(...casas.map(c => Number(c.pl) || 0)) || 1;
16360
+ const PASSO = 46, BASE = 17;
16361
+ const T = casas.map((c, i) => ({
16362
+ c, x: cel[i][0] * PASSO, z: cel[i][1] * PASSO,
16363
+ h: 8 + 300 * Math.sqrt((Number(c.pl) || 0) / maxPl),
16364
+ pos: (Number(c.net) || 0) >= 0,
16365
+ }));
16366
+ const cam = { yaw: 0.7, pitch: 0.62, vy: 0, pmin: 0.25, pmax: 1.15, arrastando: false };
16367
+ let hover = -1;
16368
+ const faces = []; // polígonos do quadro, para o hover
16369
+ const cor = (pos, luz, alfa = 1) => {
16370
+ const [r, g, b] = pos ? [79, 176, 122] : [224, 112, 92];
16371
+ return `rgba(${Math.round(r * luz)},${Math.round(g * luz)},${Math.round(b * luz)},${alfa})`;
16372
+ };
16373
+ homeCanvas(canvas, ep, (ctx, st) => {
16374
+ if (!cam.arrastando) { cam.yaw += cam.vy; cam.vy *= 0.94; if (mexe) cam.yaw += 0.0009; }
16375
+ const W = st.W, H = st.H;
16376
+ const pit = Math.max(0.2, Math.min(1.2, cam.pitch + st.rolagem * 0.35));
16377
+ const D = 1100 - st.rolagem * 250, F = Math.min(W, H * 1.7) * 1.05;
16378
+ const cx = W * (W > 900 ? 0.63 : 0.5), cy = H * 0.62;
16379
+ const c0 = Math.cos(cam.yaw), s0 = Math.sin(cam.yaw), cp = Math.cos(pit), sp = Math.sin(pit);
16380
+ const P = (x, y, z) => {
16381
+ const x1 = x * c0 - z * s0, z1 = x * s0 + z * c0;
16382
+ const y2 = -y * cp - z1 * sp, z2 = -y * sp + z1 * cp, f = F / (D + z2);
16383
+ return [cx + x1 * f, cy + y2 * f, z2];
16384
+ };
16385
+ // chao em grade
16386
+ ctx.lineWidth = 1; ctx.strokeStyle = 'rgba(79,176,122,0.09)';
16387
+ const L = (lado / 2 + 1.5) * PASSO;
16388
+ for (let g = -L; g <= L + 1; g += PASSO) {
16389
+ let a = P(g - PASSO / 2, 0, -L), b = P(g - PASSO / 2, 0, L);
16390
+ ctx.beginPath(); ctx.moveTo(a[0], a[1]); ctx.lineTo(b[0], b[1]); ctx.stroke();
16391
+ a = P(-L, 0, g - PASSO / 2); b = P(L, 0, g - PASSO / 2);
16392
+ ctx.beginPath(); ctx.moveTo(a[0], a[1]); ctx.lineTo(b[0], b[1]); ctx.stroke();
16393
+ }
16394
+ // de tras para a frente, pela profundidade do centro
16395
+ const ord = T.map((t, i) => [i, P(t.x, 0, t.z)[2]]).sort((a, b) => b[1] - a[1]);
16396
+ faces.length = 0;
16397
+ for (const [i] of ord) {
16398
+ const t = T[i], b = BASE;
16399
+ const v = [[-b, -b], [b, -b], [b, b], [-b, b]].map(([dx, dz]) => [t.x + dx, t.z + dz]);
16400
+ const baixo = v.map(([x, z]) => P(x, 0, z)), alto = v.map(([x, z]) => P(x, t.h, z));
16401
+ const luzH = i === hover ? 1.25 : 1;
16402
+ // laterais: as 4, desenhadas da mais distante para a mais proxima
16403
+ const lados = [0, 1, 2, 3].map(k => {
16404
+ const k2 = (k + 1) % 4;
16405
+ return { k, z: (baixo[k][2] + baixo[k2][2]) / 2, pts: [baixo[k], baixo[k2], alto[k2], alto[k]] };
16406
+ }).sort((a, b2) => b2.z - a.z);
16407
+ for (const ld of lados) {
16408
+ ctx.beginPath(); ld.pts.forEach((p, j) => (j ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]))); ctx.closePath();
16409
+ ctx.fillStyle = cor(t.pos, (ld.k % 2 ? 0.42 : 0.6) * luzH, 0.92); ctx.fill();
16410
+ ctx.strokeStyle = cor(t.pos, 0.95 * luzH, 0.35); ctx.stroke();
16411
+ }
16412
+ ctx.beginPath(); alto.forEach((p, j) => (j ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1]))); ctx.closePath();
16413
+ ctx.fillStyle = cor(t.pos, 1.0 * luzH, 0.95); ctx.fill();
16414
+ faces.push({ i, poly: [baixo[0], baixo[1], baixo[2], baixo[3], alto[0], alto[1], alto[2], alto[3]] });
16415
+ }
16416
+ // nome das 6 maiores sobre o predio
16417
+ ctx.font = '600 11px "IBM Plex Mono", monospace'; ctx.textAlign = 'center';
16418
+ for (let i = 0; i < Math.min(6, n); i++) {
16419
+ const t = T[i], p = P(t.x, t.h + 22, t.z);
16420
+ ctx.fillStyle = 'rgba(236,234,228,0.92)'; ctx.fillText(String(t.c.nome).slice(0, 22), p[0], p[1]);
16421
+ }
16422
+ });
16423
+ const dentro = (mx, my) => {
16424
+ // o ultimo desenhado por cima ganha: percorre de tras para a frente e guarda o ultimo que contem o ponto
16425
+ let achou = -1;
16426
+ for (const f of faces) {
16427
+ const xs = f.poly.map(p => p[0]), ys = f.poly.map(p => p[1]);
16428
+ if (mx >= Math.min(...xs) && mx <= Math.max(...xs) && my >= Math.min(...ys) && my <= Math.max(...ys)) achou = f.i;
16429
+ }
16430
+ return achou;
16431
+ };
16432
+ const mostra = (i, mx, my) => {
16433
+ hover = i;
16434
+ if (i < 0) { tip.hidden = true; return; }
16435
+ const c = T[i].c, net = Number(c.net) || 0;
16436
+ tip.innerHTML = `<b>${esc(c.nome)}</b><span>PL ${brl(Number(c.pl), { sinal: false })}</span>
16437
+ <span class="${net >= 0 ? 'pos' : 'neg'}">captação líquida em 12 meses: ${brl(net)}</span>
16438
+ <a href="#/gestora/${c.grupo_id}">abrir a gestora →</a>`;
16439
+ homePoeTip(tip, canvas, mx, my);
16440
+ };
16441
+ canvas.addEventListener('pointermove', ev => {
16442
+ if (cam.arrastando) { tip.hidden = true; hover = -1; return; }
16443
+ const r = canvas.getBoundingClientRect();
16444
+ mostra(dentro(ev.clientX - r.left, ev.clientY - r.top), ev.clientX - r.left, ev.clientY - r.top);
16445
+ });
16446
+ canvas.addEventListener('pointerleave', () => { if (!cam.arrastando) mostra(-1); });
16447
+ homeArrasto(canvas, cam, ev => {
16448
+ const r = canvas.getBoundingClientRect();
16449
+ const i = dentro(ev.clientX - r.left, ev.clientY - r.top);
16450
+ if (i < 0) return;
16451
+ if (ev.pointerType === 'mouse' || hover === i) location.hash = `#/gestora/${T[i].c.grupo_id}`;
16452
+ else mostra(i, ev.clientX - r.left, ev.clientY - r.top);
16453
+ });
16454
+ }
16455
+
16456
+ /** VERSAO B: o anel de portas, que se arrasta e gira em 3D (CSS). */
16457
+ function homeAnel(palco, ep) {
16458
+ if (!palco) return;
16459
+ const anel = palco.querySelector('.home-anel');
16460
+ const itens = [...anel.children];
16461
+ const n = itens.length, passo = 360 / n;
16462
+ const raio = () => Math.max(260, Math.min(430, palco.clientWidth * 0.36));
16463
+ const poe = () => itens.forEach((el, i) => { el.style.transform = `rotateY(${i * passo}deg) translateZ(${raio()}px)`; });
16464
+ poe(); new ResizeObserver(poe).observe(palco);
16465
+ let ang = 0, vel = homeMovimento() ? 0.08 : 0, arr = false, ux = 0, moveu = 0;
16466
+ const quadro = () => {
16467
+ if (!palco.isConnected || !epocaAtual(ep)) return;
16468
+ requestAnimationFrame(quadro);
16469
+ if (!arr) { ang += vel; vel = vel * 0.95 + (homeMovimento() ? 0.08 : 0) * 0.05; }
16470
+ anel.style.transform = `translateZ(${-raio()}px) rotateY(${ang}deg)`;
16471
+ // o cartao da frente acende; os de tras somem um pouco
16472
+ itens.forEach((el, i) => {
16473
+ const a = (((i * passo + ang) % 360) + 360) % 360;
16474
+ const frente = Math.cos(a * Math.PI / 180);
16475
+ el.style.opacity = (0.35 + 0.65 * Math.max(0, frente)).toFixed(2);
16476
+ el.classList.toggle('frente', frente > 0.92);
16477
+ });
16478
+ };
16479
+ requestAnimationFrame(quadro);
16480
+ // A captura do ponteiro so entra DEPOIS de arrastar: capturando no toque, o
16481
+ // clique ia para o palco e o cartao nunca abria.
16482
+ let pid = null, cap = false;
16483
+ palco.addEventListener('pointerdown', ev => { arr = true; ux = ev.clientX; moveu = 0; pid = ev.pointerId; cap = false; });
16484
+ palco.addEventListener('pointermove', ev => {
16485
+ if (!arr) return;
16486
+ const dx = ev.clientX - ux; ux = ev.clientX; moveu += Math.abs(dx);
16487
+ if (moveu > 6 && !cap) { try { palco.setPointerCapture(pid); } catch { /* ok */ } cap = true; }
16488
+ if (moveu > 6) { ang += dx * 0.25; vel = dx * 0.25; }
16489
+ });
16490
+ palco.addEventListener('pointercancel', () => { arr = false; });
16491
+ palco.addEventListener('pointerup', ev => {
16492
+ arr = false; cap = false;
16493
+ // arrasto nao e clique: so navega quem soltou sem mexer
16494
+ if (moveu > 6) { ev.preventDefault(); palco.addEventListener('click', e => e.preventDefault(), { once: true, capture: true }); }
16495
+ });
16496
+ }
16497
+
16498
+ /** VERSAO C: tunel de particulas, na proporcao do PL de cada classe. */
16499
+ function homeTunel(canvas, fat, ep) {
16500
+ if (!canvas) return;
16501
+ const mexe = homeMovimento();
16502
+ const tot = fat.reduce((a, b) => a + b, 0) || 1;
16503
+ const N = window.matchMedia && matchMedia('(max-width: 760px)').matches ? 700 : 1600;
16504
+ const r0 = homeRnd(12345);
16505
+ const sorteia = () => { let u = r0() * tot; for (let k = 0; k < 4; k++) { u -= fat[k]; if (u <= 0) return k; } return 3; };
16506
+ const Q = Array.from({ length: N }, () => ({ a: r0() * Math.PI * 2, r: 60 + r0() * 520, z: r0() * 1600, k: sorteia(), v: 2 + r0() * 5 }));
16507
+ let mx = 0.5, my = 0.5;
16508
+ canvas.addEventListener('pointermove', ev => {
16509
+ const r = canvas.getBoundingClientRect();
16510
+ mx = (ev.clientX - r.left) / r.width; my = (ev.clientY - r.top) / r.height;
16511
+ });
16512
+ homeCanvas(canvas, ep, (ctx, st) => {
16513
+ const W = st.W, H = st.H;
16514
+ const fx = W * (0.35 + 0.3 * mx), fy = H * (0.35 + 0.3 * my); // ponto de fuga segue o mouse
16515
+ const vel = (mexe ? 1 : 0) * (1 + st.rolagem * 4);
16516
+ ctx.globalCompositeOperation = 'lighter';
16517
+ for (const q of Q) {
16518
+ const zAnt = q.z;
16519
+ q.z -= q.v * vel;
16520
+ if (q.z < 1) { q.z += 1600; q.a = r0() * Math.PI * 2; }
16521
+ const f = 320 / q.z, f0 = 320 / Math.min(1600, zAnt + q.v * 6);
16522
+ const x = fx + Math.cos(q.a) * q.r * f, y = fy + Math.sin(q.a) * q.r * f;
16523
+ const x0 = fx + Math.cos(q.a) * q.r * f0, y0 = fy + Math.sin(q.a) * q.r * f0;
16524
+ ctx.strokeStyle = HOME_CLASSES[q.k].cor;
16525
+ ctx.globalAlpha = Math.min(1, 0.15 + f * 0.9);
16526
+ ctx.lineWidth = Math.min(3, 0.6 + f * 1.6);
16527
+ ctx.beginPath(); ctx.moveTo(x0, y0); ctx.lineTo(x, y); ctx.stroke();
16528
+ }
16529
+ ctx.globalAlpha = 1; ctx.globalCompositeOperation = 'source-over';
16530
+ });
16531
+ }
16532
+
16533
+ /** VERSAO C: a narrativa presa na tela -- o numero grande troca conforme a rolagem. */
16534
+ function homeHistoria(ep) {
16535
+ const sec = document.getElementById('homeHistoria');
16536
+ if (!sec) return;
16537
+ const passos = [...sec.querySelectorAll('.home-passo')];
16538
+ const num = document.getElementById('homeHistNum'), rot = document.getElementById('homeHistRot');
16539
+ const barras = document.getElementById('homeBarras');
16540
+ let atual = -1;
16541
+ const io = new IntersectionObserver(es => es.forEach(e => {
16542
+ if (!e.isIntersecting) return;
16543
+ const i = passos.indexOf(e.target);
16544
+ if (i === atual) return;
16545
+ atual = i;
16546
+ rot.textContent = e.target.dataset.rot;
16547
+ homeConta(num, Number(e.target.dataset.alvo) || 0, e.target.dataset.fmt);
16548
+ barras.classList.toggle('on', !!e.target.dataset.barras);
16549
+ num.classList.remove('troca'); void num.offsetWidth; num.classList.add('troca');
16550
+ }), { threshold: 0.6 });
16551
+ passos.forEach(p => io.observe(p));
16552
+ }
16553
+
16554
+ /** VERSAO C: o cinema -- um video grande e os capitulos ao lado. */
16555
+ function homeCinema() {
16556
+ const cin = document.getElementById('homeCinema');
16557
+ if (!cin) return;
16558
+ const v = cin.querySelector('video');
16559
+ let ultimo = 0;
16560
+ cin.querySelectorAll('.home-cap').forEach(b => b.addEventListener('click', () => {
16561
+ const vd = HOME_VIDEOS[Number(b.dataset.i)];
16562
+ ultimo = 0;
16563
+ cin.querySelectorAll('.home-cap').forEach(x => x.classList.toggle('on', x === b));
16564
+ v.poster = `media/${vd.arq}.jpg`; v.dataset.src = `media/${vd.arq}.mp4`; v.src = v.dataset.src;
16565
+ v.play().catch(() => {});
16566
+ }));
16567
+ // terminou o loop de um capitulo: passa ao seguinte (so se o movimento estiver ligado)
16568
+ v.addEventListener('timeupdate', () => {
16569
+ if (!homeMovimento() || !v.duration) return;
16570
+ if (v.currentTime < ultimo - 1) {
16571
+ const caps = [...cin.querySelectorAll('.home-cap')];
16572
+ const i = caps.findIndex(x => x.classList.contains('on'));
16573
+ caps[(i + 1) % caps.length].click();
16574
+ }
16575
+ ultimo = v.currentTime;
16576
+ });
16577
+ }
index.html CHANGED
@@ -142,6 +142,7 @@
142
  logado -- o mesmo teste que protege os dados. Para os outros ele nao
143
  aparece, e a pagina continua barrada pelo Worker mesmo por URL. -->
144
  <a href="#/acessos" data-route="acessos" id="menuAdmin" title="painel de acessos (só você vê)" hidden>Acompanhamento</a>
 
145
  </nav>
146
 
147
  <div class="asof" id="asof"></div>
 
142
  logado -- o mesmo teste que protege os dados. Para os outros ele nao
143
  aparece, e a pagina continua barrada pelo Worker mesmo por URL. -->
144
  <a href="#/acessos" data-route="acessos" id="menuAdmin" title="painel de acessos (só você vê)" hidden>Acompanhamento</a>
145
+ <a href="#/inicio/a" data-route="inicio" class="so-dono" title="as versões da página inicial em teste (só você vê)" hidden>Home (testes)</a>
146
  </nav>
147
 
148
  <div class="asof" id="asof"></div>
media/home_captacao.jpg ADDED
media/home_captacao.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f25ff3b8fbcbeab88458bd96ed184c26a3ec44e598cd92ff22fd097fa1ff7dae
3
+ size 588387
media/home_credito.jpg ADDED
media/home_credito.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b821e685c71ccb850c894506bfb7b7d12960271adb1c267995439f58cc456282
3
+ size 700849
media/home_retornos.jpg ADDED
media/home_retornos.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:951b4ea1365b66c1b8090399bad5c2ba2f8e5d817e4915e308fff1f7f38df916
3
+ size 253407
styles.css CHANGED
@@ -2721,3 +2721,233 @@ tr.hist-linha > td { padding: 6px 0 14px; background: var(--papel-2); }
2721
 
2722
  /* Item do dono no menu: nasce [hidden] e assim tem de ficar para os outros. */
2723
  .tabs a[hidden], .topbar.lateral .tabs a[hidden] { display: none !important; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2721
 
2722
  /* Item do dono no menu: nasce [hidden] e assim tem de ficar para os outros. */
2723
  .tabs a[hidden], .topbar.lateral .tabs a[hidden] { display: none !important; }
2724
+
2725
+ /* ================================================================ HOME (testes)
2726
+ A vitrine (18/11/2026): tres versoes em #/inicio/a|b|c. Tudo aqui vive sob
2727
+ `.home` e o prefixo `home-`: nada vaza para o resto do site, que continua
2728
+ com a cara sobria de sempre. Cores: o acento do site (#4fb07a) e o azul da
2729
+ paleta validada, com brilho; texto continua nos tokens de tinta. */
2730
+ .home {
2731
+ --h-neon: #4fb07a; --h-azul: #3987e5; --h-fundo: #07090a;
2732
+ /* `overflow-x: clip` e NAO `overflow: hidden`: hidden cria um conteiner de
2733
+ rolagem e mata o `position: sticky` da narrativa da versao C. */
2734
+ margin: -22px -26px -40px; color: var(--tinta); position: relative; overflow-x: clip;
2735
+ background:
2736
+ radial-gradient(1200px 600px at 75% 0%, rgba(57,135,229,.10), transparent 60%),
2737
+ radial-gradient(900px 500px at 10% 30%, rgba(79,176,122,.08), transparent 60%),
2738
+ var(--h-fundo);
2739
+ }
2740
+ @media (max-width: 960px) { .home { margin: -16px -14px -30px; } }
2741
+
2742
+ /* ---------------------------------------------------------------- hero */
2743
+ .home-hero { position: relative; min-height: min(92vh, 880px); display: flex; align-items: center; overflow: hidden; }
2744
+ .home-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
2745
+ .home-chao {
2746
+ position: absolute; left: -20%; right: -20%; bottom: -8%; height: 46%; pointer-events: none;
2747
+ background-image: linear-gradient(rgba(79,176,122,.22) 1px, transparent 1px),
2748
+ linear-gradient(90deg, rgba(79,176,122,.22) 1px, transparent 1px);
2749
+ background-size: 64px 64px; transform: perspective(520px) rotateX(62deg); transform-origin: 50% 0;
2750
+ -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%); mask-image: linear-gradient(to top, #000 10%, transparent 90%);
2751
+ animation: homeChao 6s linear infinite; opacity: .55;
2752
+ }
2753
+ @keyframes homeChao { to { background-position: 0 64px, 0 0; } }
2754
+ .home-hero-txt { position: relative; z-index: 2; max-width: 620px; padding: 64px 0 120px 56px; pointer-events: none; }
2755
+ .home-hero-txt a, .home-hero-txt button { pointer-events: auto; }
2756
+ /* sombra atras do texto: o grafico passa por baixo sem roubar a leitura */
2757
+ .home-hero-txt::before { content: ''; position: absolute; z-index: -1; inset: -10px -140px -20px -90px; pointer-events: none;
2758
+ background: radial-gradient(closest-side, rgba(7,9,10,.88), rgba(7,9,10,.6) 55%, rgba(7,9,10,0)); }
2759
+ .home-kicker { font: 600 11px/1.4 "IBM Plex Mono", monospace; letter-spacing: .16em; color: var(--h-neon); display: flex; align-items: center; gap: 10px; }
2760
+ .home-pulso { width: 8px; height: 8px; border-radius: 50%; background: var(--h-neon); box-shadow: 0 0 0 0 rgba(79,176,122,.7); animation: homePulso 2s infinite; }
2761
+ @keyframes homePulso { 70% { box-shadow: 0 0 0 10px rgba(79,176,122,0); } 100% { box-shadow: 0 0 0 0 rgba(79,176,122,0); } }
2762
+ .home-h1 { font: 700 clamp(40px, 6.2vw, 86px)/0.98 "Instrument Sans", system-ui, sans-serif; letter-spacing: -.035em; margin: 18px 0 18px; }
2763
+ .home-grad { background: linear-gradient(100deg, #6fe0a0 0%, var(--h-neon) 35%, #63a8f5 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 22px rgba(79,176,122,.35)); }
2764
+ .home-lead { font-size: 17px; line-height: 1.55; color: var(--tinta-2); max-width: 520px; margin: 0 0 26px; }
2765
+ .home-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }
2766
+ .home-btn {
2767
+ display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px;
2768
+ font: 600 14px "Instrument Sans", sans-serif; color: #06120b; background: var(--h-neon); text-decoration: none;
2769
+ box-shadow: 0 0 0 1px rgba(79,176,122,.6), 0 10px 40px -10px rgba(79,176,122,.7); transition: transform .2s, box-shadow .2s;
2770
+ }
2771
+ .home-btn:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 0 0 1px rgba(79,176,122,.9), 0 16px 50px -8px rgba(79,176,122,.9); }
2772
+ .home-btn-2 { background: rgba(255,255,255,.04); color: var(--tinta); box-shadow: inset 0 0 0 1px rgba(236,234,228,.22); backdrop-filter: blur(6px); }
2773
+ .home-btn-2:hover { box-shadow: inset 0 0 0 1px rgba(236,234,228,.5), 0 10px 30px -10px rgba(57,135,229,.6); }
2774
+ .home-stats { display: flex; flex-wrap: wrap; gap: 14px 34px; }
2775
+ .home-stat b { display: block; font: 600 clamp(22px, 2.6vw, 32px)/1.1 "IBM Plex Mono", monospace; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
2776
+ .home-stat span { font-size: 12px; color: var(--tinta-3); }
2777
+ .home-legenda { position: absolute; left: 56px; bottom: 26px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px 16px; font: 11px "IBM Plex Mono", monospace; color: var(--tinta-2); }
2778
+ .home-legenda i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: 0 0 10px currentColor; }
2779
+ .home-legenda-obs { color: var(--tinta-3); flex-basis: 100%; }
2780
+ .home-tip {
2781
+ position: absolute; z-index: 5; width: 270px; padding: 10px 12px; border-radius: 10px; pointer-events: auto;
2782
+ background: rgba(14,16,15,.82); backdrop-filter: blur(10px); border: 1px solid rgba(79,176,122,.35);
2783
+ box-shadow: 0 20px 50px -20px rgba(0,0,0,.8); font-size: 12.5px; display: grid; gap: 3px;
2784
+ }
2785
+ .home-tip[hidden] { display: none; }
2786
+ .home-tip span { color: var(--tinta-2); }
2787
+ .home-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
2788
+ .home-tip a { color: var(--h-neon); margin-top: 4px; }
2789
+ .home-desca { position: absolute; right: 30px; bottom: 26px; font: 11px "IBM Plex Mono", monospace; color: var(--tinta-3); letter-spacing: .14em; text-transform: uppercase; }
2790
+ .home-desca span { display: inline-block; animation: homeDesce 1.6s ease-in-out infinite; }
2791
+ @keyframes homeDesce { 50% { transform: translateY(5px); } }
2792
+
2793
+ /* ---------------------------------------------------------- faixa que corre */
2794
+ .home-faixa { position: relative; display: flex; align-items: center; gap: 18px; padding: 14px 0 14px 56px;
2795
+ border-top: 1px solid rgba(79,176,122,.18); border-bottom: 1px solid rgba(79,176,122,.18); background: rgba(79,176,122,.03); }
2796
+ .home-faixa-rot { flex: none; font: 600 10.5px "IBM Plex Mono", monospace; letter-spacing: .16em; color: var(--h-neon); }
2797
+ .home-trilho { overflow: hidden; flex: 1; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
2798
+ .home-trilho-in { display: flex; gap: 34px; width: max-content; animation: homeCorre 60s linear infinite; }
2799
+ .home-faixa:hover .home-trilho-in { animation-play-state: paused; }
2800
+ @keyframes homeCorre { to { transform: translateX(-50%); } }
2801
+ .home-casa { display: inline-flex; gap: 10px; align-items: baseline; white-space: nowrap; color: var(--tinta); text-decoration: none; }
2802
+ .home-casa:hover { color: var(--h-neon); text-decoration: none; }
2803
+ .home-casa-n { font-size: 13.5px; }
2804
+ .home-casa-v { font: 12px "IBM Plex Mono", monospace; color: var(--tinta-3); }
2805
+
2806
+ /* ---------------------------------------------------------------- secoes */
2807
+ .home-sec { position: relative; padding: 96px 56px; }
2808
+ .home-sec-cab { position: relative; z-index: 2; max-width: 760px; margin-bottom: 40px; }
2809
+ .home-sec-cab h2 { font: 700 clamp(28px, 3.6vw, 46px)/1.05 "Instrument Sans", sans-serif; letter-spacing: -.03em; margin: 8px 0 12px; }
2810
+ .home-sec-cab p { color: var(--tinta-2); font-size: 16px; margin: 0; }
2811
+ .home-num { font: 600 12px "IBM Plex Mono", monospace; color: var(--h-neon); letter-spacing: .2em; }
2812
+ .home-camada { position: absolute; pointer-events: none; border-radius: 50%; filter: blur(60px); }
2813
+ .home-camada-1 { width: 520px; height: 520px; right: -120px; top: 40px; background: rgba(57,135,229,.16); }
2814
+ .home-camada-2 { width: 380px; height: 380px; left: 8%; bottom: -80px; background: rgba(79,176,122,.14); }
2815
+
2816
+ /* entrada em 3D: sobe girando em X. `backwards` e nao `both`: terminada a
2817
+ animacao, o transform volta a ser o do elemento (a inclinacao dos cartoes). */
2818
+ .home-rev { opacity: 0; }
2819
+ .home-rev.home-vis { opacity: 1; animation: homeEntra .9s cubic-bezier(.2,.7,.2,1) backwards; animation-delay: calc(var(--i, 0) * 90ms); }
2820
+ @keyframes homeEntra { from { opacity: 0; transform: perspective(900px) translateY(46px) rotateX(22deg); } }
2821
+
2822
+ .home-grade { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
2823
+ .home-porta {
2824
+ position: relative; display: grid; gap: 8px; padding: 26px 24px 22px; border-radius: 16px; overflow: hidden;
2825
+ color: var(--tinta); text-decoration: none; background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
2826
+ border: 1px solid rgba(236,234,228,.10); transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
2827
+ transition: transform .18s ease-out, border-color .2s, box-shadow .2s; transform-style: preserve-3d; min-height: 190px;
2828
+ }
2829
+ .home-porta:hover { text-decoration: none; border-color: rgba(79,176,122,.55); box-shadow: 0 30px 60px -30px rgba(79,176,122,.45); }
2830
+ .home-porta-luz { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s;
2831
+ background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(79,176,122,.20), transparent 60%); }
2832
+ .home-porta:hover .home-porta-luz { opacity: 1; }
2833
+ .home-porta-ic { width: 34px; height: 34px; fill: none; stroke: var(--h-neon); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
2834
+ filter: drop-shadow(0 0 8px rgba(79,176,122,.6)); transform: translateZ(30px); }
2835
+ .home-porta-t { font: 700 21px "Instrument Sans", sans-serif; letter-spacing: -.01em; transform: translateZ(24px); }
2836
+ .home-porta-d { color: var(--tinta-2); font-size: 14px; line-height: 1.5; transform: translateZ(16px); }
2837
+ .home-porta-ir { margin-top: auto; font: 12px "IBM Plex Mono", monospace; color: var(--h-neon); transform: translateZ(20px); }
2838
+
2839
+ .home-numeros { overflow: hidden; padding-top: 120px; padding-bottom: 120px; }
2840
+ .home-gigante { position: absolute; left: 50%; top: 50%; margin: -0.55em 0 0 -1.5em; font: 800 clamp(160px, 26vw, 380px)/1 "Instrument Sans", sans-serif;
2841
+ letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1px rgba(79,176,122,.22); pointer-events: none; white-space: nowrap; }
2842
+ .home-numeros-in { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 1000px; margin: 0 auto; text-align: center; }
2843
+ .home-numeros-in b { display: block; font: 600 clamp(40px, 5vw, 68px)/1 "IBM Plex Mono", monospace; letter-spacing: -.04em; text-shadow: 0 0 30px rgba(79,176,122,.35); }
2844
+ .home-numeros-in span { color: var(--tinta-2); font-size: 14px; }
2845
+
2846
+ /* ---------------------------------------------------------------- videos */
2847
+ .home-vgrade { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
2848
+ .home-video { margin: 0; display: grid; gap: 14px; align-content: start; }
2849
+ .home-tela {
2850
+ position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; background: #0d0f0e;
2851
+ border: 1px solid rgba(236,234,228,.12); box-shadow: 0 40px 80px -40px rgba(0,0,0,.9), 0 0 0 1px rgba(79,176,122,.08);
2852
+ transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .18s ease-out, box-shadow .2s;
2853
+ }
2854
+ .home-tela:hover { box-shadow: 0 40px 80px -30px rgba(79,176,122,.35), 0 0 0 1px rgba(79,176,122,.45); }
2855
+ .home-tela video { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
2856
+ .home-play { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; border: 0; cursor: pointer;
2857
+ background: rgba(79,176,122,.92); color: #06120b; font-size: 20px; box-shadow: 0 0 40px rgba(79,176,122,.6); transition: opacity .2s, transform .2s; }
2858
+ .home-play:hover { transform: scale(1.08); }
2859
+ .tocando .home-play { opacity: 0; pointer-events: none; }
2860
+ .home-vbarra { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.08); }
2861
+ .home-vbarra i { display: block; height: 100%; width: 0; background: var(--h-neon); box-shadow: 0 0 10px var(--h-neon); }
2862
+ .home-video figcaption { display: grid; gap: 8px; }
2863
+ .home-vt { font: 700 18px "Instrument Sans", sans-serif; }
2864
+ .home-video ol { margin: 0; padding-left: 18px; color: var(--tinta-2); font-size: 13.5px; line-height: 1.55; }
2865
+ .home-vir { font: 12px "IBM Plex Mono", monospace; color: var(--h-neon); }
2866
+
2867
+ .home-fim { text-align: center; padding: 110px 24px 120px; background: radial-gradient(600px 300px at 50% 40%, rgba(79,176,122,.12), transparent 70%); }
2868
+ .home-fim h2 { font: 700 clamp(30px, 4.4vw, 56px)/1 "Instrument Sans", sans-serif; letter-spacing: -.035em; margin: 0 0 12px; }
2869
+ .home-fim p { color: var(--tinta-2); margin: 0 0 26px; }
2870
+ .home-fonte { margin-top: 34px; font: 11px "IBM Plex Mono", monospace; color: var(--tinta-3); }
2871
+
2872
+ /* seletor de versoes (teste) */
2873
+ .home-versoes { position: fixed; z-index: 30; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px;
2874
+ padding: 5px; border-radius: 999px; background: rgba(12,14,13,.86); backdrop-filter: blur(10px); border: 1px solid rgba(79,176,122,.35);
2875
+ box-shadow: 0 20px 50px -20px rgba(0,0,0,.9); font: 12px "IBM Plex Mono", monospace; }
2876
+ .home-versoes > span { color: var(--tinta-3); padding: 0 8px 0 10px; }
2877
+ .home-versoes a { padding: 6px 12px; border-radius: 999px; color: var(--tinta-2); text-decoration: none; white-space: nowrap; }
2878
+ .home-versoes a:hover { color: var(--tinta); text-decoration: none; }
2879
+ .home-versoes a.on { background: var(--h-neon); color: #06120b; }
2880
+
2881
+ /* ------------------------------------------------------------ versao B */
2882
+ .home-hero-b { min-height: min(94vh, 900px); }
2883
+ .home-hero-txt-b { max-width: 520px; }
2884
+ .home-b-stats { padding-top: 42px; padding-bottom: 42px; display: flex; justify-content: center; }
2885
+ .home-b-stats .home-stats { gap: 18px 70px; justify-content: center; }
2886
+ .home-anel-sec { overflow: hidden; }
2887
+ .home-anel-palco { position: relative; height: 380px; perspective: 1500px; cursor: grab; touch-action: pan-y; user-select: none; }
2888
+ .home-anel-palco:active { cursor: grabbing; }
2889
+ .home-anel { position: absolute; left: 50%; top: 50%; width: 270px; height: 220px; margin: -110px 0 0 -135px; transform-style: preserve-3d; }
2890
+ .home-anel-item { position: absolute; inset: 0; min-height: 0; transition: border-color .2s, box-shadow .2s; -webkit-user-drag: none;
2891
+ backface-visibility: hidden; -webkit-backface-visibility: hidden;
2892
+ background: linear-gradient(160deg, rgba(20,24,22,.96), rgba(12,14,13,.96)); }
2893
+ .home-anel-item.frente { border-color: rgba(79,176,122,.7); box-shadow: 0 0 60px -10px rgba(79,176,122,.5); }
2894
+
2895
+ /* ------------------------------------------------------------ versao C */
2896
+ .home-hero-c { min-height: min(96vh, 920px); justify-content: center; text-align: center; }
2897
+ .home-hero-txt-c { max-width: 820px; padding: 60px 24px 120px; margin: 0 auto; }
2898
+ .home-hero-txt-c .home-kicker, .home-hero-txt-c .home-ctas { justify-content: center; }
2899
+ .home-hero-txt-c .home-lead { margin-left: auto; margin-right: auto; }
2900
+ .home-h1-c { font-size: clamp(56px, 10vw, 150px); }
2901
+ .home-hero-c .home-legenda { left: 50%; transform: translateX(-50%); justify-content: center; text-align: center; width: max-content; max-width: 92%; }
2902
+ .home-historia { position: relative; }
2903
+ .home-historia-palco { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 0 24px; }
2904
+ .home-historia-num { font: 600 clamp(56px, 11vw, 160px)/1 "IBM Plex Mono", monospace; letter-spacing: -.05em; font-variant-numeric: tabular-nums;
2905
+ background: linear-gradient(100deg, #6fe0a0, #63a8f5); -webkit-background-clip: text; background-clip: text; color: transparent;
2906
+ filter: drop-shadow(0 0 30px rgba(79,176,122,.3)); }
2907
+ .home-historia-num.troca { animation: homeTroca .6s cubic-bezier(.2,.7,.2,1); }
2908
+ @keyframes homeTroca { from { transform: perspective(800px) rotateX(70deg) translateY(30px); opacity: 0; } }
2909
+ .home-historia-rot { font-size: 18px; color: var(--tinta-2); max-width: 560px; margin-top: 18px; min-height: 2.6em; }
2910
+ .home-barras { width: min(720px, 92vw); margin-top: 34px; display: grid; gap: 10px; opacity: 0; transform: translateY(20px); transition: opacity .6s, transform .6s; }
2911
+ .home-barras.on { opacity: 1; transform: none; }
2912
+ .home-barra { display: grid; grid-template-columns: 9.5rem 1fr 3rem; gap: 12px; align-items: center; font-size: 13px; text-align: left; }
2913
+ .home-barra i { display: block; height: 10px; border-radius: 0 6px 6px 0; width: 0; transition: width 1.1s cubic-bezier(.2,.7,.2,1); box-shadow: 0 0 14px currentColor; }
2914
+ .home-barras.on .home-barra i { width: var(--w); }
2915
+ .home-barra b { font: 600 13px "IBM Plex Mono", monospace; text-align: right; }
2916
+ .home-historia-passos { margin-top: -100vh; position: relative; pointer-events: none; }
2917
+ .home-passo { height: 100vh; }
2918
+ .home-cinema { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 22px; align-items: start; }
2919
+ .home-capitulos { display: grid; gap: 10px; }
2920
+ .home-cap { text-align: left; display: grid; gap: 4px; padding: 16px 18px; border-radius: 12px; cursor: pointer; font: inherit; color: var(--tinta);
2921
+ background: rgba(255,255,255,.03); border: 1px solid rgba(236,234,228,.10); transition: border-color .2s, background .2s; }
2922
+ .home-cap:hover { border-color: rgba(79,176,122,.45); }
2923
+ .home-cap.on { border-color: var(--h-neon); background: rgba(79,176,122,.08); box-shadow: 0 0 40px -18px rgba(79,176,122,.7); }
2924
+ .home-cap-n { font: 600 11px "IBM Plex Mono", monospace; color: var(--h-neon); letter-spacing: .16em; }
2925
+ .home-cap-t { font: 700 16px "Instrument Sans", sans-serif; }
2926
+ .home-cap-d { font-size: 13px; color: var(--tinta-2); }
2927
+
2928
+ /* ------------------------------------------------------------ celular */
2929
+ @media (max-width: 960px) {
2930
+ .home-hero-txt { padding: 48px 20px 150px; max-width: none; }
2931
+ .home-hero-txt-c { padding: 48px 20px 150px; }
2932
+ .home-legenda { left: 20px; right: 20px; bottom: 18px; }
2933
+ .home-desca { display: none; }
2934
+ .home-faixa { padding-left: 20px; }
2935
+ .home-sec { padding: 64px 20px; }
2936
+ .home-grade, .home-vgrade, .home-numeros-in, .home-cinema { grid-template-columns: 1fr; }
2937
+ .home-numeros-in { gap: 34px; }
2938
+ .home-anel-palco { height: 320px; }
2939
+ .home-anel { width: 220px; height: 210px; margin: -105px 0 0 -110px; }
2940
+ .home-versoes { bottom: 10px; max-width: 94vw; overflow-x: auto; }
2941
+ .home-versoes > span { display: none; }
2942
+ .home-barra { grid-template-columns: 7rem 1fr 2.6rem; }
2943
+ }
2944
+
2945
+ /* movimento reduzido: nada corre, nada gira sozinho */
2946
+ .home-quieta .home-chao, .home-quieta .home-trilho-in, .home-quieta .home-pulso, .home-quieta .home-desca span { animation: none; }
2947
+ .home-quieta .home-trilho { overflow-x: auto; }
2948
+ .home-quieta .home-rev { opacity: 1; }
2949
+ .home-quieta .home-rev.home-vis { animation: none; }
2950
+ @media (prefers-reduced-motion: reduce) {
2951
+ .home-chao, .home-trilho-in, .home-pulso { animation: none; }
2952
+ .home-rev { opacity: 1; }
2953
+ }