/* ─── RESET & BASE ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: #050a12;
  color: #e0e8f0;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ─── VARIABLES ─── */
:root {
  --void: #050a12;
  --cyan: #00d4ff;
  --gold: #C8A45C;
  --gold-bright: #ffd000;
  --ice: #e0e8f0;
  --frost: #7a8fa3;
  --grid: #0a1520;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ─── 3D SCENE CONTAINERS ─── */
.scene-3d-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: var(--void);
}
.scene-3d-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.scene-3d-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.scene-3d-container-small {
  position: relative;
  width: 100%;
  min-height: 420px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 212, 255, 0.15);
  box-shadow: 0 0 60px rgba(0, 212, 255, 0.08);
}
.scene-3d-container-small canvas {
  width: 100% !important;
  height: 100% !important;
  min-height: 420px;
  display: block;
}
.scene-3d-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(5,10,18,0.95) 0%, rgba(5,10,18,0.5) 40%, rgba(5,10,18,0.2) 70%, transparent 100%);
}
.scene-3d-content {
  padding: 60px 24px;
  max-width: 750px;
  margin: 0 auto;
  text-align: center;
  pointer-events: auto;
}
.scene-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--cyan);
  display: block;
  margin-bottom: 14px;
}
.scene-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 64px);
  color: var(--gold);
  margin-bottom: 16px;
  line-height: 1.1;
}
.scene-desc {
  font-size: 15px;
  font-weight: 300;
  color: var(--frost);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.scene-desc-sub {
  font-size: 13px;
  font-weight: 300;
  color: var(--frost);
  opacity: 0.8;
  max-width: 480px;
  margin: -18px auto 28px;
  line-height: 1.6;
}
.scene-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  text-decoration: none;
  margin-bottom: 32px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.25);
  transition: border-color 0.25s ease, color 0.25s ease, gap 0.25s ease;
}
.scene-link:hover {
  color: var(--gold-bright);
  border-color: rgba(255, 208, 0, 0.4);
  gap: 12px;
}
.scene-link svg { transition: transform 0.25s ease; }
.scene-link:hover svg { transform: translateX(2px); }

.scene-hud {
  display: inline-flex;
  align-items: flex-end;
  gap: 44px;
  padding: 18px 32px;
  border-radius: 14px;
  background: rgba(5, 10, 18, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(224, 232, 240, 0.06);
  text-align: center;
}
.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 96px;
}
.hud-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--cyan);
}
.hud-value.gold { color: var(--gold-bright); }
.hud-value.hud-status {
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: 0.06em;
  text-shadow: 0 0 14px rgba(0, 212, 255, 0.55);
}
.hud-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--frost);
  text-transform: uppercase;
  text-align: center;
  line-height: 1.35;
  min-height: 2.4em;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
/* Rotulo mas largo ("Revisiones a la fecha") — mismo estilo, un poco mas
   chico y con ancho limitado para que quede centrado en 2 lineas parejas
   con las demas columnas. */
.hud-label--long {
  font-size: 8px;
  letter-spacing: 0.1em;
  max-width: 96px;
}

/* ─── COMPOSICION DE #solar-system (Ecosistema Atlas) ───
   Todo aqui esta escrito con el selector de ID para que SOLO afecte a esta
   seccion. #portal usa las mismas clases base (.scene-title, .scene-desc,
   etc.) y no debe cambiar. */
#solar-system {
  min-height: 150vh;
}
#solar-system .scene-3d-content {
  padding: 70px 24px 90px;
}
#solar-system .scene-label {
  font-size: 9px;
  margin-bottom: 30px;
}
#solar-system .scene-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 400;
  max-width: 620px;
  margin: 0 auto 22px;
  line-height: 1.35;
  color: rgba(200, 164, 92, 0.86);
}
#solar-system .scene-desc {
  font-size: 13.5px;
  max-width: 440px;
  margin: 0 auto 36px;
  opacity: 0.85;
}
#solar-system .scene-desc-sub {
  font-size: 12px;
  max-width: 420px;
  margin: 4px auto 30px;
  opacity: 0.78;
}
#solar-system .scene-link {
  /* El link es inline-flex por defecto (misma linea que el HUD, tambien
     inline-flex, si hay espacio horizontal). Forzarlo a flex de bloque y
     centrarlo lo pone en su propia fila, arriba de las metricas. */
  display: flex;
  width: 100%;
  justify-content: center;
  font-size: 10px;
  opacity: 0.92;
  margin: 22px 0 46px;
}
#solar-system .scene-hud {
  margin-top: 6px;
}

