/* =========================================================================
   Base: reset, tipografía, contenedores y utilidades
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 350;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Grano de papel: capa fija, sin coste de repintado al hacer scroll */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

[hidden] { display: none !important; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
address { font-style: normal; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--ink);
}

.display { font-size: var(--fs-display); line-height: 1; }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); line-height: 1.12; }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); font-weight: 300; }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-small); }
.italic { font-style: italic; padding-bottom: 0.06em; }
.gold { color: var(--gold); }
.prose { max-width: var(--measure); color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 500; }

/* Etiqueta superior: uso restringido (máximo 1 cada 3 secciones) */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1.4rem;
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow::before { content: ""; width: 2.25rem; height: 1px; background: currentColor; opacity: 0.6; }

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

.section { padding-block: var(--section); position: relative; }
.section--tight { padding-block: calc(var(--section) * 0.6); }

/* Accesibilidad */
.sr-only {
  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: fixed;
  top: 0.75rem; left: 0.75rem;
  z-index: calc(var(--z-menu) + 1);
  padding: 0.75rem 1.25rem;
  border-radius: var(--r-pill);
  background: var(--green);
  color: var(--green-ink);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: none; }

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

::selection { background: var(--gold-fill); color: var(--green-deep); }

/* Estado inicial de las animaciones de entrada: solo si GSAP está activo */
.js-motion [data-reveal] { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js-motion [data-reveal] { opacity: 1; }
}
