/* =========================================================================
   base.css — Reset enxuto, tipografia padrão e acessibilidade
   ========================================================================= */

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

html {
  /* Âncoras (#how, #faq…) param abaixo do cabeçalho fixo em vez de sob ele */
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--c-page);
  color: var(--c-ink-700);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Títulos ---------------------------------------------------------- */

h1,
h2,
h3 {
  margin: 0;
  color: var(--c-ink-900);
  font-weight: 800;
  line-height: var(--lh-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-2xl);
}

h2 {
  font-size: var(--fs-xl);
}

h3 {
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
}

p {
  margin: 0;
  text-wrap: pretty;
}

/* ---- Links ------------------------------------------------------------ */

a {
  color: var(--c-brand-700);
  text-decoration: none;
}

a:hover {
  color: var(--c-brand-900);
}

/* ---- Mídia e formulários ---------------------------------------------- */

img,
svg,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* ---- Foco visível ------------------------------------------------------
   Um único anel de foco para todo o site, aplicado só à navegação por
   teclado (:focus-visible), nunca ao clique de mouse.
   ----------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--c-brand-600);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Utilitários de acessibilidade ------------------------------------ */

/* Visível apenas para leitores de tela */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Link "pular para o conteúdo": some até receber foco pelo teclado */
.skip-link {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-surface);
  color: var(--c-ink-900);
  font-size: var(--fs-sm);
  font-weight: 700;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transform: translateY(-150%);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* Respeita quem pediu menos movimento no sistema operacional */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
