/* ==========================================================================
   Guía del Eclipse 2026 — sistema de diseño
   Un sitio documental con identidad propia: cielo profundo, luz solar,
   tipografía de contraste y movimiento contenido.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --ink: #f4f1e8;
  --ink-dim: #b6b3c4;
  --ink-faint: #7c7a92;

  --space-0: #04050d;
  --space-1: #080a18;
  --space-2: #0d1024;

  --sol: #ffb347;
  --sol-bright: #ffd98a;
  --sol-deep: #f08c1e;
  --corona: #ff7847;
  --chromo: #ff4d3d;
  --cielo: #8ab6ff;
  --cielo-dim: #5f7fd4;
  --verde: #6ee7a0;

  --line: rgba(180, 190, 255, 0.14);
  --line-warm: rgba(255, 179, 71, 0.35);

  --panel: rgba(16, 18, 38, 0.66);
  --panel-solid: #0e1126;

  --font-display: 'Unbounded', 'Space Grotesk', sans-serif;
  --font-body: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1080px;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--space-0);
  line-height: 1.7;
  font-size: 1.04rem;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255, 179, 71, 0.4); color: #fff; }

/* ---------- Fondo por capas: gradiente + nebulosas + estrellas ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(1100px 700px at 85% -10%, rgba(255, 140, 60, 0.10), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(90, 120, 230, 0.12), transparent 60%),
    radial-gradient(800px 600px at 60% 110%, rgba(255, 90, 60, 0.07), transparent 60%),
    linear-gradient(180deg, var(--space-0) 0%, var(--space-1) 45%, var(--space-0) 100%);
}
#stars { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
.star-twinkle {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  animation: twinkle var(--tw-dur, 3s) ease-in-out var(--tw-delay, 0s) infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50% { opacity: 0.9; transform: scale(1.15); }
}

/* ---------- Barra de progreso de lectura ---------- */
#progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 200;
  background: linear-gradient(90deg, var(--sol-deep), var(--sol), var(--corona));
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.7);
  transition: width 0.1s linear;
}

/* ==========================================================================
   Cabecera de navegación
   ========================================================================== */
.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(4, 5, 13, 0.72);
  border-bottom: 1px solid var(--line);
}
.site-head .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brandlink { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.mark { position: relative; width: 30px; height: 30px; flex: 0 0 auto; }
.mark .m-corona {
  position: absolute; inset: -3px; border-radius: 50%;
  background: radial-gradient(circle, transparent 42%, rgba(255, 206, 138, 0.6) 58%, transparent 74%);
  animation: markpulse 4s var(--ease) infinite;
}
.mark .m-sun { position: absolute; inset: 4px; border-radius: 50%; background: radial-gradient(circle at 35% 32%, #fff3d6, var(--sol) 55%, var(--sol-deep)); box-shadow: 0 0 12px rgba(255, 179, 71, 0.8); }
.mark .m-moon { position: absolute; inset: 4px; border-radius: 50%; background: #04050d; animation: marktransit 8s var(--ease) infinite; }
@keyframes markpulse { 0%,100% { opacity: .5; transform: scale(1);} 50% { opacity: 1; transform: scale(1.12);} }
@keyframes marktransit { 0% { transform: translateX(-62%);} 50% { transform: translateX(0);} 100% { transform: translateX(62%);} }
.brandlink .b-title { font-family: var(--font-display); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1.2; }
.brandlink .b-sub { display: block; font-family: var(--font-body); font-size: 0.62rem; font-weight: 500; color: var(--sol); letter-spacing: 0.18em; text-transform: uppercase; }

.site-nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.site-nav a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 99px;
  border: 1px solid transparent;
  transition: all 0.25s var(--ease);
}
.site-nav a:hover { color: var(--sol-bright); background: rgba(255, 179, 71, 0.08); }
.site-nav a.active { color: var(--sol-bright); border-color: var(--line-warm); background: rgba(255, 179, 71, 0.1); }
.site-nav a.sim-link {
  color: #1a0e00;
  font-weight: 700;
  background: linear-gradient(135deg, var(--sol-bright), var(--sol) 55%, var(--corona));
  box-shadow: 0 0 16px -4px rgba(255, 179, 71, 0.8);
}
.site-nav a.sim-link:hover { filter: brightness(1.1); transform: translateY(-1px); }

.nav-toggle { display: none; }

/* ==========================================================================
   Héroe — apertura característica: el eclipse en sí
   ========================================================================== */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 84px 24px 70px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  min-height: 78vh;
}
.hero-copy .kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sol);
  padding: 6px 14px;
  border: 1px solid var(--line-warm);
  border-radius: 99px;
  background: rgba(255, 179, 71, 0.07);
  margin-bottom: 26px;
}
.hero-copy .kicker .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--corona); box-shadow: 0 0 10px var(--corona); animation: markpulse 2s ease-in-out infinite; }

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}
.hero-copy h1 .hl { color: var(--sol); text-shadow: 0 0 30px rgba(255, 179, 71, 0.45); }
.hero-copy h1 .hl2 { color: var(--cielo); }

