/* =============================================================
   DETALHES · microinterações, transições e ícones animados
   (pedido do Hans em 25/11: "detalhes, detalhes, detalhes").
   Carregar depois de v3-componentes.css. Tudo some com
   prefers-reduced-motion (bloco no fim do arquivo).
   ============================================================= */

/* ---------- transição entre páginas (navegação do próprio site) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: sai .32s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: entra .5s cubic-bezier(.2, .7, .1, 1) both; }
@keyframes sai { to { opacity: 0; transform: translateY(-10px); } }
@keyframes entra { from { opacity: 0; transform: translateY(14px); } }

/* seta que convida a rolar (a do "Conheça meu trabalho" do site atual) */
.hero__rolar { display: inline-grid; place-items: center; width: 52px; height: 52px; margin-top: 26px; border-radius: 50%; border: 1px solid rgba(244, 245, 247, .28); color: var(--color-text); transition: background .3s, border-color .3s; }
.hero__rolar svg { width: 20px; height: 20px; animation: desce 2.4s var(--curva) infinite; }
.hero__rolar:hover { background: var(--color-brand); border-color: var(--color-brand); }
@keyframes desce { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(4px); } }

/* ---------- títulos sobem por trás de uma máscara ---------- */
.js .titulo[data-r], .js .topo__titulo[data-r] { opacity: 1; transform: none; clip-path: inset(0 0 100% 0); translate: 0 .35em; transition: clip-path 1.1s var(--curva), translate 1.1s var(--curva); transition-delay: calc(var(--d, 0) * 90ms); }
.js .titulo[data-r].vis, .js .topo__titulo[data-r].vis { clip-path: inset(-10% -5% -20% -5%); translate: 0 0; }

/* ---------- o fio do rótulo se desenha ---------- */
.js .rotulo[data-r]::after { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.3s var(--curva) .2s; }
.js .rotulo[data-r].vis::after { transform: scaleX(1); }
.rotulo b { display: inline-block; }
.js .rotulo[data-r].vis b { animation: pisca-num 1.2s var(--curva) .15s both; }
@keyframes pisca-num { 0% { opacity: 0; transform: translateY(6px); } 100% { opacity: 1; transform: none; } }

/* ---------- telas se revelam (portfólio, blocos, embreve, retrato) ---------- */
.js [data-r] .port__tela, .js [data-r] .bloco__tela, .js [data-r].retrato, .js [data-r] .embreve { clip-path: inset(100% 0 0 0 round 18px); transition: clip-path 1.2s var(--curva) .1s; }
.js [data-r].vis .port__tela, .js [data-r].vis .bloco__tela, .js [data-r].retrato.vis, .js [data-r].vis .embreve { clip-path: inset(0 0 0 0 round 18px); }
.js [data-r].retrato { clip-path: inset(100% 0 0 0 round 28px); }
.js [data-r].retrato.vis { clip-path: inset(0 0 0 0 round 28px); }

/* ---------- ícones SVG das frentes: se desenham ao aparecer e ganham vida no hover ---------- */
.bloco__icone { width: 64px; height: 64px; margin-left: auto; color: var(--color-brand); }
.bloco__topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bloco__icone path, .bloco__icone circle, .bloco__icone rect, .bloco__icone line, .bloco__icone polyline { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 220; stroke-dashoffset: 220; transition: stroke-dashoffset 1.6s var(--curva); }
.vis .bloco__icone path, .vis .bloco__icone circle, .vis .bloco__icone rect, .vis .bloco__icone line, .vis .bloco__icone polyline { stroke-dashoffset: 0; }
.vis .bloco__icone :nth-child(2) { transition-delay: .25s; }
.vis .bloco__icone :nth-child(3) { transition-delay: .45s; }
.vis .bloco__icone :nth-child(4) { transition-delay: .6s; }
.bloco__icone g { transform-box: fill-box; transform-origin: 50% 50%; transition: transform .8s var(--curva); }
/* elos: os anéis se aproximam */
.icone-elos .elo-a { transition: transform .8s var(--curva); }
.bloco:hover .icone-elos .elo-a { transform: translateX(5px); }
.bloco:hover .icone-elos .elo-b { transform: translateX(-5px); }
/* dados: as barras crescem e a lupa varre */
.icone-dados .barra { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .6s var(--curva); }
.bloco:hover .icone-dados .barra:nth-of-type(1) { transform: scaleY(1.35); }
.bloco:hover .icone-dados .barra:nth-of-type(2) { transform: scaleY(.7); transition-delay: .05s; }
.bloco:hover .icone-dados .barra:nth-of-type(3) { transform: scaleY(1.2); transition-delay: .1s; }
.bloco:hover .icone-dados .lupa { transform: translate(-6px, -4px); }
/* tecnologia: o cursor pisca dentro da janela */
.icone-codigo .cursor { animation: cursor 1.1s steps(1) infinite; }
@keyframes cursor { 50% { opacity: 0; } }
.bloco:hover .icone-codigo .chaves { transform: scaleX(1.12); }

