/* NICA Insights, sitio público. Misma identidad que el one-pager (docs/articles/one-pager):
   azul marino con acento nogal, Source Serif 4 para títulos y Archivo para el texto.
   Diseño de un solo tema, claro con secciones oscuras: todos los colores salen de estos tokens. */
:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #16202b;
  --ink-2: #48535f;
  --ink-3: #6f7a86;
  --rule: #d7dde4;
  --panel: #eef2f6;
  --navy-900: #0f2234;
  --navy-800: #16304a;
  --navy-700: #1f374e;
  --blue-600: #2d5f8a;
  --blue-300: #8fb3d3;
  --walnut-700: #8f5a14;
  --walnut-400: #d69a45;
  --walnut-200: #f1d9b3;
  --walnut-50: #fbf4e9;
  --on-navy: #f3f6f9;
  --on-navy-2: #b9c8d8;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Archivo", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 4vw, 40px);
  --header: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--walnut-400); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; text-wrap: balance; margin: 0; }
p { margin: 0; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 20;
  background: var(--walnut-400); color: var(--navy-900); padding: 8px 14px; font-weight: 650;
}
.skip:focus { top: 12px; }

/* Rótulos */
.label, .eyebrow {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.tick { display: flex; align-items: center; gap: 10px; }
.tick::before { content: ""; width: 20px; height: 2px; background: currentColor; flex: none; }
.tick-walnut, .label-walnut { color: var(--walnut-700); }
.tick-blue { color: var(--blue-600); }
.tick-navy { color: var(--navy-700); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 22px; border-radius: 3px;
  background: var(--walnut-400); color: var(--navy-900);
  font-weight: 650; font-size: 16px; text-decoration: none;
  border: 1px solid var(--walnut-400);
  transition: background-color .15s, border-color .15s, color .15s, translate .2s, box-shadow .2s;
}
.btn:hover { background: var(--walnut-200); border-color: var(--walnut-200); translate: 0 -1px; box-shadow: 0 10px 24px rgba(214, 154, 69, .28); }
.btn-ghost { background: transparent; color: var(--on-navy); border-color: rgba(185, 200, 216, .45); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); border-color: var(--on-navy-2); box-shadow: none; }
/* Flecha dibujada como máscara: la tipografía no trae el glifo → en el subconjunto latino */
.btn-arrow::after {
  content: ""; width: 15px; height: 11px; margin-left: 10px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12'%3E%3Cpath d='M1 6h13M9 1l5 5-5 5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12'%3E%3Cpath d='M1 6h13M9 1l5 5-5 5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: translate .2s;
}
.btn-arrow:hover::after { translate: 3px 0; }
.btn-small { min-height: 38px; padding: 0 16px; font-size: 15px; }

