/* ===================== Base ===================== */
*, *::before, *::after { box-sizing: border-box; }
:root {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  background: var(--c-ink);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1em; }
dialog { color: inherit; }

h1, h2, h3, .h2, .h3 {
  font-family: var(--f-display);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.012em;
  margin: 0 0 .5em;
  font-optical-sizing: auto;
  text-wrap: balance;
}
h2, .h2 { font-size: var(--fs-h2); }
h3, .h3 { font-size: var(--fs-h3); line-height: 1.2; font-weight: 400; }
.lead { font-family: var(--f-display); font-size: var(--fs-lead); line-height: 1.45; font-weight: 300; }

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

/* Temas de sección */
.section { padding-block: var(--section-y); background: var(--bg); color: var(--text); position: relative; }
.section--tight { padding-top: 0; }
.section--light { --bg: var(--c-ivory); }
.section--sand  { --bg: var(--c-sand); }
.section--dark, .is-dark {
  --bg: var(--c-ink);
  --surface: var(--c-ink-2);
  --text: #EFE8DD;
  --muted: #ADA497;
  --line: rgba(239, 232, 221, .14);
  --accent-text: var(--c-glow);
}

.section-head { max-width: 640px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head p { color: var(--muted); margin: 0; }
.section-head--split { max-width: none; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; }
.section-head--split > div:first-child { max-width: 560px; }

/* 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: absolute; left: 1rem; top: -100px; z-index: 200; background: var(--c-glow); color: var(--c-ink); padding: .75rem 1.25rem; border-radius: var(--r-pill); }
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + .75rem); }
:focus-visible { outline: 2px solid var(--c-glow); outline-offset: 3px; border-radius: 4px; }

/* Aparición suave al hacer scroll (solo títulos de sección) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

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