.hero-copy .lead {
  font-size: 1.16rem;
  color: var(--ink-dim);
  max-width: 52ch;
  margin-bottom: 34px;
}
.hero-copy .lead strong { color: var(--ink); }

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: 12px;
  transition: all 0.25s var(--ease);
}
.btn-primary {
  color: #1a0e00;
  background: linear-gradient(135deg, var(--sol-bright), var(--sol) 50%, var(--corona));
  box-shadow: 0 6px 24px -6px rgba(255, 140, 60, 0.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -6px rgba(255, 140, 60, 0.9); filter: brightness(1.06); }
.btn-ghost {
  color: var(--cielo);
  border: 1px solid rgba(138, 182, 255, 0.35);
  background: rgba(138, 182, 255, 0.06);
}
.btn-ghost:hover { border-color: var(--cielo); background: rgba(138, 182, 255, 0.14); transform: translateY(-2px); }

/* --- El eclipse animado --- */
.eclipse-stage { position: relative; width: 100%; aspect-ratio: 1; max-width: 440px; margin-left: auto; }
.eclipse-stage .halo {
  position: absolute; inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 46%, rgba(255, 190, 110, 0.28) 56%, rgba(255, 120, 71, 0.12) 66%, transparent 74%);
  animation: halobreath 5s var(--ease) infinite;
}
@keyframes halobreath { 0%,100% { transform: scale(1); opacity: .7;} 50% { transform: scale(1.06); opacity: 1;} }
.eclipse-stage .rays {
  position: absolute; inset: -20%;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0deg, rgba(255,200,120,0.10) 8deg, transparent 16deg,
    transparent 40deg, rgba(255,200,120,0.07) 48deg, transparent 56deg,
    transparent 90deg, rgba(255,200,120,0.10) 98deg, transparent 106deg,
    transparent 150deg, rgba(255,200,120,0.06) 158deg, transparent 166deg,
    transparent 210deg, rgba(255,200,120,0.10) 218deg, transparent 226deg,
    transparent 270deg, rgba(255,200,120,0.07) 278deg, transparent 286deg,
    transparent 330deg, rgba(255,200,120,0.10) 338deg, transparent 346deg);
  animation: rayspin 60s linear infinite;
  filter: blur(2px);
}
@keyframes rayspin { to { transform: rotate(360deg); } }
.eclipse-stage .sun-disc {
  position: absolute; inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fff8e8 0%, #ffe9b8 28%, var(--sol) 58%, var(--sol-deep) 82%, #d96a12 100%);
  box-shadow: 0 0 60px 8px rgba(255, 179, 71, 0.55), 0 0 140px 30px rgba(255, 120, 50, 0.25);
}
.eclipse-stage .moon-disc {
  position: absolute; inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 36%, #10121f 0%, #05060f 70%);
  animation: herotransit 11s var(--ease) infinite;
}
@keyframes herotransit {
  0% { transform: translateX(-105%); }
  42% { transform: translateX(0); }
  58% { transform: translateX(0); }
  100% { transform: translateX(105%); }
}
.eclipse-stage .diamond {
  position: absolute;
  width: 3.5%; height: 3.5%;
  left: 20%; top: 30%;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 18px 6px rgba(255, 255, 255, 0.9), 0 0 40px 14px rgba(255, 220, 160, 0.6);
  opacity: 0;
  animation: diamondflash 11s var(--ease) infinite;
}
@keyframes diamondflash {
  0%, 38% { opacity: 0; }
  42% { opacity: 1; }
  48% { opacity: 0; }
  56% { opacity: 0; }
  60% { opacity: 1; }
  66%, 100% { opacity: 0; }
}
.eclipse-stage .stage-caption {
  position: absolute;
  bottom: -8px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ==========================================================================
   Secciones y prosa
   ========================================================================== */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

section.block { padding: 64px 0; border-top: 1px solid var(--line); }
section.block:first-of-type { border-top: none; }

.sec-kicker {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--corona);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.sec-kicker::after { content: ''; flex: 0 0 46px; height: 1px; background: linear-gradient(90deg, var(--corona), transparent); }

h2.sec-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
h2.sec-title .accent { color: var(--sol); }

.prose { max-width: 70ch; }
.prose p { margin-bottom: 18px; color: var(--ink-dim); }
.prose p strong { color: var(--ink); font-weight: 600; }
.prose p em { color: var(--sol-bright); font-style: normal; font-weight: 500; }
.prose a { color: var(--cielo); text-underline-offset: 3px; transition: color 0.2s; }
.prose a:hover { color: var(--sol-bright); }
.prose h3 {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  margin: 34px 0 12px;
  color: var(--ink);
}
.prose ul, .prose ol { margin: 0 0 18px 22px; color: var(--ink-dim); }
.prose li { margin-bottom: 8px; }
.prose li strong { color: var(--ink); }

/* ==========================================================================
   Índice de capítulos (portada) — lista asimétrica, no tarjetas iguales
   ========================================================================== */
.chapters { display: flex; flex-direction: column; gap: 0; margin-top: 38px; }
.chapter {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 26px;
  align-items: center;
  padding: 30px 22px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.chapter:last-child { border-bottom: 1px solid var(--line); }
.chapter::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ch-color, var(--sol));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s var(--ease);
}
.chapter:hover { background: rgba(255, 255, 255, 0.025); transform: translateX(6px); }
.chapter:hover::before { transform: scaleY(1); }
.chapter .ch-num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ch-color, var(--sol));
  line-height: 1;
  transition: color 0.3s var(--ease);
}
.chapter:hover .ch-num { color: var(--ch-color, var(--sol)); }
.chapter .ch-body h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.chapter .ch-body p { color: var(--ink-dim); font-size: 0.95rem; max-width: 56ch; }
.chapter .ch-tags { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.chapter .ch-tags span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 10px;
  white-space: nowrap;
}
.chapter .ch-arrow { font-size: 1.4rem; color: var(--ch-color, var(--sol)); opacity: 0; transform: translateX(-8px); transition: all 0.3s var(--ease); }
.chapter:hover .ch-arrow { opacity: 1; transform: translateX(0); }

