/* ==========================================================================
   Legado 7 — Dobra 04: os 7 pilares da Estrutura Legado 7
   Abas acessíveis (pilares.js): lista à esquerda, painel com frase + animação à direita.
   Cada animação explica a função do pilar e termina num estado estático (que é o que
   aparece com movimento reduzido). Sem JS: os 7 painéis aparecem empilhados.
   ========================================================================== */

.pilares {
  position: relative; isolation: isolate; overflow: clip;
  padding: clamp(88px, 12vh, 140px) var(--gutter) clamp(64px, 9vh, 110px);
  background:
    radial-gradient(45% 50% at 85% 55%, rgba(164, 5, 78, .14), transparent 70%),
    radial-gradient(50% 50% at 0% 30%, rgba(7, 30, 65, .55), transparent 70%),
    var(--l7-abismo);
}
.pilares__inner { max-width: var(--max); margin: 0 auto; }

/* Cabeçalho -------------------------------------------------------------- */
.pilares__head { max-width: 760px; }
.pilares__eyebrow {
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 20px;
  font-family: var(--l7-mono); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--l7-rosa-glow);
}
.pilares__eyebrow span { width: 28px; height: 1px; background: currentColor; box-shadow: 0 0 8px currentColor; }
.pilares__title {
  margin: 0; font-weight: 800; letter-spacing: -.03em; line-height: 1.04;
  font-size: clamp(34px, 3.4vw + 10px, 64px);
}
.pilares__title em { font-style: normal; color: var(--l7-rosa-glow); text-shadow: 0 0 30px rgba(255, 26, 94, .3); }
.pilares__lead { margin: 18px 0 0; max-width: 52ch; font-size: 16px; line-height: 1.6; color: var(--l7-texto-suave); }

/* Corpo: lista + painel ---------------------------------------------------- */
.pilares__corpo {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 4vw, 64px); align-items: start; margin-top: clamp(36px, 6vh, 64px);
}

