/* ==========================================================================
   Base — reset, tipografía y utilidades. Mobile-first.
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Los <figure> traen margin:0 40px por defecto y rompen las rejillas */
figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

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

/* ── Titulares ───────────────────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }

/* ── Utilidades ──────────────────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede { font-size: var(--step-1); line-height: 1.55; color: var(--muted); max-width: 46ch; }
.prose { max-width: 62ch; color: var(--muted); }
.prose p + p { margin-top: var(--s3); }

.sec { padding-block: var(--sec-y); border-top: 1px solid var(--line); }
.sec--flush { border-top: 0; }

.sec-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
  margin-bottom: var(--s4);
}

.lnk {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color var(--dur-fast) var(--ease);
}
.lnk:hover { color: var(--text); }
/* Junto a un título, el enlace mide 22 px de alto: el relleno lo lleva a
   44 px de área táctil y el margen negativo lo compensa, así que la
   maquetación no cambia. Solo aquí: dentro de un párrafo, el relleno
   invadiría la línea de arriba. */
.sec-hd > .lnk { padding-block: 11px; margin-block: -11px; }

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

/* Salto al contenido — primera parada del teclado */
.skip {
  position: absolute; top: -100px; left: var(--s3); z-index: 100;
  background: var(--accent); color: var(--ink);
  padding: 12px 18px; border-radius: var(--radius); font-weight: 700;
}
.skip:focus { top: var(--s2); }

/* ── Foco visible en todo lo interactivo ─────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--accent); color: var(--ink); }

/* ── Rack focus: el signature del sitio ──────────────────────────────────
   Sin JS (sin la clase .js en <html>) el contenido se ve siempre.          */
.js .rf {
  opacity: 0;
  filter: blur(9px);
  transform: scale(1.02);
  will-change: opacity, filter, transform;
  /* La transición va en el estado BASE, nunca en el estado final: si se declara
     junto al cambio de valor, el navegador la registra en el mismo frame y el
     elemento se queda congelado en el valor inicial. */
  transition:
    opacity .45s ease-out,
    filter var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
.js .rf.is-in {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
  will-change: auto;   /* libera la capa de GPU una vez revelado */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .js .rf { opacity: 1; filter: none; transform: none; }
}
