/* ==========================================================================
   Base: reset, tipografía, utilidades
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}
h1 { font-size: var(--fs-hero); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { margin: 0 0 var(--space-4); max-width: 62ch; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s var(--ease);
}
a:hover { color: var(--ink); }

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

ul, ol { padding-left: 1.2em; }

strong { font-weight: 600; color: var(--ink); }

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

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

/* Cuando el cursor personalizado está activo, ocultamos el nativo en toda la página */
html.has-brick-cursor,
html.has-brick-cursor * {
  cursor: none !important;
}
html.has-brick-cursor input,
html.has-brick-cursor textarea,
html.has-brick-cursor select,
html.has-brick-cursor iframe {
  cursor: auto !important;
}

/* Layout ----------------------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
.container--narrow { --container: 52rem; }

.section { padding-block: var(--space-8); }
.section--tight { padding-block: var(--space-7); }
.section--band { background: var(--paper-2); }

@media (min-width: 768px) {
  .section { padding-block: var(--space-9); }
}

/* Papel cuadriculado (fondo del hero y del pie) */
.grid-paper {
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: var(--stud) var(--stud);
  background-position: center top;
}

/* Tipografía utilitaria --------------------------------------------------- */
.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.lead {
  font-size: var(--fs-lg);
  line-height: 1.5;
  color: var(--text);
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.hl {
  background: rgba(255, 176, 46, 0.35);
  padding-inline: 0.15em;
  border-radius: 2px;
}

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

/* Interacción de aparición limpia (sin fade-up retardado) */
.reveal {
  opacity: 1;
}