/* ─── 3D BUTTONS (tactile, tilt on hover via JS) ─── */
.btn-3d {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border: none;
  border-radius: 999px;
  color: var(--void);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(180deg, #6be6ff 0%, var(--cyan) 45%, #009fc4 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -4px 6px rgba(0, 40, 55, 0.35),
    0 2px 0 #00728b,
    0 12px 26px rgba(0, 212, 255, 0.35);
  transform: perspective(500px) translateY(0) translateZ(0);
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
  will-change: transform;
}
.btn-3d:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -4px 6px rgba(0, 40, 55, 0.35),
    0 3px 0 #00728b,
    0 18px 36px rgba(0, 212, 255, 0.5);
}
.btn-3d.pressed {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 40, 55, 0.4),
    0 1px 0 #00728b,
    0 6px 14px rgba(0, 212, 255, 0.3);
}
.btn-3d.gold {
  background: linear-gradient(180deg, #ffe6a8 0%, var(--gold) 45%, #9c7638 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -4px 6px rgba(50, 35, 5, 0.35),
    0 2px 0 #7a5c2a,
    0 12px 26px rgba(200, 164, 92, 0.35);
}
.btn-3d.gold:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -4px 6px rgba(50, 35, 5, 0.35),
    0 3px 0 #7a5c2a,
    0 18px 36px rgba(200, 164, 92, 0.5);
}
.btn-3d.ghost {
  background: rgba(224, 232, 240, 0.04);
  color: var(--ice);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -3px 6px rgba(0, 0, 0, 0.25),
    0 2px 0 rgba(0, 212, 255, 0.25),
    0 10px 24px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 212, 255, 0.3);
}
.btn-3d.ghost:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -3px 6px rgba(0, 0, 0, 0.25),
    0 3px 0 rgba(0, 212, 255, 0.35),
    0 16px 32px rgba(0, 0, 0, 0.35);
  border-color: rgba(0, 212, 255, 0.6);
}

/* ─── NAVIGATION ─── */
.nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(5, 10, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 212, 255, 0.2);
  box-shadow: 0 4px 40px rgba(0,0,0,0.5);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--gold);
  letter-spacing: 0.15em;
  padding: 4px 12px;
  cursor: pointer;
}
.nav-divider {
  width: 1px;
  height: 18px;
  background: rgba(0, 212, 255, 0.15);
}
.nav-link {
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--frost);
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.3s;
  border: none;
  background: none;
  font-family: 'Inter', sans-serif;
}
.nav-link:hover, .nav-link.active {
  color: var(--ice);
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}
.nav-cta {
  padding: 6px 16px;
  font-size: 10px;
}

/* ─── HERO VIDEO ─── */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(5,10,18,0.3) 0%, rgba(5,10,18,0.1) 40%, rgba(5,10,18,0.6) 70%, rgba(5,10,18,1) 100%);
  z-index: 2;
}
.hero-content {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
  opacity: 0;
  animation: fadeIn 2s ease 0.5s forwards;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(60px, 12vw, 160px);
  color: var(--gold);
  letter-spacing: 0.12em;
  line-height: 1;
  margin-bottom: 12px;
}
.hero-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.4vw, 14px);
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--cyan);
  margin-bottom: 24px;
  text-transform: uppercase;
}
.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 400;
  max-width: 560px;
  margin-bottom: 16px;
  color: var(--ice);
  line-height: 1.25;
}
.hero-desc {
  font-size: clamp(13px, 1.6vw, 16px);
  font-weight: 300;
  max-width: 560px;
  margin-bottom: 40px;
  color: var(--frost);
  line-height: 1.65;
}
.hero-scroll {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeIn 1s ease 2s forwards;
}
.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: var(--cyan);
  opacity: 0.4;
  position: relative;
}
.hero-scroll-dot {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  animation: bounceDot 2s ease-in-out infinite;
}
.hero-scroll-text {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--frost);
}

/* ─── ECOSYSTEM CARDS ─── */
.ecosystem {
  padding: 100px 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.section-header {
  text-align: center;
  margin-bottom: 60px;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--cyan);
  display: block;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  color: var(--ice);
  margin-bottom: 16px;
}
.section-desc {
  font-size: 16px;
  font-weight: 300;
  color: var(--frost);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
@media (min-width: 900px) {
  /* 3 por fila en escritorio cuando hay espacio de sobra */
  .bento-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 620px) and (max-width: 899px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}
.bento-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 0;
  background: var(--grid);
  border: 1px solid rgba(0, 212, 255, 0.1);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translateY(40px);
  display: flex;
  flex-direction: column;
}
.bento-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.bento-card:hover {
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.1);
  transform: translateY(-4px);
}
.bento-card.coming:hover {
  border-color: rgba(122, 143, 163, 0.3);
  box-shadow: none;
  transform: none;
}

/* Zona de imagen: ~35-45% de la tarjeta, fundida con degradado hacia el fondo */
.bento-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  flex-shrink: 0;
}
.bento-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.02);
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.bento-card:hover .bento-visual img { transform: scale(1.07); }
.bento-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 10, 18, 0) 35%, var(--grid) 100%),
    linear-gradient(120deg, rgba(0, 212, 255, 0.12), transparent 55%);
  pointer-events: none;
}

