/* ==========================================================================
   Base · reset, tipografía, layout, utilidades
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-2));
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

body.is-menu-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
/* :where() = especificidad 0, para que las clases de componente puedan fijar su padding */
:where(ul[class], ol[class]) { list-style: none; padding: 0; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }

a { color: var(--text-primary); }
a:hover { color: var(--text-accent); }

:focus-visible {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: var(--focus-offset);
}
.s-dark :focus-visible { outline-color: var(--focus-ring-on-dark); }

/* --- Accesibilidad --- */
.u-visually-hidden {
  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: var(--space-2);
  top: -100px;
  z-index: 100;
  padding: var(--space-1-5) var(--space-2);
  border-radius: var(--radius-md);
  background: var(--bg-dark);
  color: var(--text-on-dark);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}
.skip-link:focus { top: var(--space-2); color: var(--text-on-dark); }

/* --- Layout --- */
.l-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--grid-margin);
}

.l-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--grid-gutter);
}

.l-section { padding-block: var(--section-py); }
.l-stack { display: flex; flex-direction: column; }

/* Fondos de sección */
.s-alt  { background: var(--bg-alt); }
.s-info { background: var(--bg-info); }
.s-dark { background: var(--bg-dark); color: var(--text-on-dark); }

/* --- Tipografía --- */
.t-eyebrow {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-accent);
}
.s-dark .t-eyebrow { color: var(--text-on-dark-accent); }

.t-h1 {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.t-h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.t-h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: var(--fw-semibold);
}
.t-lead    { font-size: var(--fs-body-lg); line-height: var(--lh-body); color: var(--text-secondary); }
.t-body    { font-size: var(--fs-body);    line-height: var(--lh-body); color: var(--text-secondary); }
.t-small   { font-size: var(--fs-body-sm); line-height: 1.5; color: var(--text-muted); }
.t-caption { font-size: var(--fs-caption); line-height: 1.5; color: var(--text-muted); }

.s-dark .t-lead, .s-dark .t-body { color: var(--color-neutral-200); }
.s-dark .t-small, .s-dark .t-caption { color: var(--text-on-dark-muted); }

/* --- Iconos (Remix Icon line, sprite inline) --- */
.icon { width: 24px; height: 24px; flex-shrink: 0; fill: currentColor; }
.icon--sm { width: 20px; height: 20px; }
.icon--lg { width: 32px; height: 32px; }

/* --- Movimiento reducido --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
