/* ==========================================================================
   LIBERT7 · hero.css
   Topo do site público (<section class="l7-hero" id="inicio">). Mesma pegada do
   topo do institucional da Atto, adaptada à marca LIBERT7: layout centrado,
   frase em destaque que troca sozinha, luz céu que segue o ponteiro e o painel
   "O caminho até a liberdade" com os 7 passos acendendo em sequência.

   Classe raiz própria (.l7-hero) para não casar com as regras antigas de .hero
   em site.css. Usa só tokens e botões de base.css; não edita nenhum dos dois.

   Sem JS: tudo legível e parado (a frase fica na primeira, a luz fica no centro).
   Movimento reduzido: nada desliza, nada deriva, nada troca; tudo aparece direto.
   ========================================================================== */


/* Posição da luz (o JS move com o mouse). Prefixo l7- para não colidir com variáveis de outras partes do site. */
@property --l7-mx { syntax: "<percentage>"; inherits: false; initial-value: 50%; }
@property --l7-my { syntax: "<percentage>"; inherits: false; initial-value: 30%; }


/* --------------------------------------------------------------------------
   1. Seção e fundo
   -------------------------------------------------------------------------- */

.l7-hero {
  --l7-curva-sobe: cubic-bezier(0.22, 0.8, 0.24, 1);
  --l7-linha: rgba(200, 214, 233, 0.14);       /* marinho-200 translúcido */
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: var(--marinho-200);
  background-color: var(--marinho);
  /* Brilho: anéis finos e uma mancha azul no alto à direita, outra céu bem fraca embaixo à esquerda */
  background-image:
    repeating-radial-gradient(circle at 82% 0, transparent 0 78px, rgba(141, 179, 226, 0.065) 79px 80px),
    radial-gradient(ellipse 820px 560px at 82% 0, rgba(41, 96, 158, 0.5) 0%, transparent 70%),
    radial-gradient(ellipse 760px 460px at 8% 100%, rgba(40, 152, 209, 0.12) 0%, transparent 70%);
  background-repeat: no-repeat;
  background-size: 100% 1100px, 100% 1100px, 100% 100%;
}

/* Luz que segue o ponteiro (o JS move --l7-mx/--l7-my só com mouse; no toque ela fica parada) */
.l7-hero-luz {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(600px circle at var(--l7-mx) var(--l7-my),
    rgba(89, 181, 236, 0.2), rgba(63, 122, 190, 0.09) 38%, transparent 68%);
}

/* Monograma L7 em marca-d'água, só contorno, no alto à direita */
.l7-hero-marca {
  position: absolute;
  z-index: 0;
  top: clamp(-72px, -4vw, -28px);
  right: clamp(-150px, -7vw, -56px);
  width: clamp(220px, 30vw, 440px);
  height: auto;
  color: rgba(141, 179, 226, 0.045);
  pointer-events: none;
}

.l7-hero-marca path {
  fill: none;
  stroke: currentColor;
  stroke-width: 100;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Foco visível no marinho: céu claro */
.l7-hero :focus-visible {
  outline-color: var(--ceu-300);
}


/* --------------------------------------------------------------------------
   2. Coluna central
   -------------------------------------------------------------------------- */

.l7-hero-grade {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: clamp(2.5rem, 1.5rem + 3vw, 4rem);
  padding-block: clamp(3rem, 1.5rem + 5vw, 6.5rem) clamp(3.5rem, 2rem + 5vw, 7rem);
  text-align: center;
}

.l7-hero-texto {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 62rem;
  min-width: 0;
}

/* Pílula no topo: leva aos Níveis de Liberdade */
.l7-hero-pilula {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  max-width: 100%;
  padding: 0.5rem 0.875rem 0.5rem 1.125rem;
  border: 1px solid rgba(246, 248, 250, 0.16);
  border-radius: var(--raio-pilula);
  background: rgba(246, 248, 250, 0.04);
  color: var(--off);
  font-size: var(--fonte-sm);
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: border-color var(--transicao), background-color var(--transicao), color var(--transicao);
}

.l7-hero-pilula:hover,
.l7-hero-pilula:focus-visible {
  border-color: var(--ceu-400);
  background: rgba(89, 181, 236, 0.12);
  color: var(--branco);
  text-decoration: none;
}

.l7-hero-pilula-ponto {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ceu-400);
  box-shadow: 0 0 0 4px rgba(89, 181, 236, 0.18);
}

