/* ==========================================================================
   Base — reset, elementos, layout y utilidades
   ========================================================================== */

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

* { margin: 0; }

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(900px 520px at 12% -8%, rgba(11, 138, 224, 0.13), transparent 65%),
    radial-gradient(760px 440px at 92% 4%, rgba(255, 157, 10, 0.09), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

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

img { height: auto; }

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

button { background: none; border: none; cursor: pointer; }

p,
h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-strong);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

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

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-7) 0;
}

:focus-visible {
  outline: 2px solid var(--orange-400);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

::selection {
  background: var(--blue-500);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--ink-950); }
::-webkit-scrollbar-thumb {
  background: var(--ink-500);
  border-radius: var(--r-pill);
  border: 3px solid var(--ink-950);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-400); }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.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(--section-y); position: relative; }
.section--tight { padding-block: clamp(2.5rem, 4vw, 4rem); }
.section--sunken { background: var(--bg-sunken); }
.section--surface { background: var(--bg-surface); }

.grid { display: grid; gap: var(--sp-6); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }

/* --------------------------------------------------------------------------
   Encabezados de sección
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--orange-400);
  margin-bottom: var(--sp-3);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
}

.eyebrow--center::after {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: var(--r-pill);
  background: linear-gradient(270deg, var(--blue-500), var(--orange-500));
}

.section-head { margin-bottom: var(--sp-8); max-width: 62ch; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head p {
  color: var(--text-muted);
  font-size: var(--fs-lg);
  margin-top: var(--sp-4);
}

.section-head--split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  max-width: none;
  flex-wrap: wrap;
}
.section-head--split > div { max-width: 58ch; }

/* --------------------------------------------------------------------------
   Utilidades
   -------------------------------------------------------------------------- */

.text-muted { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-accent { color: var(--orange-400); }
.text-primary { color: var(--blue-400); }
.text-center { text-align: center; }
.text-gradient {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: var(--fs-lg);
  color: var(--text-muted);
  line-height: var(--lh-loose);
}

.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-0 { margin-bottom: 0; }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }

.full-width { width: 100%; }
.relative { position: relative; }

.sr-only {
  position: absolute;
  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;
  top: -100px;
  left: var(--sp-4);
  z-index: var(--z-toast);
  padding: var(--sp-3) var(--sp-5);
  background: var(--orange-500);
  color: #10131a;
  font-weight: 700;
  border-radius: var(--r-sm);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

.divider-glow {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--border-strong) 20%, var(--border-strong) 80%, transparent);
  margin: 0;
}

/* Ruido/textura sutil para separar bloques oscuros */
.bg-mesh::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(11, 138, 224, 0.12), transparent 70%),
    radial-gradient(520px 280px at 85% 100%, rgba(255, 157, 10, 0.1), transparent 70%);
}

/* --------------------------------------------------------------------------
   Movimiento reducido
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Si AOS no llega a cargar, el contenido nunca queda invisible */
html:not(.aos-ready) [data-aos] {
  opacity: 1 !important;
  transform: none !important;
}
