/* base.css — Reset, configuração do corpo, helpers de fonte, container,
   ::selection e estados base do scroll-reveal. */

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

* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px; /* compensa o TOC fixo ao saltar para âncoras */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--weight-regular);
  line-height: var(--lh-normal);
  color: var(--text-secondary);
  background-color: var(--noir-950);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
iconify-icon { display: inline-flex; line-height: 1; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

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

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 { font-weight: var(--weight-regular); line-height: var(--lh-tight); }

::selection { background: var(--gold-500); color: var(--text-on-gold); }

:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ---- HELPERS DE FONTE ---- */
.font-display { font-family: var(--font-display); }
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }

/* ---- CONTAINER ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}
.container-wide { max-width: var(--container-wide); }

/* ---- UTILITÁRIOS ---- */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

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

/* ---- ESTADOS BASE DO SCROLL-REVEAL ----
   .js-reveal é adicionado ao <html> por scroll-reveal.js. Sem JS o conteúdo
   permanece visível — os elementos só ficam ocultos quando o JS está ativo. */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition: opacity var(--dur-slow) var(--ease-reveal),
              transform var(--dur-slow) var(--ease-reveal);
  will-change: opacity, transform;
}
.js-reveal [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---- ACESSIBILIDADE: MOVIMENTO REDUZIDO ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-reveal [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
