/* =========================================================
   Justina · base
   Reset, tipografía, fondo y utilidades globales.
   ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* La fuente pixel tiene un solo peso: nada de negrita "inventada"
     por el navegador, que emborrona los píxeles. */
  font-synthesis: none;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--fuente-texto);
  font-size: var(--texto-m);
  line-height: var(--interlineado);
  color: var(--color-tinta);
  /* Papel crema con puntitos, como el fondo de un menú de consola. */
  background-color: var(--color-fondo);
  background-image: radial-gradient(var(--color-fondo-punto) 1.5px, transparent 1.6px);
  background-size: 16px 16px;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

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

a {
  color: var(--color-enlace);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

button {
  font: inherit;
  color: inherit;
}

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: var(--radio-s);
  background: var(--color-superficie-alt);
}

::selection {
  background: var(--color-seleccion);
}

:focus-visible {
  outline: 3px solid var(--color-foco);
  outline-offset: 3px;
  border-radius: var(--radio-s);
}

[tabindex="-1"]:focus {
  outline: none;
}

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

.contenedor {
  width: 100%;
  max-width: var(--ancho-max);
  margin-inline: auto;
  padding-inline: var(--esp-4);
}

@media (min-width: 600px) {
  .contenedor {
    padding-inline: var(--esp-5);
  }
}

.principal {
  flex: 1;
  padding-block: var(--esp-6) var(--esp-8);
}

/* ---------- Utilidades ---------- */

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

.pixel {
  font-family: var(--fuente-pixel);
}

/* ---------- Movimiento reducido ----------
   Si el sistema pide menos movimiento, todo queda quieto. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
