/* ============================================================
   BASE — reset enxuto, tipografia padrão e utilitários de layout
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* âncoras param abaixo da barra de prazo + cabeçalho fixos */
  scroll-padding-top: calc(var(--topbar-h) + var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 800;
  line-height: var(--lh-snug);
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}

/* Assinatura editorial do Instituto: a palavra-chave em itálico */
h1 em, h2 em, h3 em {
  font-style: italic;
  font-weight: 800;
}

p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: .18em;
}
a:hover { text-decoration-color: currentColor; }

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

strong { font-weight: 700; }

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

/* ---------- Utilitários ---------- */

.u-container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.u-narrow { max-width: calc(var(--narrow) + var(--gutter) * 2); }

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 200;
  padding: var(--sp-3) var(--sp-5);
  background: var(--navy);
  color: var(--on-dark);
  font-weight: 700;
  font-size: var(--t-sm);
  border-radius: var(--r-sm);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus-visible { top: var(--sp-4); }

/* ---------- Revelação no scroll (progressiva) ----------
   Sem JS o conteúdo já nasce visível: a classe `has-reveal`
   só é adicionada ao <html> pelo main.js.                  */

.has-reveal .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.has-reveal .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .has-reveal .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
