/* Biblioteca de motion: estilos estruturais dos componentes.
   Cores vêm do tema por variáveis: --acao, --acao-forte, --traco, --fundo, --painel,
   --linha, --linha2, --texto, --texto-sec, --sobre-acao. */

/* P-016 · reduced-motion: tudo para no estado final */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* P-001 · traço de caneta */
.tr { fill: none; stroke: var(--traco, var(--acao)); stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.draw .tr { animation: tr-desenha 1.1s cubic-bezier(.65,.05,.3,1) both; }
.draw .tr.d2 { animation-delay: .35s } .draw .tr.d3 { animation-delay: .6s } .draw .tr.d4 { animation-delay: .85s }
@keyframes tr-desenha { from { stroke-dashoffset: 1 } to { stroke-dashoffset: 0 } }
.mk { position: relative; display: inline-block; white-space: nowrap; z-index: 0; }
.mk > svg { position: absolute; pointer-events: none; overflow: visible; z-index: -1; max-width: none; }

/* P-003 · tag de sobretítulo */
.tag { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--tag, var(--acao)); margin: 0 0 24px; }
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* avatares acendendo */
.av { transform-box: fill-box; transform-origin: center; transition: opacity .45s ease, transform .5s cubic-bezier(.3,1.6,.5,1); }
.av.off { opacity: .12; transform: scale(.55); }
.ping { fill: none; stroke: var(--acao); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ping 1.1s ease-out forwards; }
@keyframes ping { from { opacity: 1; transform: scale(1) } to { opacity: 0; transform: scale(2.4) } }
.sobe-some { transform-box: fill-box; transform-origin: center bottom; animation: sobe-some 1.6s ease-out forwards; }
@keyframes sobe-some { 0% { opacity: 0; transform: translateY(6px) scale(.6) } 20% { opacity: 1; transform: none } 100% { opacity: 0; transform: translateY(-34px) } }

/* slider estilizado */
.faixa-range input { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; cursor: grab; }
.faixa-range input:active { cursor: grabbing; }
.faixa-range input::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--acao) var(--p,0%), var(--linha2) var(--p,0%)); }
.faixa-range input::-moz-range-track { height: 4px; border-radius: 4px; background: var(--linha2); }
.faixa-range input::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--acao); }
.faixa-range input::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -11px; border-radius: 50%; background: var(--texto); box-shadow: 0 0 0 7px color-mix(in srgb, var(--acao) 28%, transparent); }
.faixa-range input::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--texto); }

/* marquee */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee ul { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; width: max-content; animation: marquee var(--marquee-dur, 64s) linear infinite; }
.marquee:hover ul { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%) } }

/* P-005 · comparador */
.cmp { position: relative; overflow: hidden; --x: 50%; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.cmp .pane { position: absolute; inset: 0; }
.cmp .pane.b { clip-path: inset(0 0 0 var(--x)); }
.cmp-alca { position: absolute; top: 0; bottom: 0; left: var(--x); z-index: 4; pointer-events: none; }
.cmp-alca::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--cmp-linha, var(--texto)); }
.cmp-botao { position: absolute; top: 50%; left: 0; transform: translate(-50%,-50%); width: 60px; height: 60px; border-radius: 50%; background: var(--cmp-linha, var(--texto)); color: var(--fundo); display: grid; place-items: center; font-weight: 700; font-size: 18px; box-shadow: 0 0 0 8px color-mix(in srgb, var(--cmp-linha, var(--texto)) 14%, transparent); }
.cmp input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; z-index: 5; margin: 0; }
.cmp:has(input:focus-visible) .cmp-botao { outline: 3px solid var(--acao); outline-offset: 4px; }

