/* ============================================================
   OCEANAVAL — Sistema de diseño según Manual de Identidad v1.0
   "Deliberadamente contenida": blanco-dominante, plano, técnico.
   Proporción 60% blanco / 30% negro / 10% azul eléctrico.
   Tokens, reset, tipografía y utilidades base.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Paleta de marca — bloques planos, sin degradados ni glow.
     Azul eléctrico = acción/acento (10%); negro = estructura (30%);
     blanco = fondo dominante (60%). Grises de apoyo del manual. */
  --c-blue:       #2456D3;   /* Azul Eléctrico — acento / acción */
  --c-blue-pale:  #E8EEFB;   /* Azul claro — fondos sutiles / seleccionado */
  --c-blue-sub:   #DCE5FA;   /* azul muy claro para subtexto sobre azul (AA) */

  --c-black:      #000000;   /* Negro — estructura / contraste */
  --c-white:      #FFFFFF;   /* Blanco — fondo base dominante */
  --c-panel:      #F2F2F2;   /* Gris muy claro — paneles / secciones alternas */

  --c-ink:        #111111;   /* texto principal */
  --c-ink-2:      #222222;   /* texto cuerpo */
  --c-muted:      #595959;   /* texto secundario (AA sobre blanco/panel/azul claro) */
  --c-muted-2:    #767676;   /* gris de control / bordes de campo (AA UI 3:1) */
  --c-line:       #CCCCCC;   /* divisores decorativos (líneas finas, planas) */

  /* Tintes sobre fondos oscuros (secciones negras/azules de acento) */
  --c-on-dark:        #FFFFFF;   /* texto sobre negro/azul */
  --c-on-dark-muted:  #CCCCCC;   /* texto secundario sobre negro */
  --c-on-blue-muted:  #DCE5FA;   /* texto secundario sobre azul */

  /* Alias semánticos de superficie (los usan componentes) */
  --c-bg:        var(--c-white);
  --c-text:      var(--c-ink);
  --c-accent:    var(--c-blue);

  /* Tipografía — Source Sans 3 EXCLUSIVA (manual §3). Sin serif ni mono. */
  --f-base:    "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: var(--f-base);
  --f-mono:    var(--f-base);   /* alias retrocompatible: NO es monoespaciada */
  --f-serif:   var(--f-base);   /* alias retrocompatible: NO es serif */

  /* Escala tipográfica del manual (con fluidez controlada por clamp,
     respetando pesos y proporciones; la marca es contenida). */
  --t-display: clamp(2.6rem, 5.2vw, 3.5rem);   /* Display 700 · ~56px */
  --t-h1:    clamp(2.1rem, 4vw, 2.5rem);       /* H1 700 · 40px */
  --t-h2:    clamp(1.7rem, 3vw, 2rem);         /* H2 700 · 32px */
  --t-h3:    clamp(1.3rem, 2vw, 1.5rem);       /* H3 600 · 24px */
  --t-lead:  clamp(1.0625rem, 1.4vw, 1.1875rem);
  --t-body:  1rem;                              /* Cuerpo 400 · 16px */
  --t-small: 0.875rem;
  --t-micro: 0.75rem;                           /* Pie 300 · 12px */

  /* Espaciado (ritmo armónico base 8) */
  --s-1: 0.5rem;   --s-2: 1rem;    --s-3: 1.5rem;  --s-4: 2rem;
  --s-5: 3rem;     --s-6: 4rem;    --s-7: 6rem;    --s-8: 8rem;
  --s-9: 11rem;    --s-10: 15rem;

  --section-y: clamp(4rem, 10vh, 8rem);
  --gutter:    clamp(1.25rem, 5vw, 5rem);
  --maxw:      82rem;

  /* Motion (se conserva el movimiento; sin glow/color) */
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --d-fast: 0.3s;
  --d-base: 0.6s;
  --d-slow: 1s;

  --radius: 2px;       /* esquinas casi rectas, técnicas */
  --header-h: 5rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--f-base);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--c-ink-2);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul, ol { list-style: none; }

::selection { background: var(--c-blue); color: var(--c-white); }

/* ---------- Tipografía (jerarquía del manual) ---------- */
h1, h2, h3, h4 {
  font-family: var(--f-base);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--c-ink);
  text-wrap: balance;
}
h3, h4 { font-weight: 600; }

