/* ==========================================================================
   Base — reset corto, tipografía y elementos
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* El recorte tiene que estar también aquí: el desbordamiento de las
     graduaciones a sangre se mide en el elemento raíz, no en el body. */
  overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  /* Las graduaciones a sangre usan 100vw, que incluye el ancho de la barra de
     scroll. `clip` recorta ese desbordamiento sin crear contenedor de scroll,
     así que la cabecera sticky sigue funcionando (`hidden` la rompería). */
  overflow-x: clip;
  background: var(--face);
  color: var(--ink);
  font-family: var(--font-read);
  font-size: var(--step-body);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-panel);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--step-display); }
h2 { font-size: var(--step-h2); }
h3 { font-size: var(--step-h3); line-height: 1.2; letter-spacing: -0.015em; }
h4 { font-size: var(--step-h4); line-height: 1.3; letter-spacing: 0; }

p { margin: 0 0 var(--s4); max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 140ms linear, color 140ms linear;
}
a:hover { text-decoration-color: var(--red); }

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

ul, ol { margin: 0 0 var(--s4); padding-left: 1.15em; max-width: var(--measure); }
li { margin-bottom: var(--s2); }
li::marker { color: var(--rule-strong); }

strong, b { font-weight: 600; }

blockquote {
  margin: var(--s6) 0;
  padding-left: var(--s5);
  border-left: 1px solid var(--red);
  font-family: var(--font-panel);
  font-size: var(--step-h3);
  line-height: 1.3;
  letter-spacing: -0.015em;
  max-width: 34ch;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--s7) 0;
}

code, kbd, samp {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--face-2);
  padding: 0.1em 0.35em;
}

table { border-collapse: collapse; width: 100%; }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow { max-width: calc(var(--wrap-narrow) + var(--gutter) * 2); }

.section { padding-block: var(--section-y); }

.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;
}

.skip-link {
  position: absolute;
  left: var(--s4);
  top: -100%;
  z-index: 100;
  background: var(--red);
  color: #fff;
  padding: var(--s3) var(--s4);
  font-family: var(--font-panel);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--s4); }

/* Rótulo de panel. Sistema acotado: etiqueta zonas, nunca antetítulo decorativo. */
.panel-label {
  font-family: var(--font-panel);
  font-size: var(--step-label);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0;
}
.panel-label--dark { color: var(--ink-on-dark-muted); }

/* Lectura numérica: cifras tabulares, alineadas por la coma. */
.readout {
  font-family: var(--font-panel);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  font-feature-settings: 'tnum' 1;
}

.lead {
  font-size: var(--step-lead);
  line-height: 1.55;
  font-weight: 500;
  color: var(--ink);
  max-width: 56ch;
}

.muted { color: var(--ink-muted); }
