/* base.css · fuentes, tokens, reset, tipografía, retícula, utilidades */

/* Fuentes alojadas en la propia web (licencia OFL en fuentes/). Mismas reglas
   que servía Google Fonts: Fraunces 500 con eje óptico, Inter 400 y 600. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fuentes/fraunces-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fuentes/fraunces-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fuentes/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fuentes/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fuentes/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fuentes/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #14181B;
  --ink-soft: #5A6268;
  --paper: #FBFAF8;
  --paper-alt: #F2EFE9;
  --verde: #1F4D3D;
  --verde-alto: #16392C;
  --verde-tenue: #E4EDE8;
  --linea: #E2DED6;
  --linea-campo: #80858A; /* bordes de campo: 3:1 sobre --paper y --paper-alt */
  --error: #A32C22;

  --fuente-titulo: 'Fraunces', Georgia, serif;
  --fuente-texto: 'Inter', system-ui, -apple-system, sans-serif;

  --s1: 4px;  --s2: 8px;  --s3: 16px; --s4: 24px;
  --s5: 40px; --s6: 64px; --s7: 96px; --s8: 128px;

  --ancho-max: 1180px;
  --ancho-texto: 660px;
  --radio: 12px;

  --dur-corta: 200ms;
  --dur-media: 400ms;
  --dur-larga: 700ms;
  --ease-salida: cubic-bezier(0.22, 1, 0.36, 1);

  --seccion-y: 80px;      /* ritmo vertical: 80 móvil / 128 escritorio */
  --margen-x: 24px;
  --cabecera-alto: 72px;
  --sombra-suave: 0 8px 24px rgba(20, 24, 27, 0.06);
}

@media (min-width: 1024px) {
  :root { --seccion-y: 128px; }
}

/* Reset */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--cabecera-alto) + 16px);
}

body {
  margin: 0;
  font: 400 18px/1.6 var(--fuente-texto);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

@media (min-width: 1024px) {
  body { font-size: 19px; }
}

h1, h2, h3, h4, p, ul, ol, figure, fieldset { margin: 0; }
ul, ol { padding: 0; }
fieldset { padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--verde); }
address { font-style: normal; }
strong { font-weight: 600; }

/* Tipografía. Tres niveles: Fraunces (h1, h2) · Inter 600 · Inter 400. */

h1, h2 {
  font-family: var(--fuente-titulo);
  font-weight: 500;
  font-optical-sizing: auto;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.15;
}

h3, h4 {
  font-weight: 600;
  font-size: 1.125rem;   /* 18 px */
  line-height: 1.4;
}

.texto-grande { font-size: 1.125em; }

/* Retícula */

.contenedor {
  width: min(100% - 2 * var(--margen-x), var(--ancho-max));
  margin-inline: auto;
}

.contenedor--texto {
  width: min(100% - 2 * var(--margen-x), var(--ancho-texto));
  margin-inline: auto;
}

.seccion {
  padding-block: var(--seccion-y);
  background: var(--paper);
}

.seccion--alt { background: var(--paper-alt); }

.prosa { max-width: var(--ancho-texto); }
.prosa > * + * { margin-top: var(--s3); }
.prosa > h2 + * { margin-top: var(--s4); }
.prosa > * + h2 { margin-top: var(--s6); }
.prosa > * + h3 { margin-top: var(--s5); }
.prosa ul { padding-left: 1.2em; }
.prosa li + li { margin-top: var(--s2); }

/* Cabecera de sección: separador (el motivo) + antetítulo + h2 + entradilla.
   Idéntica en todas las secciones. */

.cabecera-seccion {
  max-width: var(--ancho-texto);
  margin-bottom: var(--s5);
}

@media (min-width: 1024px) {
  .cabecera-seccion { margin-bottom: var(--s6); }
}

.cabecera-seccion--centrada {
  margin-inline: auto;
  text-align: center;
}

.separador {
  position: relative;
  display: block;
  width: 48px;
  height: 3px;
  margin-bottom: var(--s3);
  background: var(--ink);
}

.separador::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 100%;
  background: var(--verde);
}

.cabecera-seccion--centrada .separador { margin-inline: auto; }

.antetitulo {
  display: block;
  margin-bottom: var(--s3);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--verde);
}

.entradilla {
  margin-top: var(--s3);
  color: var(--ink-soft);
  font-size: 1.05em;
  text-wrap: pretty;
}

/* Utilidades */

.oculto {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.saltar {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 12px 20px;
  background: var(--verde);
  color: var(--paper);
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.saltar:focus { transform: none; }

.icono {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

/* Estados iniciales de las animaciones. Cuelgan de html.js: sin JavaScript
   todo el contenido se ve. GSAP anima hasta el estado final y añade .is-in. */

html.js [data-reveal]:not(.is-in),
html.js [data-reveal-group] > :not(.is-in) {
  opacity: 0;
  transform: translateY(28px);
}

/* Movimiento reducido: nada se mueve. */

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

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html.js [data-reveal]:not(.is-in),
  html.js [data-reveal-group] > :not(.is-in) {
    opacity: 1;
    transform: none;
  }
}
