/* ═══════════════════════════════════════════════════════════════════════════
   Base: reset mínimo, tipografía, accesibilidad y movimiento de entrada.
   ═══════════════════════════════════════════════════════════════════════════ */

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

html {
	color-scheme: dark;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	scroll-behavior: smooth;
	/* Los anclajes no quedan debajo de la barra fija. */
	scroll-padding-top: calc(var(--nav-h) + 1rem);
	background: var(--surface-0);
}

body {
	margin: 0;
	min-width: 320px;
	overflow-x: clip;
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.6;
	letter-spacing: -0.01em;
	color: var(--text-1);
	background: var(--surface-0);
	-webkit-tap-highlight-color: transparent;
}

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

/* Los <img> llevan width/height en el HTML para reservar espacio y evitar
   saltos de layout. Sin esto, ese alto gana al ancho que fija el CSS. */
img {
	height: auto;
}

h1,
h2,
h3,
h4 {
	margin: 0;
	font-family: var(--font-instrument);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.05;
	text-wrap: balance;
}

p {
	margin: 0;
	text-wrap: pretty;
}

ul,
ol,
dl,
dd {
	margin: 0;
	padding: 0;
}

li {
	list-style: none;
}

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

button {
	font: inherit;
	color: inherit;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
}

/* ── Accesibilidad ────────────────────────────────────────────────────────── */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.92);
	outline-offset: 3px;
	border-radius: var(--r-small);
}

.skip-link {
	position: fixed;
	left: 1rem;
	top: 1rem;
	z-index: 100;
	transform: translateY(-180%);
	border-radius: var(--r-small);
	background: var(--text-1);
	color: var(--surface-0);
	padding: 0.75rem 1rem;
	font-weight: 700;
	font-size: 0.875rem;
	transition: transform var(--t-base) var(--ease-out);
}

.skip-link:focus-visible {
	transform: translateY(0);
}

/* Texto sólo para lectores de pantalla.
   `left/top: 0` es obligatorio: sin ellos el elemento se queda en su posición
   estática y, dentro de un contenedor con scroll horizontal, ensancha el
   documento entero. Anclado al origen no arrastra a nadie. */
.visually-hidden {
	position: absolute;
	left: 0;
	top: 0;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ── Primitivas de layout ─────────────────────────────────────────────────── */

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

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

.section-head {
	max-width: 62ch;
	margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}

.section-head .lede {
	margin-top: 1.25rem;
}

/* ── Escala tipográfica ───────────────────────────────────────────────────── */

.h2 {
	font-size: clamp(2rem, 5vw, 3.25rem);
}

.h3 {
	font-size: clamp(1.375rem, 2.6vw, 1.75rem);
}

.lede {
	color: var(--text-2);
	font-size: clamp(1rem, 1.6vw, 1.125rem);
	max-width: 58ch;
}

.kicker {
	font-family: var(--font-instrument);
	font-weight: 700;
	font-size: 0.75rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--signal-bright);
}

.figure {
	font-family: var(--font-instrument);
	font-weight: 700;
	font-size: clamp(2.25rem, 5vw, 3.25rem);
	line-height: 1;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
}

.note {
	margin-top: 1.5rem;
	font-size: 0.875rem;
	line-height: 1.55;
	color: var(--text-3);
	max-width: 66ch;
}

.note-tight {
	margin-top: 1rem;
}

/* ── Movimiento de entrada ────────────────────────────────────────────────── */
/* Propósito: jerarquía. El contenido entra en el orden en que debe leerse.
   Disparado con IntersectionObserver, nunca con listeners de scroll. */

.js .reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 620ms var(--ease-out), transform 620ms var(--ease-out);
	transition-delay: var(--d, 0ms);
}

.js .reveal.is-in {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.js .reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}

	/* Nada se mueve solo: ni pulsos, ni barridos, ni avances automáticos. */
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}
