// === Escena 08 — "El foso" (RECAP + ECO) ===
// Duración real del mp3: 42.5s. SlideCanvas variant="promise".
// Dos mitades: (1) recap doctrinal de 3 ideas sincronizadas con "Uno/Dos/Tres";
// (2) EL FOSO — panel "Montarlo tú" con 5 costes en cascada que un sello verde
// "YA ESTÁ HECHO" tacha, y la PILA de 5 capas que se ensambla DEBAJO de una
// tarjeta "TU NEGOCIO" (el golpe "menuda infraestructura" es verla toda junta).
// Cierra con el bookend ("tan fiable como lo que tiene debajo" → "ya sabes lo que
// hay debajo") + logo, pantalla fija. Es el ECO: rima con la escena 01.
// LOCUCIÓN (audio/escena-08.mp3): "Recuerda lo que acabas de ver. Uno: todo está
// doblado. Proveedor, país, servidor, archivos. Ningún punto único que se pueda
// romper. Dos: tus archivos, aceptados solo cuando están a salvo dos veces. Tres:
// todo vigilado, día y noche. Ahora piensa en montar esto tú. Contratos con varias
// empresas. Ingenieros. Copias entre países. Años de trabajo. Y una factura enorme,
// cada mes. En Dinaup, ya está hecho. Y está debajo de tu negocio, desde el primer
// día. Un software es tan fiable como lo que tiene debajo. Y ahora ya sabes lo que
// hay debajo."
function EscenaIN08({ t }){
  const T = {
    head:    0.37,   // "Recuerda lo que acabas de ver"      → cabecera recap "Lo que acabas de ver"
    idea1:   3.24,   // "todo está doblado"                  → tarjeta idea 1
    gemelos: 4.73,   // "Proveedor, país, servidor"          → 4 mini-gemelos DOBLADOS bajo idea 1
    remate1: 8.15,   // "Ningún punto único"                 → píldora remate "Ni un punto único"
    idea2:  13.98,   // "a salvo dos veces"                  → tarjeta idea 2 (✓✓)
    idea3:  17.10,   // "todo vigilado"                      → tarjeta idea 3
    fosoIn: 20.38,   // "piensa en montar esto tú"           → las 3 ideas se apartan; entra panel "Montarlo tú"
    coste1: 22.54,   // "Contratos con varias empresas"      → coste 1
    coste2: 24.34,   // "Ingenieros"                         → coste 2
    coste3: 25.13,   // "Copias entre países"                → coste 3
    coste4: 27.02,   // "Años de trabajo"                    → coste 4
    coste5: 28.61,   // "una factura enorme"                 → coste 5 (naranja)
    hecho:  31.19,   // "En Dinaup, ya está hecho"           → sello verde cruza; los costes se tachan
    pila:   33.76,   // "debajo de tu negocio"              → "TU NEGOCIO" se posa sobre una PILA de 5 capas
    bookend:37.72,   // "tan fiable como lo que tiene debajo" → subtítulo BOOKEND
    cierre: 40.73,   // "ya sabes lo que hay debajo"         → logo + cierre (pantalla fija hasta el final)
  };

  const C = {
    blue:'#0085FF', green:'#10B981', green2:'#56E16A', orange:'#FB8C00',
    ink:'#0F172A', gray:'#64748B', gray2:'#94A3B8', border:'#E2E8F0',
  };

  // ============================================================
  // Transiciones de fase (salidas dignas: fade + slide, nunca en seco)
  // ============================================================
  const recapOut = Easing.easeOutCubic(clamp((t - T.fosoIn)/0.55, 0, 1));
  const recapOp  = 1 - recapOut;                              // las 3 ideas se apartan
  const fosoIn   = Easing.easeOutCubic(clamp((t - T.fosoIn)/0.6, 0, 1));
  // El foso se despeja ANTES de que entre la pila (T.pila=33.76): si no, se solapan.
  const fosoOut  = Easing.easeOutCubic(clamp((t - (T.pila - 0.6))/0.45, 0, 1));
  const fosoOp   = fosoIn * (1 - fosoOut);                    // el foso entra y luego cede a la pila

  // ============================================================
  // GLYPHS mini (atrezzo: se perciben, no se leen)
  // ============================================================
  const glyph = (kind, col)=>{
    if (kind === 'cloud') return (
      <svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M7 18 H17 A4 4 0 0 0 17 10 A5 5 0 0 0 7.5 9 A3.5 3.5 0 0 0 7 18 Z" stroke={col} strokeWidth="1.8" strokeLinejoin="round"/></svg>
    );
    if (kind === 'pin') return (
      <svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M12 21 C12 21 5 14 5 9 A7 7 0 0 1 19 9 C19 14 12 21 12 21 Z" stroke={col} strokeWidth="1.8" strokeLinejoin="round"/><circle cx="12" cy="9" r="2.4" stroke={col} strokeWidth="1.8"/></svg>
    );
    if (kind === 'server') return (
      <svg width="20" height="20" viewBox="0 0 24 24" fill="none"><rect x="4" y="4.5" width="16" height="6" rx="1.5" stroke={col} strokeWidth="1.8"/><rect x="4" y="13.5" width="16" height="6" rx="1.5" stroke={col} strokeWidth="1.8"/><circle cx="8" cy="7.5" r="0.9" fill={col}/><circle cx="8" cy="16.5" r="0.9" fill={col}/></svg>
    );
    return ( // doc
      <svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M7 3 H15 L19 7 V21 H7 Z" stroke={col} strokeWidth="1.8" strokeLinejoin="round"/><path d="M15 3 V7 H19" stroke={col} strokeWidth="1.8" strokeLinejoin="round"/><path d="M10 12 H16 M10 16 H16" stroke={col} strokeWidth="1.6" strokeLinecap="round"/></svg>
    );
  };

  const costeGlyph = (kind, col)=>{
    if (kind === 'contract') return (
      <svg width="22" height="22" viewBox="0 0 24 24" fill="none"><path d="M6 3 H14 L18 7 V21 H6 Z" stroke={col} strokeWidth="1.8" strokeLinejoin="round"/><path d="M14 3 V7 H18" stroke={col} strokeWidth="1.8" strokeLinejoin="round"/><path d="M9 13 L11 15 L15 11" stroke={col} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/></svg>
    );
    if (kind === 'team') return (
      <svg width="22" height="22" viewBox="0 0 24 24" fill="none"><circle cx="9" cy="8" r="3" stroke={col} strokeWidth="1.8"/><circle cx="17" cy="9" r="2.4" stroke={col} strokeWidth="1.8"/><path d="M4 19 C4 15.5 6.5 14 9 14 C11.5 14 14 15.5 14 19" stroke={col} strokeWidth="1.8" strokeLinecap="round"/><path d="M15 14 C18 14 20 15.5 20 18.5" stroke={col} strokeWidth="1.8" strokeLinecap="round"/></svg>
    );
    if (kind === 'copy') return (
      <svg width="22" height="22" viewBox="0 0 24 24" fill="none"><rect x="4" y="4" width="11" height="13" rx="2" stroke={col} strokeWidth="1.8"/><path d="M8 8 H8.01 M18 7 H19 A1 1 0 0 1 20 8 V19 A1 1 0 0 1 19 20 H10 A1 1 0 0 1 9 19 V18" stroke={col} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/></svg>
    );
    if (kind === 'calendar') return (
      <svg width="22" height="22" viewBox="0 0 24 24" fill="none"><rect x="4" y="6" width="16" height="14" rx="2" stroke={col} strokeWidth="1.8"/><path d="M4 10 H20 M8 3 V7 M16 3 V7" stroke={col} strokeWidth="1.8" strokeLinecap="round"/></svg>
    );
    return ( // invoice
      <svg width="22" height="22" viewBox="0 0 24 24" fill="none"><path d="M6 3 H18 V21 L15 19 L12 21 L9 19 L6 21 Z" stroke={col} strokeWidth="1.8" strokeLinejoin="round"/><path d="M9 8 H15 M9 12 H15" stroke={col} strokeWidth="1.6" strokeLinecap="round"/></svg>
    );
  };

  // ============================================================
  // Datos de la fase RECAP
  // ============================================================
  const GEMELOS = [
    { kind:'cloud',  label:'PROVEEDOR' },
    { kind:'pin',    label:'PAÍS' },
    { kind:'server', label:'SERVIDOR' },
    { kind:'doc',    label:'ARCHIVOS' },
  ];

  // Un gemelo: dos tiles idénticos con línea de sincronía viva y un pulso que
  // viaja de A a B UNA vez (el motivo conductor "doblado / en tiempo real").
  const Gemelo = (g, i)=>{
    const appear = T.gemelos + i*0.26;
    const p = clamp((t - appear)/0.5, 0, 1);
    if (p <= 0) return <div key={g.label} style={{width:228, height:96}}/>;
    const e = Easing.easeOutCubic(p);
    const travP = clamp((t - (appear+0.28))/0.85, 0, 1);
    const showDot = travP > 0.02 && travP < 0.98;
    const dotX = lerp(94, 138, Easing.easeInOutCubic(travP));
    const tile = (left)=>(
      <div style={{position:'absolute', left, top:6, width:54, height:44, background:'#fff', border:`1px solid ${C.border}`, borderRadius:9, boxShadow:'0 6px 14px rgba(15,23,42,0.06)', display:'flex', alignItems:'center', justifyContent:'center'}}>
        {glyph(g.kind, C.gray)}
      </div>
    );
    return (
      <div key={g.label} style={{position:'relative', width:228, height:96, opacity:clamp(p*1.3,0,1), transform:`translateY(${(1-e)*12}px)`}}>
        {tile(40)}
        {tile(134)}
        <div style={{position:'absolute', left:94, top:27, width:44, height:2, borderRadius:2, background:`linear-gradient(90deg, ${C.blue}, ${C.green})`, opacity:0.7}}/>
        {showDot && <div style={{position:'absolute', left:dotX, top:24, width:8, height:8, borderRadius:100, background:C.blue, boxShadow:`0 0 10px ${C.blue}`}}/>}
        <div className="f-mono" style={{position:'absolute', left:0, right:0, top:62, textAlign:'center', fontSize:11, fontWeight:700, letterSpacing:'2px', color:C.gray2}}>{g.label}</div>
      </div>
    );
  };

  // Ideas 2 y 3
  const check = (delay)=>{
    const p = clamp((t - (T.idea2 + delay))/0.5, 0, 1);
    const dE = Easing.easeInOutCubic(clamp((t - (T.idea2 + delay + 0.12))/0.4, 0, 1));
    const e = Easing.easeOutBack(p);
    if (p <= 0) return <div style={{width:64, height:64}}/>;
    return (
      <div style={{width:64, height:64, borderRadius:100, background:'linear-gradient(180deg,#34D399,#10B981)', boxShadow:'0 12px 26px rgba(16,185,129,0.3)', display:'flex', alignItems:'center', justifyContent:'center', opacity:clamp(p*1.3,0,1), transform:`scale(${lerp(0.5,1,e)})`}}>
        <svg width="34" height="34" viewBox="-24 -24 48 48" fill="none"><path d="M -13 1 L -4 10 L 14 -10" stroke="#fff" strokeWidth="6" strokeLinecap="round" strokeLinejoin="round" strokeDasharray="42" strokeDashoffset={42*(1-dE)}/></svg>
      </div>
    );
  };

  const idea3Glow = 0.45 + 0.55*Math.sin(t*2.1); // ÚNICA animación ambiental sutil (vigilancia)

  // Progreso de cada tarjeta de idea
  const i1P = clamp((t - T.idea1)/0.6, 0, 1), i1E = Easing.easeOutCubic(i1P);
  const i2P = clamp((t - T.idea2)/0.6, 0, 1), i2E = Easing.easeOutCubic(i2P);
  const i3P = clamp((t - T.idea3)/0.6, 0, 1), i3E = Easing.easeOutCubic(i3P);
  const headP = clamp((t - T.head)/0.6, 0, 1), headE = Easing.easeOutCubic(headP);
  const rem1P = clamp((t - T.remate1)/0.5, 0, 1), rem1E = Easing.easeOutBack(rem1P);

  const ideaCard = (x, w, num, numColor, prog, e, title, children)=>{
    if (prog <= 0) return null;
    return (
      <div style={{position:'absolute', left:x, top:270, width:w, height:396, background:'#fff', border:`1px solid ${C.border}`, borderRadius:22, boxShadow:'0 22px 50px rgba(15,23,42,0.08)', padding:'26px 30px', opacity:clamp(prog*1.3,0,1), transform:`translateY(${(1-e)*26}px)`}}>
        <div style={{display:'flex', alignItems:'center', gap:14, marginBottom:20}}>
          <div className="f-mono" style={{width:38, height:38, borderRadius:100, background:`${numColor}14`, border:`1px solid ${numColor}44`, color:numColor, fontSize:18, fontWeight:800, display:'flex', alignItems:'center', justifyContent:'center'}}>{num}</div>
          <div className="f-plex" style={{fontSize:25, fontWeight:800, letterSpacing:'-0.02em', color:C.ink, lineHeight:1.1}}>{title}</div>
        </div>
        {children}
      </div>
    );
  };

  // ============================================================
  // Datos de la fase FOSO
  // ============================================================
  const COSTES = [
    { beat:T.coste1, kind:'contract', text:'Contratos con varias empresas', chip:'3+ proveedores' },
    { beat:T.coste2, kind:'team',     text:'Ingenieros en plantilla',       chip:'equipo propio' },
    { beat:T.coste3, kind:'copy',     text:'Copias entre países',           chip:'2 países' },
    { beat:T.coste4, kind:'calendar', text:'Años de montaje',               chip:'2 – 3 años' },
    { beat:T.coste5, kind:'invoice',  text:'Una factura enorme, cada mes',  chip:'€€€€ / mes', pain:true },
  ];

  const stampP = clamp((t - T.hecho)/0.55, 0, 1);
  const stampE = Easing.easeOutCubic(stampP);
  const stampScale = lerp(1.55, 1, stampE);               // "slam" de sello
  const stampRing  = Easing.easeOutCubic(clamp((t - T.hecho)/0.9, 0, 1));

  const costeRow = (c, i)=>{
    const p = clamp((t - c.beat)/0.5, 0, 1);
    const e = Easing.easeOutCubic(p);
    const strikeP = clamp((t - (T.hecho + 0.12 + i*0.06))/0.5, 0, 1);
    const struck = Easing.easeOutCubic(strikeP);
    const accent = c.pain ? C.orange : C.gray;
    return (
      <div key={c.text} style={{position:'relative', display:'flex', alignItems:'center', gap:16, height:64, padding:'0 20px', background: c.pain ? 'rgba(251,140,0,0.06)' : '#F8FAFC', border:`1px solid ${c.pain ? 'rgba(251,140,0,0.3)' : C.border}`, borderRadius:13, opacity: clamp(p*1.3,0,1) * lerp(1,0.42,struck), filter:`saturate(${lerp(1,0.5,struck)})`, transform:`translateX(${(1-e)*-22}px)`}}>
        <div style={{width:40, height:40, borderRadius:10, background:'#fff', border:`1px solid ${C.border}`, display:'flex', alignItems:'center', justifyContent:'center', flexShrink:0}}>
          {costeGlyph(c.kind, accent)}
        </div>
        <span className="f-plex" style={{flex:1, fontSize:19, fontWeight:600, color:C.ink, letterSpacing:'-0.01em'}}>{c.text}</span>
        <span className="f-mono" style={{fontSize:13, fontWeight:700, color:accent, background: c.pain ? 'rgba(251,140,0,0.12)' : '#EEF2F7', border:`1px solid ${c.pain ? 'rgba(251,140,0,0.32)' : C.border}`, borderRadius:100, padding:'5px 12px', whiteSpace:'nowrap'}}>{c.chip}</span>
        {/* Tachado verde que se dibuja al llegar el sello */}
        <div style={{position:'absolute', left:16, right:16, top:31, height:3, borderRadius:2, background:C.green, transformOrigin:'left center', transform:`scaleX(${struck})`, opacity:struck*0.9}}/>
      </div>
    );
  };

  // ============================================================
  // Datos de la fase PILA (la pila se reensambla — payoff)
  // ============================================================
  const stackX = 650, stackW = 620;
  const negTop = 168, negH = 74;
  const layerH = 62, layerGap = 8;
  const layerTop = (i)=> negTop + negH + 14 + i*(layerH+layerGap); // i=0 arriba … i=4 abajo
  const LAYERS = [ // i=0 (arriba) → i=4 (suelo, abajo). Se ensambla de abajo a arriba.
    { label:'SERVIR · CDN + CACHÉ',      accent:C.blue },
    { label:'ARCHIVOS · ×4 COPIAS',      accent:C.green },
    { label:'SERVIDOR · DOBLADO',        accent:C.blue },
    { label:'DATOS · 2 PAÍSES',          accent:C.green },
    { label:'SUELO · CLOUD EUROPEO',     accent:C.blue },
  ];
  const negP = clamp((t - T.pila)/0.7, 0, 1), negE = Easing.easeOutBack(negP); // protagonista: UN overshoot

  const bookP = clamp((t - T.bookend)/0.7, 0, 1), bookE = Easing.easeOutCubic(bookP);
  const c1P   = clamp((t - T.cierre)/0.6, 0, 1),  c1E   = Easing.easeOutBack(c1P);
  const c2P   = clamp((t - (T.cierre+0.4))/0.6, 0, 1), c2E = Easing.easeOutCubic(c2P);

  return (
    <SlideCanvas variant="promise">

      {/* ===================== FASE 1 — RECAP ===================== */}
      {recapOp > 0.01 && (
        <div style={{position:'absolute', inset:0, opacity:recapOp, transform:`translateY(${recapOut*-42}px)`}}>

          {/* Cabecera recap */}
          {headP > 0 && (
            <div style={{position:'absolute', left:0, right:0, top:78, textAlign:'center', opacity:headP, transform:`translateY(${(1-headE)*-10}px)`}}>
              <div className="f-mono" style={{fontSize:13, fontWeight:700, letterSpacing:'4px', color:C.gray2}}>RECAPITULACIÓN</div>
              <h2 className="f-plex" style={{fontSize:50, fontWeight:800, letterSpacing:'-0.035em', color:C.ink, margin:'12px 0 0'}}>Lo que acabas de ver</h2>
            </div>
          )}

          {/* Idea 1 — Todo está doblado (+ 4 gemelos) */}
          {ideaCard(220, 560, '1', C.blue, i1P, i1E, 'Todo está doblado', (
            <>
              <div style={{display:'flex', flexWrap:'wrap', columnGap:24, rowGap:16, marginTop:2}}>
                {GEMELOS.map(Gemelo)}
              </div>
            </>
          ))}

          {/* Remate idea 1 */}
          {rem1P > 0 && (
            <div style={{position:'absolute', left:220, top:686, width:560, textAlign:'center', opacity:clamp(rem1P*1.3,0,1), transform:`scale(${lerp(0.85,1,rem1E)})`}}>
              <span className="f-plex" style={{display:'inline-flex', alignItems:'center', gap:10, fontSize:18, fontWeight:700, color:'#059669', background:'#ECFDF5', border:'1px solid #A7F3D0', borderRadius:100, padding:'10px 22px', boxShadow:'0 8px 20px rgba(16,185,129,0.16)'}}>
                <svg width="18" height="18" viewBox="-24 -24 48 48" fill="none"><path d="M -13 1 L -4 10 L 14 -10" stroke="#059669" strokeWidth="6" strokeLinecap="round" strokeLinejoin="round"/></svg>
                Ni un punto único que romper
              </span>
            </div>
          )}

          {/* Idea 2 — Aceptado solo a salvo 2 veces */}
          {ideaCard(820, 420, '2', C.green, i2P, i2E, 'A salvo dos veces', (
            <div style={{display:'flex', flexDirection:'column', alignItems:'center', justifyContent:'center', gap:22, marginTop:24}}>
              <div style={{display:'flex', gap:22}}>
                {check(0.5)}
                {check(0.95)}
              </div>
              <div className="f-plex" style={{fontSize:16, fontWeight:500, color:C.gray, textAlign:'center', lineHeight:1.4, padding:'0 6px'}}>
                Aceptado <b style={{color:C.ink}}>solo</b> cuando llegó a las dos
              </div>
            </div>
          ))}

          {/* Idea 3 — Vigilado día y noche */}
          {ideaCard(1280, 420, '3', C.blue, i3P, i3E, 'Vigilado día y noche', (
            <div style={{display:'flex', flexDirection:'column', alignItems:'center', justifyContent:'center', gap:20, marginTop:24}}>
              <div style={{position:'relative', width:78, height:78, borderRadius:20, background:'#fff', border:`1px solid ${C.border}`, boxShadow:'0 10px 24px rgba(15,23,42,0.08)', display:'flex', alignItems:'center', justifyContent:'center'}}>
                <svg width="40" height="40" viewBox="0 0 24 24" fill="none">
                  <path d="M2 12 C4.5 7 8 5 12 5 C16 5 19.5 7 22 12 C19.5 17 16 19 12 19 C8 19 4.5 17 2 12 Z" stroke={C.blue} strokeWidth="1.8" strokeLinejoin="round"/>
                  <circle cx="12" cy="12" r="3.2" stroke={C.blue} strokeWidth="1.8"/>
                </svg>
                <div style={{position:'absolute', top:-6, right:-6, width:18, height:18, borderRadius:100, background:C.green, border:'2px solid #fff', boxShadow:`0 0 ${8+8*idea3Glow}px rgba(16,185,129,${0.4+0.4*idea3Glow})`}}/>
              </div>
              <div className="f-mono" style={{fontSize:17, fontWeight:800, letterSpacing:'2px', color:'#059669'}}>24 / 7</div>
            </div>
          ))}
        </div>
      )}

      {/* ===================== FASE 2 — EL FOSO ===================== */}
      {fosoOp > 0.01 && (
        <div style={{position:'absolute', inset:0, opacity:fosoOp, transform:`translateY(${(1-fosoIn)*24 + fosoOut*-30}px)`}}>

          {/* Eyebrow del foso */}
          <div style={{position:'absolute', left:0, right:0, top:118, textAlign:'center', opacity:fosoIn}}>
            <div className="f-mono" style={{fontSize:13, fontWeight:700, letterSpacing:'4px', color:C.gray2}}>SI LO MONTARAS TÚ</div>
          </div>

          {/* Panel "Montarlo tú" */}
          <div style={{position:'absolute', left:600, top:172, width:720, background:'#fff', border:`1px solid ${C.border}`, borderRadius:24, boxShadow:'0 26px 60px rgba(15,23,42,0.10)', padding:'28px 30px 30px', opacity:fosoIn, transform:`scale(${lerp(0.96,1,fosoIn)})`}}>
            <div className="f-plex" style={{fontSize:30, fontWeight:800, letterSpacing:'-0.025em', color:C.ink, marginBottom:22}}>Montarlo tú</div>
            <div style={{display:'flex', flexDirection:'column', gap:12}}>
              {COSTES.map(costeRow)}
            </div>
          </div>

          {/* Sello "YA ESTÁ HECHO" — cruza el panel */}
          {stampP > 0 && (
            <div style={{position:'absolute', left:0, right:0, top:406, display:'flex', justifyContent:'center', pointerEvents:'none'}}>
              <div style={{position:'relative', transform:`rotate(-7deg) scale(${stampScale})`, opacity:clamp(stampP*1.4,0,1)}}>
                <div className="f-plex" style={{fontSize:52, fontWeight:900, letterSpacing:'0.02em', color:'#fff', background:'linear-gradient(135deg,#10B981,#0085FF)', border:'4px solid rgba(255,255,255,0.85)', borderRadius:16, padding:'14px 40px', boxShadow:'0 22px 50px rgba(16,185,129,0.4)'}}>
                  YA ESTÁ HECHO
                </div>
                {/* onda de choque, una vez */}
                <div style={{position:'absolute', inset:-8, borderRadius:20, border:'3px solid rgba(16,185,129,0.55)', transform:`scale(${lerp(0.9,1.5,stampRing)})`, opacity:1-stampRing}}/>
              </div>
            </div>
          )}
        </div>
      )}

      {/* ===================== FASE 3 — LA PILA (payoff) ===================== */}
      {negP > 0 && (
        <>
          {/* Capas que se ensamblan DEBAJO (de abajo a arriba) */}
          {LAYERS.map((l,i)=>{
            const appear = T.pila + (4 - i)*0.11;
            const p = clamp((t - appear)/0.55, 0, 1);
            if (p <= 0) return null;
            const e = Easing.easeOutCubic(p);
            return (
              <div key={l.label} style={{position:'absolute', left:stackX, top:layerTop(i), width:stackW, height:layerH, background:'#fff', border:`1px solid ${C.border}`, borderRadius:14, boxShadow:'0 10px 24px rgba(15,23,42,0.06)', display:'flex', alignItems:'center', gap:16, padding:'0 22px', opacity:clamp(p*1.3,0,1), transform:`translateY(${(1-e)*30}px)`}}>
                <div style={{width:6, height:34, borderRadius:4, background:l.accent, flexShrink:0}}/>
                <span className="f-mono" style={{flex:1, fontSize:15, fontWeight:700, letterSpacing:'1.5px', color:'#334155'}}>{l.label}</span>
                {/* eco del "doblado": par de nodos */}
                <div style={{display:'flex', gap:6}}>
                  <div style={{width:12, height:12, borderRadius:4, background:l.accent, opacity:0.9}}/>
                  <div style={{width:12, height:12, borderRadius:4, background:l.accent, opacity:0.9}}/>
                </div>
              </div>
            );
          })}

          {/* TU NEGOCIO — se posa ENCIMA (protagonista, overshoot) */}
          <div style={{position:'absolute', left:stackX, top:negTop, width:stackW, height:negH, background:'linear-gradient(135deg,#0F172A,#1E293B)', borderRadius:16, boxShadow:'0 26px 60px rgba(15,23,42,0.28)', display:'flex', alignItems:'center', gap:16, padding:'0 26px', opacity:clamp(negP*1.4,0,1), transform:`translateY(${(1-negE)*-44}px)`}}>
            <div style={{width:40, height:40, borderRadius:11, background:'linear-gradient(135deg,#0085FF,#56E16A)', display:'flex', alignItems:'center', justifyContent:'center', flexShrink:0}}>
              <svg width="22" height="22" viewBox="0 0 24 24" fill="none"><path d="M4 20 V10 L12 4 L20 10 V20 Z" stroke="#fff" strokeWidth="1.8" strokeLinejoin="round"/><path d="M9 20 V13 H15 V20" stroke="#fff" strokeWidth="1.8" strokeLinejoin="round"/></svg>
            </div>
            <span className="f-plex" style={{flex:1, fontSize:26, fontWeight:800, letterSpacing:'-0.02em', color:'#fff'}}>Tu negocio</span>
            <span className="f-mono" style={{fontSize:12, fontWeight:700, letterSpacing:'2px', color:'rgba(255,255,255,0.6)'}}>DESDE EL DÍA 1</span>
          </div>
        </>
      )}

      {/* ===================== BOOKEND + CIERRE ===================== */}
      {bookP > 0 && (
        <div style={{position:'absolute', left:0, right:0, top:668, textAlign:'center', opacity:bookE, transform:`translateY(${(1-bookE)*12}px)`}}>
          <div className="f-plex" style={{fontSize:26, fontWeight:500, color:C.gray, letterSpacing:'-0.015em'}}>
            Un software es tan fiable como <b style={{color:C.ink, fontWeight:700}}>lo que tiene debajo.</b>
          </div>
        </div>
      )}

      {c1P > 0 && (
        <div style={{position:'absolute', left:0, right:0, top:756, display:'flex', justifyContent:'center', opacity:clamp(c1P*1.3,0,1), transform:`translateY(${(1-c1E)*18}px) scale(${lerp(0.9,1,c1E)})`}}>
          <DinaupLogo size={52}/>
        </div>
      )}
      {c2P > 0 && (
        <div style={{position:'absolute', left:0, right:0, top:838, textAlign:'center', opacity:clamp(c2P*1.3,0,1), transform:`translateY(${(1-c2E)*14}px)`}}>
          <div className="f-plex" style={{fontSize:40, fontWeight:800, letterSpacing:'-0.03em', color:C.ink, lineHeight:1.1}}>
            Y ahora ya sabes lo que hay <span className="grad-text">debajo.</span>
          </div>
        </div>
      )}
    </SlideCanvas>
  );
}
Object.assign(window, { EscenaIN08 });