/* P-004 · scrollytelling */
.sty { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); }
.sty-palco { position: sticky; top: 0; height: 100vh; display: grid; place-items: center; }
.sty-caixa { position: relative; width: 100%; aspect-ratio: 1; max-height: 100%; max-width: 560px; }
.sty-cena { position: absolute; inset: 0; opacity: 0; transform: scale(.97); transition: opacity .6s ease, transform .6s ease; pointer-events: none; }
.sty-cena.on { opacity: 1; transform: none; pointer-events: auto; }
.sty-cena > svg, .sty-cena > * { width: 100%; height: 100%; overflow: visible; }
.sty-pontos { position: absolute; left: 0; right: 0; bottom: -6px; display: flex; justify-content: center; gap: 8px; }
.sty-pontos i { width: 26px; height: 4px; border-radius: 4px; background: var(--linha2); transition: background .4s; }
.sty-pontos i.on { background: var(--acao); }
.sty-passos { list-style: none; margin: 0; padding: 0; }
.sty-passo { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; opacity: .3; transition: opacity .45s ease; }
.sty-passo.on { opacity: 1; }
@media (max-width: 900px) {
  .sty { grid-template-columns: 1fr; gap: 0; }
  .sty-palco { order: -1; }
  .sty-palco { top: var(--nav-h, 60px); height: 44vh; z-index: 2; background: linear-gradient(var(--fundo-secao, var(--fundo)) 88%, transparent); }
  .sty-caixa { max-width: min(86vw, 40vh); }
  .sty-passo { min-height: 88vh; padding-top: calc(44vh + var(--nav-h, 60px)); }
  .sty-pontos { bottom: -14px; }
}

/* P-010 · roda */
.rd-trilho { fill: none; stroke: var(--linha); stroke-width: 14; }
.rd-arco { fill: none; stroke: var(--acao); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.5,0,.2,1); }
.rd-raio { stroke: var(--linha2); stroke-width: 1.5; stroke-dasharray: 3 7; }
.rd-centro { fill: var(--painel); stroke: var(--linha2); stroke-width: 1.5; transition: stroke .4s; }
.rd-centro.on { stroke: var(--acao); }
.rd-corredor { fill: var(--acao); }
.rd-no { cursor: pointer; }
.rd-no .rd-borda { fill: var(--painel); stroke: var(--linha2); stroke-width: 2; transition: stroke .35s, stroke-width .35s; }
.rd-no .rd-icone { transform-box: fill-box; transform-origin: center; transition: transform .4s cubic-bezier(.3,1.5,.5,1), opacity .35s; opacity: .6; }
.rd-no .rd-rotulo { fill: var(--texto-sec); font-size: 17px; font-weight: 600; text-anchor: middle; transition: fill .35s; }
.rd-no.on .rd-borda { stroke: var(--acao); stroke-width: 4; }
.rd-no.on .rd-icone { transform: scale(1.08); opacity: 1; }
.rd-no.on .rd-rotulo { fill: var(--texto); }
.rd-lista { list-style: none; margin: 0; padding: 0; counter-reset: rd; }
.rd-lista li { position: relative; padding: 13px 0 13px 44px; border-top: 1px solid var(--linha); color: var(--texto-sec); cursor: pointer; transition: color .3s; }
.rd-lista li:last-child { border-bottom: 1px solid var(--linha); }
.rd-lista li::before { counter-increment: rd; content: counter(rd); position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--painel); color: var(--texto-sec); transition: background .3s, color .3s; }
.rd-lista li.on { color: var(--texto); }
.rd-lista li.on b { color: var(--acao); }
.rd-lista li.on::before { background: var(--acao); color: var(--sobre-acao); }

/* P-011 · fluxo */
.fx-p { fill: var(--fx-cor1, var(--texto)); }
.fx-p.fx-p2 { fill: var(--fx-cor2, var(--acao)); }
.fx-anel { transform-box: fill-box; transform-origin: center; animation: gira 18s linear infinite; }
@keyframes gira { to { transform: rotate(360deg) } }
.fx-destino { transform-box: fill-box; transform-origin: center bottom; transition: transform .25s cubic-bezier(.3,1.8,.5,1); }
.fx-destino.bate { transform: scale(1.07); }

