/* ───────── Fuentes (alojadas en la propia web, sin llamadas a Google) ───────── */
@font-face {
  font-family: 'Libre Caslon Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/libre-caslon-text.woff2') format('woff2');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/manrope.woff2') format('woff2');
}

/* ───────── Tokens ───────── */
:root {
  --primary: #1b3b2f;
  --neutral: #e5e4e2;
  --text: #222222;

  /* Derivados: blanco roto y opacidades */
  --off: #f7f6f3;
  --muted: rgba(34, 34, 34, .66);
  --line: rgba(34, 34, 34, .12);
  --primary-soft: rgba(27, 59, 47, .08);
  --on-dark: #f7f6f3;
  --on-dark-muted: rgba(247, 246, 243, .7);
  --line-dark: rgba(247, 246, 243, .16);

  --serif: 'Libre Caslon Text', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 16px;
  --radius-lg: 24px;
  --pill: 999px;

  --wrap: 1160px;
  --gutter: 22px;
  --section: 88px;
  --nav-h: 64px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (min-width: 768px) {
  :root { --gutter: 40px; --section: 128px; --nav-h: 76px; }
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--off);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
strong { font-weight: 600; }
::selection { background: var(--primary); color: var(--on-dark); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--on-dark); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 680px; }

.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 100;
  background: var(--primary); color: var(--on-dark);
  padding: 10px 16px; border-radius: var(--pill); font-size: .875rem; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ───────── Tipografía ───────── */
h1, h2, h3, .serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.02em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.125rem, 7.6vw, 4.125rem); line-height: 1.14; }
h2 { font-size: clamp(1.875rem, 5.4vw, 3rem); line-height: 1.16; }
h3 { font-size: clamp(1.3125rem, 3vw, 1.625rem); line-height: 1.3; }
h2 em, h1 em { font-style: normal; }
p { text-wrap: pretty; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--sans);
  font-size: .75rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 24px;
}
.eyebrow::before { content: ''; width: 28px; height: 1px; background: currentColor; opacity: .6; }
.on-dark .eyebrow { color: var(--on-dark-muted); }

.lead { font-size: 1.125rem; color: var(--muted); }
.prose p + p { margin-top: 1.1em; }
.prose p { color: var(--muted); }
.prose strong { color: var(--text); }

/* ───────── Wordmark ───────── */
.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.625rem;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--primary);
  text-decoration: none;
}
.wordmark--light { color: var(--on-dark); }

/* ───────── Botones ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 14px 30px;
  font-family: var(--sans); font-size: .9375rem; font-weight: 600; letter-spacing: .01em;
  text-decoration: none; text-align: center;
  border: 1px solid var(--primary); border-radius: var(--pill);
  background: var(--primary); color: var(--on-dark);
  transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease);
  cursor: pointer;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn .btn-arrow { margin-right: -2px; transition: transform .45s var(--ease); }
.btn--ghost { background: transparent; color: var(--primary); }
.btn--light { background: var(--on-dark); color: var(--primary); border-color: var(--on-dark); }
.btn--sm { min-height: 38px; padding: 8px 16px; font-size: .8125rem; gap: 8px; }
.btn--sm .btn-arrow { width: 13px; height: 13px; }
@media (hover: hover) {
  .btn:hover { background: #2a4d40; border-color: #2a4d40; }
  .btn--ghost:hover { background: var(--primary-soft); border-color: var(--primary); }
  .btn--light:hover { background: var(--neutral); border-color: var(--neutral); }
  .btn:hover .btn-arrow { transform: translateX(4px); }
}

.link-arrow {
  font-size: .9375rem; font-weight: 500; color: var(--primary);
  text-decoration: none; border-bottom: 1px solid rgba(27, 59, 47, .35);
  padding-bottom: 2px; transition: border-color .3s var(--ease);
}
.link-arrow:hover { border-color: var(--primary); }
.link-arrow .down { display: inline-block; transition: transform .45s var(--ease); }
.link-arrow:hover .down { transform: translateY(3px); }

/* ───────── Barra superior ───────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(247, 246, 243, .9);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ───────── Secciones ───────── */
.section { padding: var(--section) 0; }
.bg-off { background: var(--off); }
.bg-neutral { background: var(--neutral); }
.bg-primary { background: var(--primary); color: var(--on-dark); }
.anchor { position: relative; top: calc(-1 * var(--nav-h)); display: block; height: 0; }

/* Aparición suave al hacer scroll (solo si hay JS) */
/* El contenido es visible por defecto: solo se oculta cuando el script ya está
   funcionando (clase reveal-ready) y nunca lo que ya está en pantalla. */
.reveal { transition: opacity .4s var(--ease), transform .4s var(--ease); }
.reveal-ready .reveal:not(.in) { opacity: 0; transform: translateY(12px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal-ready .reveal:not(.in) { opacity: 1; transform: none; }
}

/* ───────── Footer ───────── */
.footer {
  background: var(--primary); color: var(--on-dark-muted);
  border-top: 1px solid var(--line-dark);
  padding: 40px 0;
  font-size: .875rem;
}
.footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer a { text-decoration: none; transition: color .25s; }
.footer a:hover { color: var(--on-dark); }

/* ───────── Páginas legales ───────── */
.legal { padding: calc(var(--nav-h) + 56px) 0 var(--section); }
.legal h1 { font-size: clamp(2.25rem, 6vw, 3.25rem); margin-bottom: 12px; }
.legal .updated { font-size: .875rem; color: var(--muted); margin-bottom: 48px; }
.legal h2 { font-size: clamp(1.375rem, 3.4vw, 1.75rem); margin: 48px 0 14px; }
.legal p, .legal li { color: var(--muted); }
.legal p + p { margin-top: 1em; }
.legal ul { margin: 14px 0 0 1.1em; }
.legal li + li { margin-top: 6px; }
.legal a { color: var(--primary); text-underline-offset: 3px; }
.legal dl { display: grid; grid-template-columns: 1fr; gap: 2px 24px; margin-top: 8px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.legal dt { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }
.legal dd { color: var(--text); margin-bottom: 12px; }
@media (min-width: 640px) {
  .legal dl { grid-template-columns: 180px 1fr; }
  .legal dt { padding-top: 5px; }
  .legal dd { margin-bottom: 6px; }
}
