/* Reset, tipografía y layout base. */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.65;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}

body.no-scroll { overflow: hidden; }

img, svg { max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 { margin: 0 0 var(--s-4); font-family: var(--font-display); text-wrap: balance; }
h1 { font-size: var(--fs-h1); font-weight: 650; line-height: 1.04; letter-spacing: var(--tracking-display); }
h2 { font-size: var(--fs-h2); font-weight: 650; line-height: 1.1; letter-spacing: var(--tracking-display); }
h3 { font-size: var(--fs-h3); font-weight: 620; line-height: 1.2; letter-spacing: var(--tracking-heading); }
h4 { font-size: var(--fs-h4); font-weight: 600; line-height: 1.3; letter-spacing: var(--tracking-heading); }
p { margin: 0 0 var(--s-4); text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }

a { color: var(--brand); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-strong); }
:where(.on-dark, .section--dark, .section--deep, .page-head, .cta-band) a:where(:not(.btn)) { color: var(--brand-on-dark); }
:where(.on-dark, .section--dark, .section--deep, .page-head, .cta-band) a:where(:not(.btn)):hover { color: #fff; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

::selection { background: var(--accent); color: var(--on-accent); }

/* Barra de desplazamiento en la paleta del sitio (solo navegadores que la soportan) */
html { scrollbar-color: var(--ink-600) var(--ink-950); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 50rem; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0;
}
.trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.skip-link {
    position: absolute; left: var(--s-4); top: -4rem; z-index: var(--z-skip);
    background: var(--accent); color: var(--on-accent); font-weight: 650;
    padding: var(--s-2) var(--s-4); border-radius: var(--r-control); text-decoration: none;
}
.skip-link:focus { top: var(--s-2); color: var(--on-accent); }

/* Secciones: ritmo vertical y alternancia claro/oscuro */
.section { padding-block: var(--s-9); position: relative; }
.section--surface { background: var(--surface); }
.section--dark { background: var(--ink-900); color: var(--text-on-dark); }
.section--deep { background: var(--ink-950); color: var(--text-on-dark); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4,
.section--deep h1, .section--deep h2, .section--deep h3, .section--deep h4 { color: #fff; }

.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--text-soft); max-width: var(--measure); }
:where(.on-dark, .section--dark, .section--deep, .page-head, .cta-band, .hero) .lead { color: var(--text-soft-on-dark); }

.section-head { max-width: 46rem; margin-bottom: var(--s-7); }
.section-head > :last-child { margin-bottom: 0; }

/* Marcadores de contenido pendiente (solo visibles si Site:MostrarMarcadoresPendientes) */
mark.pendiente { background: var(--marker-bg); color: var(--text); padding: 0.05rem 0.35rem; border-radius: 4px; font-size: 0.85em; font-weight: 600; }

/* Revelado al hacer scroll. Sin JS o con movimiento reducido todo permanece visible. */
.js .reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
    transition-delay: calc(var(--i, 0) * 50ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js .reveal { opacity: 1; transform: none; transition: none; }
}
