/* ---------- Mockup da solução: Marca → Site → Loja → Resultados ---------- */
.historia { --dur: 4.6s; gap: 16px; }

/* Abas com barra de progresso */
.hist-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hist-step { position: relative; overflow: hidden; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 12px; color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 10px 8px; cursor: pointer; text-align: left; transition: color 0.3s, background 0.3s, border-color 0.3s; }
.hist-step b { display: block; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 500; letter-spacing: 1px; color: rgba(255,255,255,0.35); margin-bottom: 2px; }
.hist-step i { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: #8BF573; }
.hist-step:hover { color: #fff; }
.hist-step.ativa { color: #fff; background: rgba(139,245,115,0.1); border-color: rgba(139,245,115,0.35); }
.hist-step.ativa b { color: #8BF573; }
.hist-step.ativa i { animation: histProg var(--dur) linear forwards; }
.historia.pausa .hist-step.ativa i { animation-play-state: paused; }
.hist-step.feita i { width: 100%; opacity: 0.35; }
@keyframes histProg { to { width: 100%; } }

/* Palco: cenas sobrepostas */
.hist-palco { position: relative; height: 330px; }
.cena { position: absolute; inset: 0; opacity: 0; visibility: hidden; transform: translateY(10px) scale(0.98); transition: opacity 0.45s, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0.45s; }
.cena.ativa { opacity: 1; visibility: visible; transform: none; transition: opacity 0.45s, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.cena.ativa * { animation-fill-mode: both; }

/* Utilitários de entrada */
@keyframes hUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes hPop { 0% { opacity: 0; transform: scale(0.4); } 70% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
@keyframes hFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hLargura { from { width: 0; } to { width: var(--w); } }
@keyframes hDesenho { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }

/* ---------- 01 Marca ---------- */
.cena-marca { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; }
.mc-logo, .mc-box { background: rgba(255,255,255,0.05); border-radius: 14px; }
.mc-logo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: radial-gradient(circle at 50% 35%, rgba(139,245,115,0.16), rgba(255,255,255,0.04) 70%); }
.mc-logo svg { flex: none; width: 92px; height: 92px; overflow: visible; }
.mc-logo .traco { fill: none; stroke: #8BF573; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.mc-logo rect.traco { stroke-width: 4; stroke: rgba(139,245,115,0.6); }
.cena-marca.ativa .traco { animation: hDesenho 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.15s forwards; }
.cena-marca.ativa .traco.t2 { animation-delay: 0.6s; }
.mc-nome { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 400; color: #fff; letter-spacing: -0.5px; }
.mc-nome b { font-weight: 800; color: #8BF573; }
.mc-tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.45); }
.cena-marca.ativa .mc-nome { animation: hUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 1.2s; }
.cena-marca.ativa .mc-tag { animation: hFade 0.6s 1.5s; }
.mc-lado { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
.mc-box { padding: 14px; display: flex; flex-direction: column; }
.mc-box small { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 1px; color: rgba(255,255,255,0.45); margin-bottom: 12px; }
.mc-paleta { display: flex; gap: 8px; flex: 1; align-items: center; }
.mc-paleta i { flex: 1; aspect-ratio: 1; max-width: 46px; border-radius: 12px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
.cena-marca.ativa .mc-paleta i { animation: hPop 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.cena-marca.ativa .mc-paleta i:nth-child(1) { animation-delay: 1.5s; }
.cena-marca.ativa .mc-paleta i:nth-child(2) { animation-delay: 1.62s; }
.cena-marca.ativa .mc-paleta i:nth-child(3) { animation-delay: 1.74s; }
.cena-marca.ativa .mc-paleta i:nth-child(4) { animation-delay: 1.86s; }
.mc-tipo div { display: flex; align-items: center; gap: 12px; flex: 1; }
.mc-tipo span { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 40px; line-height: 1; color: #fff; }
.mc-tipo em { font-style: normal; font-size: 11px; line-height: 1.5; color: rgba(255,255,255,0.55); }
.cena-marca.ativa .mc-tipo div { animation: hUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 2.1s; }

/* ---------- 02 Site ---------- */
.sm { height: 100%; background: #F4F1EA; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.sm-nav { display: flex; align-items: center; gap: 10px; }
.sm-logo { width: 22px; height: 22px; border-radius: 7px; background: #1E9A46; }
.sm-nav span { width: 34px; height: 6px; border-radius: 4px; background: rgba(10,31,38,0.18); }
.sm-nav span:first-of-type { margin-left: auto; }
.sm-nav em { width: 58px; height: 20px; border-radius: 999px; background: #0A1F26; }
.cena-site.ativa .sm-nav { animation: hFade 0.4s 0.1s; }
.sm-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; flex: 1; }
.sm-txt { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.sm-txt i { display: block; height: 14px; width: var(--w); border-radius: 5px; background: #0A1F26; }
.sm-txt i.fino { height: 6px; background: rgba(10,31,38,0.25); }
.cena-site.ativa .sm-txt i { animation: hLargura 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
.cena-site.ativa .sm-txt i:nth-child(1) { animation-delay: 0.35s; }
.cena-site.ativa .sm-txt i:nth-child(2) { animation-delay: 0.5s; }
.cena-site.ativa .sm-txt i:nth-child(3) { animation-delay: 0.7s; }
.cena-site.ativa .sm-txt i:nth-child(4) { animation-delay: 0.8s; }
.sm-btn { align-self: flex-start; margin-top: 6px; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 10px; color: #0A1F26; background: #8BF573; border-radius: 999px; padding: 7px 14px; }
.cena-site.ativa .sm-btn { animation: hPop 0.45s 1.05s, hClique 0.35s 2.75s; }
@keyframes hClique { 50% { transform: scale(0.9); box-shadow: 0 0 0 8px rgba(139,245,115,0.35); } }
.sm-img { border-radius: 12px; background: linear-gradient(150deg, #8BF573, #1E9A46 55%, #0A1F26); position: relative; overflow: hidden; }
.sm-img::after { content: ''; position: absolute; width: 46%; aspect-ratio: 1; border-radius: 50%; right: 12%; top: 18%; background: rgba(244,241,234,0.35); }
.cena-site.ativa .sm-img { animation: hPop 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.6s; }
.sm-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; height: 64px; }
.sm-cards i { border-radius: 10px; background: #fff; box-shadow: 0 6px 16px rgba(10,31,38,0.08); }
.cena-site.ativa .sm-cards i { animation: hUp 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.cena-site.ativa .sm-cards i:nth-child(1) { animation-delay: 1.3s; }
.cena-site.ativa .sm-cards i:nth-child(2) { animation-delay: 1.42s; }
.cena-site.ativa .sm-cards i:nth-child(3) { animation-delay: 1.54s; }

/* Cursor animado (Site e Loja) */
.hist-cursor { position: absolute; left: 0; top: 0; width: 22px; height: 22px; z-index: 5; pointer-events: none; opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l16 9-7 2-3 7z' fill='%23fff' stroke='%230A1F26' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.35)); }
.cena-site.ativa .hist-cursor { animation: cursorSite 3.2s cubic-bezier(0.45, 0, 0.2, 1) 0.9s; }
@keyframes cursorSite {
  0% { opacity: 0; left: 80%; top: 85%; }
  15% { opacity: 1; left: 80%; top: 85%; }
  55% { left: 18%; top: 58%; transform: scale(1); }
  62% { left: 18%; top: 58%; transform: scale(0.8); }
  70%, 92% { opacity: 1; left: 18%; top: 58%; transform: scale(1); }
  100% { opacity: 0; left: 18%; top: 58%; }
}

/* ---------- 03 Loja ---------- */
.cena-loja { display: flex; flex-direction: column; gap: 12px; }
.lj-top { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.05); border-radius: 12px; padding: 10px 14px; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 1px; color: rgba(255,255,255,0.5); }
.lj-cart { position: relative; color: #fff; display: flex; }
.lj-badge { position: absolute; top: -8px; right: -10px; min-width: 17px; height: 17px; border-radius: 999px; background: #8BF573; color: #0A1F26; font-family: 'Sora', sans-serif; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.lj-badge.pula { animation: hPop 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.lj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; flex: 1; }
.lj-prod { background: rgba(255,255,255,0.05); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.lj-prod i { flex: 1; min-height: 70px; border-radius: 10px; background: var(--g); margin-bottom: 6px; }
.lj-prod span { font-size: 11.5px; color: rgba(255,255,255,0.7); }
.lj-prod b { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 14px; color: #fff; }
.lj-prod em { margin-top: 6px; font-style: normal; text-align: center; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 10.5px; color: #0A1F26; background: #8BF573; border-radius: 999px; padding: 6px 0; }
.cena-loja.ativa .lj-prod { animation: hUp 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.cena-loja.ativa .lj-prod:nth-child(1) { animation-delay: 0.1s; }
.cena-loja.ativa .lj-prod:nth-child(2) { animation-delay: 0.22s; }
.cena-loja.ativa .lj-prod:nth-child(3) { animation-delay: 0.34s; }
.cena-loja.ativa .lj-prod:nth-child(1) em { animation: hClique 0.35s 1.45s; }
.cena-loja.ativa .lj-prod:nth-child(3) em { animation: hClique 0.35s 2.45s; }
.lj-toast { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); font-family: 'Sora', sans-serif; font-weight: 700; font-size: 12px; color: #0A1F26; background: #fff; border-radius: 999px; padding: 9px 18px; box-shadow: 0 12px 30px rgba(0,0,0,0.35); opacity: 0; white-space: nowrap; }
.cena-loja.ativa .lj-toast { animation: toastIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 3s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.cena-loja.ativa .hist-cursor { animation: cursorLoja 2.9s cubic-bezier(0.45, 0, 0.2, 1) 0.5s; }
@keyframes cursorLoja {
  0% { opacity: 0; left: 50%; top: 20%; }
  10% { opacity: 1; left: 50%; top: 20%; }
  32% { left: 16%; top: 88%; transform: scale(1); }
  36% { left: 16%; top: 88%; transform: scale(0.8); }
  42% { left: 16%; top: 88%; transform: scale(1); }
  66% { left: 82%; top: 88%; transform: scale(1); }
  70% { left: 82%; top: 88%; transform: scale(0.8); }
  76%, 92% { opacity: 1; left: 82%; top: 88%; transform: scale(1); }
  100% { opacity: 0; left: 82%; top: 88%; }
}

/* ---------- 04 Resultados ---------- */
.cena-res { display: flex; flex-direction: column; gap: 12px; }
.rs-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cena-res .mock-kpi b { font-size: 22px; }
.cena-res.ativa .mock-kpi { animation: hUp 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.cena-res.ativa .mock-kpi:nth-child(2) { animation-delay: 0.1s; }
.cena-res.ativa .mock-kpi:nth-child(3) { animation-delay: 0.2s; }
.rs-grafico { position: relative; flex: 1; background: rgba(255,255,255,0.05); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; }
.rs-grafico small { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 1px; color: rgba(255,255,255,0.45); margin-bottom: 10px; }
.rs-grafico svg { flex: 1; width: 100%; overflow: visible; }
.rs-linha { fill: none; stroke: #8BF573; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.rs-area { fill: url(#rsArea); opacity: 0; }
.cena-res.ativa .rs-linha { animation: hDesenho 1.5s cubic-bezier(0.65, 0, 0.35, 1) 0.4s forwards; }
.cena-res.ativa .rs-area { animation: hFade 0.8s 1.3s forwards; }
.rs-ponto { position: absolute; right: 12px; top: 40px; width: 12px; height: 12px; border-radius: 50%; background: #8BF573; box-shadow: 0 0 0 0 rgba(139,245,115,0.6); opacity: 0; }
.cena-res.ativa .rs-ponto { animation: hPop 0.4s 1.85s forwards, pontoPulso 1.4s ease-out 2.2s infinite; }
@keyframes pontoPulso { to { box-shadow: 0 0 0 14px rgba(139,245,115,0); } }

/* ---------- Responsivo ---------- */
@media (max-width: 767px) {
  .hist-palco { height: 300px; }
  .hist-step { font-size: 11px; padding: 8px 6px; text-align: center; }
  .mc-nome { font-size: 22px; }
  .mc-logo svg { width: 74px; height: 74px; }
  .mc-tipo span { font-size: 32px; }
  .rs-kpis { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cena-res .mock-kpi { padding: 10px; }
  .cena-res .mock-kpi b { font-size: 17px; }
  .cena-res .mock-kpi.ia { grid-column: auto; }
}
@media (max-width: 479px) {
  .hist-palco { height: 290px; }
  .hist-steps { gap: 5px; }
  .hist-step { font-size: 10px; letter-spacing: -0.2px; }
  .hist-step b { display: none; }
  .cena-marca { grid-template-columns: 1fr; grid-template-rows: 1.1fr 1fr; }
  .mc-lado { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .mc-logo { flex-direction: row; gap: 14px; }
  .mc-logo svg { width: 56px; height: 56px; }
  .mc-tag { display: none; }
  .lj-prod i { min-height: 54px; }
  .lj-prod span { font-size: 10.5px; }
  .lj-prod b { font-size: 12.5px; }
  .cena-res .mock-kpi small { font-size: 9px; letter-spacing: 0.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .cena.ativa *, .hist-step.ativa i { animation-duration: 0.01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .hist-cursor { display: none; }
}