/* Cabecera fija */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--navy-900);
  border-bottom: 1px solid rgba(185, 200, 216, .14);
}
.bar { height: var(--header); display: flex; align-items: center; gap: 28px; }
.wordmark {
  font-weight: 800; font-stretch: 112%; font-size: 21px; letter-spacing: -.01em;
  color: #fff; text-decoration: none; white-space: nowrap;
}
.wordmark span { font-weight: 400; color: var(--on-navy-2); }
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { position: relative; color: var(--on-navy-2); text-decoration: none; font-size: 15px; font-weight: 500; transition: color .2s; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1.5px; background: var(--walnut-400);
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav a:hover { color: #fff; }
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }
.bar-end { display: flex; align-items: center; gap: 16px; }
.lang {
  color: var(--on-navy); text-decoration: none; font-size: 13px; font-weight: 650; letter-spacing: .1em;
  padding: 6px 8px; border: 1px solid rgba(185, 200, 216, .35); border-radius: 3px;
}
.lang:hover { border-color: var(--on-navy-2); }

/* Portada */
.hero {
  color: var(--on-navy);
  background-color: var(--navy-900);
  background-image:
    radial-gradient(90% 120% at 100% 0%, rgba(45, 95, 138, .55) 0%, rgba(45, 95, 138, 0) 60%),
    linear-gradient(180deg, var(--navy-800), var(--navy-900));
  padding-block: clamp(56px, 8vw, 104px);
  position: relative; isolation: isolate; overflow: hidden;
}
/* Ondas concéntricas centradas en la tarjeta de la mejora: la brecha como algo que se mide */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-radial-gradient(circle at 78% 50%, rgba(143, 179, 211, .11) 0 1px, transparent 1.5px 32px);
  -webkit-mask-image: radial-gradient(circle at 78% 50%, #000 0, rgba(0, 0, 0, .55) 22%, transparent 48%);
  mask-image: radial-gradient(circle at 78% 50%, #000 0, rgba(0, 0, 0, .55) 22%, transparent 48%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 760px; aspect-ratio: 1; right: -220px; top: -300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 154, 69, .16), rgba(214, 154, 69, 0) 64%);
}
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero .eyebrow { color: var(--walnut-400); }
h1 { font-size: clamp(40px, 5.4vw, 66px); line-height: 1.03; letter-spacing: -.02em; color: #fff; margin-bottom: 24px; }
h1 em { font-style: italic; font-weight: 500; color: var(--walnut-200); }
.lede { font-size: clamp(17px, 1.5vw, 19.5px); line-height: 1.55; max-width: 58ch; }
.lede b { color: #fff; font-weight: 650; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.gap-card {
  margin: 0;
  border: 1px solid rgba(185, 200, 216, .3);
  background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 28px 64px rgba(5, 14, 24, .38), inset 0 1px 0 rgba(255, 255, 255, .08);
  border-radius: 6px;
  padding: clamp(20px, 2.4vw, 30px);
}
.big-row { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.big {
  font-weight: 750; font-stretch: 80%; font-size: clamp(60px, 7vw, 84px); line-height: .9;
  letter-spacing: -.02em; color: var(--walnut-400); font-variant-numeric: lining-nums; white-space: nowrap;
}
.big small { font-size: .5em; font-weight: 600; margin-left: 2px; }
.big-row p:last-child { font-size: 16px; line-height: 1.4; }
.gap-card svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Métricas */
.kpis { border-bottom: 1px solid var(--rule); }
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.kpi { padding-block: 32px; padding-inline: 0 28px; display: flex; flex-direction: column; gap: 8px; }
.kpi + .kpi { border-left: 1px solid var(--rule); padding-left: 28px; }
.kpi .label { margin-bottom: 0; }
.kpi .v {
  font-weight: 750; font-stretch: 82%; font-size: clamp(34px, 3.6vw, 44px); line-height: 1;
  letter-spacing: -.012em; color: var(--navy-700); white-space: nowrap; font-variant-numeric: tabular-nums lining-nums;
}
.kpi .v span { font-size: .5em; font-weight: 600; color: var(--blue-600); letter-spacing: 0; }
.kpi .d { font-size: 15px; line-height: 1.45; color: var(--ink-2); max-width: 36ch; }

/* Secciones */
.section { padding-block: clamp(64px, 8vw, 104px); }
.section-panel { background: var(--panel); }
.section-walnut { background: var(--walnut-50); }
.section-navy { background: var(--navy-700); color: var(--on-navy); }
h2 { font-size: clamp(28px, 3.1vw, 40px); line-height: 1.12; letter-spacing: -.012em; color: var(--navy-700); margin-bottom: 18px; }
.section-navy h2 { color: #fff; }
.section-navy { position: relative; isolation: isolate; overflow: hidden; }
.section-navy::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 900px; aspect-ratio: 1; left: -320px; bottom: -520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 95, 138, .6), rgba(45, 95, 138, 0) 64%);
}
.section-navy .label-walnut { color: var(--walnut-400); }
.label-live { display: flex; align-items: flex-start; gap: 12px; }
.label-live::before { content: ""; width: 8px; height: 8px; margin-top: .45em; flex: none; border-radius: 50%; background: var(--walnut-400); }
.prose { font-size: 18px; line-height: 1.62; max-width: 62ch; text-align: justify; hyphens: auto; }
.prose + .prose { margin-top: 16px; }
.prose b { font-weight: 650; }
.muted { color: var(--ink-2); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 88px); align-items: start; }
.intro-block { max-width: 760px; margin-bottom: 48px; }

/* Solución */
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.features li {
  background: var(--paper); border-top: 2px solid var(--navy-700); border-radius: 0 0 6px 6px;
  padding: 22px 22px 24px; box-shadow: 0 1px 2px rgba(15, 34, 52, .06), 0 8px 24px rgba(15, 34, 52, .05);
  transition: border-color .25s ease;
}
.features li:hover { border-top-color: var(--walnut-400); }
.features .icon { display: block; width: 34px; height: 34px; color: var(--blue-600); margin-bottom: 16px; transition: color .25s ease; }
.features li:hover .icon { color: var(--walnut-700); }
.features h3 { font-size: 21px; line-height: 1.2; color: var(--navy-700); margin-bottom: 8px; }
.features p { font-size: 16px; line-height: 1.5; color: var(--ink-2); }

/* Validación */
.chips { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 14px; font-weight: 550; padding: 5px 12px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--walnut-200); color: var(--walnut-700);
}
.quote { margin: 0; border-left: 4px solid var(--walnut-400); padding: 6px 0 6px 28px; align-self: center; }
.quote p { font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.28; color: var(--ink); text-wrap: balance; }