.bento-body {
  padding: 18px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.bento-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.bento-status {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
}
.bento-status.active {
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.08);
}
.bento-status.coming {
  color: var(--frost);
  background: rgba(122, 143, 163, 0.08);
}
.bento-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--frost);
  opacity: 0.4;
}
.bento-name {
  font-family: var(--font-display);
  font-size: 28px;
  margin-bottom: 6px;
  transition: color 0.3s;
}
.bento-name.cyan { color: var(--cyan); }
.bento-name.gold { color: var(--gold); }
.bento-name.gray { color: var(--frost); }
.bento-fullname {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--frost);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.bento-desc {
  font-size: 13px;
  color: var(--ice);
  opacity: 0.75;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Fila de acciones: INGRESAR (parte de la tarjeta-enlace) + CONOCER (enlace propio) */
.bento-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(224, 232, 240, 0.06);
}
.bento-enter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--cyan);
  text-transform: uppercase;
}
.bento-enter-badge.gold { color: var(--gold); }
.bento-enter-badge svg { transition: transform 0.3s ease; }
.bento-card:hover .bento-enter-badge { color: var(--gold-bright); }
.bento-card:hover .bento-enter-badge svg { transform: translateX(3px); }

.bento-conocer {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--frost);
  border-bottom: 1px solid rgba(122, 143, 163, 0.3);
  padding-bottom: 2px;
  white-space: nowrap;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.bento-conocer:hover { color: var(--cyan); border-color: rgba(0, 212, 255, 0.45); }

/* Etiqueta secundaria para tarjetas sin seccion "Conocer" (Bases de Negocios,
   Taller de PDFs): ocupa el mismo lugar visual que .bento-conocer para que
   la fila de acciones no se vea incompleta frente a las demas tarjetas. */
.bento-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--frost);
  opacity: 0.7;
  white-space: nowrap;
}

/* Visual procedural para modulos sin imagen real todavia (Portal BI) */
.bento-visual-procedural {
  background: linear-gradient(160deg, var(--grid) 0%, #0a1520 100%);
}
.bento-visual-procedural svg {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.85;
}
.bento-card.coming .bento-visual img { filter: saturate(0.9) brightness(0.9); }

/* Enlace que cubre toda la tarjeta (click en cualquier parte = ingresar).
   .bento-conocer queda por encima (z-index) asi que sigue siendo clicable
   de forma independiente. */
.bento-stretched-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Shimmer effect */
.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(0, 212, 255, 0.04) 50%, transparent 60%);
  background-size: 300% 300%;
  background-position: -200% -200%;
  transition: background-position 1.5s ease;
  pointer-events: none;
  border-radius: 16px;
  z-index: 1;
}
.bento-card:hover::before { background-position: 200% 200%; }

/* ─── MODULE SECTIONS (IVAN, LINCE, CALC, CONCESIONES) ───
   Editorial / cinematic chapters: menos cajas, mas aire.
   Cada modulo es un capitulo visual independiente. */
.module {
  padding: clamp(56px, 11vh, 108px) 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(36px, 6vh, 56px);
  align-items: center;
}
@media (min-width: 900px) {
  .module-grid { grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 80px); }
  .module-grid.flip .module-text { order: 2; }
  .module-grid.flip .module-visual { order: 1; }
}
.module-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--cyan);
  margin-bottom: 16px;
  display: block;
  opacity: 0.85;
}
/* Nombre corto + significado completo, en vez de un titulo largo unico */
.module-name {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 56px);
  color: var(--ice);
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.module-meaning {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--frost);
  opacity: 0.75;
  margin-bottom: 22px;
}
/* Compat: por si algun modulo conserva titulo unico */
.module-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  color: var(--ice);
  margin-bottom: 20px;
  line-height: 1.15;
}
.module-desc {
  font-size: 15.5px;
  font-weight: 300;
  color: var(--frost);
  line-height: 1.75;
  margin-bottom: 28px;
  max-width: 48ch;
}
.module-features {
  list-style: none;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.module-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 300;
  letter-spacing: 0.01em;
  color: var(--ice);
}
.module-features li svg { flex-shrink: 0; opacity: 0.85; }
/* Variante horizontal, usada en el capitulo-hero de IVAN */
.module-features--row {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 36px;
}
.module-cta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.module-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--frost);
  opacity: 0.7;
  white-space: nowrap;
}
/* Visuales sin caja: mascara suave en vez de borde/sombra duros */
.module-visual {
  position: relative;
}
.module-visual img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at center, black 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 100% 100% at center, black 72%, transparent 100%);
}
/* Visual procedural (Portal BI): sin foto real todavia, mismo tratamiento sin caja */
.module-visual-procedural {
  background: linear-gradient(160deg, var(--grid) 0%, #0a1520 100%);
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at center, black 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 100% 100% at center, black 72%, transparent 100%);
}
/* Pequeno detalle grafico: indice de modulo, sin caja */
.module-index {
  position: absolute;
  top: -34px;
  left: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--cyan);
  opacity: 0.45;
}

/* IVAN: espacio de sobra para que el navbar fijo (pill flotante, ~60px
   incluyendo su margen superior) nunca tape el titulo, tanto al llegar
   por scroll normal como al saltar con el enlace CONOCER IVAN. */
#ivan {
  scroll-margin-top: 104px;
  padding-top: clamp(96px, 15vh, 140px);
}

