/* ==========================================================================
   Base — reset moderno, tipografía y utilidades de maquetación
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Compensa el encabezado fijo al saltar a un ancla */
  scroll-padding-top: 6.5rem;
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* Tamaño por defecto de los iconos en línea del sprite.
   Va en :where() para tener especificidad cero: cualquier regla de
   componente que fije otro tamaño gana sin necesidad de !important. */
:where(svg[aria-hidden="true"]:not(.solo-lectores)) {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  letter-spacing: -0.022em;
  text-wrap: balance;
  font-weight: 700;
  color: var(--navy-800);
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p, li { text-wrap: pretty; }

a {
  color: var(--navy-600);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--cyan-600); }

ul[class], ol[class] { list-style: none; padding: 0; }

strong, b { font-weight: 650; }

::selection {
  background: var(--cyan-300);
  color: var(--navy-800);
}

/* --- Foco visible y consistente: requisito de accesibilidad --- */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --- Maquetación --- */
.contenedor {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.contenedor--angosto { max-width: var(--container-narrow); }

.seccion { padding-block: var(--space-2xl); }
.seccion--compacta { padding-block: var(--space-xl); }
.seccion--alt { background: var(--bg-alt); }

.seccion--oscura {
  background: var(--navy-700);
  color: var(--text-invert);
}
.seccion--oscura h2,
.seccion--oscura h3 { color: var(--white); }
.seccion--oscura p { color: var(--text-invert-muted); }

/* --- Encabezados de sección --- */
.encabezado-seccion {
  max-width: 62ch;
  margin-bottom: var(--space-xl);
}
.encabezado-seccion--centrado {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan-600);
  margin-bottom: var(--space-xs);
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.encabezado-seccion--centrado .eyebrow::before { display: none; }
.seccion--oscura .eyebrow { color: var(--cyan-400); }

.subtitulo-seccion {
  margin-top: var(--space-sm);
  font-size: var(--step-1);
  color: var(--text-muted);
  line-height: 1.55;
}

/* --- Utilidades --- */
.solo-lectores {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.saltar-al-contenido {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 999;
  padding: 0.7rem 1.1rem;
  background: var(--navy-700);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease-out);
}
.saltar-al-contenido:focus-visible {
  transform: translateY(0);
  color: var(--white);
}

.texto-degradado {
  background: linear-gradient(100deg, var(--cyan-500), var(--navy-600) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.seccion--oscura .texto-degradado {
  background: linear-gradient(100deg, var(--cyan-300), var(--cyan-500));
  -webkit-background-clip: text;
  background-clip: text;
}

/* Deja hueco a la barra de acciones fija de móvil */
@media (max-width: 767px) {
  body { padding-bottom: 4.75rem; }
}
