/* ==========================================================================
   Portada «Experiencia 3D» (body.lx): requiere theme.css (html.x3)
   Escenario fijo (sticky) con el lienzo de escaños y paneles que pasan al lado.
   ========================================================================== */
/* Se respeta el relleno superior de main (igual que el pre-render): #view no se mueve al pintar la portada (CLS 0). */

.lx-stage { position: relative; margin-inline: calc(50% - 50vw); --pad: max(20px, calc(50vw - 590px)); }
/* La pista ocupa todo el escenario; el lienzo va fijo dentro de ella y se despide con el último panel */
.lx-gl { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.lx-canvas { position: sticky; top: 0; display: block; width: 100%; height: 100vh; opacity: 0; transition: opacity 900ms var(--out); }
.lx-stage.ready .lx-canvas { opacity: 1; }
.lx-nogl .lx-gl { display: none; }
.lx-hero, .lx-steps { position: relative; z-index: 1; padding-inline: var(--pad); }

/* ---------- portada ---------- */
.lx-hero {
  min-height: calc(100vh - 76px); padding-top: clamp(28px, 5vh, 56px); padding-bottom: clamp(28px, 5vh, 52px);
  display: grid; grid-template-columns: minmax(0, 620px) minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; column-gap: 48px;
}
.lx-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 clamp(28px, 5vh, 52px); font: 500 12px/1 var(--mono); color: var(--ink-2); }
.lx-meta span { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.03); }
.lx-meta span:empty { display: none; }
.lx-meta span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); border-color: rgba(242, 195, 91, 0.4); }
.lx-meta span:first-child::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(242, 195, 91, 0.18); }
.lx-head { display: contents; }
.lx-stage h1 { grid-column: 1; grid-row: 2; font-size: clamp(36px, 3.7vw, 60px); line-height: 1.02; letter-spacing: -0.04em; font-weight: 600; max-width: 16ch; margin: 0; }

/* Cuenta atrás: ficha de vidrio con cifras finas */
.lx-count {
  grid-column: 2; grid-row: 2; justify-self: end; align-self: start;
  display: grid; grid-template-columns: auto auto; align-items: end; column-gap: 14px; row-gap: 10px;
  padding: 16px 20px 16px 22px; border-radius: 20px; border: 1px solid var(--edge-2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)), rgba(10, 16, 31, 0.55);
  box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.lx-days { font: 250 clamp(64px, 6vw, 96px)/0.8 var(--mono); letter-spacing: -0.07em; color: var(--gold); font-variant-numeric: tabular-nums; }
.lx-days-l { font: 500 13px/1.25 var(--font); color: var(--ink-2); max-width: 7ch; padding-bottom: 4px; }
.lx-hms { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--edge); font: 400 12px/1 var(--mono); color: var(--muted); }
.lx-hms b { font-weight: 500; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }

.lx-foot { grid-column: 1; grid-row: 3; align-self: start; }
.lx-foot .lede { margin: 22px 0 0; max-width: 56ch; }
.lx-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.lx-foot .lx-counts { margin-top: 16px; } /* recuentos bajo los botones cuando la entradilla da el promedio (POR-01) */

/* Botones: píldoras con prensa física */
.lx-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px; border-radius: 999px; cursor: pointer; text-decoration: none;
  font: 550 14.5px/1 var(--font); letter-spacing: -0.01em; color: var(--ink);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--edge-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 160ms var(--out), background-color 180ms ease, border-color 180ms ease;
}
.lx-btn span { transition: transform 220ms var(--out); }
.lx-btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 14px 30px -14px rgba(242, 195, 91, 0.45); }
@media (hover: hover) and (pointer: fine) {
  .lx-btn:hover { border-color: rgba(242, 195, 91, 0.55); background: rgba(255, 255, 255, 0.07); }
  .lx-btn.primary:hover { background: #f6d07a; }
  .lx-btn[href^="#"]:hover span { transform: translateY(2px); }
  .lx-btn[href^="/"]:hover span { transform: translateX(3px); }
}
.lx-btn:active { transform: scale(0.97); }

/* Leyenda bajo el hemiciclo */
.lx-viz { grid-column: 2; grid-row: 4; justify-self: end; align-self: end; max-width: 560px; }
.lx-viz .lx-eyebrow { text-align: right; }
.lx-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.lx-legend li {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 9px; border-radius: 999px; cursor: default;
  border: 1px solid var(--edge); background: rgba(10, 16, 31, 0.55); font: 500 12.5px/1 var(--font); color: var(--ink-2);
  transition: border-color 160ms ease, color 160ms ease;
}
.lx-legend li i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.35); }
.lx-legend li b { font: 500 12.5px/1 var(--mono); color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .lx-legend li:hover { border-color: var(--c); color: var(--ink); } }