/* Capitulo IVAN: composicion centrada, apilada, calibrada para laptop al 100% */
.module--hero .module-hero-text {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}
.module--hero .module-desc { margin: 0 auto 8px; }
.module-visual--hero {
  max-width: 1040px;
  margin: clamp(20px, 4vh, 36px) auto 0;
  position: relative;
}
.module-visual--hero img {
  aspect-ratio: 2.9 / 1;
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at center, black 78%, transparent 100%);
  mask-image: radial-gradient(ellipse 100% 100% at center, black 78%, transparent 100%);
}

/* ─── IVAN: cerebro 3D como capa de fondo inmersiva (solo #ivan) ─── */
.module--brain-hero .module-brain-stage {
  position: relative;
  min-height: clamp(480px, 68vh, 760px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(4px, 1vh, 18px);
}
/* El cerebro llena todo el escenario, detras del texto (z-index 1).
   Ya no es un enlace: solo reacciona al cursor (arrastrar para girar). */
.module-brain-obj {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}
.module-brain-3d,
.module-brain-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.module-brain-3d canvas { background: transparent !important; }
.module-brain-fallback {
  display: none;
  object-fit: contain;
  padding: clamp(16px, 6vh, 64px) 8%;
  box-sizing: border-box;
}
/* Si WebGL no esta disponible, la clase brain-3d-active nunca se agrega y se ve el respaldo */
.module-brain-obj:not(.brain-3d-active) .module-brain-fallback { display: block; }
.module-brain-obj:not(.brain-3d-active) .module-brain-3d { display: none; }

/* ─── Resto de modulos: mismo patron inmersivo de I.V.A.N. (escenario +
   texto superpuesto + franja de capacidades), con foto en vez de 3D. ─── */
.module--stage-hero .module-stage {
  position: relative;
  min-height: clamp(420px, 58vh, 620px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(4px, 1vh, 18px);
}
.module-stage-visual {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}
.module-stage-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at center, black 76%, transparent 100%);
  mask-image: radial-gradient(ellipse 100% 100% at center, black 76%, transparent 100%);
}

/* ─── LINCE: reencuadre puntual para que el rostro/ojos del lince queden
   protagonistas (la foto fuente tiene la cabeza muy arriba y el cuerpo/patas
   ocupando el resto). Mas alto que el resto para no recortar la cara, y el
   texto se desplaza debajo de la cabeza para no taparla. Solo afecta #lince. ─── */
#lince .module-stage { min-height: clamp(460px, 62vh, 640px); }
#lince .module-hero-text--overlay { margin-top: clamp(150px, 24vh, 240px); }

/* ─── PORTAL BI: Atlas a la derecha del dashboard. En escritorio la foto se
   ancla a la izquierda para que el texto no le tape el rostro; en celular se
   centra en Atlas. Solo afecta #portalbi. ─── */
#portalbi .module-stage-visual img { object-position: 0% 30%; }
@media (max-width: 768px) {
  #portalbi .module-stage-visual img { object-position: 74% center; }
}

/* Texto superpuesto: se queda encima del cerebro, con un scrim suave detras
   para mantener contraste sin caja ni fondo solido. */
.module-hero-text--overlay {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  padding: 2px 24px 12px;
}
.module-hero-text--overlay::before {
  content: '';
  position: absolute;
  inset: -30px -60px;
  /* Scrim eliptico mas presente en el centro + desenfoque localizado muy
     leve. La mascara radial hace que el blur y el oscurecido se desvanezcan
     hacia los bordes: nada de caja rectangular, el cerebro sigue visible. */
  background: radial-gradient(ellipse 62% 75% at center, rgba(5, 10, 18, 0.88) 0%, rgba(5, 10, 18, 0.52) 48%, rgba(5, 10, 18, 0.18) 70%, transparent 86%);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  -webkit-mask-image: radial-gradient(ellipse 72% 82% at center, black 42%, transparent 82%);
  mask-image: radial-gradient(ellipse 72% 82% at center, black 42%, transparent 82%);
  z-index: -1;
  pointer-events: none;
}
/* Legibilidad inmediata sobre las particulas: sombra suave en cada linea y
   un paso mas de contraste en meaning/descripcion (solo en este overlay). */
.module-hero-text--overlay .module-name {
  letter-spacing: 0.04em; /* I.V.A.N. con puntos respira mejor algo mas abierto */
  text-shadow: 0 2px 18px rgba(5, 10, 18, 0.95), 0 1px 4px rgba(5, 10, 18, 0.85);
}
.module-hero-text--overlay .module-label {
  text-shadow: 0 1px 8px rgba(5, 10, 18, 0.9);
}
.module-hero-text--overlay .module-meaning {
  color: #9db1c3;
  text-shadow: 0 1px 10px rgba(5, 10, 18, 0.9);
}
.module-hero-text--overlay .module-desc {
  color: #a9bac9;
  text-shadow: 0 1px 12px rgba(5, 10, 18, 0.9);
}
.module-hero-footer {
  max-width: 880px;
  margin: clamp(24px, 4vh, 40px) auto 0;
  text-align: center;
}
.module-hero-footer .module-cta-row { justify-content: center; margin-top: 6px; }