.l7-hero-pilula svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transicao);
}

.l7-hero-pilula:hover svg {
  transform: translateX(3px);
}


/* --------------------------------------------------------------------------
   3. Título com a frase que troca
   -------------------------------------------------------------------------- */

.l7-hero-titulo {
  max-width: 15em;
  color: var(--branco);
  font-size: clamp(2.125rem, 1.2rem + 3.9vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.l7-hero-linha,
.l7-hero-hl {
  display: block;
}

.l7-hero-hl {
  color: var(--ceu-400);   /* céu sobre marinho: 6,8:1 */
}

/* Caixa da frase: as frases empilham na mesma célula e a caixa corta o que sai.
   A folga fica em cada frase para acento e descendente aparecerem inteiros. */
.l7-rot {
  display: inline-grid;
  max-width: 100%;
  vertical-align: bottom;
  overflow: hidden;
  margin-block: -0.16em -0.24em;
}

.l7-w {
  grid-area: 1 / 1;
  justify-self: center;
  padding-block: 0.16em 0.24em;
  transition: transform 0.75s cubic-bezier(0.34, 1.45, 0.64, 1), opacity 0.45s ease;
}

/* Sem JS só a primeira aparece */
.l7-w:not(:first-child),
.l7-w.down { opacity: 0; transform: translateY(135%); }
.l7-w.up   { opacity: 0; transform: translateY(-135%); }
.l7-w.on   { opacity: 1; transform: none; }

/* Brilho que varre a frase uma vez. Só onde o texto recortado existe; sem isso fica céu liso. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .l7-w {
    background-image: linear-gradient(100deg,
      var(--ceu-400) 0%, var(--ceu-400) 40%, var(--ceu-100) 50%, var(--ceu-400) 60%, var(--ceu-400) 100%);
    background-size: 250% 100%;
    background-position: -20% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}


/* --------------------------------------------------------------------------
   4. Texto de apoio, botões e autoria
   -------------------------------------------------------------------------- */

.l7-hero-sub {
  max-width: 44rem;
  color: var(--marinho-200);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.l7-hero-sub strong {
  color: var(--branco);
  font-weight: 600;
}

.l7-hero-acoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.l7-hero-acoes .btn {
  min-height: 52px;
  padding: 0.75rem 1.75rem;
  font-size: var(--fonte-base);
}

/* Botão fantasma claro (contorno) para o marinho.
   Especificidade alta de propósito: vence o hover genérico do .btn em base.css. */
.l7-hero .btn.l7-hero-fantasma {
  --btn-fundo: transparent;
  --btn-texto: var(--off);
  --btn-borda: rgba(200, 214, 233, 0.32);
}

.l7-hero .btn.l7-hero-fantasma.l7-hero-fantasma:hover:not(:disabled):not([aria-disabled="true"]) {
  --btn-fundo: rgba(246, 248, 250, 0.08);
  --btn-borda: var(--ceu-400);
  --btn-texto: var(--branco);
}

.l7-hero-autoria {
  color: var(--marinho-300);
  font-size: var(--fonte-sm);
  font-weight: 500;
}

@media (max-width: 479px) {
  .l7-hero-acoes {
    width: 100%;
    max-width: 22rem;
  }

  .l7-hero-acoes .btn {
    flex: 1 1 100%;
  }
}


/* --------------------------------------------------------------------------
   5. Painel "O caminho até a liberdade"
   -------------------------------------------------------------------------- */

.l7-sys {
  width: 100%;
  max-width: 40rem;
  min-width: 0;
  padding: 1.375rem;
  border: 1px solid var(--l7-linha);
  border-radius: 22px;
  background: rgba(5, 23, 46, 0.42);
  box-shadow: 0 24px 64px -24px rgba(0, 0, 0, 0.45);
  text-align: left;
}

.l7-sys-rotulo {
  margin-bottom: 0.625rem;
  color: var(--marinho-200);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.l7-sys-linhas {
  position: relative;
}

/* Trilho vertical que liga os nós */
.l7-sys-linhas::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 26px;
  bottom: 26px;
  width: 2px;
  border-radius: 2px;
  background: rgba(200, 214, 233, 0.16);
}

/* Luz que percorre o trilho (só roda com movimento liberado) */
.l7-sys-linhas::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 20px;
  bottom: 20px;
  width: 8px;
  background: radial-gradient(closest-side, var(--ceu-200), rgba(89, 181, 236, 0.5) 45%, transparent) no-repeat;
  background-size: 100% 44px;
  background-position: 0 0;
  opacity: 0;
  pointer-events: none;
}

.l7-sys-linha {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.125rem 0.875rem;
  padding: 0.8125rem 0.375rem;
  border-top: 1px solid var(--l7-linha);
}

.l7-sys-no {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--azul-300);
  box-shadow: 0 0 0 5px rgba(141, 179, 226, 0.16);
}

.l7-sys-linha b {
  min-width: 0;
  color: var(--branco);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.l7-sys-linha small {
  color: var(--marinho-200);
  font-size: var(--fonte-sm);
  line-height: 1.4;
  text-align: right;
}

/* Escolha: o sétimo passo, em céu */
.l7-sys-linha--escolha {
  border-radius: 12px;
  background: rgba(89, 181, 236, 0.1);
  box-shadow: inset 0 0 0 1px rgba(89, 181, 236, 0.28);
}

.l7-sys-linha--escolha .l7-sys-no {
  background: var(--ceu-400);
  box-shadow: 0 0 0 5px rgba(89, 181, 236, 0.24), 0 0 18px rgba(89, 181, 236, 0.55);
}

.l7-sys-linha--escolha b { color: var(--ceu-300); }
.l7-sys-linha--escolha small { color: var(--ceu-100); }

.l7-sys-pe {
  margin-top: 0.625rem;
  padding: 0.75rem 0.875rem;
  border-radius: 12px;
  background: rgba(89, 181, 236, 0.1);
  box-shadow: inset 0 0 0 1px rgba(89, 181, 236, 0.15);
  color: var(--ceu-200);
  font-size: var(--fonte-sm);
  font-weight: 600;
}

/* Celular: o "o que é" desce para baixo do verbo */
@media (max-width: 519px) {
  .l7-sys {
    padding: 1.125rem 1rem;
  }

  .l7-sys-linha {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .l7-sys-linha small {
    grid-column: 2;
    text-align: left;
  }
}


/* --------------------------------------------------------------------------
   6. Luz no celular e no tamanho menor
   Parada de propósito: animar --l7-mx/--l7-my repinta o topo inteiro a cada
   quadro, para sempre, e no iPhone isso disputa com a pintura da rolagem
   (a página "some" em branco). No toque a luz é só o gradiente, no centro.
   -------------------------------------------------------------------------- */

@media (max-width: 700px) {
  .l7-hero-luz {
    background: radial-gradient(340px circle at var(--l7-mx) var(--l7-my),
      rgba(89, 181, 236, 0.22), rgba(63, 122, 190, 0.09) 40%, transparent 70%);
  }
}


/* --------------------------------------------------------------------------
   7. Entrada e movimento (só com movimento liberado)
   -------------------------------------------------------------------------- */

@keyframes l7-subir {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

@keyframes l7-brilho {
  0%   { background-position: 120% 0; }
  100% { background-position: -20% 0; }
}

@keyframes l7-acender {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes l7-pulso {
  0%, 100% { box-shadow: 0 0 0 4px rgba(141, 179, 226, 0.18); }
  50%      { box-shadow: 0 0 0 9px rgba(141, 179, 226, 0.04); }
}

@keyframes l7-percorre {
  0%   { opacity: 0; background-position: 0 0; }
  8%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { opacity: 0; background-position: 0 100%; }
}

@keyframes l7-respira {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(89, 181, 236, 0.15); }
  50%      { box-shadow: inset 0 0 0 1px rgba(89, 181, 236, 0.5), 0 0 24px rgba(89, 181, 236, 0.16); }
}

@media (prefers-reduced-motion: no-preference) {
  /* Coluna de texto: cada filho sobe em sequência */
  .l7-hero-texto > * {
    animation: l7-subir 0.8s var(--l7-curva-sobe) both;
  }

  .l7-hero-pilula { animation-delay: 0.05s; }

  /* Título: as duas linhas sobem separadas */
  .l7-hero-texto > .l7-hero-titulo { animation: none; }
  .l7-hero-linha { animation: l7-subir 0.9s var(--l7-curva-sobe) 0.15s both; }
  .l7-hero-hl    { animation: l7-subir 0.9s var(--l7-curva-sobe) 0.4s both; }
  .l7-w          { animation: l7-brilho 1.4s ease-out 1s both; }

  .l7-hero-sub     { animation-delay: 0.55s; }
  .l7-hero-acoes   { animation-delay: 0.7s; }
  .l7-hero-autoria { animation-delay: 0.82s; }

  /* Painel: sobe, as etapas acendem uma a uma, a luz percorre o trilho */
  .l7-sys {
    animation: l7-subir 0.9s var(--l7-curva-sobe) 0.85s both;
  }

  .l7-sys-linha {
    animation: l7-acender 0.6s ease both;
    animation-delay: calc(1.1s + var(--i, 0) * 0.12s);
  }

  .l7-sys-no {
    animation: l7-pulso 2.4s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * 0.3s);
  }

  .l7-sys-linha--escolha .l7-sys-no { animation: none; }

  .l7-sys-pe {
    animation: l7-subir 0.6s ease 2s both, l7-respira 3.2s ease-in-out 2.6s infinite;
  }

  .l7-sys-linhas::after {
    animation: l7-percorre 3.6s cubic-bezier(0.45, 0.05, 0.55, 0.95) 2.4s infinite;
  }

  /* Painel fora da tela no carregamento (o JS marca): espera aparecer para acender */
  .l7-sys.is-espera,
  .l7-sys.is-espera .l7-sys-linha,
  .l7-sys.is-espera .l7-sys-pe {
    animation: none;
    opacity: 0;
  }

  .l7-sys.is-entra { animation-delay: 0s; }
  .l7-sys.is-entra .l7-sys-linha { animation-delay: calc(0.25s + var(--i, 0) * 0.12s); }
  .l7-sys.is-entra .l7-sys-pe { animation-delay: 1.15s, 1.8s; }
  .l7-sys.is-entra .l7-sys-linhas::after { animation-delay: 1.6s; }
}

/* Laços infinitos do painel param com o topo fora da tela (o JS marca .is-fora)
   ou com a aba escondida. Toque: nenhum laço infinito no fundo do topo. */
.l7-hero.is-fora .l7-sys-no,
.l7-hero.is-fora .l7-sys-pe,
.l7-hero.is-fora .l7-sys-linhas::after {
  animation-play-state: paused;
}

/* Movimento reduzido: a frase não desliza (o JS também não troca) */
@media (prefers-reduced-motion: reduce) {
  .l7-w { transition: none; }
}
