/* ==========================================================================
   HOFT — BASE
   Reset moderno + elementos. Sin decoración de sección (eso va en sections.css).
   ========================================================================== */

/* --- Fuente local: DM Mono Medium (detalles y números) -------------------- */
@font-face {
  font-family: "DM Mono";
  src: url("../fonts/DMMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--alto-barra) + var(--esp-sm));
}

body {
  /* Ancla de la capa de pegatinas: sin esto la capa mediría la ventana en vez
     del documento y las pegatinas del final de la página no cabrían. */
  position: relative;
  min-height: 100svh;
  background-color: var(--color-fondo);
  color: var(--color-texto);
  font-family: var(--font-texto);
  font-weight: var(--peso-light);
  font-size: var(--txt-base);
  line-height: var(--alto-linea-texto);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;           /* red de seguridad; nada debe desbordar */
}

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

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

button { background: none; border: 0; cursor: pointer; }

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

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

/* --- Titulares: Host Grotesk SemiBold, siempre en mayúsculas -------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--peso-semibold);
  text-transform: uppercase;
  line-height: var(--alto-linea-titular);
  letter-spacing: var(--tracking-titular);
  text-wrap: balance;
}

h1 { font-size: var(--txt-3xl); }
h2 { font-size: var(--txt-2xl); }
h3 { font-size: var(--txt-lg); }
h4 { font-size: var(--txt-md); }

p { text-wrap: pretty; }

/* --- Utilidades tipográficas --------------------------------------------- */
.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--txt-xs);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--color-texto-suave);
}

.texto-largo {
  max-width: var(--ancho-texto);
  font-size: var(--txt-md);
  color: var(--color-texto-suave);
}

/* El color de acento nunca va como tinta de texto (ilegible sobre blanco y
   contra la norma del manual): va de fondo, con el texto siempre en negro. */
.acento {
  background-color: var(--color-acento);
  color: var(--hoft-negro);
  padding: 0 0.25em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* --- Accesibilidad -------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: var(--esp-xs);
  left: var(--esp-xs);
  z-index: var(--z-skip);
  padding: var(--esp-2xs) var(--esp-sm);
  background: var(--color-texto);
  color: var(--color-fondo);
  font-family: var(--font-mono);
  font-size: var(--txt-xs);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform var(--dur-rapida) var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

:focus-visible {
  outline: 2px solid var(--color-foco);
  outline-offset: 3px;
}

/* Estado inicial de las animaciones de scroll.
   Solo se oculta si el JS de animación ha podido arrancar: sin JS o sin GSAP
   el contenido se ve igual. */
.anim-pendiente [data-anim] { opacity: 0; }
/* `will-change` lo pone y lo quita el JS justo alrededor de cada animación:
   dejarlo fijo en CSS reserva capas de GPU de más y penaliza en móvil. */

@media (prefers-reduced-motion: reduce) {
  .anim-pendiente [data-anim] { opacity: 1 !important; transform: none !important; }

  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
