/* ==========================================================
   BASE
   Fontes locais, reset e estilos gerais de texto.
   ========================================================== */

/* ---------- Fontes (arquivos em assets/fonts) ---------- */
/* Macondo é a fonte das falas e do código dos feitiços no jogo */
@font-face {
  font-family: "Macondo";
  src: url("../assets/fonts/macondo/macondo-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../assets/fonts/atkinson-hyperlegible/atkinson-hyperlegible-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../assets/fonts/atkinson-hyperlegible/atkinson-hyperlegible-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../assets/fonts/atkinson-hyperlegible/atkinson-hyperlegible-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  overflow-x: hidden;
}

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

/* Pixel art sempre nítida, sem borrar ao ampliar */
img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

/* ---------- Texto ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-pixel);
  font-weight: 400;
  line-height: 1.5;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

strong {
  color: var(--color-gold);
  font-weight: 700;
}

a {
  color: var(--color-gold);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-text);
}

/* Foco visível para quem navega pelo teclado */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

/* Voz do Narrador: comentários irônicos entre parênteses */
.narrator {
  color: var(--color-lilac);
  font-style: italic;
}

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

/* Texto lido por leitores de tela, mas invisível na tela */
.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;
}

/* Link "Pular para o conteúdo", aparece ao apertar Tab */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--color-gold);
  color: var(--color-on-gold);
  font-family: var(--font-pixel);
  font-size: var(--pixel-xs);
  text-decoration: none;
  transform: translateY(-200%);
}

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

/* Quem pediu menos movimento no sistema não vê animações */
@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;
  }
}