.lx-eyebrow { margin: 0; font: 500 11.5px/1.2 var(--mono); letter-spacing: 0.04em; color: var(--gold); text-transform: uppercase; }

/* Indicador de scroll: un punto que baja por un hilo (decorativo) */
.lx-hero::after {
  content: ""; position: absolute; left: var(--pad); bottom: 14px; width: 1px; height: 40px;
  background: linear-gradient(var(--gold), var(--gold)) 0 0 / 1px 10px no-repeat, rgba(176, 198, 255, 0.18);
  animation: lx-cue 2200ms var(--inout) infinite;
}
@keyframes lx-cue { 0% { background-position: 0 -10px, 0 0; } 70%, 100% { background-position: 0 40px, 0 0; } }

/* ---------- pasos de la secuencia ---------- */
.lx-steps { padding-bottom: 12vh; }
.lx-step { min-height: 100vh; display: flex; align-items: center; }
.lx-panel {
  position: relative; width: min(470px, 100%); padding: 26px 26px 24px; border-radius: 24px;
  border: 1px solid var(--edge); box-shadow: var(--shadow);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)), rgba(10, 16, 31, 0.84);
  opacity: 0.3; transform: translate3d(0, 18px, 0) scale(0.985);
  transition: opacity 520ms var(--out), transform 720ms var(--out), border-color 400ms ease;
}
.lx-step.on .lx-panel { opacity: 1; transform: none; border-color: var(--edge-2); }
.lx-panel h2 { font-size: clamp(22px, 1.9vw, 28px); line-height: 1.12; letter-spacing: -0.03em; margin: 10px 0 6px; }
.lx-panel .sub { font-family: var(--mono); font-size: 11.5px; margin: 0 0 4px; }

/* Camino a la mayoría */
.lx-path { margin-top: 18px; display: grid; gap: 18px; }
.lx-path-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--ink-2); }
.lx-path-head b { font: 400 28px/1 var(--mono); letter-spacing: -0.05em; color: var(--ink); }
.lx-path-bar { position: relative; margin-top: 8px; height: 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.05); }
.lx-path-fill { display: flex; height: 100%; gap: 2px; border-radius: 99px; overflow: hidden; transform-origin: 0 50%; }
.lx-step.on .lx-path-fill { animation: lx-grow 1000ms var(--out) both; }
@keyframes lx-grow { from { transform: scaleX(0.04); } }
.lx-path-fill span { height: 100%; }
.lx-path-176 { position: absolute; top: -6px; bottom: -6px; width: 0; border-left: 1px dashed var(--gold); }
.lx-path-176 em { position: absolute; top: -16px; left: -11px; font: 500 10.5px/1 var(--mono); color: var(--gold); }
.lx-path-gap { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.lx-path-gap b { color: var(--ink); font-weight: 600; }
.lx-path-note { margin: 4px 0 0; padding-top: 14px; border-top: 1px solid var(--edge); font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.lx-path-note b { color: var(--ink); }
.lx-path-note a { color: var(--gold); text-decoration: none; }
.lx-path-note a:hover { text-decoration: underline; }

/* La carrera */
.lx-race { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 9px; }
.lx-race li { display: grid; grid-template-columns: 74px minmax(0, 1fr) 58px 42px; align-items: center; gap: 10px; font-size: 13.5px; }
.lx-race-id { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-race-bar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.045); overflow: hidden; }
.lx-race-bar span { display: block; height: 100%; width: calc(var(--w) * 100%); border-radius: 99px; background: var(--c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); transform-origin: 0 50%; }
.lx-step.on .lx-race-bar span { animation: lx-grow 900ms var(--out) both; animation-delay: calc(var(--i) * 50ms); }
.lx-race-v { text-align: right; font: 500 15px/1 var(--mono); letter-spacing: -0.03em; }
.lx-race-v small { font-size: 11px; color: var(--muted); margin-left: 1px; }
.lx-dv { text-align: right; font: 400 11.5px/1 var(--mono); color: var(--muted); }

/* ¿Dónde voto? */
.lx-vote label { display: block; margin-top: 16px; font: 500 12px/1 var(--mono); color: var(--muted); }
.lx-vote-row { display: flex; gap: 8px; margin-top: 8px; }
.lx-vote input {
  flex: 1; min-width: 0; height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--edge-2);
  background: rgba(5, 8, 15, 0.6); color: var(--ink); font: 500 20px/1 var(--mono); letter-spacing: 0.14em;
  transition: border-color 160ms ease;
}
.lx-vote input::placeholder { color: #3c4a68; }
.lx-vote input:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 195, 91, 0.2); }
.lx-vote .lx-btn { height: 52px; border-radius: 14px; }
.lx-vote .sub { margin-top: 12px; }