/* ─── I.V.A.N.: franja premium de capacidades (numeracion, lineas finas) ─── */
.ivan-caps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  border-top: 1px solid rgba(0, 212, 255, 0.14);
  border-bottom: 1px solid rgba(0, 212, 255, 0.14);
  text-align: left;
}
.ivan-cap {
  position: relative;
  padding: 22px 20px 24px;
  transition: background 0.45s ease;
}
/* Separadores verticales sutiles entre capacidades */
.ivan-cap + .ivan-cap::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16%;
  bottom: 16%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(0, 212, 255, 0.22), transparent);
}
.ivan-cap-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--cyan);
  opacity: 0.75;
  margin-bottom: 10px;
  transition: opacity 0.4s ease;
}
/* Indicador cian: linea fina bajo el numero, crece apenas en hover */
.ivan-cap-num::after {
  content: '';
  display: block;
  width: 18px;
  height: 1px;
  margin-top: 8px;
  background: var(--cyan);
  opacity: 0.45;
  transition: width 0.45s ease, opacity 0.45s ease;
}
.ivan-cap-name {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.65;
  color: var(--ice);
  opacity: 0.88;
  transition: color 0.4s ease, opacity 0.4s ease;
}
@media (hover: hover) {
  .ivan-cap:hover { background: rgba(0, 212, 255, 0.045); }
  .ivan-cap:hover .ivan-cap-num { opacity: 1; }
  .ivan-cap:hover .ivan-cap-num::after { width: 34px; opacity: 0.9; }
  .ivan-cap:hover .ivan-cap-name { color: #ffffff; opacity: 1; }
}
/* Microanimacion de entrada escalonada cuando la franja entra en pantalla */
.reveal.visible .ivan-cap { animation: ivanCapIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
.reveal.visible .ivan-cap:nth-child(2) { animation-delay: 0.09s; }
.reveal.visible .ivan-cap:nth-child(3) { animation-delay: 0.18s; }
.reveal.visible .ivan-cap:nth-child(4) { animation-delay: 0.27s; }
@keyframes ivanCapIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal.visible .ivan-cap { animation: none; }
}

/* ─── I.V.A.N.: franja final — boton centrado + tecnologias debajo ─── */
#ivan .module-cta-row {
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: clamp(26px, 4vh, 38px);
}
/* Misma franja final en columna, para el resto de modulos (clase generica,
   no ligada al ID de #ivan) */
.module-cta-row--stacked {
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: clamp(26px, 4vh, 38px);
}
.ivan-tech {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: 9.5px;
  letter-spacing: 0.3em;
  color: var(--frost);
  opacity: 0.75;
}
.ivan-tech::before,
.ivan-tech::after {
  content: '';
  width: 44px;
  height: 1px;
}
.ivan-tech::before { background: linear-gradient(to right, transparent, rgba(122, 143, 163, 0.55)); }
.ivan-tech::after { background: linear-gradient(to left, transparent, rgba(122, 143, 163, 0.55)); }

/* ─── ATLAS EN EL TERRITORIO: linea de transmision 3D + faja de servidumbre ─── */
.territory {
  padding: 0 0 clamp(72px, 10vh, 110px);
  background: var(--void);
}
.territory-scene {
  position: relative;
  width: 100%;
  height: clamp(430px, 62vh, 650px);
  overflow: hidden;
  /* Fondo con un leve horizonte azul por si WebGL tarda o no esta disponible */
  background: radial-gradient(ellipse 90% 65% at center 78%, rgba(0, 60, 90, 0.16) 0%, transparent 65%), var(--void);
}
.territory-3d { position: absolute; inset: 0; }
.territory-3d canvas { display: block; background: transparent !important; }
.territory-scene-fade {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 130px;
  background: linear-gradient(to bottom, transparent, var(--void));
  pointer-events: none;
}
.territory-content {
  max-width: 880px;
  margin: clamp(4px, 1.5vh, 18px) auto 0;
  padding: 0 24px;
  text-align: center;
}
.territory-content .module-title {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}
.territory-desc {
  margin: 0 auto 14px;
  max-width: 62ch;
}
.territory-desc--sub {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: clamp(30px, 5vh, 44px);
}
/* Descripcion corta bajo cada capacidad (extiende la franja ivan-caps) */
.ivan-cap-desc {
  display: block;
  margin-top: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--frost);
}
.territory-cta { justify-content: center; margin-top: clamp(26px, 4vh, 38px); }

/* ─── VISIÓN TERRITORIAL (#globo): conceptos numerados en 2 columnas,
   dentro de la columna de texto junto al planeta ─── */
.vision-desc-sub {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 30px;
}
.vision-caps {
  grid-template-columns: 1fr 1fr;
  max-width: 540px;
  margin: 0;
  text-align: left;
}
.vision-caps .ivan-cap { padding: 16px 18px 18px; }
.vision-caps .ivan-cap:nth-child(odd)::before { display: none; }
.vision-caps .ivan-cap:nth-child(n+3) { border-top: 1px solid rgba(0, 212, 255, 0.1); }
.vision-caps .ivan-cap-name { font-size: 10.5px; }
.vision-caps .ivan-cap-desc { font-size: 11px; }
/* La microanimacion de entrada tambien debe dispararse bajo reveal-left/right
   (la columna de texto del planeta usa reveal-left, no reveal) */