/* ==========================================================================
   Cifras rápidas — tira con divisores, anchos variables
   ========================================================================== */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 44px 0 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel);
  backdrop-filter: blur(8px);
}
.stat {
  flex: 1 1 160px;
  padding: 26px 24px;
  border-right: 1px solid var(--line);
  position: relative;
  transition: background 0.3s var(--ease);
}
.stat:last-child { border-right: none; }
.stat:hover { background: rgba(255, 179, 71, 0.05); }
.stat .num {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--sol);
}
.stat:nth-child(2) .num { color: var(--corona); }
.stat:nth-child(3) .num { color: var(--cielo); }
.stat:nth-child(4) .num { color: var(--sol-bright); }
.stat:nth-child(5) .num { color: var(--chromo); }
.stat .cap { font-size: 0.8rem; color: var(--ink-dim); margin-top: 6px; line-height: 1.45; }

/* ==========================================================================
   Tablas
   ========================================================================== */
.table-scroll { overflow-x: auto; margin: 26px 0; border-radius: 14px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--panel); backdrop-filter: blur(8px); }
thead th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sol);
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-warm);
  background: rgba(255, 179, 71, 0.05);
  white-space: nowrap;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.2s var(--ease); }
tbody tr:hover { background: rgba(138, 182, 255, 0.06); }
tbody td:first-child { color: var(--ink); font-weight: 600; }
td .total { color: var(--sol-bright); font-weight: 700; }
td .partial { color: var(--cielo); }

/* ==========================================================================
   Línea de tiempo de contactos
   ========================================================================== */
.contact-timeline { margin: 34px 0 10px; position: relative; padding-left: 8px; }
.contact {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 22px;
  position: relative;
  padding: 0 0 34px 26px;
}
.contact::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: -4px;
  width: 2px;
  background: linear-gradient(180deg, var(--line-warm), var(--line));
}
.contact:last-child::before { bottom: 8px; }
.contact::after {
  content: '';
  position: absolute;
  left: -6px; top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--space-0);
  border: 2px solid var(--c-color, var(--sol));
  box-shadow: 0 0 12px var(--c-color, var(--sol));
}
.contact .c-code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--c-color, var(--sol));
  padding-top: 2px;
}
.contact .c-body h4 { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; margin-bottom: 5px; }
.contact .c-body p { color: var(--ink-dim); font-size: 0.95rem; max-width: 60ch; }
.contact .c-body .c-time { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-faint); display: block; margin-top: 6px; }
.contact.is-total { background: linear-gradient(90deg, rgba(255, 120, 71, 0.07), transparent 70%); border-radius: 12px; margin-left: -14px; padding-left: 40px; }

