/* ============================================================
   MiVisita365 — landing
   Mundo visual: "sala de control" nocturna. La semántica de
   estados de la visita (programada/en curso/completada) es el
   hilo estructural de toda la página.
   ============================================================ */

:root {
  --ink:      #0d0f1e;
  --ink-2:    #14172b;
  --ink-3:    #1b1f38;
  --line:     rgba(255, 255, 255, 0.09);
  --line-2:   rgba(255, 255, 255, 0.14);

  --purple:      #7367f0;   /* marca / programada */
  --purple-br:   #8b80ff;
  --purple-deep: #5a4fd6;
  --live:        #28c76f;   /* en sitio / completada */
  --amber:       #ff9f43;   /* en curso */

  --text:    #eeedf7;
  --muted:   #9a97b8;
  --muted-2: #6f6c8f;

  --maxw: 1140px;
  --radius: 18px;
  --radius-sm: 12px;

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Textura de fondo: grilla de mapa muy tenue + halo púrpura */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 78%);
  z-index: 0;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple-br);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 4px rgba(40, 199, 111, 0.18);
}

/* ---------------- Nav ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(13, 15, 30, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; display: block; }
.brand b { color: var(--purple-br); font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links .lnk { color: var(--muted); font-size: 0.92rem; transition: color 0.2s; }
.nav-links .lnk:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 10px; }

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 10px;
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s, border-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 8px 26px -10px rgba(115, 103, 240, 0.9); }
.btn-primary:hover { background: var(--purple-br); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--purple-br); color: var(--purple-br); transform: translateY(-2px); }
.btn-lg { padding: 15px 26px; font-size: 1rem; border-radius: 12px; }

.nav-toggle { display: none; }

/* ---------------- Hero ---------------- */
.hero { position: relative; z-index: 1; padding: 74px 0 40px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 54px;
  align-items: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5.2vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 20px 0 20px;
  text-wrap: balance;
}
.hero h1 .accent {
  background: linear-gradient(100deg, var(--purple-br), var(--live));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede { font-size: 1.15rem; color: var(--muted); max-width: 33ch; }
.hero-cta { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-note { margin-top: 20px; font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted-2); letter-spacing: 0.03em; }

/* ---- Consola / mapa en vivo (signature) ---- */
.console {
  position: relative;
  background: linear-gradient(160deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255,255,255,0.04);
}
.console-bar { display: flex; align-items: center; gap: 8px; padding: 4px 6px 14px; }
.console-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted-2); opacity: 0.5; }
.console-bar .title { margin-left: 8px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.08em; }
.console-bar .badge-live {
  margin-left: auto; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em;
  color: var(--live); border: 1px solid rgba(40,199,111,0.35); border-radius: 20px; padding: 3px 10px;
  display: inline-flex; align-items: center; gap: 6px;
}
.console-bar .badge-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: pulse 1.8s infinite; }

.map { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: #0a0c18; aspect-ratio: 4 / 3.05; }
.map svg { width: 100%; height: 100%; display: block; }

/* tarjeta flotante de check-in */
.checkin-card {
  position: absolute;
  left: 14px; bottom: 14px;
  background: rgba(20, 23, 43, 0.92);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 11px 13px;
  backdrop-filter: blur(6px);
  min-width: 210px;
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.8);
}
.checkin-card .ck-top { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600; }
.checkin-card .ck-top .pin { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px rgba(40,199,111,0.2); }
.checkin-card .ck-sub { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); margin-top: 4px; }
.checkin-card .ck-coord { font-family: var(--font-mono); font-size: 0.66rem; color: var(--purple-br); margin-top: 6px; }

/* ---------------- franja de métricas ---------------- */
.stats { position: relative; z-index: 1; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 26px;
}
.stat { background: var(--ink-2); padding: 24px 22px; }
.stat .num { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; letter-spacing: -0.02em; }
.stat .lbl { color: var(--muted); font-size: 0.86rem; margin-top: 3px; }
.stat.c-purple .num { color: var(--purple-br); }
.stat.c-amber .num { color: var(--amber); }
.stat.c-live .num { color: var(--live); }

/* ---------------- secciones ---------------- */
section { position: relative; z-index: 1; }
.section-pad { padding: 84px 0; }
.section-head { max-width: 640px; margin-bottom: 46px; }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 14px 0 12px;
  text-wrap: balance;
}
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---- Cómo funciona (secuencia real) ---- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px 26px;
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--purple-br);
  letter-spacing: 0.1em;
}
.step h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.24rem; margin: 14px 0 9px; letter-spacing: -0.01em; }
.step p { color: var(--muted); font-size: 0.96rem; }
.step .st-icon { position: absolute; top: 24px; right: 24px; width: 26px; height: 26px; color: var(--muted-2); }
.step .st-tag { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line-2); }
.st-tag .d { width: 7px; height: 7px; border-radius: 50%; }
.st-tag.programada { color: var(--purple-br); } .st-tag.programada .d { background: var(--purple); }
.st-tag.encurso { color: var(--amber); } .st-tag.encurso .d { background: var(--amber); }
.st-tag.completada { color: var(--live); } .st-tag.completada .d { background: var(--live); }