.reveal-left.visible .ivan-cap,
.reveal-right.visible .ivan-cap { animation: ivanCapIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
.reveal-left.visible .ivan-cap:nth-child(2),
.reveal-right.visible .ivan-cap:nth-child(2) { animation-delay: 0.09s; }
.reveal-left.visible .ivan-cap:nth-child(3),
.reveal-right.visible .ivan-cap:nth-child(3) { animation-delay: 0.18s; }
.reveal-left.visible .ivan-cap:nth-child(4),
.reveal-right.visible .ivan-cap:nth-child(4) { animation-delay: 0.27s; }
@media (prefers-reduced-motion: reduce) {
  .reveal-left.visible .ivan-cap,
  .reveal-right.visible .ivan-cap { animation: none; }
}

/* Imagen angosta/vertical (LINCE): retrato contenido, no una columna gigante */
.module-visual--narrow {
  max-width: 380px;
}
@media (min-width: 900px) {
  .module-grid.flip .module-visual--narrow { margin-left: auto; }
  .module-visual--narrow { margin-right: auto; }
}
/* Difumina bordes laterales para integrar paneles de HUD que quedan en el corte */
.module-visual--fade-x img {
  -webkit-mask-image: linear-gradient(to right, transparent, black 14%, black 86%, transparent),
                       radial-gradient(ellipse 120% 120% at center, black 70%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, black 14%, black 86%, transparent),
              radial-gradient(ellipse 120% 120% at center, black 70%, transparent 100%);
  mask-composite: intersect;
}

/* Capitulo apilado y panoramico (PDFs): texto arriba, imagen ancha documental */
.module--stacked .module-hero-text { max-width: 600px; }
.module--stacked .module-visual--hero { max-width: 760px; }
.module--stacked .module-visual--hero img { aspect-ratio: 1.74 / 1; }

/* ─── CALCULADORA: mismo sistema, sin caja/tarjeta ─── */
.calc-card {
  max-width: 1200px;
  margin: 0 auto;
}
.calc-feature-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  margin-bottom: 36px;
}
.calc-feature {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--frost);
}
.calc-feature::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}
.calc-live {
  position: absolute;
  bottom: 22px;
  left: 22px;
  right: 22px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(5, 10, 18, 0.5);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 200, 87, 0.22);
  z-index: 5;
}
.calc-live-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--frost);
  margin-bottom: 4px;
}
.calc-live-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold-bright);
}
.cursor-blink {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--cyan);
  margin-left: 4px;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}

/* ─── ATLAS BUILDS SECTION ─── */
.builds {
  padding: 80px 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.acronym {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 24px;
  justify-content: center;
}
.acronym-letter {
  position: relative;
  cursor: default;
}
.acronym-letter span {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--gold);
  transition: all 0.3s;
}
.acronym-letter:hover span {
  color: var(--ice);
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}
.acronym-letter .tooltip {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--frost);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.acronym-letter:hover .tooltip { opacity: 1; }

/* ─── GLOBE SECTION ─── */
.globe-section {
  padding: 100px 20px;
  max-width: 1100px;
  margin: 0 auto;
}
/* El cuadro del planeta se estira a la altura de la columna de texto para
   que ambos queden alineados arriba y abajo (solo en el layout de 2 columnas;
   en movil, apilado, conserva su alto minimo propio). */
@media (min-width: 900px) {
  #globo .module-grid { align-items: stretch; }
  #globo .module-text { align-self: stretch; }
  #globo .scene-3d-container-small { height: auto; min-height: 420px; }
}
.globe-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--grid);
  border: 1px solid rgba(0, 212, 255, 0.15);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--cyan);
}
.globe-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}

/* ─── PORTAL SECTION ─── */
.portal-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  justify-content: center;
}
.portal-progress span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--frost);
  opacity: 0.5;
}
.portal-progress span:last-child { color: var(--cyan); opacity: 1; }
.portal-progress .line {
  width: 16px;
  height: 1px;
  background: rgba(0, 212, 255, 0.2);
}
.portal-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
@media (min-width: 500px) {
  .portal-buttons { flex-direction: row; justify-content: center; }
}

/* ─── DEL DOCUMENTO AL CONTROL: etapas del flujo documental ───
   Cuatro palabras discretas que se iluminan en secuencia, como la
   informacion avanzando por el flujo. No son botones: solo texto mono
   con una onda de brillo que acompana la animacion de los documentos. */