/* Acentos que antes eran cursiva serif → ahora se diferencian por COLOR azul,
   misma familia y peso del titular (manual: no usar otra familia). */
em { font-style: normal; color: var(--c-blue); }

/* Kicker / eyebrow: Source Sans 3, peso 600, en azul, uppercase discreto. */
.kicker {
  font-family: var(--f-base);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-blue);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.kicker::before {
  content: "";
  width: 2rem;
  height: 2px;
  background: var(--c-blue);
}
.kicker--center::before { display: none; }

.lead {
  font-family: var(--f-base);
  font-size: var(--t-lead);
  line-height: 1.6;
  color: var(--c-muted);
}

/* Aliases de familia retrocompatibles — todos resuelven a Source Sans 3 */
.mono { font-family: var(--f-base); font-weight: 600; letter-spacing: 0.04em; }
.serif { font-family: var(--f-base); }
.display { font-family: var(--f-base); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--wide { max-width: 94rem; }
.section { padding-block: var(--section-y); position: relative; }

/* Retícula técnica de fondo: finísima, gris, plana (sin máscara de degradado). */
.grid-lines {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--c-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--c-line) 1px, transparent 1px);
  background-size: clamp(60px, 8vw, 120px) clamp(60px, 8vw, 120px);
  opacity: 0.35;
}
/* La retícula es puramente decorativa y va DETRÁS: el contenido que la sigue
   (siempre el .wrap u otros hermanos) se eleva por encima. Sin esto, al estar
   .grid-lines posicionada, se pintaría sobre el texto. */
.grid-lines ~ * { position: relative; z-index: 1; }

/* ---------- Botones ---------- */
/* Primario: fondo azul plano, texto blanco. Sin glow, sin sombra de color. */
.btn {
  --bg: var(--c-blue);
  --fg: var(--c-white);
  --bd: var(--c-blue);
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--f-base);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 0.9em 1.6em;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  transition: background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out);
}
.btn:hover { background: #1b46b4; border-color: #1b46b4; }
.btn .arrow { transition: transform var(--d-fast) var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

/* Secundario: borde de control gris/negro, texto negro, hover sutil azul claro. */
.btn--ghost {
  --bg: transparent;
  --fg: var(--c-ink);
  --bd: var(--c-muted-2);
}
.btn--ghost:hover { background: var(--c-blue-pale); color: var(--c-blue); border-color: var(--c-blue); }

/* Sobre fondos oscuros (secciones negras/azules): variante clara del secundario. */
.on-dark .btn--ghost, .btn--ghost.on-dark {
  --fg: var(--c-white);
  --bd: #8A8A8A;
}
.on-dark .btn--ghost:hover, .btn--ghost.on-dark:hover {
  background: var(--c-white); color: var(--c-ink); border-color: var(--c-white);
}

/* Link con subrayado animado (plano, azul) */
.link-u {
  position: relative; color: var(--c-blue);
  font-family: var(--f-base); font-size: var(--t-small);
  font-weight: 600; letter-spacing: 0.01em;
}
.link-u::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 100%; height: 2px;
  background: var(--c-blue); transform: scaleX(0); transform-origin: right;
  transition: transform var(--d-base) var(--ease-out);
}
.link-u:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Foco accesible (azul de marca, AA) ---------- */
:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 3px;
  border-radius: var(--radius);
}
.on-dark :focus-visible { outline-color: #6F92E8; }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 200;
  background: var(--c-blue); color: var(--c-white);
  padding: 0.75rem 1.25rem; font-family: var(--f-base); font-weight: 600;
  font-size: var(--t-small);
  border-radius: var(--radius); transition: top var(--d-fast);
}
.skip-link:focus { top: 1rem; }

.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;
}

/* ---------- Helpers de acento ---------- */
.t-cyan, .t-blue { color: var(--c-blue); }
.t-paper { color: var(--c-ink); }
.t-mist { color: var(--c-muted); }

.divider {
  height: 1px; width: 100%;
  background: var(--c-line);
}

/* ---------- Etiqueta técnica (cota / índice) ---------- */
.tag-index {
  font-family: var(--f-base);
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--c-blue);
  letter-spacing: 0.04em;
}

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