/* ==========================================================================
   Base — tudo escopado em .nes-page (sem estilo em tag solta fora do escopo)
   ========================================================================== */

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

.nes-page {
  margin: 0;
  background: var(--nes-cream-50);
  color: var(--nes-ink);
  font-family: var(--nes-font-sans);
  font-size: var(--nes-fs-body);
  line-height: var(--nes-lh-body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

.nes-page :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote) {
  margin: 0;
}

.nes-page :where(ul, ol)[role="list"],
.nes-page :where(ul, ol).nes-list-reset {
  list-style: none;
  padding: 0;
}

.nes-page :where(img, picture, video, svg) {
  display: block;
  max-width: 100%;
  height: auto;
}

.nes-page :where(button, input, select, textarea) {
  font: inherit;
  color: inherit;
}

.nes-page :where(button) {
  cursor: pointer;
}

.nes-page :where(a) {
  color: inherit;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Tipografia
   -------------------------------------------------------------------------- */

.nes-display {
  font-family: var(--nes-font-serif);
  font-weight: 700;
  font-size: var(--nes-fs-display);
  line-height: var(--nes-lh-display);
  text-wrap: balance;
}

.nes-h2 {
  font-family: var(--nes-font-serif);
  font-weight: 700;
  font-size: var(--nes-fs-h2);
  line-height: var(--nes-lh-h2);
  text-wrap: balance;
}

.nes-h3 {
  font-family: var(--nes-font-serif);
  font-weight: 600;
  font-size: var(--nes-fs-h3);
  line-height: var(--nes-lh-h3);
  text-wrap: balance;
}

.nes-h4 {
  font-family: var(--nes-font-sans);
  font-weight: 600;
  font-size: var(--nes-fs-h4);
  line-height: var(--nes-lh-h4);
}

.nes-eyebrow {
  display: block;
  font-family: var(--nes-font-sans);
  font-weight: 600;
  font-size: var(--nes-fs-eyebrow);
  line-height: 1.4;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.nes-body-l {
  font-size: var(--nes-fs-body-l);
  line-height: var(--nes-lh-body-l);
}

.nes-small {
  font-size: var(--nes-fs-small);
  line-height: var(--nes-lh-small);
}

.nes-measure {
  max-width: 70ch;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.nes-container {
  width: 100%;
  max-width: calc(var(--nes-container) + 2 * var(--nes-margin));
  margin-inline: auto;
  padding-inline: var(--nes-margin);
}

.nes-section {
  position: relative;
  padding-block: var(--nes-section-pad);
  scroll-margin-top: 72px; /* altura do menu fixo */
}

.nes-section__head {
  margin-bottom: var(--nes-title-gap);
}

.nes-section__head > * + * {
  margin-top: var(--nes-space-3);
}

/* --------------------------------------------------------------------------
   Acessibilidade
   -------------------------------------------------------------------------- */

.nes-page :focus-visible {
  outline: var(--nes-focus-ring);
  outline-offset: var(--nes-focus-offset);
}

/* Em fundos escuros o anel night-900 some: usa creme */
.nes-on-dark :focus-visible {
  outline-color: var(--nes-cream-100);
}

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

.nes-skip-link {
  position: absolute;
  top: var(--nes-space-2);
  left: var(--nes-space-2);
  z-index: calc(var(--nes-z-a11y) + 1);
  padding: var(--nes-space-3) var(--nes-space-4);
  background: var(--nes-cream-100);
  color: var(--nes-night-900);
  font-weight: 600;
  border-radius: var(--nes-radius-sm);
  transform: translateY(-200%);
}

.nes-skip-link:focus {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .nes-page *,
  .nes-page *::before,
  .nes-page *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

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