/* I-KELA · Sitio institucional (ikela.com.py). Estático, sin JavaScript y sin estilos
   inline (CSP style-src 'self').

   Criterio: negro, un solo color (el celeste de la marca, encendido) y poco texto. La
   imagen de la página es el isotipo convertido en esquema: I-KELA en el centro, unida a
   quienes participan de una factura. El mismo motivo (nodo cuadrado + línea + pulso) se
   repite en el recorrido de la API y en las etapas. Títulos en Sora, texto en Inter. */

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-var.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Sora';
  src: url('fonts/sora-var.woff2') format('woff2');
  font-weight: 100 800; font-style: normal; font-display: swap;
}

:root {
  --negro: #030508;
  --panel: #071421;
  --panel-2: #0a2a44;
  --linea: #16304a;
  --linea-2: #2b5a80;
  --celeste: #38bdf8;
  --celeste-claro: #7dd3fc;
  --texto: #f4f7fb;
  --texto-2: #93a7bd;
  --titulos: 'Sora', 'Inter', system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ancho: 1180px;
  --margen: max(24px, calc((100vw - var(--ancho)) / 2));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; background: var(--negro); }
body {
  margin: 0; background: var(--negro); color: var(--texto); overflow-x: clip;
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--celeste-claro); text-decoration: none; }
:focus-visible { outline: 2px solid var(--celeste-claro); outline-offset: 4px; border-radius: 6px; }

.saltar {
  position: absolute; left: -999px; top: 8px; z-index: 30; padding: 8px 16px;
  background: var(--texto); color: var(--negro); border-radius: 8px;
}
.saltar:focus { left: 8px; }

h1, h2, h3 { font-family: var(--titulos); text-wrap: balance; }
h1 { font-size: clamp(40px, 5.6vw, 78px); line-height: 1.04; font-weight: 600; letter-spacing: -.04em; }
h2 { font-size: clamp(30px, 3.6vw, 50px); line-height: 1.08; font-weight: 600; letter-spacing: -.035em; }
h3 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.sobre { font: 500 13px var(--titulos); letter-spacing: .22em; text-transform: uppercase; color: var(--celeste); }

/* ── Botones ──────────────────────────────────────────────────────────────── */
.boton {
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 28px;
  border-radius: 999px; background: var(--celeste); color: #021018; font-weight: 600; font-size: 16px;
  box-shadow: 0 0 0 1px var(--celeste-claro) inset, 0 12px 40px -8px rgba(56, 189, 248, .7);
  transition: transform .2s, box-shadow .2s, background .2s;
}
.boton:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px #fff inset, 0 18px 50px -8px rgba(56, 189, 248, .9); }
.boton.fantasma { background: transparent; color: var(--texto); box-shadow: 0 0 0 1px rgba(255, 255, 255, .2) inset; }
.boton.fantasma:hover { background: rgba(255, 255, 255, .06); box-shadow: 0 0 0 1px rgba(255, 255, 255, .4) inset; }

