/* ==========================================================================
   ESTRUTURA — LINKBIO
   --------------------------------------------------------------------------
   ARQUIVO DE NÚCLEO. É igual em todos os clientes e NÃO se edita por cliente.
   Não há nenhum [TROQUE] aqui: tudo que varia entre marcas está em
   css/contrato.css e é preenchido por css/tema.css.

   Ordem de carregamento no index.html:
     contrato.css  ->  tema.css  ->  style.css  (e marca.css depois, se houver)
   ========================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--fonte-corpo);
  font-weight: var(--peso-corpo);
  letter-spacing: var(--letra);
  background: var(--bg);
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

::selection { background: var(--acento); color: var(--texto); }

:focus-visible {
  outline: 3px solid var(--acao);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================
   HERO — seção inteira, background cobre tudo, com parallax
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  flex-shrink: 0;                 /* não encolher como flex-item do body */
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  /* padding inferior extra: reserva a área que os cards vão "comer",
     mantendo o slogan e o indicador de scroll 100% visíveis */
  padding: 54px 24px 90px;
  overflow: hidden;
  isolation: isolate;
}

/* camada de background separada para o parallax */
.hero__bg {
  position: absolute;
  inset: -10% 0 -10% 0;           /* folga vertical para o parallax não mostrar borda */
  z-index: -1;
  background:
    var(--hero-overlay),
    var(--hero-img) center / cover no-repeat,
    var(--hero-base);
  will-change: transform;         /* parallax controlado via JS (js/main.js) */
}

.hero__inner { position: relative; }

.hero__logo {
  width: var(--hero-logo);
  max-width: 55%;
  height: auto;
  margin: 0 auto 20px;
  display: block;
}

.hero__title {
  color: var(--hero-texto);
  font-family: var(--fonte-display);
  font-weight: var(--peso-titulo);
  font-size: clamp(1.5rem, 7.5vw, 2.9rem);
  line-height: 1.2;
  text-wrap: balance;             /* linhas equilibradas quando quebra sozinho */
}

/* ===== Indicador de scroll animado ===== */
.scroll-hint {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: hintFade 3s ease-in-out infinite;
}
.scroll-hint__mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--hero-linha);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.scroll-hint__wheel {
  width: 3px;
  height: 7px;
  border-radius: 3px;
  background: var(--hero-texto);
  animation: wheelMove 1.6s ease-in-out infinite;
}
.scroll-hint__arrow {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--hero-linha);
  border-bottom: 2px solid var(--hero-linha);
  transform: rotate(45deg);
  animation: arrowBob 1.6s ease-in-out infinite;
}
@keyframes wheelMove {
  0%   { transform: translateY(0);    opacity: 1; }
  70%  { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0);    opacity: 0; }
}
@keyframes arrowBob {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: .5; }
  50%      { transform: rotate(45deg) translate(3px, 3px); opacity: 1; }
}
@keyframes hintFade {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}

/* ===== Estrutura do corpo ===== */
.page {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  flex: 1 0 auto;
}

/* ============================================================
   CARDS — sobem para dentro da hero (margin negativo)
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 0 20px 10px;
  margin-top: -40px;             /* pega só um pouco da hero */
  position: relative;
  z-index: 2;
}
.card {
  display: block;
  text-decoration: none;         /* o card é um <a>: nada de sublinhado */
  border-radius: var(--raio);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(var(--sombra-rgb), .22);
  transition: transform .35s cubic-bezier(.22,1,.36,1),
              box-shadow .35s cubic-bezier(.22,1,.36,1);
  line-height: 0;
  will-change: transform;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .55s cubic-bezier(.22,1,.36,1);
}
/* hover — especificidade alta para vencer .reveal.is-visible { transform: none } */
.card.is-visible:hover,
.card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 22px 46px rgba(var(--sombra-rgb), .30);
  /* garante a transição rápida do hover, mesmo com a regra .reveal */
  transition: transform .35s cubic-bezier(.22,1,.36,1),
              box-shadow .35s cubic-bezier(.22,1,.36,1);
}
.card:hover img { transform: scale(1.06); }   /* leve zoom na imagem */
.card.is-visible:active,
.card:active { transform: translateY(-2px) scale(1.005); }

/* ---- Variante .card--texto: foto + texto escrito em HTML ----------------
   Alternativa ao card em PNG. Mesma aparência, mas o texto é texto: dá para
   editar sem abrir editor gráfico, o Google lê, o leitor de tela anuncia e
   o arquivo pesa só a foto. Use uma OU outra forma — nunca as duas no mesmo
   card. */
.card--texto {
  position: relative;
  line-height: normal;            /* desfaz o line-height: 0 do .card */
  aspect-ratio: var(--card-prop);
  display: flex;
  align-items: flex-end;
}
.card--texto .card__foto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.card--texto::after {               /* véu que garante leitura do texto */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--card-overlay);
}
.card__conteudo {
  position: relative;
  z-index: 2;
  display: block;
  padding: 18px 22px;
  color: var(--card-texto);
}
.card__titulo {
  display: block;
  font-family: var(--fonte-display);
  font-weight: var(--peso-titulo);
  font-size: clamp(1.15rem, 3.2vw, 1.6rem);
  line-height: 1.15;
  text-wrap: balance;
}
.card__sub {
  display: block;
  margin-top: 5px;
  font-family: var(--fonte-corpo);
  font-weight: var(--peso-corpo);
  font-size: .875rem;
  line-height: 1.35;
  opacity: .88;
}

