/* ============================================================
   CON CADA LATIDO — Base, reset y tipografía
   ============================================================ */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  font-size: var(--t-body);
  font-weight: 300;
  line-height: var(--leading-texto);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul[class], ol[class] { list-style: none; padding: 0; }

/* ---------- TITULARES: serif ------------------------------ */
h1, h2, h3, h4, .serif {
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: var(--leading-titulo);
  letter-spacing: var(--track-titulo);
  color: var(--text);
}
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); font-weight: 400; }

.display {
  font-family: var(--font-serif);
  font-size: var(--t-display);
  font-weight: 300;
  line-height: .98;
  letter-spacing: -0.012em;
}

/* ---------- EMOCIÓN: script ------------------------------- */
.script {
  font-family: var(--font-script);
  font-weight: 400;
  /* Una caligráfica en mayúsculas no hay quien la lea. Este valor
     directo gana a cualquier `uppercase` heredado de un contenedor. */
  text-transform: none;
  font-variant: normal;
  letter-spacing: 0;
  /* Calligraphy baja 0,42 em por debajo de la línea base: hace falta
     interlínea generosa y un poco de aire abajo para no cortar los rabos. */
  line-height: 1.5;
  color: var(--acento);
  padding-bottom: .22em;
}
.script--xl { font-size: var(--t-script-xl); }
.script--l  { font-size: var(--t-script-l); }
.script--m  { font-size: var(--t-script-m); }

/* ---------- FUNCIÓN: sans --------------------------------- */
.etiqueta {
  font-family: var(--font-sans);
  font-size: var(--t-micro);
  font-weight: 400;
  letter-spacing: var(--track-etiqueta);
  text-transform: uppercase;
  color: var(--text-tenue);
}

.entradilla {
  font-size: clamp(1.06rem, 1rem + 0.34vw, 1.28rem);
  font-weight: 300;
  line-height: 1.66;
  color: var(--text-suave);
  max-width: 60ch;
}

/* ---------- ENLACES --------------------------------------- */
a { color: inherit; text-decoration: none; }

.enlace-texto {
  color: var(--acento);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: color-mix(in srgb, var(--acento) 35%, transparent);
  transition: text-decoration-color var(--dur-rapida);
}
.enlace-texto:hover { text-decoration-color: currentColor; }

/* ---------- ACCESIBILIDAD --------------------------------- */
:focus-visible {
  outline: 2px solid var(--madera-500);
  outline-offset: 3px;
  border-radius: 2px;
}

.saltar-al-contenido {
  position: absolute; left: 50%; top: -100px;
  transform: translateX(-50%);
  z-index: 999;
  background: var(--madera-700); color: var(--crema-0);
  padding: .8rem 1.4rem; border-radius: 0 0 var(--r-m) var(--r-m);
  font-size: var(--t-small); letter-spacing: var(--track-nav); text-transform: uppercase;
  transition: top var(--dur-rapida);
}
.saltar-al-contenido:focus { top: 0; }

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

::selection { background: var(--verde-200); color: var(--tinta); }
