/* ============================================================
   BASE — reset, fonte e tipografia
   ============================================================ */

/* Uma única fonte para todos os pesos.
   O intervalo 100-900 faz este arquivo responder a QUALQUER peso pedido
   (font-weight: 700, bold, etc). Sem isso o navegador não acharia a
   variante e engordaria a letra sozinho, o famoso negrito falso. */
@font-face {
  font-family: "Deforma";
  src: url("../assets/fonts/Deforma-Regular.woff2") format("woff2"),
       url("../assets/fonts/Deforma-Regular.woff")  format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: var(--fw-regular);
  font-size: var(--fs-corpo-g);
  line-height: var(--lh-corpo);
  font-synthesis: none;            /* trava negrito e itálico falsos */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Tracking: cada elemento calcula o próprio, a partir do --ls que
   herda. Assim o valor em em vale para o tamanho de letra de cada
   texto. (Com letter-spacing direto no body, o valor virava px fixo
   e os textos menores herdavam um tracking apertado demais.)
   Regra: nunca usar letter-spacing; sempre --ls. */
:root { --ls: var(--ls-corpo); }
*, *::before, *::after { letter-spacing: var(--ls); }

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl { margin: 0; }
ul, ol { padding: 0; list-style: none; }

/* O navegador deixa títulos, b, strong e th em negrito por padrão.
   Como só existe um peso da Deforma, todos voltam para o peso regular
   em vez de pedir um arquivo que não existe. */
h1, h2, h3, h4, h5, h6,
b, strong, th, dfn, optgroup, legend {
  font-weight: var(--fw-regular);
}

/* Mesma lógica para o itálico: a Deforma só tem o romano, então address,
   em, i e cite ficam em pé em vez de pedir um itálico inexistente.
   Com font-synthesis: none o navegador também não inclina na marra. */
address, em, i, cite, var, dfn, q {
  font-style: normal;
}

img, video, svg { display: block; max-width: 100%; height: auto; }

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: opacity var(--transicao);
}
a:hover { opacity: 0.55; }
a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

button { font: inherit; color: inherit; }

/* link que não deve receber o sublinhado padrão */
a.sem-risco { border-bottom: 0; }

::selection { background: var(--c-verde); color: var(--c-preto); }

/* ---------- escala tipográfica ---------- */

.t-display {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  --ls: var(--ls-display);
  font-weight: var(--fw-light);
}

.t-marquee {
  font-size: var(--fs-marquee);
  line-height: var(--lh-display);
  --ls: var(--ls-display);
}

.t-titulo {
  font-size: var(--fs-titulo);
  line-height: var(--lh-titulo);
  --ls: var(--ls-titulo);
  font-weight: var(--fw-medium);
}

.t-lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
  --ls: var(--ls-corpo);
}

.t-corpo-g { font-size: var(--fs-corpo-g); line-height: var(--lh-corpo); }
.t-corpo   { font-size: var(--fs-corpo);   line-height: var(--lh-corpo); }
.t-corpo-p { font-size: var(--fs-corpo-p); line-height: var(--lh-corpo-p); }

.t-credito {
  font-size: var(--fs-credito);
  line-height: var(--lh-credito);
  --ls: var(--ls-corpo);
}

.t-micro {
  font-size: var(--fs-micro);
  line-height: var(--lh-corpo);
  --ls: var(--ls-micro);
  font-weight: var(--fw-medium);
}

/* ---------- utilitários ---------- */

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.pular-para-conteudo {
  position: absolute; left: var(--margem); top: -100px;
  z-index: 999; background: var(--c-preto); color: var(--c-branco);
  padding: var(--sp-xs) var(--sp-s); border: 0; border-radius: var(--raio-botao);
  font-size: var(--fs-corpo);
}
.pular-para-conteudo:focus { top: var(--sp-xs); }
