/* ==========================================================================
   SIMIAN SAGE — LANDING v2.1: más vida
   Puntos del hero, tarjetas de ediciones, pilares, réplica del dashboard,
   Simian Sage Recomienda y fondos de nodos en las secciones oscuras.
   ========================================================================== */

/* ---------- Hero: puntos de las ediciones con parpadeo lento ---------- */
.dot { --c: 255, 255, 255; animation: dot-breathe 3.6s ease-in-out infinite; }
.dot-blue { --c: 37, 99, 235; box-shadow: none; }
.dot-orange { --c: 255, 138, 0; animation-delay: 1.2s; }
.dot-red { --c: 255, 32, 85; animation-delay: 2.4s; }
@keyframes dot-breathe {
  0%, 100% { opacity: 0.35; box-shadow: 0 0 0 0 rgba(var(--c), 0); }
  50% { opacity: 1; box-shadow: 0 0 0 5px rgba(var(--c), 0.18), 0 0 14px 2px rgba(var(--c), 0.65); }
}

/* ---------- Ediciones: más vida ---------- */
.edition {
  --mx: 50%; --my: 0%;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s, border-color .35s;
}
.edition-blue { --accent-rgb: 37, 99, 235; }
.edition-orange { --accent-rgb: 255, 138, 0; }
.edition-red { --accent-rgb: 255, 32, 85; }
.edition::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(var(--accent-rgb), 0.10), transparent 60%);
}
.edition:hover { transform: translateY(-6px); border-color: rgba(var(--accent-rgb), 0.35); box-shadow: 0 2px 4px rgba(16,24,40,.04), 0 24px 48px -18px rgba(var(--accent-rgb), 0.35); }
.edition:hover::after { opacity: 1; }
.edition > * { position: relative; z-index: 1; }
.edition::before {
  z-index: 2;
  background: linear-gradient(90deg, var(--accent) 0%, rgba(var(--accent-rgb), .3) 40%, var(--accent) 50%, rgba(var(--accent-rgb), .3) 60%, var(--accent) 100%);
  background-size: 250% 100%;
  animation: accent-flow 6s linear infinite;
}
@keyframes accent-flow { to { background-position: -250% 0; } }

/* La S de cada tarjeta se dibuja al aparecer y al pasar el ratón */
.edition-mark { stroke-dasharray: 1600; stroke-dashoffset: 0; }
.edition.is-visible .edition-mark { animation: mark-draw 1.6s cubic-bezier(.65,0,.35,1) .2s both; }
.edition:hover .edition-mark { animation: mark-draw-hover 1.2s cubic-bezier(.65,0,.35,1) both; }
@keyframes mark-draw { from { stroke-dashoffset: 1600; } to { stroke-dashoffset: 0; } }
@keyframes mark-draw-hover { from { stroke-dashoffset: 1600; } to { stroke-dashoffset: 0; } }