/* ==========================================================================
   Lista de comprobación interactiva
   ========================================================================== */
.checklist { margin: 28px 0; display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  user-select: none;
}
.check-item:hover { border-color: var(--line-warm); transform: translateX(4px); }
.check-item .box {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 7px;
  border: 2px solid var(--cielo-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: transparent;
  transition: all 0.25s var(--ease);
  margin-top: 2px;
}
.check-item .txt { color: var(--ink-dim); font-size: 0.95rem; transition: color 0.25s; }
.check-item .txt strong { color: var(--ink); }
.check-item.done { border-color: rgba(110, 231, 160, 0.4); background: rgba(110, 231, 160, 0.06); }
.check-item.done .box { background: var(--verde); border-color: var(--verde); color: #04220f; }
.check-item.done .txt { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: rgba(110, 231, 160, 0.5); }
.check-progress { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-faint); margin-top: 4px; }
.check-progress b { color: var(--verde); }

/* ==========================================================================
   Aviso de seguridad (destacado rojo)
   ========================================================================== */
.safety {
  margin: 34px 0;
  border: 1px solid rgba(255, 77, 61, 0.5);
  border-left: 5px solid var(--chromo);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 77, 61, 0.12), rgba(255, 77, 61, 0.04));
  padding: 26px 28px;
}
.safety .s-head {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffb4ab;
  margin-bottom: 12px;
}
.safety .s-head .s-ico { font-size: 1.5rem; filter: drop-shadow(0 0 8px rgba(255, 77, 61, 0.8)); }
.safety p { color: var(--ink-dim); font-size: 0.97rem; margin-bottom: 10px; }
.safety p strong { color: #ffd9d4; }
.safety .s-rule { font-family: var(--font-mono); font-size: 0.82rem; color: var(--chromo); letter-spacing: 0.04em; }

/* ==========================================================================
   Demo interactivo: magnitud vs oscurecimiento
   ========================================================================== */
.demo {
  margin: 34px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.demo .demo-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.demo .demo-head .d-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.demo .demo-head .d-hint { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); }
.demo .demo-body { display: grid; grid-template-columns: 1fr 260px; gap: 0; }
.demo .d-sky {
  position: relative;
  aspect-ratio: 16/9;
  background: #0a1024;
  transition: background 0.3s var(--ease);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.demo .d-sky svg { width: 62%; height: auto; max-height: 80%; }
.demo .d-panel { padding: 24px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.demo .d-read { display: flex; flex-direction: column; gap: 3px; }
.demo .d-read .r-label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.demo .d-read .r-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.demo .d-read .r-value.v-mag { color: var(--cielo); }
.demo .d-read .r-value.v-obsc { color: var(--sol); }
.demo .d-read .r-value.v-phase { font-size: 1rem; color: var(--corona); }
.demo input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 7px; border-radius: 99px;
  background: linear-gradient(90deg, var(--cielo-dim), var(--sol), var(--corona));
  outline: none; cursor: pointer;
}
.demo input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--sol) 60%, var(--sol-deep));
  border: 2px solid #fff;
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.9);
  cursor: grab;
}
.demo input[type=range]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--sol); border: 2px solid #fff;
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.9);
}
.demo .d-caption { padding: 14px 24px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--ink-faint); }

/* ==========================================================================
   Diagrama umbra / penumbra
   ========================================================================== */
.diagram { margin: 30px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 10px; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram .d-cap { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-faint); text-align: center; padding: 8px 14px 12px; letter-spacing: 0.04em; }

/* ==========================================================================
   Flujo de arquitectura
   ========================================================================== */
.flow { display: flex; flex-direction: column; gap: 0; margin: 30px 0; }
.flow-step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 20px;
  padding: 20px 0;
  position: relative;
}
.flow-step::before { content: ''; position: absolute; left: 27px; top: 62px; bottom: -6px; width: 2px; background: var(--line); }
.flow-step:last-child::before { display: none; }
.flow-step .f-node {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background: rgba(255, 179, 71, 0.1);
  border: 1px solid var(--line-warm);
  box-shadow: 0 0 18px -4px rgba(255, 179, 71, 0.5);
}
.flow-step .f-body h4 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 5px; }
.flow-step .f-body h4 code { font-family: var(--font-mono); font-size: 0.82rem; color: var(--cielo); background: rgba(138, 182, 255, 0.1); padding: 2px 8px; border-radius: 6px; }
.flow-step .f-body p { color: var(--ink-dim); font-size: 0.94rem; max-width: 62ch; }