/* ============================================================
   CARROSSEL (OPCIONAL) — inerte se o index.html não tiver .vitrine
   ============================================================ */
.vitrine { padding: 34px 0 10px; }

.vitrine__cabecalho {
  padding: 0 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.vitrine__rotulo {
  color: var(--rotulo-cor);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.vitrine__titulo {
  font-family: var(--fonte-display);
  font-weight: var(--peso-titulo);
  font-size: 1.75rem;
  line-height: 1.1;
  margin-top: 4px;
}

.vitrine__setas { display: flex; gap: 8px; }
.vitrine__setas button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1.5px solid var(--texto);
  background: transparent;
  color: var(--texto);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color .15s ease, color .15s ease;
}
.vitrine__setas button:hover { background: var(--texto); color: var(--contraste); }
.vitrine__setas svg { width: 16px; height: 16px; }

.trilho {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 20px 12px;
  scrollbar-width: none;
}
.trilho::-webkit-scrollbar { display: none; }

.slide {
  flex: none;
  width: calc((100% - 32px) / 3);   /* 3 slides visíveis (32px = 2 gaps) */
  scroll-snap-align: center;
  border-radius: var(--raio);
  overflow: hidden;
  background: var(--superficie);
}
.slide__foto {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;            /* foto quadrada, sem moldura */
  height: auto;
  object-fit: cover;
}
.slide__legenda {
  padding: 12px 16px 16px;
  font-weight: var(--peso-corpo);
  font-size: .9375rem;
  letter-spacing: 0;
  line-height: 1.45;
  color: var(--texto);
}

.pontos {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.pontos button {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: none;
  background: var(--borda);
  cursor: pointer;
  padding: 0;
  transition: background-color .15s ease, transform .15s ease;
}
.pontos button[aria-current="true"] {
  background: var(--acao);
  transform: scale(1.25);
}

/* ===== CTA final ===== */
.cta {
  text-align: center;
  padding: 40px 24px 46px;
}
.cta__title {
  color: var(--texto-suave);
  font-family: var(--fonte-display);
  font-weight: var(--peso-titulo);
  font-size: clamp(1.4rem, 4.5vw, 1.9rem);
  line-height: 1.2;
  margin-bottom: 22px;
}
.cta__btn {
  display: inline-block;
  background: var(--acao);
  color: var(--contraste);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 15px 46px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(var(--acao-rgb), .35);
  transition: transform .3s cubic-bezier(.22,1,.36,1),
              box-shadow .3s cubic-bezier(.22,1,.36,1),
              filter .3s ease;
  will-change: transform;
}
.cta__btn.is-visible:hover,
.cta__btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 30px rgba(var(--acao-rgb), .45);
  filter: brightness(1.06);
  transition: transform .3s cubic-bezier(.22,1,.36,1),
              box-shadow .3s cubic-bezier(.22,1,.36,1),
              filter .3s ease;
}
.cta__btn.is-visible:active,
.cta__btn:active { transform: translateY(-1px) scale(1.01); }

/* ===== Divisor SVG antes do rodapé (opcional) ===== */
.serra-rodape {
  display: block;
  flex-shrink: 0;
  width: 100%;
  height: 46px;
  color: var(--serra-cor);
}

/* ===== Rodapé (faixa gradiente) ===== */
.footer {
  flex-shrink: 0;
  background: var(--grad-rodape);
  text-align: center;
  padding: 14px 20px;
}
.footer small {
  color: var(--contraste);
  font-weight: 500;
  font-size: .8rem;
  letter-spacing: 0;
}

/* ============================================================
   ANIMAÇÕES DE ENTRADA (reveal on scroll, com stagger)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.22,1,.36,1),
              transform .7s cubic-bezier(.22,1,.36,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* stagger entre os cards */
.cards .card:nth-child(1).reveal { transition-delay: .05s; }
.cards .card:nth-child(2).reveal { transition-delay: .15s; }
.cards .card:nth-child(3).reveal { transition-delay: .25s; }
.cards .card:nth-child(4).reveal { transition-delay: .35s; }
.cta__btn.reveal { transition-delay: .1s; }

/* respeita quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__bg { transform: none !important; }
  .scroll-hint,
  .scroll-hint__wheel,
  .scroll-hint__arrow { animation: none; }
  .card, .card img, .cta__btn { transition: none; }
  .card:hover, .cta__btn:hover { transform: none; }
  .card:hover img { transform: none; }
}

/* ===== Responsivo (celular) ===== */
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; margin-top: -35px; }
  .hero { padding-bottom: 100px; }
  .hero__logo { width: var(--hero-logo-mobile); max-width: 62%; }
  /* usa a versão vertical do fundo; se o tema não declarar, repete a do desktop */
  .hero__bg {
    background:
      var(--hero-overlay),
      var(--hero-img-mobile) center / cover no-repeat,
      var(--hero-base);
  }
  .slide { width: 84vw; }          /* no celular, 1 slide por vez */
}