/* P-009 · chat e ranking */
.msg { display: flex; gap: 8px; align-items: flex-end; animation: msg-entra .5s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes msg-entra { from { opacity: 0; transform: translateY(16px) scale(.96) } to { opacity: 1; transform: none } }
.msg svg { width: 28px; height: 28px; flex: none; }
.msg p { margin: 0; background: var(--painel2, var(--painel)); border-radius: 16px 16px 16px 4px; padding: 9px 12px; font-size: 13.5px; line-height: 1.35; max-width: 86%; }
.msg p small { display: block; font-size: 11px; color: var(--acao); font-weight: 600; margin-bottom: 2px; }
.msg.marca { flex-direction: row-reverse; }
.msg.marca p { background: var(--acao); color: var(--sobre-acao); border-radius: 16px 16px 4px 16px; }
.msg.marca p small { color: inherit; opacity: .65; }
.rank { list-style: none; margin: 12px 0 0; padding: 0; position: relative; }
.rank li { position: absolute; left: 0; right: 0; top: 0; height: 56px; display: grid; grid-template-columns: 18px 32px 1fr auto; gap: 9px; align-items: center; padding: 0 8px; border-radius: 14px; transition: transform .7s cubic-bezier(.3,1.2,.5,1), background .3s; }
.rank .pos { font-size: 13px; font-weight: 700; color: var(--texto-sec); text-align: center; }
.rank svg { width: 32px; height: 32px; }
.rank .nm { font-size: 13px; font-weight: 600; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .nm small { display: block; font-size: 11px; color: var(--texto-sec); font-weight: 500; }
.rank .v { font-size: 15px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; transition: color .3s; }
.rank li.topo { background: color-mix(in srgb, var(--acao) 12%, transparent); }
.rank li.topo .pos, .rank li.sobe .v { color: var(--acao); }

/* P-008 · gráfico de blocos */
.gb-bloco { fill: var(--gb-fraco, color-mix(in srgb, var(--acao) 55%, #fff)); transform-box: fill-box; transform-origin: center bottom; }
.gb-bloco.forte { fill: var(--acao); }
.vai .gb-bloco { animation: gb-entra .5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes gb-entra { from { opacity: 0; transform: translateY(10px) scaleY(.2) } to { opacity: 1; transform: none } }
.gb-eixo { stroke: var(--linha); stroke-width: 2; }
.gb-curva { fill: none; stroke: var(--acao-forte, var(--acao)); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.vai .gb-curva { animation: tr-desenha 1.8s cubic-bezier(.55,.05,.25,1) both; }

/* P-012 · FAQ */
.faq { border-top: 1px solid var(--linha2); }
.faq details { border-bottom: 1px solid var(--linha2); }
.faq summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr 36px; gap: 18px; align-items: center; padding: 24px 0; font-size: clamp(1.08rem, 1.6vw, 1.3rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.3; transition: color .2s; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--acao-forte, var(--acao)); }
.faq summary i { width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--linha2); position: relative; transition: background .25s, box-shadow .25s; }
.faq summary i::before, .faq summary i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; background: var(--texto); transform: translate(-50%,-50%); }
.faq summary i::after { transform: translate(-50%,-50%) rotate(90deg); transition: transform .3s; }
.faq details[open] summary i { background: var(--acao-forte, var(--acao)); box-shadow: none; }
.faq details[open] summary i::before, .faq details[open] summary i::after { background: var(--sobre-acao); }
.faq details[open] summary i::after { transform: translate(-50%,-50%) rotate(0); }
.faq .resp { padding: 0 54px 26px 0; color: var(--texto-sec); max-width: 60ch; }
.faq .resp p { margin: 0; }

/* P-017 · progresso */
.progresso { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--acao); transform-origin: left; transform: scaleX(0); }

/* P-019 · demonstração em capítulos: celular, legenda de etapa e barra */
.cel { position: relative; width: min(100%, 300px); aspect-ratio: 9/19; margin: 0 auto; border-radius: 40px; background: var(--cel-moldura, #0F0F0F); padding: 10px; box-shadow: 0 40px 80px -40px rgba(0,0,0,.45); }
.cel-tela { position: relative; width: 100%; height: 100%; border-radius: 31px; overflow: hidden; background: var(--cel-fundo, #fff); }
.cel-tela > .tela { position: absolute; inset: 0; transition: transform .7s cubic-bezier(.43,.195,.02,1), opacity .3s cubic-bezier(.43,.195,.02,1); }
.cel-tela > .tela.fora { transform: translateX(-30%); opacity: 0; }
.cel-tela > .tela.depois { transform: translateX(100%); }
.etapa { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: min(100%, 300px); margin: 14px auto 0; padding: 12px 16px 14px; position: relative; background: var(--acao); color: var(--sobre-acao); font-size: 13px; font-weight: 600; border-radius: 12px; overflow: hidden; }
.etapa-barra { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--sobre-acao) 70%, transparent); transform-origin: left; transform: scaleX(0); }
.capitulo-pontos { display: flex; gap: 6px; } .capitulo-pontos i { height: 4px; width: 12px; border-radius: 4px; background: var(--linha2); transition: width .6s cubic-bezier(.45,0,.55,1), background .3s; } .capitulo-pontos i.on { width: 40px; background: var(--texto); }
.bolha { max-width: 80%; padding: 9px 12px; border-radius: 16px; font-size: 13px; line-height: 1.35; animation: msg-entra .5s cubic-bezier(.43,.195,.02,1) both; }

/* P-020 · antes/depois por sobreposição */
.sobre { position: relative; }
.sobre-fixo { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; justify-content: center; gap: 24px; overflow: hidden; }
.sobre-fixo > * { will-change: transform; transform-origin: center; }
@media (max-width: 900px) { .sobre { height: auto !important; } .sobre-fixo { position: static; height: auto; flex-direction: column; } .sobre-fixo > * { transform: none !important; opacity: 1 !important; } }
@media (max-width: 900px) {
  /* o celular mantém o desenho de 300px e é reduzido inteiro (zoom), sem espremer o conteúdo */
  .sty-palco .cel { width: 300px; zoom: var(--cel-zoom, .36); }
  .sty-palco .etapa { margin-top: 8px; padding: 8px 12px 10px; font-size: 12px; }
}

/* P-024 · vitrine de casos */
.vit { display: grid; grid-template-columns: minmax(260px, 340px) 1fr minmax(200px, 280px); gap: clamp(20px, 4vw, 56px); align-items: center; }
.vit-lista { background: var(--vit-cartao, #fff); color: var(--vit-cartao-texto, #0F0F0F); border-radius: 18px; padding: 24px 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.vit-lista [role=tab] { all: unset; cursor: pointer; padding: 12px 14px; border-radius: 10px; transition: background .3s cubic-bezier(.43,.195,.02,1); }
.vit-lista [role=tab]:hover { background: color-mix(in srgb, currentColor 5%, transparent); }
.vit-lista [role=tab][aria-selected=true] { background: color-mix(in srgb, currentColor 8%, transparent); }
.vit-lista [role=tab]:focus-visible { outline: 2px solid var(--acao); outline-offset: 2px; }
.vit-lista [role=tab] small { display: block; margin-top: 4px; font: 600 11px/1.3 ui-monospace, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.vit-desc [role=tabpanel] { border-left: 2px solid currentColor; padding-left: 16px; animation: msg-entra .5s cubic-bezier(.43,.195,.02,1) both; }
@media (max-width: 900px) {
  .vit { grid-template-columns: 1fr; }
  .vit-lista { flex-direction: row; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px; order: 0; }
  .vit-lista [role=tab] { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; }
  .vit-lista [role=tab] small { display: none; }
  .vit .cel { width: min(70vw, 280px); }
}