/* Inversores */
.investors .prose { margin-bottom: 28px; }
.phases-title { font-size: 24px; color: #fff; margin-bottom: 6px; }
.phases-intro { color: var(--on-navy-2); margin-bottom: 24px; }
.phases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.phases li { position: relative; display: grid; grid-template-columns: 84px 1fr; gap: 18px; align-items: start; }
.phases li:not(:last-child)::after {
  content: ""; position: absolute; left: 42px; top: 34px; bottom: -22px;
  border-left: 1.5px solid rgba(143, 179, 211, .55);
}
.step {
  height: 30px; display: grid; place-items: center; border-radius: 3px;
  background: var(--navy-900); color: #fff; border: 1px solid rgba(185, 200, 216, .3);
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
.phases h4 { font-size: 19px; line-height: 1.25; color: #fff; margin-bottom: 4px; }
.phases p { color: var(--on-navy-2); font-size: 16px; line-height: 1.5; }
.phases p b { color: var(--on-navy); font-weight: 650; }
/* La Fase I es la que financia la ronda */
.phases li:first-child .step { background: var(--walnut-400); border-color: var(--walnut-400); color: var(--navy-900); }

/* Contacto */
.contact-card { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.contact-card div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding-block: 18px; border-bottom: 1px solid var(--rule); }
.contact-card dt { font-size: 12px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding-top: 4px; }
.contact-card dd { margin: 0; font-size: 20px; font-weight: 550; color: var(--navy-700); overflow-wrap: anywhere; }
.contact-card a { color: var(--blue-600); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Pie */
.site-footer { background: var(--navy-900); color: var(--on-navy-2); padding-block: 28px; }
.legal { font-size: 13px; color: var(--on-navy); }

/* Pantallas medianas y angostas */
@media (max-width: 1080px) {
  .nav { display: none; }
  .bar-end { margin-left: auto; }
}
@media (max-width: 960px) {
  .hero-grid, .two-col { grid-template-columns: 1fr; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi, .kpi + .kpi { padding: 22px 0; border-left: 0; }
  .kpi + .kpi { border-top: 1px solid var(--rule); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .features { grid-template-columns: 1fr; }
  .prose { font-size: 17px; text-align: left; }
  .phases li { grid-template-columns: 1fr; gap: 10px; }
  .phases li::after { display: none; }
  .step { justify-self: start; padding-inline: 12px; }
  .contact-card div { grid-template-columns: 1fr; gap: 4px; }
  .big-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .wordmark { font-size: 19px; }
  .btn-small { padding: 0 12px; }
}

/* Movimiento. Solo CSS: el sitio no tiene scripts propios y la CSP admite solo el beacon de Cloudflare. Lo que se mueve vive dentro de
   prefers-reduced-motion: no-preference; lo que depende del scroll, además, dentro de @supports: sin soporte
   (Firefox, por ahora) la página se ve completa y quieta. */
@media (prefers-reduced-motion: no-preference) {
  /* Portada: entrada escalonada, la barra del rango se dibuja y después aparece la media */
  .hero .eyebrow, .hero h1, .hero .lede, .hero .actions, .gap-card { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .hero h1 { animation-delay: .08s; }
  .hero .lede { animation-delay: .16s; }
  .hero .actions { animation-delay: .24s; }
  .gap-card { animation-delay: .32s; }
  /* Las cifras quedan en el borde de la primera pantalla: entran con la portada, por tiempo y no por scroll */
  .kpi { animation: rise .9s .45s cubic-bezier(.2, .7, .2, 1) both; }
  .kpi:nth-child(2) { animation-delay: .55s; }
  .kpi:nth-child(3) { animation-delay: .65s; }
  .range-bar { stroke-dasharray: 224 400; animation: draw 1.1s .7s cubic-bezier(.65, 0, .35, 1) both; }
  .range-mean { transform-box: fill-box; transform-origin: center; animation: pop .55s 1.55s cubic-bezier(.3, 1.6, .5, 1) both; }
  .range-mean-label { animation: fade .5s 1.75s both; }
  .hero::before { animation: breathe 14s ease-in-out infinite alternate; }
  .hero::after { animation: drift 18s ease-in-out infinite alternate; }
  .label-live::before { animation: pulse 2.4s ease-out infinite; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes draw { from { stroke-dashoffset: 224; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.2); } }
@keyframes fade { from { opacity: 0; } }
@keyframes breathe { to { transform: scale(1.06); } }
@keyframes drift { to { transform: translate(-140px, 90px) scale(1.12); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(214, 154, 69, .6); }
  75%, 100% { box-shadow: 0 0 0 10px rgba(214, 154, 69, 0); }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* Los bloques suben con un fundido al entrar y terminan cuando entraron enteros (así el contacto, al pie,
       también termina en pantallas altas); las tarjetas, en escalera */
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
    .features li:nth-child(2) { animation-range: entry 8% entry 78%; }
    .features li:nth-child(3) { animation-range: entry 16% entry 86%; }
    .features li:nth-child(4) { animation-range: entry 24% entry 94%; }

    /* La línea que une las fases se dibuja al pasar */
    .phases li { view-timeline-name: --fase; }
    .phases li:not(:last-child)::after {
      transform-origin: top; animation: grow linear both; animation-timeline: --fase; animation-range: cover 25% cover 55%;
    }

    /* Encabezado: sombra al bajar y una línea de progreso de lectura */
    .site-header { animation: shade linear both; animation-timeline: scroll(root); animation-range: 0px 160px; }
    .site-header::after {
      content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
      background: linear-gradient(90deg, var(--walnut-400), var(--walnut-200));
      transform-origin: left; animation: progress linear both; animation-timeline: scroll(root);
    }
  }
}
@keyframes reveal { from { opacity: 0; transform: translateY(32px); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes shade { to { box-shadow: 0 10px 30px rgba(5, 14, 24, .3); } }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .btn:hover { translate: none; }
}