.pilares__lista { display: grid; border-bottom: 1px solid var(--l7-linha); }
.pilares__tab {
  position: relative; display: grid; grid-template-columns: 88px 1fr; align-items: center;
  width: 100%; padding: 14px 16px 14px 20px; margin: 0; border: 0; border-top: 1px solid var(--l7-linha);
  background: none; color: inherit; text-align: left; cursor: pointer;
  font: inherit; transition: background-color .35s var(--ease);
}
.pilares__tab::before { /* indicador de seleção */
  content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 0; border-radius: 3px;
  background: var(--l7-rosa-glow); box-shadow: 0 0 12px var(--l7-rosa-glow);
  transform: translateY(-50%); transition: height .4s var(--ease);
}
.pilares__num {
  font-size: clamp(32px, 2.2vw + 10px, 46px); font-weight: 800; letter-spacing: -.03em; line-height: 1;
  color: rgba(255, 255, 255, .16);
  transition: color .35s var(--ease), text-shadow .35s var(--ease);
}
.pilares__nome {
  font-size: 15px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--l7-texto-suave);
  transition: color .35s var(--ease), transform .35s var(--ease);
}
.pilares__tab:hover .pilares__nome { color: #fff; }
.pilares__tab:hover .pilares__num { color: rgba(255, 26, 94, .55); }
.pilares__tab[aria-selected="true"] { background: linear-gradient(90deg, rgba(255, 26, 94, .1), transparent 80%); }
.pilares__tab[aria-selected="true"]::before { height: 64%; }
.pilares__tab[aria-selected="true"] .pilares__num { color: var(--l7-rosa-glow); text-shadow: 0 0 24px rgba(255, 26, 94, .45); }
.pilares__tab[aria-selected="true"] .pilares__nome { color: #fff; transform: translateX(4px); }
.pilares__tab:focus-visible { outline: 2px solid #fff; outline-offset: -2px; border-radius: 6px; }

/* Painel */
.pilares__paineis { position: relative; }
.pilares__painel {
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 24px; overflow: hidden;
  background: linear-gradient(160deg, rgba(14, 24, 62, .75), rgba(5, 4, 25, .9));
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.pilares__painel:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.pilares__painel + .pilares__painel { margin-top: 20px; } /* sem JS: todos empilhados */
.js .pilares__painel + .pilares__painel { margin-top: 0; }
.pilares__visual {
  position: relative; aspect-ratio: 560 / 360;
  background: radial-gradient(60% 70% at 50% 50%, rgba(4, 31, 87, .45), transparent 75%);
  border-bottom: 1px solid var(--l7-linha);
}
.pilares__texto { padding: 24px 28px 28px; }
.pilares__rotulo {
  margin: 0 0 10px; font-family: var(--l7-mono); font-size: 12px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase; color: var(--l7-rosa-glow);
}
.pilares__frase { margin: 0; font-size: clamp(20px, .9vw + 13px, 28px); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
.pilares__desc { margin: 10px 0 0; font-size: 15px; line-height: 1.6; color: var(--l7-texto-suave); }

.pilares__nav { display: none; }
.pilares__next {
  margin: clamp(36px, 6vh, 56px) 0 0; display: flex; justify-content: center; align-items: center; gap: 10px;
  font-family: var(--l7-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--l7-texto-suave);
}
.pilares__next::after {
  content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--l7-rosa-glow); border-bottom: 1.5px solid var(--l7-rosa-glow);
  transform: rotate(45deg) translateY(-2px);
}
.no-js .pilares__lista { display: none; }
.no-js .pilares__corpo { grid-template-columns: 1fr; }

/* --------------------------------------------------------------------------
   Ilustrações (estado final = estático)
   -------------------------------------------------------------------------- */
.ilu { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ilu text { font-family: var(--l7-mono); font-size: 10px; letter-spacing: .16em; fill: var(--l7-texto-suave); }
.ilu * { transform-box: fill-box; transform-origin: center; }
.ilu-grade path { stroke: rgba(255, 255, 255, .045); stroke-width: 1; }

/* 01 Estratégia */
.rota { fill: none; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.rota--alt { stroke: rgba(255, 255, 255, .5); stroke-width: 1.2; opacity: .3; }
.rota--principal { stroke: var(--l7-rosa-glow); stroke-width: 3; filter: drop-shadow(0 0 6px rgba(255, 26, 94, .8)); }
.ilu-pontos-inicio circle { fill: rgba(255, 255, 255, .45); }
.ilu-pontos-inicio .inicio-principal { fill: var(--l7-rosa-glow); }
.alvo-anel { fill: none; stroke: rgba(255, 26, 94, .7); stroke-width: 1.5; }
.alvo-centro { fill: var(--l7-rosa-glow); filter: drop-shadow(0 0 8px var(--l7-rosa-glow)); }
.alvo-mira { stroke: rgba(255, 255, 255, .45); stroke-width: 1.5; stroke-linecap: round; }
.ilu-alvo text { fill: #fff; }

/* 02 Posicionamento */
.pp { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .16); opacity: .35; }
.destaque-peca { fill: var(--l7-rosa); stroke: var(--l7-rosa-glow); filter: drop-shadow(0 0 18px rgba(255, 26, 94, .7)); }
.destaque-l7 { fill: #fff; }
.destaque-onda { fill: none; stroke: rgba(255, 26, 94, .6); stroke-width: 1.5; opacity: 0; }

/* 03 Autoridade */
.anel { fill: none; stroke: rgba(255, 26, 94, .45); stroke-width: 1.2; stroke-dasharray: 1; stroke-dashoffset: 0; }
.no { fill: var(--l7-rosa-glow); filter: drop-shadow(0 0 5px rgba(255, 26, 94, .8)); }
.aut-centro { fill: var(--l7-rosa); filter: drop-shadow(0 0 16px rgba(255, 26, 94, .7)); }
.aut-check { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.aut-pulso { fill: none; stroke: rgba(255, 26, 94, .5); stroke-width: 1.5; opacity: 0; }

/* 04 Aquisição */
.canal { fill: none; stroke: rgba(255, 255, 255, .13); stroke-width: 1.2; }
.canal-fluxo { fill: none; stroke: var(--l7-rosa-glow); stroke-width: 4; stroke-linecap: round; stroke-dasharray: .001 .249; filter: drop-shadow(0 0 4px rgba(255, 26, 94, .9)); }
.canal-ponto { fill: rgba(255, 255, 255, .55); }
.destino-peca { fill: var(--l7-navy); stroke: var(--l7-rosa-glow); stroke-width: 1.5; filter: drop-shadow(0 0 16px rgba(255, 26, 94, .55)); }
.ilu-destino svg { fill: var(--l7-rosa-glow); }
.destino-onda { fill: none; stroke: rgba(255, 26, 94, .55); stroke-width: 1.5; opacity: 0; }

/* 05 Conversão */
.etapa { fill: rgba(255, 255, 255, .04); stroke: rgba(255, 255, 255, .22); }
.faixa { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 1.2; }
.faixa-fluxo { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: .001 .199; }
.acao-centro { fill: var(--l7-rosa); filter: drop-shadow(0 0 14px rgba(255, 26, 94, .75)); }
.acao-check { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.acao-onda { fill: none; stroke: rgba(255, 26, 94, .6); stroke-width: 1.5; opacity: 0; }

/* 06 Escala */
.modulo { fill: rgba(255, 26, 94, .08); stroke: rgba(255, 26, 94, .45); stroke-width: 1.2; }
.modulo--topo { fill: rgba(255, 26, 94, .3); stroke: var(--l7-rosa-glow); filter: drop-shadow(0 0 8px rgba(255, 26, 94, .5)); }
.escala-linha { fill: none; stroke: rgba(255, 255, 255, .75); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 0; stroke-linecap: round; stroke-linejoin: round; }
.escala-seta { fill: none; stroke: rgba(255, 255, 255, .75); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 07 Legado */
.camada { fill: rgba(31, 46, 110, .75); stroke: rgba(255, 26, 94, .5); stroke-width: 1.2; }
.camada:last-child { fill: rgba(255, 26, 94, .35); stroke: var(--l7-rosa-glow); }
.legado-pilar { fill: none; stroke: rgba(255, 255, 255, .18); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 0; }
.legado-topo circle { fill: var(--l7-navy); stroke: var(--l7-rosa-glow); stroke-width: 1.5; filter: drop-shadow(0 0 14px rgba(255, 26, 94, .6)); }
.legado-topo svg { fill: var(--l7-rosa-glow); }
.legado-brilho { display: none; }

/* --------------------------------------------------------------------------
   Movimento (só sem preferência por movimento reduzido)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .js .pilares__painel:not([hidden]) .pilares__texto > * { animation: pil-sobe .6s var(--ease) both; }
  .js .pilares__painel:not([hidden]) .pilares__frase { animation-delay: .08s; }
  .js .pilares__painel:not([hidden]) .pilares__desc { animation-delay: .16s; }
  .js .pilares__painel:not([hidden]) .pilares__visual { animation: pil-surge .7s var(--ease) both; }

  /* 01 Estratégia: caminhos testados, uma direção traçada até o objetivo */
  .rota--alt { animation: pil-rota-alt 2.2s var(--ease) var(--d, 0s) both; }
  .rota--principal { animation: pil-desenha 1.4s cubic-bezier(.6, 0, .3, 1) .9s both; }
  .ilu-alvo { animation: pil-pop .7s cubic-bezier(.2, 1.4, .4, 1) 2.1s both; }
  .alvo-anel:first-child { animation: pil-pulsa 2.4s ease-in-out 2.8s infinite; }

  /* 02 Posicionamento: o mercado recua, sua marca ganha destaque */
  .pp { animation: pil-recua 1.2s var(--ease) calc(.5s + var(--d, 0s)) both; }
  .destaque-peca { animation: pil-destaca 1.4s cubic-bezier(.2, 1.2, .4, 1) .3s both; }
  .destaque-l7 { animation: pil-aparece .6s var(--ease) 1.4s both; }
  .destaque-onda { animation: pil-onda 2.6s ease-out 1.6s infinite; }
  .destaque-onda--2 { animation-delay: 2.9s; }

  /* 03 Autoridade: influência se expande e o reconhecimento acende */
  .anel { animation: pil-desenha 1s var(--ease) var(--d, 0s) both; }
  .no { animation: pil-acende .7s var(--ease) var(--d, 0s) both; }
  .aut-centro { animation: pil-pop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
  .aut-check { stroke-dasharray: 40; animation: pil-check .5s var(--ease) .4s both; }
  .aut-pulso { animation: pil-onda-grande 3.4s ease-out 2s infinite; }

  /* 04 Aquisição: oportunidades chegam por diferentes caminhos */
  .canal { animation: pil-aparece .8s var(--ease) both; }
  .canal-fluxo { animation: pil-fluxo-4 1.8s linear var(--d, 0s) infinite; }
  .ilu-destino { animation: pil-pop .7s cubic-bezier(.2, 1.4, .4, 1) .3s both; }
  .destino-onda { animation: pil-onda 1.8s ease-out 1s infinite; }

  /* 05 Conversão: interações avançam pelo fluxo até a ação desejada */
  .etapa { animation: pil-ergue .7s var(--ease) var(--d, 0s) both; }
  .ilu-etapas text { animation: pil-aparece .6s var(--ease) calc(.3s + var(--d, 0s)) both; }
  .faixa-fluxo { animation: pil-fluxo-5 2.2s linear var(--d, 0s) infinite; }
  .ilu-acao { animation: pil-pop .7s cubic-bezier(.2, 1.4, .4, 1) .9s both; }
  .acao-onda { animation: pil-onda 2.2s ease-out 1.6s infinite; }

  /* 06 Escala: a estrutura cresce em ordem, mantendo as conexões */
  .modulo { animation: pil-modulo .5s cubic-bezier(.2, 1.2, .4, 1) var(--d, 0s) both; }
  .escala-linha { animation: pil-desenha 1s var(--ease) 1.1s both; }
  .escala-seta { animation: pil-aparece .5s var(--ease) 1.9s both; }

  /* 07 Legado: camadas se acumulam e permanecem */
  .camada { animation: pil-camada .7s cubic-bezier(.3, 1.3, .5, 1) var(--d, 0s) both; }
  .legado-pilar { animation: pil-desenha 1s var(--ease) 1s both; }
  .legado-topo { animation: pil-pop .7s cubic-bezier(.2, 1.4, .4, 1) 1.4s both; }
}

@keyframes pil-sobe { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pil-surge { from { opacity: 0; } to { opacity: 1; } }
@keyframes pil-aparece { from { opacity: 0; } }
@keyframes pil-desenha { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pil-rota-alt { 0% { stroke-dashoffset: 1; opacity: .9; } 55% { stroke-dashoffset: 0; opacity: .9; } 100% { stroke-dashoffset: 0; opacity: .3; } }
@keyframes pil-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes pil-pulsa { 50% { transform: scale(1.18); opacity: .5; } }
@keyframes pil-recua { from { opacity: 1; transform: none; } to { opacity: .35; transform: scale(.86); } }
@keyframes pil-destaca {
  0% { transform: scale(.46); fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .16); }
  60% { transform: scale(1.12); }
  100% { transform: none; }
}
@keyframes pil-onda { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(2.8); } }
@keyframes pil-onda-grande { from { opacity: .6; transform: scale(1); } to { opacity: 0; transform: scale(5.6); } }
@keyframes pil-acende { 0% { opacity: 0; transform: scale(0); fill: #fff; } 60% { opacity: 1; transform: scale(1.4); fill: #fff; } 100% { transform: none; } }
@keyframes pil-check { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
@keyframes pil-fluxo-4 { from { stroke-dashoffset: .25; } to { stroke-dashoffset: 0; } }
@keyframes pil-fluxo-5 { from { stroke-dashoffset: .2; } to { stroke-dashoffset: 0; } }
@keyframes pil-ergue { from { opacity: 0; transform: scaleY(0); } to { opacity: 1; transform: none; } }
@keyframes pil-modulo { from { opacity: 0; transform: translateY(14px) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes pil-camada { from { opacity: 0; transform: translateY(-46px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Tablet e celular: faixa horizontal de pilares + painel + anterior/próximo
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .pilares__corpo { grid-template-columns: 1fr; gap: 18px; margin-top: 32px; }
  .pilares__lista {
    display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 10px; border: 0;
    scrollbar-width: none;
  }
  .pilares__lista::-webkit-scrollbar { display: none; }
  .pilares__tab {
    flex: none; width: auto; grid-template-columns: auto auto; gap: 8px; scroll-snap-align: start;
    min-height: 48px; padding: 10px 16px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px;
  }
  .pilares__tab::before { display: none; }
  .pilares__num { font-size: 15px; color: var(--l7-texto-suave); }
  .pilares__nome { font-size: 12px; letter-spacing: .12em; }
  .pilares__tab[aria-selected="true"] { background: var(--l7-rosa); border-color: var(--l7-rosa-glow); box-shadow: 0 8px 24px -8px rgba(230, 11, 79, .7); }
  .pilares__tab[aria-selected="true"] .pilares__num { color: #fff; text-shadow: none; }
  .pilares__tab[aria-selected="true"] .pilares__nome { transform: none; }
  .pilares__texto { padding: 20px 20px 22px; }
  .ilu text { font-size: 15px; letter-spacing: .1em; }
  .js .pilares__nav { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
  .pilares__seta {
    min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .03); color: #fff; font: 600 12px var(--l7-fonte); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  }
  .pilares__seta:disabled { opacity: .35; cursor: default; }
  .pilares__contador { font-family: var(--l7-mono); font-size: 12px; color: var(--l7-texto-suave); }
  .pilares__contador b { color: #fff; font-weight: 500; }
}