.portal-flow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  justify-content: center;
  flex-wrap: wrap;
}
.portal-flow-step {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--frost);
  opacity: 0.4;
  animation: portalFlowStep 7s ease-in-out infinite;
}
.portal-flow-step:nth-child(3) { animation-delay: 1.4s; }
.portal-flow-step:nth-child(5) { animation-delay: 2.8s; }
.portal-flow-step:nth-child(7) { animation-delay: 4.2s; }
.portal-flow .line {
  width: 16px;
  height: 1px;
  background: rgba(0, 212, 255, 0.2);
}
@keyframes portalFlowStep {
  0%, 100% { color: var(--frost); opacity: 0.4; text-shadow: none; }
  12% { color: var(--cyan); opacity: 1; text-shadow: 0 0 12px rgba(0, 212, 255, 0.5); }
  26% { color: var(--frost); opacity: 0.4; text-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-flow-step { animation: none; opacity: 0.7; }
}
/* Frase de transicion hacia el cierre */
.portal-close {
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 22px);
  color: var(--ice);
  opacity: 0.92;
  margin: -6px auto 30px;
  letter-spacing: 0.01em;
}
/* ─── CIERRE: gestion predial real sobre video de territorio ─── */
.cierre {
  position: relative;
  min-height: 94vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: var(--void);
}
.cierre-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Las torres y la subestacion del video quedan al centro/derecha del
     encuadre (verificado fotograma a fotograma): el centro es seguro. */
  object-position: center center;
}
/* Degradado doble: piso oscuro para el texto + esquina izquierda mas densa
   (el texto va alineado a la izquierda) sin apagar el video completo. */
.cierre-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(5, 10, 18, 0.97) 0%, rgba(5, 10, 18, 0.72) 30%, rgba(5, 10, 18, 0.28) 58%, rgba(5, 10, 18, 0.35) 100%),
    linear-gradient(to right, rgba(5, 10, 18, 0.55) 0%, transparent 55%);
  pointer-events: none;
}
.cierre-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(200px, 34vh, 340px) 24px 54px;
  text-align: left;
}
.cierre-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 42px);
  color: var(--ice);
  line-height: 1.22;
  max-width: 640px;
  margin-bottom: 20px;
  text-shadow: 0 2px 20px rgba(5, 10, 18, 0.8);
}
.cierre-desc {
  font-size: 15px;
  font-weight: 300;
  color: #b9c6d4;
  line-height: 1.75;
  max-width: 58ch;
  margin-bottom: 14px;
  text-shadow: 0 1px 12px rgba(5, 10, 18, 0.8);
}
.cierre-desc--sub {
  font-size: 13.5px;
  color: var(--frost);
  margin-bottom: 26px;
}
.cierre-lema {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.92;
  margin-bottom: 30px;
  text-shadow: 0 1px 10px rgba(5, 10, 18, 0.85);
}
.cierre-cta { display: flex; }
/* Marca final, muy sobria, centrada al pie de la seccion */
.cierre-brand {
  margin-top: clamp(54px, 9vh, 92px);
  padding-top: 26px;
  border-top: 1px solid rgba(224, 232, 240, 0.09);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}
.cierre-brand-name {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: 0.34em;
  margin-right: -0.34em; /* compensa el tracking para centrado optico */
  color: var(--ice);
}
.cierre-brand-sub {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.28em;
  color: var(--frost);
  opacity: 0.85;
}
.cierre-brand-tag {
  font-size: 11px;
  font-weight: 300;
  color: var(--frost);
  opacity: 0.7;
}

/* ─── RIEL LATERAL DE SECCIONES (puntos de navegacion, margen derecho) ───
   SOLO en la version web de escritorio: oculto por defecto y habilitado
   unicamente con pantalla ancha + mouse real (ni moviles ni tablets). */
.section-rail {
  display: none;
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  padding: 12px 4px;
}
@media (hover: hover) and (pointer: fine) and (min-width: 900px) and (min-height: 621px) {
  .section-rail { display: flex; }
}
/* Hilo vertical tenue que une los puntos, como una regla */
.section-rail::before {
  content: '';
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(122, 143, 163, 0.16) 12%, rgba(122, 143, 163, 0.16) 88%, transparent);
  pointer-events: none;
}
.section-rail-dot {
  position: relative;
  width: 14px;
  height: 14px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.section-rail-dot::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(122, 143, 163, 0.42);
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.section-rail-dot:hover::before {
  background: rgba(0, 212, 255, 0.85);
  transform: scale(1.4);
}
.section-rail-dot.active::before {
  background: var(--cyan);
  transform: scale(1.55);
  box-shadow: 0 0 9px rgba(0, 212, 255, 0.7);
}
/* Etiqueta con el nombre de la seccion, aparece hacia la izquierda */
.section-rail-label {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%) translateX(5px);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ice);
  background: rgba(5, 10, 18, 0.88);
  border: 1px solid rgba(0, 212, 255, 0.16);
  padding: 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.section-rail-dot:hover .section-rail-label,
.section-rail-dot:focus-visible .section-rail-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
/* ─── FOOTER ─── */
.footer {
  text-align: center;
  padding: 60px 20px;
  border-top: 1px solid rgba(0, 212, 255, 0.06);
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--gold);
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}
.footer-sub {
  font-size: 13px;
  color: var(--frost);
  margin-bottom: 20px;
  font-weight: 300;
}
.footer-line {
  width: 60px;
  height: 1px;
  background: var(--cyan);
  opacity: 0.4;
  margin: 0 auto 24px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 28px;
}
.footer-links button {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--frost);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s;
  font-family: 'Inter', sans-serif;
}
.footer-links button:hover { color: var(--ice); }
.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--frost);
  opacity: 0.5;
}
@media (min-width: 600px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; max-width: 900px; margin: 0 auto; }
}
.footer-bottom span { cursor: pointer; transition: color 0.3s; }
.footer-bottom span:hover { color: var(--ice); }