/* ---------- debajo del escenario ---------- */
#lx-below { position: relative; z-index: 1; }
.lx-bento { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; margin-top: 12px; }
.lx-tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-height: 168px; padding: 22px 24px; border-radius: 22px;
  text-decoration: none; color: var(--ink); border: 1px solid var(--edge); box-shadow: var(--shadow);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012)), var(--glass);
}
.lx-tile:first-child { background: radial-gradient(90% 140% at 100% 0%, rgba(242, 195, 91, 0.1), transparent 60%), linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012)), var(--glass); }
.lx-tile h2 { font-size: clamp(22px, 2vw, 30px); letter-spacing: -0.035em; margin: 10px 0 0; max-width: 16ch; }
.lx-tile > span { align-self: flex-end; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--edge-2); font-size: 18px; transition: transform 220ms var(--out), background-color 200ms ease, color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .lx-tile:hover { border-color: var(--edge-2); } .lx-tile:hover > span { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); transform: translateX(3px); } }
.lx-tile:active { scale: 0.985; }
/* Test político: tile destacado a doble altura en la columna ancha */
.lx-tile-test { grid-row: span 2; justify-content: space-between; }
html.x3 .lx-tile-test h2 { font-size: clamp(30px, 3.1vw, 44px); line-height: 1.04; max-width: 13ch; margin-top: 0; }
.lx-tile-test > .lx-eyebrow { position: relative; z-index: 1; }
.lx-tt-viz { position: absolute; top: 22px; right: 24px; width: clamp(110px, 13vw, 170px); height: auto; opacity: 0.9; pointer-events: none; }
.lx-tt-viz rect { fill: rgba(255, 255, 255, 0.02); stroke: var(--edge-2); }
.lx-tt-viz path { stroke: var(--edge-2); stroke-dasharray: 2 3; }
.lx-tt-viz circle { fill: var(--ink-2); opacity: 0.55; }
.lx-tt-viz circle.you { fill: none; stroke: var(--gold); stroke-width: 2; opacity: 1; }
.lx-tt-viz circle.you { transform-origin: 52px 48px; transition: transform 300ms var(--out); }
@media (hover: hover) and (pointer: fine) { .lx-tile-test:hover .lx-tt-viz circle.you { transform: translate(6px, 4px); } }
.lx-tile-sub { margin: 12px 0 0; max-width: 46ch; color: var(--ink-2); line-height: 1.55; }
.lx-tile-meta { margin: 18px 0 0; font-family: var(--mono, "Geist Mono", ui-monospace, monospace); font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.lx-tile-meta b { color: var(--gold); font-weight: 500; font-size: 15px; }
.lx-tile-meta i { font-style: normal; opacity: 0.5; margin: 0 4px; }
.lx-tile-meta span { white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .lx-tile-test:hover { border-color: rgba(242, 195, 91, 0.45); } }

/* «Qué dicen las encuestas esta semana» (AdSense D): el mismo nodo en el pre-render y en la vista (viewGeneral) */
.semana-card p { margin: 0; max-width: 72ch; color: var(--ink-2); line-height: 1.6; }
.semana-card .semana-lede { color: var(--ink); font-size: 16.5px; }
.semana-list { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 8px; max-width: 72ch; }
.semana-list li { color: var(--ink-2); line-height: 1.55; }
.semana-card .semana-note { margin-top: 16px; }
.semana-card a { color: var(--ink); text-underline-offset: 3px; }
.semana-card, .semana-list li { overflow-wrap: break-word; }

.lx-veda { padding: 18px 20px; border-radius: 18px; border: 1px solid rgba(242, 195, 91, 0.35); background: rgba(10, 16, 31, 0.8); max-width: 440px; }
.lx-veda b { color: var(--gold); }
.lx-veda p { margin: 6px 0 0; color: var(--ink-2); }

/* ---------- entrada de la portada (animación CSS: el texto nunca depende de que cargue el JS) ---------- */
.lx-meta, .lx-stage h1, .lx-count, .lx-foot, .lx-viz { animation: lx-in 900ms var(--out) both; }
.lx-stage h1 { animation-delay: 50ms; }
.lx-foot { animation-delay: 140ms; }
.lx-count { animation-delay: 240ms; }
.lx-viz { animation-delay: 900ms; }
@keyframes lx-in { from { opacity: 0; transform: translate3d(0, 14px, 0); } }

/* ---------- pantallas medianas y estrechas: una columna; la escena aparece bajo el texto ---------- */
@media (max-width: 1099px) {
  .lx-hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; min-height: 0; }
  .lx-meta, .lx-stage h1, .lx-count, .lx-foot, .lx-viz { grid-column: 1; grid-row: auto; }
  .lx-stage h1 { max-width: 20ch; }
  .lx-count { justify-self: start; margin-top: 22px; }
  .lx-viz { justify-self: stretch; margin-top: 64vh; max-width: none; }
  .lx-viz .lx-eyebrow { text-align: left; }
  .lx-legend { justify-content: flex-start; }
  .lx-hero::after { display: none; }
  .lx-step { align-items: flex-end; padding-bottom: 7vh; }
  /* Los paneles pasan por encima de la escena: opacos para no mezclarse con los escaños */
  .lx-panel { width: 100%; max-width: 560px; opacity: 1; background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012)), rgba(10, 16, 31, 0.96); }
}
@media (max-width: 760px) {
  .lx-meta { gap: 6px; font-size: 11px; margin-bottom: 24px; }
  .lx-meta span { padding: 7px 10px; }
  .lx-stage h1 { font-size: clamp(30px, 8.6vw, 40px); }
  .lx-days { font-size: 64px; }
  .lx-panel { padding: 20px 18px; border-radius: 20px; }
  .lx-race li { grid-template-columns: 62px minmax(0, 1fr) 52px 38px; gap: 8px; }
  .lx-bento { grid-template-columns: 1fr; }
  .lx-tile { min-height: 132px; }
  .lx-tile-test { grid-row: auto; gap: 22px; }
  html.x3 .lx-tile-test h2 { font-size: clamp(26px, 7.4vw, 32px); }
  .lx-tt-viz { width: 84px; top: 18px; right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .lx-hero::after { animation: none; }
  .lx-panel { transform: none; transition: opacity 200ms ease; }
  .lx-step.on .lx-path-fill, .lx-step.on .lx-race-bar span { animation: none; }
  .lx-meta, .lx-stage h1, .lx-count, .lx-foot, .lx-viz { animation: none; }
  .lx-canvas { transition: none; }
}
@media print { .lx-gl, .lx-hero::after { display: none; } .lx-panel { opacity: 1; transform: none; } }
@media (max-width: 420px) { .lx-tile-meta { gap: 4px 14px; } .lx-tile-meta i { display: none; } }