/* ---------- menu do celular vira X ---------- */
.nav__menu svg path { transition: transform .35s var(--curva), opacity .25s; transform-box: fill-box; transform-origin: 50% 50%; }
.nav.aberto .nav__menu .l1 { transform: translateY(4px) rotate(45deg); }
.nav.aberto .nav__menu .l2 { transform: translateY(-4px) rotate(-45deg); }
.nav__links a:not(.nav__cta) { position: relative; }
@media (min-width: 901px) {
  .nav__links a:not(.nav__cta)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--color-brand); transform: scaleX(0); transform-origin: 100% 50%; transition: transform .45s var(--curva); }
  .nav__links a:not(.nav__cta):hover::after { transform: scaleX(1); transform-origin: 0 50%; }
}
.nav__cta::before, .nav__links a[aria-current="page"]::before { animation: pulso 2.6s ease-in-out infinite; }
@keyframes pulso { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 9, 20, .55); } 60% { box-shadow: 0 0 0 6px rgba(229, 9, 20, 0); } }

/* ---------- botões: brilho que atravessa e leve atração pelo cursor (via site.js) ---------- */
.botao { position: relative; overflow: hidden; isolation: isolate; will-change: transform; }
.botao--cheio::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s var(--curva); }
.botao--cheio:hover::after { transform: translateX(120%); }
.link-seta span, .bloco__destino { transition: transform .35s var(--curva), letter-spacing .35s var(--curva); }
.bloco:hover .bloco__destino { letter-spacing: .1em; }

/* ---------- cartões: luz que segue o cursor (variáveis --mx/--my via site.js) ---------- */
.parceiro, .bloco, .painel, .cartao { --mx: 50%; --my: 50%; }
.parceiro--tinta, .bloco--texto { background-image: radial-gradient(420px circle at var(--mx) var(--my), rgba(229, 9, 20, .10), transparent 60%); }
.secao--clara .bloco--texto { background-image: radial-gradient(420px circle at var(--mx) var(--my), rgba(229, 9, 20, .06), transparent 60%); }
.parceiro--vermelho { background-image: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, .16), transparent 60%); }

/* ---------- números: contador + desenho com a quantidade exata (site.js) ---------- */
.numero b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.numero b span { font-size: inherit; line-height: inherit; color: inherit; }   /* o ".numero span" do v3.css é para a legenda, não para o número */
.numero b .numero__mais { color: var(--color-brand); }
.numero__mais { display: inline-block; color: var(--color-brand); margin-left: .02em; transition: transform .5s var(--curva); }
.numero b.chegou .numero__mais { animation: mais .7s var(--curva); }
@keyframes mais { 40% { transform: scale(1.35) rotate(90deg); } 100% { transform: none; } }
.numero__viz { grid-column: 2; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; margin-top: 4px; }
.numero__viz i { display: block; background: var(--color-line); transition: background .25s, transform .35s var(--curva); }
.numero__viz i.on { background: var(--color-brand); }
.numero__viz--anos { gap: 6px; }
.numero__viz--anos i { width: 3px; height: 22px; border-radius: 2px; transform: scaleY(.45); transform-origin: 50% 100%; }
.numero__viz--anos i.on { transform: none; }
.numero__viz--marcas { gap: 3px; max-width: 300px; }
.numero__viz--marcas i { width: 6px; height: 6px; border-radius: 50%; }
.numero__viz--telas { gap: 5px; max-width: 260px; }
.numero__viz--telas i { width: 18px; height: 12px; border-radius: 3px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .12); }
.numero__viz--telas i.on { background: #f4f5f7; box-shadow: inset 0 3px 0 var(--color-brand); }
@media (max-width: 680px) { .numero__viz { grid-column: 1; justify-content: center; margin-inline: auto; } }

/* ---------- etiquetas e itens de lista: resposta ao toque ---------- */
.etiqueta { transition: border-color .3s, color .3s, background .3s; }
.etiqueta:hover { border-color: var(--color-brand); color: var(--color-text); }
.lista li { transition: padding-left .4s var(--curva), color .3s; }
.lista li::before { transition: width .4s var(--curva); }
.lista li:hover { padding-left: 34px; color: var(--color-text); }
.lista li:hover::before { width: 18px; }

/* ---------- logos do mural acendem um a um ao aparecer ---------- */
.js [data-r] .marcas__mural img { opacity: 0; transform: translateY(8px); transition: opacity .6s var(--curva), transform .6s var(--curva); }
.js [data-r].vis .marcas__mural img { opacity: .55; transform: none; }
.js [data-r].vis .marcas__mural img:hover { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .titulo[data-r], .js .topo__titulo[data-r], .js [data-r] .port__tela, .js [data-r] .bloco__tela, .js [data-r].retrato, .js [data-r] .embreve, .js .hero__frase span { clip-path: none !important; translate: none !important; transform: none !important; }
  .js .hero__cena { opacity: 1; transform: none; }
  .bloco__icone * { stroke-dashoffset: 0 !important; }
  .js [data-r] .marcas__mural img { opacity: .55; transform: none; }
}

/* ---------- arcos do horizonte atrás do nome (home) ---------- */
.hero__arcos { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* com o vidro 3D no ar, os arcos são desenhados dentro da textura que ele refrata; a camada solta só aparece sem WebGL */
html[data-vidro="ok"] .hero__arcos { visibility: hidden; }