/* Base: reset, tipografia e regras globais. Cores e fontes vêm só de tokens.css. */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: inherit;
}

h1 {
  font-size: clamp(2.625rem, 10.5vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2.125rem, 7vw, 3.25rem);
}

h3 {
  font-size: clamp(1.625rem, 5vw, 1.875rem);
  line-height: 1.15;
}

p {
  margin: 0 0 var(--space-4);
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--moss-800);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--moss-950);
}

ol,
ul {
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--bone-200);
  color: var(--ink);
}

/* Foco visível e consistente; seções escuras trocam a cor do contorno.
   Seção escura nova deve usar a classe .on-dark (não precisa entrar na lista abaixo). */
:focus-visible {
  outline: 3px solid var(--moss-700);
  outline-offset: 3px;
  border-radius: 4px;
}

.on-dark :focus-visible,
.hero :focus-visible,
.topbar :focus-visible,
.final-cta :focus-visible,
.footer :focus-visible {
  outline-color: var(--gold-300);
}

/* Largura de leitura: seções de fundo inteiro com conteúdo alinhado ao container. */
.section {
  padding-block: var(--space-16);
  padding-inline: max(var(--space-4), calc((100% - var(--container)) / 2));
}

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

@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;
  }
}

/* LP multilíngue: esconde o português enquanto o JS traduz (?lang=en|es). A animação é o plano B se o JS falhar. */
.i18n-loading body { opacity: 0; animation: i18n-failsafe 0s linear 2.5s forwards; }
@keyframes i18n-failsafe { to { opacity: 1; } }