/* ── Cabecera ─────────────────────────────────────────────────────────────── */
.cabecera {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px var(--margen); background: rgba(3, 5, 8, .72); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.marca {
  display: flex; align-items: center; gap: 12px; color: var(--texto);
  font: 700 18px var(--sans); letter-spacing: .08em;
}
.marca svg { width: 28px; height: 28px; color: var(--celeste); }
.cabecera nav { display: flex; align-items: center; gap: 30px; font-size: 14.5px; }
.cabecera nav a { color: var(--texto-2); transition: color .2s; }
.cabecera nav a:hover { color: var(--texto); }
.cabecera nav .accion {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px;
  color: var(--texto); border: 1px solid rgba(255, 255, 255, .22);
}
.cabecera nav .accion:hover { border-color: var(--celeste); }

/* ── Portada ──────────────────────────────────────────────────────────────── */
.portada {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center; gap: 40px; padding: 56px var(--margen) 120px;
}
.portada::before {
  content: ''; position: absolute; inset: -80px 0 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 60% at 76% 46%, #0a2540 0%, transparent 68%);
}
.portada > * { position: relative; z-index: 1; }
.portada h1 { margin-top: 22px; }
.bajada { max-width: 28em; margin-top: 24px; font-size: 19px; color: var(--texto-2); }
.botones { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

.red { width: 100%; max-width: 520px; justify-self: center; filter: drop-shadow(0 0 40px rgba(56, 189, 248, .25)); }
.red .lineas { stroke: #1c3a55; }
.red .nodos rect { stroke: var(--linea-2); fill: var(--panel); }
.red .centro { stroke: var(--celeste); fill: var(--panel-2); animation: brillar 3.2s ease-in-out infinite; }
.red .pulsos path {
  stroke: var(--celeste-claro); stroke-dasharray: 26 160; stroke-dashoffset: 186;
  animation: viajar 3.2s linear infinite; filter: drop-shadow(0 0 6px var(--celeste));
}
.red .p2 { animation-delay: -1.6s; }
.red .p3 { animation-delay: -.8s; }
.red .p4 { animation-delay: -2.4s; }
.red .rotulos text { fill: #b9cbdd; font: 500 13.5px var(--sans); }
.red .rotulos .rotulo-centro { fill: #fff; font: 700 19px var(--titulos); letter-spacing: .08em; }
@keyframes brillar { 50% { fill: #0f3d63; filter: drop-shadow(0 0 22px rgba(56, 189, 248, .9)); } }
@keyframes viajar { to { stroke-dashoffset: 0; } }

/* ── Bloques ──────────────────────────────────────────────────────────────── */
.bloque { padding: 120px var(--margen); border-top: 1px solid rgba(255, 255, 255, .06); }
.bloque-cabeza { max-width: 46em; }
.bloque-cabeza h2 { margin-top: 20px; }
.bloque-cabeza h2 + p { margin-top: 20px; font-size: 19px; color: var(--texto-2); }

/* Módulos del sistema: cada uno, un nodo del mismo tipo que los del esquema. */
.modulos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 64px; }
.modulos li {
  position: relative; padding: 28px 28px 30px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--linea);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.modulos li::before {
  content: ''; display: block; width: 14px; height: 14px; margin-bottom: 22px; border-radius: 4px;
  border: 2px solid var(--celeste); box-shadow: 0 0 14px rgba(56, 189, 248, .6);
}
.modulos li:hover { border-color: var(--celeste); transform: translateY(-4px); box-shadow: 0 24px 60px -24px rgba(56, 189, 248, .55); }
.modulos p { margin-top: 8px; color: var(--texto-2); font-size: 16px; }

/* Recorrido de una factura: secuencia real, por eso es una lista ordenada. La línea une
   los cuatro nodos y un pulso la recorre, como en el esquema de la portada. */
.recorrido { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-top: 72px; }
.recorrido::before, .recorrido::after {
  content: ''; position: absolute; top: 27px; left: 28px; right: calc(25% - 46px); height: 2px;
}
.recorrido::before { background: var(--linea-2); transform-origin: 0 50%; }
.recorrido::after {
  right: auto; width: 90px; background: linear-gradient(90deg, transparent, var(--celeste-claro));
  filter: drop-shadow(0 0 6px var(--celeste)); animation: recorrer 3.6s linear infinite;
}
@keyframes recorrer { from { left: 28px; opacity: 0; } 10%, 85% { opacity: 1; } to { left: calc(75% - 60px); opacity: 0; } }
.recorrido li { position: relative; z-index: 1; padding-right: 12px; }
.recorrido li::before {
  content: ''; display: block; width: 56px; height: 56px; margin-bottom: 24px; border-radius: 14px;
  background: var(--panel); border: 2px solid var(--linea-2);
}
.recorrido .propio::before { background: var(--panel-2); border-color: var(--celeste); box-shadow: 0 0 28px rgba(56, 189, 248, .7); }
.recorrido p { margin-top: 6px; color: var(--texto-2); font-size: 16px; }

.ventajas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; margin-top: 72px; }
.ventajas li { padding: 20px 0; border-top: 1px solid var(--linea); color: var(--texto-2); font-size: 16px; }
.ventajas strong { color: var(--texto); font-weight: 600; }
.enlace-linea { margin-top: 40px; font: 600 17px var(--titulos); }
.enlace-linea a:hover { color: #fff; }

/* Etapas: el orden importa (es la secuencia real del alta), por eso van numeradas. */
.etapas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-top: 64px; counter-reset: etapa; }
.etapas li { counter-increment: etapa; padding-top: 24px; border-top: 2px solid var(--linea-2); }
.etapas li::before {
  content: counter(etapa, decimal-leading-zero); display: block; margin-bottom: 18px;
  font: 600 15px var(--titulos); letter-spacing: .1em; color: var(--celeste);
}
.etapas p { margin-top: 8px; color: var(--texto-2); font-size: 16px; }

/* ── Contacto y pie ───────────────────────────────────────────────────────── */
.contacto {
  position: relative; overflow: clip; display: grid; justify-items: center; text-align: center;
  padding: 140px var(--margen); border-top: 1px solid rgba(255, 255, 255, .06);
}
.contacto::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 50% 70% at 50% 100%, #0c3355 0%, transparent 70%);
}
.contacto > * { position: relative; z-index: 1; }
.contacto p { max-width: 32em; margin: 20px 0 40px; font-size: 19px; color: var(--texto-2); }

.pie {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px;
  padding: 28px var(--margen); border-top: 1px solid rgba(255, 255, 255, .06);
  color: var(--texto-2); font-size: 14.5px;
}
.pie strong { color: var(--texto); letter-spacing: .08em; }
.pie nav { display: flex; gap: 26px; }
.pie a { color: var(--texto-2); }
.pie a:hover { color: var(--texto); }

/* ── Movimiento al desplazarse ────────────────────────────────────────────────
   Solo CSS (animaciones atadas al scroll). Sin soporte, o con «reducir movimiento», la
   página queda quieta y completa. La aparición usa opacity/translate/scale sueltos para
   no pisar transform. El contacto no se anima: está al final y no siempre queda scroll. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .portada::before { animation: fondo-lento linear both; animation-timeline: scroll(root); animation-range: 0 900px; }
    .portada-texto { animation: texto-sube linear both; animation-timeline: scroll(root); animation-range: 0 700px; }
    .red { animation: red-gira linear both; animation-timeline: scroll(root); animation-range: 0 900px; }

    .bloque-cabeza > *, .modulos li, .recorrido li, .ventajas li, .enlace-linea, .etapas li {
      animation: aparecer linear both; animation-timeline: view(); animation-range: entry 0% cover 24%;
    }
    .bloque-cabeza > :nth-child(2), .modulos li:nth-child(3n + 2), .recorrido li:nth-child(2), .etapas li:nth-child(2), .ventajas li:nth-child(2n) { animation-range: entry 15% cover 28%; }
    .bloque-cabeza > :nth-child(3), .modulos li:nth-child(3n), .recorrido li:nth-child(3), .etapas li:nth-child(3) { animation-range: entry 30% cover 32%; }
    .recorrido li:nth-child(4), .etapas li:nth-child(4) { animation-range: entry 45% cover 36%; }
    /* La línea del recorrido se traza a medida que entra. */
    .recorrido::before { animation: trazar linear both; animation-timeline: view(); animation-range: entry 20% cover 40%; }
  }
}
@keyframes fondo-lento { to { transform: translateY(200px); } }
@keyframes texto-sube { to { transform: translateY(-48px); opacity: .25; } }
@keyframes red-gira { to { transform: translateY(90px) rotate(45deg) scale(.86); opacity: .2; } }
@keyframes aparecer { from { opacity: 0; translate: 0 44px; } to { opacity: 1; translate: 0 0; } }
@keyframes trazar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ── Pantallas angostas ───────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .cabecera nav a:not(.accion) { display: none; }
  .portada { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 88px; }
  .red { max-width: 400px; }
  .bloque { padding-top: 88px; padding-bottom: 88px; }
  .modulos { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 48px; }
  .etapas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ventajas { grid-template-columns: 1fr; margin-top: 56px; }
  /* El recorrido pasa a vertical: la línea baja por la izquierda. */
  .recorrido { grid-template-columns: 1fr; gap: 28px; margin-top: 56px; }
  .recorrido::before { top: 28px; bottom: 60px; left: 27px; right: auto; width: 2px; height: auto; transform-origin: 50% 0; }
  .recorrido::after { display: none; }
  .recorrido li { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 20px; align-items: start; padding-right: 0; }
  .recorrido li::before { grid-row: 1 / span 2; margin-bottom: 0; }
  .recorrido li h3 { align-self: end; }
  .contacto { padding-top: 96px; padding-bottom: 96px; }
}
@media (max-width: 960px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) { .recorrido::before { animation-name: trazar-vertical; } }
}
@keyframes trazar-vertical { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (max-width: 600px) {
  body { font-size: 16px; }
  .bajada, .bloque-cabeza h2 + p, .contacto p { font-size: 17px; }
  .botones .boton, .contacto .boton { width: 100%; justify-content: center; }
  .modulos, .etapas { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .red .centro, .red .pulsos path, .recorrido::after { animation: none; }
  .red .pulsos path { stroke-dashoffset: 120; }
  .recorrido::after { display: none; }
  .boton, .modulos li, .cabecera nav a { transition: none; }
}