/* ─── ANIMATIONS ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bounceDot {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(12px); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Section divider */
.section-divider {
  width: 1px;
  height: 80px;
  margin: 0 auto;
  background: linear-gradient(to bottom, rgba(0, 212, 255, 0.2), transparent);
}

button { font-family: 'Inter', sans-serif; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .scene-3d-content { padding: 40px 16px; }
  .scene-title { font-size: 32px; }
  .scene-hud { flex-direction: column; gap: 16px; align-items: center; }
  .hud-stat { align-items: center; }
  .nav { gap: 2px; padding: 4px 8px; }
  .nav-link { padding: 4px 8px; font-size: 9px; }
  .acronym-letter span { font-size: 28px; }

  /* Solo #solar-system: proporciones mas chicas, sin forzar 2 lineas */
  #solar-system { min-height: 135vh; }
  #solar-system .scene-3d-content { padding: 40px 16px 60px; }
  #solar-system .scene-title { font-size: 24px; max-width: 90%; margin-bottom: 16px; }
  #solar-system .scene-desc { font-size: 13px; max-width: 92%; margin-bottom: 24px; }
  #solar-system .scene-desc-sub { font-size: 11.5px; max-width: 92%; margin: 0 auto 22px; }
  #solar-system .scene-link { display: flex; width: 100%; justify-content: center; margin: 14px 0 34px; }

  /* Modulos (IVAN, LINCE, Calculadora, PDFs, Concesiones, etc): mas compactos y con menos movimiento */
  .module { padding: 56px 20px; }
  .module-name { font-size: clamp(30px, 11vw, 42px); }
  .module-desc { max-width: 100%; }
  .module-features--row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .module-hero-footer .module-cta-row { justify-content: flex-start; }
  .module-visual--hero { margin-top: 20px; }
  .module-visual--hero img,
  .module--stacked .module-visual--hero img { aspect-ratio: 4/3; }
  .module-visual--narrow { max-width: 100%; }
  .reveal, .reveal-left, .reveal-right { transition-duration: 0.6s; }

  /* Cerebro de IVAN en movil: mas bajo, mismo cerebro completo detras del texto */
  .module--brain-hero .module-brain-stage { min-height: clamp(320px, 52vh, 460px); }
  /* Mismo ajuste de altura en movil para el resto de modulos (foto de fondo) */
  .module--stage-hero .module-stage { min-height: clamp(300px, 50vh, 440px); }
  .module-hero-text--overlay::before { inset: -14px -20px; }

  /* Franja de capacidades de I.V.A.N. en movil: 2 columnas, separadores solo
     donde corresponde (vertical en pares, horizontal entre filas) */
  .ivan-caps { grid-template-columns: 1fr 1fr; }
  .ivan-cap { padding: 18px 16px 20px; }
  .ivan-cap:nth-child(odd)::before { display: none; }
  .ivan-cap:nth-child(n+3) { border-top: 1px solid rgba(0, 212, 255, 0.1); }

  /* ATLAS en el territorio en movil: escena mas baja, al menos una torre
     completa visible; textos y capacidades siguen legibles apilados */
  .territory-scene { height: clamp(300px, 46vh, 430px); }
  .territory-desc--sub { margin-bottom: 26px; }

  /* Cierre en movil: el recorte vertical del video 16:9 se corre apenas a la
     derecha (52%) para no perder las torres del primer plano (revisado
     fotograma a fotograma); titulo mas contenido y menos aire superior */
  .cierre { min-height: 86vh; }
  .cierre-video { object-position: 52% center; }
  .cierre-content { padding-top: clamp(150px, 26vh, 220px); }
  .cierre-title { font-size: clamp(23px, 6.4vw, 30px); }
  .cierre-brand-sub { letter-spacing: 0.18em; }
}


/* ═══ Accesibilidad (añadido 01-oct-2026) ═══ */
.skip-link{position:absolute;left:-9999px;top:8px;z-index:10000;background:var(--cyan);color:var(--void);padding:10px 16px;border-radius:6px;font-weight:600;text-decoration:none;}
.skip-link:focus{left:8px;}
.site-main{display:contents;}
a:focus-visible,button:focus-visible,[role="button"]:focus-visible{outline:2px solid var(--cyan);outline-offset:3px;}

/* Móvil: las etiquetas largas no deben ensanchar la página (añadido 01-oct-2026) */
@media (max-width: 600px){ .module-badge{white-space:normal;text-align:center;max-width:100%;} }

/* Pie de página: enlaces legales y crédito legibles (contraste AA) */
.footer-bottom { opacity: 1; font-size: 12px; }
.footer-bottom a { color: var(--frost); text-decoration: none; transition: color 0.3s; }
.footer-bottom a:hover, .footer-bottom a:focus-visible { color: var(--ice); text-decoration: underline; }
.footer-credit { font-size: 11px; color: var(--frost); margin-top: 16px; letter-spacing: 0.02em; max-width: 900px; margin-left: auto; margin-right: auto; line-height: 1.6; }
.footer-credit a { color: var(--frost); text-decoration: underline; }
.footer-credit a:hover { color: var(--ice); }
