/* ==========================================================================
   base.css — Reset moderno, tipografía base y utilidades
   Depende de tokens.css (cargar antes).
   ========================================================================== */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--c-body);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
svg { fill: currentColor; }

a { color: var(--c-accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-accent-600); }

button { font: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* --- Titulación --- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--c-ink);
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
}
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
p { max-width: 68ch; }

/* --- Foco visible (accesibilidad) --- */
:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

.section { padding-block: var(--sp-9); }
.section--surface { background: var(--c-surface); }
.section--navy { background: var(--c-navy); color: #c8d2dd; }
.section--navy h2, .section--navy h3 { color: var(--c-white); }

.section__head { max-width: 60ch; margin-bottom: var(--sp-7); }
.section__eyebrow {
  font-family: var(--font-head);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--sp-2);
}
.section__lead { font-size: var(--fs-md); color: var(--c-muted); margin-top: var(--sp-3); }

/* --- Grid utilitario --- */
.grid { display: grid; gap: var(--sp-5); }
@media (min-width: 640px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-family: var(--font-head); font-weight: var(--fw-semibold); font-size: var(--fs-sm);
  padding: 0.75rem 1.4rem; border-radius: var(--radius); transition: all var(--t);
  white-space: nowrap; line-height: 1;
}
.btn--primary { background: var(--c-accent); color: var(--c-white); }
.btn--primary:hover { background: var(--c-accent-600); color: var(--c-white); }
.btn--ghost { border: 1px solid currentColor; color: var(--c-navy); background: transparent; }
.btn--ghost:hover { background: var(--c-navy); color: var(--c-white); }
.btn--on-navy { border: 1px solid rgba(255,255,255,0.35); color: var(--c-white); }
.btn--on-navy:hover { background: var(--c-white); color: var(--c-navy); }

/* --- Accesibilidad: saltar al contenido --- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--c-navy); color: #fff; padding: var(--sp-3) var(--sp-4); border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: #fff; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