/* Botón y panel de características */
.edition-more {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  margin: -8px 0 18px; padding: 6px 0; border: 0; background: none; cursor: pointer;
  font: 600 14px/1.2 var(--font); color: var(--text);
}
.edition-more .i { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: rgba(var(--accent-rgb), .12); color: var(--accent); transition: transform .3s; }
.edition-more[aria-expanded="true"] .i { transform: rotate(45deg); }
.edition-more:hover { color: var(--accent); }
.edition-features {
  margin: 0 0 22px; padding: 16px 18px; border-radius: var(--radius-sm);
  background: rgba(var(--accent-rgb), .05); border: 1px solid rgba(var(--accent-rgb), .18);
  animation: features-in .35s ease both;
}
@keyframes features-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.edition .features-label { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.edition-features ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.edition-features li { position: relative; padding-left: 16px; font-size: 14px; color: var(--text); }
.edition-features li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- Pilares: animación de orden ---------- */
.pillars-wrap { position: relative; }
.pillars-line { position: absolute; left: var(--gutter); right: var(--gutter); top: 0; height: 2px; background: var(--line); overflow: hidden; }
.pillars-line span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--orange), var(--red)); transform: scaleX(0); transform-origin: left; }
.pillars-wrap .pillars { padding-top: 34px; }
.pillar-n { display: block; font-size: 12px; font-weight: 600; letter-spacing: .14em; color: var(--muted); margin-bottom: 14px; }
.js .pillars-wrap .pillar { opacity: 0; transform: translateY(16px); }
.pillars-wrap.is-in .pillars-line span { transform: scaleX(1); transition: transform 1.6s cubic-bezier(.65,0,.35,1); }
.js .pillars-wrap.is-in .pillar { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.pillars-wrap.is-in .pillar:nth-child(1) { transition-delay: .05s; }
.pillars-wrap.is-in .pillar:nth-child(2) { transition-delay: .35s; }
.pillars-wrap.is-in .pillar:nth-child(3) { transition-delay: .65s; }
.pillars-wrap.is-in .pillar:nth-child(4) { transition-delay: .95s; }
.pillars-wrap.is-in .pillar:nth-child(5) { transition-delay: 1.25s; }
.pillar .i-lg { transition: color .3s, transform .3s; }
.pillar:hover .i-lg { color: var(--blue); transform: translateY(-2px); }

/* ---------- Réplica del dashboard ---------- */
.live-dash { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(15, 23, 42, 0.35); }
.live-body { padding: 16px; background: #f6f8fb; display: grid; gap: 12px; }
.dash-banner {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 26px 26px 24px; border-radius: 14px; color: #fff;
  background: #0a1f63 url("../assets/img/banner-essential.webp") center / cover no-repeat;
}
.dash-banner::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(5, 16, 54, .92) 0%, rgba(5, 16, 54, .55) 55%, rgba(5, 16, 54, .2) 100%); }
/* Nodos que se encienden sobre el circuito del fondo */
.dash-banner::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 60% 24%, rgba(140, 200, 255, .9) 0 2px, transparent 6px),
    radial-gradient(circle at 69% 36%, rgba(140, 200, 255, .9) 0 2px, transparent 6px),
    radial-gradient(circle at 72% 54%, rgba(140, 200, 255, .9) 0 2px, transparent 6px),
    radial-gradient(circle at 79% 63%, rgba(140, 200, 255, .9) 0 2px, transparent 6px);
  animation: nodes-glow 3.2s ease-in-out infinite;
}
@keyframes nodes-glow { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.dash-hello { font-size: clamp(19px, 2vw, 24px); font-weight: 600; letter-spacing: -.01em; }
.dash-msg { margin-top: 8px; font-size: 14.5px; color: rgba(255,255,255,.86); min-height: 2.6em; max-width: 46ch; }
.dash-msg span { display: inline-block; transition: opacity .4s ease, transform .4s ease; }
.dash-msg span.is-out { opacity: 0; transform: translateY(6px); }
.dash-reco {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 8px 12px;
  border: 1px solid rgba(147, 197, 253, .45); border-radius: 8px; background: rgba(15, 35, 100, .45);
  font-size: 12px; font-weight: 600; letter-spacing: .04em; color: #93c5fd;
}
.dash-reco .i { width: 14px; height: 14px; }
.dash-reco b { font-weight: 600; }
.dash-brand { display: flex; flex-direction: column; align-items: flex-end; flex: none; text-align: right; }
.dash-brand svg { width: 30px; height: 30px; color: #fff; margin-bottom: 8px; }
.dash-brand strong { font-size: 13px; letter-spacing: .14em; font-weight: 600; }
.dash-brand small { font-size: 8.5px; letter-spacing: .4em; color: rgba(255,255,255,.75); }
.dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi { padding: 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.kpi span { display: block; font-size: 10px; font-weight: 600; letter-spacing: .12em; color: var(--muted); }
.kpi strong { display: block; margin-top: 6px; font-size: clamp(20px, 2vw, 26px); font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi strong span { display: inline; font-size: inherit; font-weight: inherit; letter-spacing: inherit; color: inherit; }
.kpi-money strong { color: #059669; }
.live-dash figcaption { padding: 8px 16px 10px; font-size: 12px; color: var(--muted); text-align: right; background: #f6f8fb; }

/* ---------- Simian Sage Recomienda ---------- */
.reco { margin-top: clamp(56px, 8vw, 96px); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.reco h3 { font-size: clamp(26px, 3vw, 34px); }
.reco-copy > p:not(.eyebrow) { margin-top: 16px; color: var(--muted); }
.reco .checks li span { color: var(--text); }
.reco-note { font-size: 14px; }
.reco-panel { border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(15, 23, 42, .4); }
.reco-head {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 20px 22px; color: #fff;
  background: linear-gradient(120deg, #0a1638 0%, #0c2468 60%, #10308a 100%);
}
.reco-mark { width: 30px; height: 30px; color: #fff; }
.reco-head strong { display: block; font-size: 15px; letter-spacing: .06em; }
.reco-head div > span { font-size: 12.5px; color: rgba(255,255,255,.75); }
.reco-live { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(96, 165, 250, .6); color: #93c5fd; font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.reco-live i { width: 7px; height: 7px; border-radius: 50%; background: #60a5fa; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: .35; box-shadow: 0 0 0 0 rgba(96,165,250,.6); } 50% { opacity: 1; box-shadow: 0 0 0 5px rgba(96,165,250,0); } }
.reco-tabs { display: flex; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.reco-tabs::-webkit-scrollbar { display: none; }
.reco-tabs button {
  flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font: 600 12px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  transition: background .2s, color .2s, border-color .2s;
}
.reco-tabs button b { font-weight: 600; color: inherit; opacity: .8; }
.reco-tabs button[aria-selected="true"] { background: rgba(37, 99, 235, .08); border-color: rgba(37, 99, 235, .35); color: var(--blue); }
.reco-card { margin: 16px 18px 4px; padding: 18px; border-radius: 12px; border: 1px solid var(--line); min-height: 236px; transition: opacity .35s ease, transform .35s ease; }
.reco-card.is-out { opacity: 0; transform: translateX(10px); }
.reco-card-top { display: flex; justify-content: space-between; align-items: center; }
.reco-chip { padding: 4px 9px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; }
.reco-chip.is-finanzas { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.reco-chip.is-estrategia { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
.reco-id { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.reco-card h4 { margin: 14px 0 0; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.reco-card p { margin-top: 8px; font-size: 14px; color: var(--muted); }
.reco-card .reco-rec { display: flex; gap: 8px; color: var(--blue); font-style: italic; }
.reco-rec .i { width: 16px; height: 16px; margin-top: 2px; }
.reco-action { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 8px 12px; border-radius: 8px; background: var(--paper-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.reco-action .i { width: 14px; height: 14px; }
.reco-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px 16px; font-size: 12.5px; color: var(--muted); }
.reco-foot i { width: 7px; height: 7px; border-radius: 50%; background: #10b981; }

/* Módulos: ahora 10 */
.modules { grid-template-columns: repeat(5, 1fr); }
.module { transition: background .25s; }
.module:hover { background: #f8fafe; }
.module-accent { background: linear-gradient(135deg, rgba(37,99,235,.07), #fff 70%); }

/* ---------- Secciones oscuras con nodos animados ---------- */
.section-dark { position: relative; overflow: hidden; isolation: isolate; }
.nodes-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.section-dark > .container { position: relative; }
.section-dark .step, .section-dark .trust-item { background: rgba(14, 18, 24, .78); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); transition: border-color .3s, transform .3s; }
.section-dark .step:hover, .section-dark .trust-item:hover { border-color: rgba(255,255,255,.22); transform: translateY(-3px); }

/* ---------- Responsive de lo nuevo ---------- */
@media (max-width: 1080px) {
  .modules { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .reco { grid-template-columns: 1fr; }
  .pillars-line { display: none; }
  .pillars-wrap .pillars { padding-top: 0; }
}
@media (max-width: 640px) {
  .dash-banner { padding: 20px; }
  .dash-brand { display: none; }
  .dash-kpis { grid-template-columns: 1fr 1fr; }
  .modules { grid-template-columns: 1fr 1fr; }
  .module { padding: 16px 14px; }
  .reco-card { min-height: 0; margin: 14px 14px 4px; }
  .reco-head { padding: 16px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .dot, .edition::before, .dash-banner::after, .reco-live i { animation: none !important; }
  .dot { opacity: 1; }
  .edition-mark { animation: none !important; }
  .edition:hover { transform: none; }
  .js .pillars-wrap .pillar { opacity: 1; transform: none; }
  .pillars-line span { transform: scaleX(1); }
}
