/* ==========================================================================
   base.css — reset, tipografia e utilitários de layout
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--altura-header) + 16px);
  /* Impede rolagem lateral causada por elementos fora da tela (painel lateral,
     faixa animada). "clip" é preferido: não quebra o position:sticky do header. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  font-family: var(--fonte-texto);
  font-size: var(--t-base);
  line-height: 1.65;
  color: var(--texto);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}

img, svg, video, canvas, iframe { display: block; max-width: 100%; height: auto; }
/* Nada de palavra comprida (link, e-mail, código) empurrando o layout. */
p, li, td, th, h1, h2, h3, h4, dd, dt, figcaption, label, summary { overflow-wrap: break-word; }
/* Tabela larga rola dentro da própria caixa, não na página inteira. */
table { max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--fonte-titulo);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: var(--t-3xl); }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-lg); }
p  { text-wrap: pretty; }

:focus-visible {
  outline: 3px solid var(--marca-500);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Layout --- */
.container {
  width: min(100% - 2.5rem, var(--largura-max));
  margin-inline: auto;
}
/* Em telas bem estreitas a margem lateral encolhe para sobrar leitura. */
@media (max-width: 400px) { .container { width: min(100% - 1.75rem, var(--largura-max)); } }
.secao { padding-block: clamp(3.5rem, 2rem + 6vw, 7rem); }
.secao--compacta { padding-block: clamp(2.5rem, 1.5rem + 3vw, 4rem); }
.secao--escura {
  background: var(--grafite-800);
  color: var(--texto-inverso);
}
.secao--escura .secao__titulo, .secao--escura h2, .secao--escura h3 { color: var(--branco); }
.secao--escura p { color: #C7CDD7; }

.grade { display: grid; gap: var(--e-5); }
.grade--2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grade--3 { grid-template-columns: repeat(auto-fill, minmax(min(285px, 100%), 1fr)); }
.grade--4 { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }

.cabecalho-secao { max-width: 62ch; margin-bottom: var(--e-6); }
.cabecalho-secao--centro { margin-inline: auto; text-align: center; }

.rotulo {
  display: inline-flex; align-items: center; gap: var(--e-2);
  font-size: var(--t-xs); font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--marca-600); margin-bottom: var(--e-3);
}
.rotulo::before {
  content: ""; width: 26px; height: 3px; border-radius: 2px;
  background: var(--marca-500);
}
.secao--escura .rotulo { color: var(--marca-400); }

.texto-suave { color: var(--texto-suave); }
.medida { max-width: var(--largura-texto); }
.centro { text-align: center; }

/* --- Acessibilidade --- */
.pular-para-conteudo {
  position: absolute; left: var(--e-4); top: -100px; z-index: 999;
  background: var(--marca-500); color: var(--sobre-marca);
  padding: var(--e-3) var(--e-4); border-radius: var(--raio-sm); font-weight: 700;
  transition: top var(--transicao);
}
.pular-para-conteudo:focus { top: var(--e-4); }
.apenas-leitor {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