code.inline {
  font-family: var(--font-mono);
  font-size: 0.84em;
  color: var(--sol-bright);
  background: rgba(255, 179, 71, 0.09);
  border: 1px solid rgba(255, 179, 71, 0.18);
  padding: 2px 7px;
  border-radius: 6px;
}
pre.code-block {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 20px 0;
  color: var(--ink-dim);
}
pre.code-block .k { color: var(--cielo); }
pre.code-block .c { color: var(--ink-faint); font-style: italic; }
pre.code-block .n { color: var(--sol); }

/* ==========================================================================
   Regiones — lista de chips con recorrido
   ========================================================================== */
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 26px 0; }
.route .stop {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  padding: 9px 18px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: all 0.25s var(--ease);
  cursor: default;
}
.route .stop:hover { border-color: var(--line-warm); background: rgba(255, 179, 71, 0.1); transform: translateY(-2px); box-shadow: 0 6px 16px -6px rgba(255, 179, 71, 0.5); }
.route .stop.key { border-color: var(--line-warm); color: var(--sol-bright); }
.route .arrow { color: var(--corona); font-size: 1.1rem; }

/* ==========================================================================
   Pie de página
   ========================================================================== */
.site-foot {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 46px 24px 60px;
  background: linear-gradient(180deg, transparent, rgba(4, 5, 13, 0.9));
}
.site-foot .inner { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: space-between; }
.site-foot .f-brand { display: flex; align-items: center; gap: 12px; }
.site-foot .f-brand .fb-t { font-family: var(--font-display); font-size: 0.9rem; font-weight: 600; }
.site-foot .f-brand .fb-s { font-size: 0.74rem; color: var(--ink-faint); }
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot nav a { color: var(--ink-dim); text-decoration: none; font-size: 0.86rem; transition: color 0.2s; }
.site-foot nav a:hover { color: var(--sol-bright); }
.site-foot .f-note { width: 100%; font-size: 0.76rem; color: var(--ink-faint); font-family: var(--font-mono); }

/* ==========================================================================
   Revelado al hacer scroll
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

/* ==========================================================================
   Página interior — cabecera más compacta
   ========================================================================== */
.page-hero { max-width: var(--maxw); margin: 0 auto; padding: 70px 24px 46px; }
.page-hero .crumb { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.page-hero .crumb a { color: var(--cielo); text-decoration: none; }
.page-hero .crumb a:hover { color: var(--sol-bright); }
.page-hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 700; line-height: 1.08; letter-spacing: -0.01em; margin-bottom: 18px; }
.page-hero h1 .accent { color: var(--sol); text-shadow: 0 0 28px rgba(255, 179, 71, 0.4); }
.page-hero .lead { font-size: 1.12rem; color: var(--ink-dim); max-width: 62ch; }
.page-hero .lead strong { color: var(--ink); }

.pager { display: flex; justify-content: space-between; gap: 16px; margin: 50px 0 0; flex-wrap: wrap; }
.pager a {
  flex: 1 1 240px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 22px;
  background: var(--panel);
  transition: all 0.25s var(--ease);
}
.pager a:hover { border-color: var(--line-warm); transform: translateY(-3px); box-shadow: 0 10px 26px -10px rgba(255, 179, 71, 0.4); }
.pager .p-dir { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: 5px; }
.pager .p-title { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: 1rem; }
.pager a.next { text-align: right; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 56px; gap: 40px; }
  .eclipse-stage { margin: 0 auto; max-width: 340px; }
  .demo .demo-body { grid-template-columns: 1fr; }
  .demo .d-panel { border-left: none; border-top: 1px solid var(--line); }
  .chapter { grid-template-columns: 60px 1fr; }
  .chapter .ch-tags, .chapter .ch-arrow { display: none; }
  .chapter .ch-num { font-size: 2rem; }
}

@media (max-width: 720px) {
  .site-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: rgba(4, 5, 13, 0.97); border-bottom: 1px solid var(--line); padding: 12px 20px 18px; gap: 6px; display: none; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 14px; }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    margin-left: auto;
    width: 40px; height: 40px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
    color: var(--sol); font-size: 1.2rem; cursor: pointer;
  }
  .stat { flex: 1 1 46%; border-bottom: 1px solid var(--line); }
  .contact { grid-template-columns: 1fr; gap: 6px; }
}

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