/* connector line */
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 40px; right: -12px;
  width: 24px; height: 1px;
  background: var(--line-2);
}

/* ---- Features (dos audiencias) ---- */
.aud-tabs { display: flex; gap: 10px; margin-bottom: 30px; flex-wrap: wrap; }
.aud-tab {
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  background: var(--ink-2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 40px; padding: 9px 20px; cursor: pointer;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 9px;
}
.aud-tab .d { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.aud-tab[aria-selected="true"] { color: var(--text); border-color: var(--purple-br); background: rgba(115,103,240,0.12); }

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: transform 0.18s ease, border-color 0.2s;
}
.feat:hover { transform: translateY(-4px); border-color: var(--line-2); }
.feat .ic {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(115,103,240,0.14); color: var(--purple-br);
  margin-bottom: 15px;
}
.feat .ic svg { width: 21px; height: 21px; }
.feat h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; margin-bottom: 7px; letter-spacing: -0.01em; }
.feat p { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.feat-panel[hidden] { display: none; }

/* ---- Banda "en vivo" (reasignación / tiempo real) ---- */
.live-band { background: linear-gradient(150deg, var(--ink-2), var(--ink)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.live-list { list-style: none; margin-top: 26px; display: grid; gap: 16px; }
.live-list li { display: flex; gap: 14px; align-items: flex-start; }
.live-list .chk { flex: none; width: 24px; height: 24px; border-radius: 7px; background: rgba(40,199,111,0.15); color: var(--live); display: grid; place-items: center; margin-top: 1px; }
.live-list .chk svg { width: 14px; height: 14px; }
.live-list strong { font-weight: 600; }
.live-list span { color: var(--muted); font-size: 0.94rem; }

/* mini timeline card */
.timeline {
  background: var(--ink-3);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 30px 70px -40px rgba(0,0,0,0.9);
}
.tl-row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-row .tl-pin { flex: none; width: 11px; height: 11px; border-radius: 50%; }
.tl-row .tl-body { flex: 1; }
.tl-row .tl-name { font-weight: 600; font-size: 0.95rem; }
.tl-row .tl-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.tl-row .tl-state { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; padding: 3px 9px; border-radius: 20px; }
.s-programada { background: rgba(115,103,240,0.16); color: var(--purple-br); }
.s-encurso { background: rgba(255,159,67,0.16); color: var(--amber); }
.s-completada { background: rgba(40,199,111,0.16); color: var(--live); }

/* ---------------- CTA final ---------------- */
.cta-final { text-align: center; }
.cta-card {
  background: radial-gradient(ellipse 80% 130% at 50% -10%, rgba(115,103,240,0.28), transparent 60%), var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 26px;
  padding: 64px 32px;
}
.cta-card h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; margin-bottom: 14px; text-wrap: balance; }
.cta-card p { color: var(--muted); font-size: 1.08rem; max-width: 48ch; margin: 0 auto 30px; }
.cta-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------------- Footer ---------------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer .brand { font-size: 1.02rem; }
.footer .foot-links { display: flex; gap: 22px; }
.footer .foot-links a { color: var(--muted); font-size: 0.9rem; transition: color 0.2s; }
.footer .foot-links a:hover { color: var(--text); }
.footer .copy { color: var(--muted-2); font-size: 0.82rem; font-family: var(--font-mono); }

/* ---------------- animaciones ---------------- */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(40,199,111,0.5); }
  70% { box-shadow: 0 0 0 12px rgba(40,199,111,0); }
  100% { box-shadow: 0 0 0 0 rgba(40,199,111,0); }
}
.route-line { stroke-dasharray: 8 7; animation: dash 22s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -600; } }
.ping { transform-origin: center; transform-box: fill-box; animation: ping 2.2s ease-out infinite; }
@keyframes ping { 0% { r: 6; opacity: 0.7; } 80%,100% { r: 30; opacity: 0; } }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero p.lede { max-width: none; }
  .live-grid { grid-template-columns: 1fr; gap: 34px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .step:not(:last-child)::after { display: none; }
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .feat-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-cta .btn span.long { display: none; }
  .hero { padding-top: 48px; }
  .section-pad { padding: 60px 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
