/* Livestream MX · Live-stream (página dinámica, mismo lenguaje que css/fm.css de Foto-Memoria)
   Escenas ligadas al scroll que mueve js/ls.js con variables de CSS:
   1 portada → multiview · 2 modalidades con selector · 3 bonding (5 enlaces, uno cae, la nube reparte) · 6 galería de lado. */
.lv { --night: #05080f; --tally: #e5322d; --tally-g: #22c55e; }
.lv h1 em, .lv h2 em, .lv p em { font-style: normal; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lv .kicker { display: block; margin-bottom: 14px; }
.lv .h2 { font-size: clamp(36px, 4.6vw, 68px); max-width: 980px; text-wrap: balance; }

/* ---------- 1 · Portada → laptop (toma sobre el hombro) ---------- */
.lv-hero { position: relative; height: 460vh; background: var(--night); }
.lv-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.lv-scene { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; will-change: transform; user-select: none; }
/* La foto se deforma en perspectiva hasta las 4 esquinas de la pantalla (matrix3d en js/ls.js) */
.lv-shot { position: absolute; left: 0; top: 0; overflow: hidden; background: var(--night); transform-origin: 0 0; will-change: transform, width, height; z-index: 1; container-type: size; }
.lv-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; will-change: transform; }
.lv-rec { position: absolute; left: var(--gutter); top: max(90px, 12vh); display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; letter-spacing: .14em; color: #fff; background: rgba(var(--navy-deep-rgb), .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 8px 14px; border-radius: 999px; }
.lv-rec i { width: 9px; height: 9px; border-radius: 50%; background: var(--tally); box-shadow: 0 0 12px var(--tally); animation: lv-blink 1.4s ease-in-out infinite; }
.lv-rec b { font-weight: 500; color: rgba(var(--white-rgb), .75); }
@keyframes lv-blink { 50% { opacity: .25; } }
.lv-player { position: absolute; inset: 0; opacity: 0; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; padding: 3.2cqh 2.6cqw; background: linear-gradient(180deg, rgba(0, 0, 0, .45), transparent 22%, transparent 72%, rgba(0, 0, 0, .6)); font-family: var(--sans, inherit); color: #fff; }
.lv-pl-top { display: flex; justify-content: space-between; align-items: center; font-size: 3.2cqh; font-weight: 600; }
.lv-pl-live { display: inline-flex; align-items: center; gap: .6em; background: var(--tally); padding: .25em .7em; border-radius: .35em; letter-spacing: .06em; }
.lv-pl-live i { width: .55em; height: .55em; border-radius: 50%; background: #fff; animation: lv-blink 1.4s ease-in-out infinite; }
.lv-pl-views { background: rgba(0, 0, 0, .55); padding: .25em .7em; border-radius: .35em; font-weight: 500; }
.lv-pl-bar { display: flex; align-items: center; gap: 2cqw; font-size: 3cqh; font-weight: 600; }
.lv-pl-play { width: 0; height: 0; border-left: 1.6cqh solid #fff; border-top: 1cqh solid transparent; border-bottom: 1cqh solid transparent; }
.lv-pl-track { flex: 1; height: .9cqh; min-height: 2px; border-radius: 99px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.lv-pl-track i { display: block; height: 100%; width: 100%; background: var(--tally); }
.lv-pl-hd { border: 1px solid rgba(255, 255, 255, .8); border-radius: .3em; padding: 0 .35em; font-size: .8em; }
.lv-veil { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(var(--navy-deep-rgb), .35) 0%, rgba(var(--navy-deep-rgb), 0) 25%, rgba(var(--navy-deep-rgb), 0) 45%, rgba(var(--navy-deep-rgb), .88) 100%); }
.lv-cap { position: absolute; z-index: 3; left: 0; right: 0; bottom: max(10vh, 80px); padding: 0 var(--gutter); color: var(--bg-light); text-align: center; pointer-events: none; }
.lv-cap > div { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 var(--gutter); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lv-cap .kicker { color: var(--orange); margin: 0; }
.lv-cap h1, .lv-cap p.display { font-size: clamp(38px, 6vw, 96px); margin: 0; line-height: 1; text-shadow: 0 2px 40px rgba(var(--navy-deep-rgb), .6); text-wrap: balance; }
.lv-cap em { text-shadow: none; }
.lv-cap .c2, .lv-cap .c3 { opacity: 0; }
.lv-cap .c3 .btn-row { justify-content: center; pointer-events: auto; }
.lv-hint { position: absolute; z-index: 3; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: rgba(var(--white-rgb), .8); }
.lv-hint i { width: 1px; height: 30px; background: linear-gradient(rgba(var(--white-rgb), .9), rgba(var(--white-rgb), 0)); animation: lv-drop 1.8s infinite; }
@keyframes lv-drop { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@media (max-width: 700px) {
  .lv-cap { bottom: 9vh; }
  .lv-cap .c3 .btn-row { flex-direction: column; }
  .lv-rec { font-size: 11px; padding: 6px 11px; }
}

.lv-lead { padding-block: 130px 40px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.lv-lead .lead { font-family: var(--display); font-size: clamp(24px, 2.8vw, 40px); line-height: 1.22; letter-spacing: -.01em; color: var(--ink); max-width: 1000px; margin: 0; text-wrap: balance; }

/* ---------- 2 · Modalidades ---------- */
.lv-modes { padding: 110px 0 140px; }
.lv-switch { display: inline-flex; gap: 6px; padding: 6px; margin: 36px 0 28px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; max-width: 100%; }
.lv-switch button { flex: 1 1 0; min-width: 0; border: 0; background: transparent; color: var(--ink-2); border-radius: 16px; padding: 14px 22px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; font: inherit; transition: background .35s, color .35s; }
.lv-switch small { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); transition: color .35s; }
.lv-switch span { font-weight: 600; font-size: 17px; line-height: 1.2; }
.lv-switch button[aria-selected="true"] { background: var(--brand-gradient); color: var(--navy); }
.lv-switch button[aria-selected="true"] small { color: rgba(11, 27, 61, .7); }
.lv-switch button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.lv-chain { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.6fr) minmax(0, .9fr); gap: 34px; padding: 28px; border-radius: 28px; background: radial-gradient(120% 140% at 0% 0%, rgba(var(--orange-rgb), .08), transparent 55%), var(--card); border: 1px solid var(--line); }
.lv-chain-g { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lv-chain-g:not(:last-child)::after { content: "→"; position: absolute; right: -26px; top: 50%; color: var(--orange); font-size: 20px; }
.lv-who { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); min-height: 1.4em; }
.lv-who b { font-weight: 500; }
.lv-nodes { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-nodes i { font-style: normal; font-size: 14px; font-weight: 500; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(var(--white-rgb), .03); transition: border-color .4s, background .4s, color .4s, opacity .4s; }
.lv-chain .ours i { border-color: rgba(var(--orange-rgb), .7); background: rgba(var(--orange-rgb), .12); }
.lv-chain .ours .lv-who, .lv-chain[data-mode="2"] .av .lv-who { color: var(--orange); }
.lv-chain .out i { border-color: rgba(var(--white-rgb), .3); }
.lv-chain[data-mode="1"] .av i { border-style: dashed; color: var(--muted); }
.lv-chain[data-mode="1"] .w2, .lv-chain[data-mode="2"] .w1 { display: none; }
.lv-chain[data-mode="2"] .av i { border-color: rgba(var(--orange-rgb), .7); background: rgba(var(--orange-rgb), .12); }
.lv-chain[data-screens="0"] .av .scr { opacity: .3; text-decoration: line-through; }
.lv-panels { margin-top: 28px; }
.lv-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); padding: clamp(26px, 3.6vw, 44px); border-radius: 28px; background: var(--card); border: 1px solid var(--line); }
.lv-panel + .lv-panel { margin-top: 18px; }
.lv-panel[hidden] { display: none; }
.lv-panel:not([hidden]) { animation: lv-rise .5s var(--ease) both; }
.lv-panel-tx { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.lv-panel-tx h3 { margin: 0; }
.lv-panel-tx p { margin: 0; color: var(--ink-2); font-size: 17px; }
.lv-for { padding: 14px 16px; border-radius: 14px; background: rgba(var(--white-rgb), .04); border: 1px solid var(--line); font-size: 15px !important; }
.lv-for .mono { display: block; color: var(--orange); font-size: 11px; margin-bottom: 5px; }
.lv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lv-list li { display: grid; grid-template-columns: 18px 1fr; column-gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.lv-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin-top: 8px; grid-row: span 2; }
.lv-list strong { font-weight: 600; font-size: 18px; }
.lv-list span { color: var(--muted); font-size: 15px; }
.lv-toggle { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 15px; font-weight: 500; }
.lv-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lv-toggle-ui { width: 44px; height: 26px; border-radius: 999px; background: rgba(var(--white-rgb), .18); position: relative; transition: background .3s; flex: none; }
.lv-toggle-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .3s var(--ease); }
.lv-toggle input:checked + .lv-toggle-ui { background: var(--orange); }
.lv-toggle input:checked + .lv-toggle-ui::after { transform: translateX(18px); }
.lv-toggle input:focus-visible + .lv-toggle-ui { outline: 2px solid var(--orange); outline-offset: 3px; }
@media (max-width: 860px) {
  .lv-switch { display: flex; }
  .lv-switch button { padding: 12px 14px; }
  .lv-switch span { font-size: 15px; }
  .lv-chain { grid-template-columns: 1fr; gap: 30px; padding: 22px; }
  .lv-chain-g:not(:last-child)::after { content: "↓"; right: auto; left: 0; top: auto; bottom: -27px; }
  .lv-panel { grid-template-columns: 1fr; }
}

/* ---------- 3 · Bonding ---------- */
.lv-bond { position: relative; height: 360vh; background: var(--night); }
.lv-bond-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: radial-gradient(80% 70% at 70% 50%, rgba(35, 64, 143, .35), transparent 70%); }
.lv-net { position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%); width: min(60vw, 1100px); height: auto; overflow: visible; }
.lv-net text { font-family: var(--mono); font-size: 15px; letter-spacing: .08em; fill: rgba(var(--white-rgb), .7); }
.lv-net .ln path { fill: none; stroke-width: 3; stroke-linecap: round; }
.lv-net .ln path:first-child { stroke: url(#lv-g); stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--d, 0)); transition: stroke .4s, stroke-width .4s; }
.lv-net .ln .fl { stroke: #fff; stroke-width: 3.5; stroke-dasharray: .015 .085; opacity: calc(var(--d, 0) * .9); animation: lv-flow 2.2s linear infinite; }
.lv-net .ln text { text-anchor: middle; opacity: var(--d, 0); }
.lv-net .ln .x { fill: var(--tally); opacity: 0; font-weight: 600; transition: opacity .4s; }
@keyframes lv-flow { to { stroke-dashoffset: -1; } }
.lv-bond.fail .ln:not(.drop) path:first-child { stroke-width: 4.5; }
.lv-bond.fail .ln:not(.drop) .fl { animation-duration: 1.5s; }
.lv-bond.fail .ln.drop path:first-child { stroke: var(--tally); stroke-dasharray: .02 .025; stroke-dashoffset: 0; opacity: .7; }
.lv-bond.fail .ln.drop .fl { opacity: 0; }
.lv-bond.fail .ln.drop .x { opacity: 1; }
.lv-net .outs path { fill: none; stroke: url(#lv-g); stroke-width: 3; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--o, 0)); }
.lv-net .enc rect:first-child { fill: #0b1530; stroke: rgba(var(--white-rgb), .25); stroke-width: 1.5; }
.lv-net .enc .scr { fill: #1c3270; stroke: rgba(var(--white-rgb), .2); }
.lv-net .enc text { fill: #fff; font-size: 16px; }
.lv-net .enc .led { fill: var(--tally-g); animation: lv-blink 1.2s ease-in-out infinite; }
.lv-net .cloud circle { fill: #0b1530; stroke: var(--orange); stroke-width: 2.5; filter: drop-shadow(0 0 18px rgba(255, 94, 0, .45)); }
.lv-net .cloud text { fill: #fff; font-size: 16px; }
.lv-net .cloud .s { font-size: 12px; fill: rgba(var(--white-rgb), .6); }
.lv-net .plats g { opacity: var(--po, 0); transform: translateX(calc((1 - var(--po, 0)) * 16px)); transition: none; }
.lv-net .plats rect { fill: rgba(var(--orange-rgb), .14); stroke: rgba(var(--orange-rgb), .8); stroke-width: 1.5; }
.lv-net .plats text { fill: #fff; font-family: var(--sans, inherit); font-size: 17px; letter-spacing: 0; }
.lv-bond-tx { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-50%); width: min(440px, 34vw); z-index: 2; }
.lv-bond-tx > div { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 14px; opacity: 0; transition: opacity .5s, transform .5s var(--ease); }
.lv-bond-tx .h2 { font-size: clamp(30px, 3.4vw, 52px); margin: 0; }
.lv-bond-tx p { margin: 0; color: var(--ink-2); font-size: 18px; }
.lv-bond[data-s="1"] .b1, .lv-bond[data-s="2"] .b2, .lv-bond[data-s="3"] .b3 { opacity: 1; }
@media (max-width: 860px) {
  .lv-net { left: 10px; right: 10px; top: max(90px, 22vh); transform: none; width: calc(100% - 20px); }
  .lv-net text { font-size: 28px; }
  .lv-net .enc text, .lv-net .cloud text { font-size: 19px; letter-spacing: 0; }
  .lv-net .cloud .s { display: none; }
  .lv-net .cloud text { font-size: 15px; }
  .lv-net .plats text { font-size: 19px; }
  .lv-bond-tx { left: 16px; right: 16px; top: auto; bottom: 7vh; transform: none; width: auto; height: 40vh; }
  .lv-bond-tx > div { top: auto; bottom: 0; transform: none; padding: 22px; border-radius: 22px; background: rgba(var(--navy-deep-rgb), .88); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); gap: 10px; }
  .lv-bond-tx .h2 { font-size: 28px; }
  .lv-bond-tx p { font-size: 15px; }
}

/* ---------- 4 · Técnica (sección clara) ---------- */
.lv-tech .kicker { color: var(--orange-text); }
.lv-tech .h2 { margin-bottom: 48px; }

/* ---------- 5 · El equipo ---------- */
.lv-crew { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 100px); align-items: center; padding-block: 150px; }
.lv-crew-tx { display: flex; flex-direction: column; gap: 18px; }
.lv-crew-tx .h2 { margin: 0; }
.lv-crew-tx > p { margin: 0; font-size: 18px; }
.lv-num { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 4px; margin-bottom: 24px; }
.lv-num .v { font-family: var(--display); font-stretch: 112%; font-weight: 700; font-size: clamp(110px, 15vw, 220px); line-height: .82; letter-spacing: -.05em; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.lv-num .plus { grid-column: 2; grid-row: 1; justify-self: start; }
.lv-num .mono { grid-column: 1 / -1; margin-top: 16px; color: var(--muted); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.lv-crew-list { list-style: none; margin: 6px 0 0; padding: 0; }
.lv-crew-list li { padding: 14px 0 14px 28px; border-top: 1px solid var(--line); position: relative; }
.lv-crew-list li::before { content: ""; position: absolute; left: 0; top: 23px; width: 14px; height: 2px; background: var(--orange); }
.lv-collage { position: relative; height: 680px; }
.lv-collage img { position: absolute; object-fit: cover; border-radius: 20px; box-shadow: 0 40px 70px -40px rgba(0, 0, 0, .9); transform: translateY(calc((.5 - var(--p, .5)) * var(--sp, 60px))); will-change: transform; }
.lv-collage img:nth-child(1) { left: 0; top: 0; width: 50%; height: 560px; }
.lv-collage img:nth-child(2) { right: 0; top: 60px; width: 46%; height: 260px; }
.lv-collage img:nth-child(3) { right: 6%; bottom: 0; width: 56%; height: 280px; }
@media (max-width: 860px) {
  .lv-crew { grid-template-columns: 1fr; padding-block: 110px; }
  .lv-collage { height: 480px; }
  .lv-collage img:nth-child(1) { height: 400px; } .lv-collage img:nth-child(2) { height: 190px; top: 30px; } .lv-collage img:nth-child(3) { height: 200px; }
}

/* ---------- 6 · En sitio (scroll horizontal) ---------- */
.lv-site { position: relative; height: 420vh; background: var(--night); }
.lv-site-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 4vh; }
.lv-site-head { width: 100%; }
.lv-site-head .h2 { margin: 0; }
.lv-line { height: 1px; background: rgba(var(--white-rgb), .14); margin-inline: var(--gutter); }
.lv-line i { display: block; height: 100%; width: calc(var(--mp, 0) * 100%); background: var(--brand-gradient); box-shadow: 0 0 10px var(--orange); }
.lv-track { display: flex; gap: 28px; padding-inline: var(--gutter); transform: translateX(var(--mx, 0px)); will-change: transform; }
.lv-track figure { flex: none; width: clamp(280px, 34vw, 520px); margin: 0; display: flex; flex-direction: column; gap: 14px; }
.lv-track img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 16px; box-shadow: 0 40px 70px -40px rgba(0, 0, 0, .9); }
.lv-track figcaption { display: flex; align-items: baseline; gap: 14px; }
.lv-track figcaption .mono { color: var(--orange); font-size: 13px; }
.lv-track strong { font-weight: 600; font-size: 18px; }
@media (max-width: 700px) { .lv-track figure { width: 78vw; } .lv-track strong { font-size: 16px; } }

/* ---------- Preguntas y cierre ---------- */
.lv .faq { padding-top: 120px; }
.lv-cta { position: relative; overflow: hidden; padding: 170px 0 150px; background: var(--night); }
.lv-cta-bg { position: absolute; inset: 0; }
.lv-cta-bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.18 - .18 * var(--p, 0))); will-change: transform; }
.lv-cta-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(var(--navy-deep-rgb), .62), rgba(var(--navy-deep-rgb), .9)); }
.lv-cta-in { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.lv-cta-in .kicker { margin: 0; }
.lv-cta-in .lead { text-align: center; }
.lv-cta .btn-row { justify-content: center; }
@keyframes lv-rise { from { opacity: 0; transform: translateY(14px); } }

/* Movimiento reducido: las escenas de scroll se quedan; se quitan los bucles decorativos */
@media (prefers-reduced-motion: reduce) {
  .lv-rec i, .lv-pl-live i, .lv-hint i, .lv-net .ln .fl, .lv-net .enc .led { animation: none; }
  .lv-panel:not([hidden]) { animation: none; }
}
