/* =====================================================================
   Tinku · capa inmersiva: barra de progreso, luz que sigue al cursor, mesa en
   perspectiva, recorrido con un celular fijo que cuenta la historia al bajar,
   brillo en tarjetas y botones magnéticos. Todo se apaga con «reducir movimiento».
   ===================================================================== */

/* barra de progreso de lectura */
.read-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px; pointer-events: none; }
.read-bar i { display: block; height: 100%; width: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---------- portada con profundidad ---------- */
.hero { position: relative; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: -80px -20vw -40px; z-index: -1; pointer-events: none;
    background: radial-gradient(520px circle at var(--mx, 70%) var(--my, 40%), rgba(35, 71, 245, .16), transparent 62%); transition: background-position .2s; }
:root[data-theme="dark"] .hero::before { background: radial-gradient(560px circle at var(--mx, 70%) var(--my, 40%), rgba(77, 107, 255, .28), transparent 62%); }
.hero-stage { perspective: 1100px; }
.floor { position: absolute; left: -20%; right: -20%; bottom: -6%; height: 46%; z-index: 0; pointer-events: none; transform: rotateX(72deg); transform-origin: 50% 100%;
    background-image: linear-gradient(rgba(35, 71, 245, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(35, 71, 245, .22) 1px, transparent 1px); background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(60% 80% at 50% 100%, #000 20%, transparent 75%); mask-image: radial-gradient(60% 80% at 50% 100%, #000 20%, transparent 75%); animation: floor 9s linear infinite; }
:root[data-theme="dark"] .floor { background-image: linear-gradient(rgba(122, 146, 255, .3) 1px, transparent 1px), linear-gradient(90deg, rgba(122, 146, 255, .3) 1px, transparent 1px); }
@keyframes floor { to { background-position: 0 46px, 0 0; } }
.orb { position: absolute; z-index: -1; border-radius: 50%; filter: blur(50px); pointer-events: none; transform: translate(calc(var(--ox, 0) * 1px), calc(var(--oy, 0) * 1px)); transition: transform .6s var(--ease); }
.orb-a { width: 300px; height: 300px; top: 4%; right: 6%; background: rgba(18, 181, 240, .30); }
.orb-b { width: 240px; height: 240px; bottom: 6%; left: 2%; background: rgba(255, 107, 74, .22); }
.tent { z-index: 2; }

/* ---------- recorrido: celular fijo, la historia avanza con el scroll ---------- */
.story { position: relative; isolation: isolate; margin-top: clamp(56px, 8vw, 96px); padding: clamp(40px, 6vw, 80px) var(--pad); background: #060A17; color: #E8ECF8; overflow: clip; }
.story-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(40% 35% at 75% 20%, rgba(35, 71, 245, .45), transparent 70%), radial-gradient(35% 30% at 15% 70%, rgba(18, 181, 240, .18), transparent 70%), radial-gradient(30% 30% at 85% 85%, rgba(255, 107, 74, .18), transparent 70%); transition: background .8s; }
.story[data-on="3"] .story-glow { background: radial-gradient(40% 35% at 75% 30%, rgba(255, 107, 74, .32), transparent 70%), radial-gradient(35% 30% at 15% 70%, rgba(35, 71, 245, .3), transparent 70%); }
.story[data-on="4"] .story-glow { background: radial-gradient(40% 35% at 75% 40%, rgba(18, 181, 240, .35), transparent 70%), radial-gradient(35% 30% at 15% 30%, rgba(35, 71, 245, .32), transparent 70%); }
.story-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 6vw, 80px); max-width: var(--wrap); margin: 0 auto; }
.story-steps { display: grid; }
.st { display: grid; align-content: center; min-height: 86vh; opacity: .28; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.st.on { opacity: 1; transform: none; }
.st-k { width: fit-content; margin-bottom: 14px; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; background: rgba(255, 255, 255, .05); color: #9FD8FF; font-size: 14px; font-weight: 600; }
.st h2 { max-width: 15ch; color: #fff; font-size: clamp(32px, 4.4vw, 54px); font-weight: 750; letter-spacing: -.04em; line-height: 1.02; }
.st p { max-width: 46ch; margin-top: 16px; color: #B5BFDA; font-size: 18px; }
.story-stage { position: sticky; top: 0; align-self: start; display: grid; place-items: center; align-content: center; height: 100vh; }
.phone3d { position: relative; width: min(300px, 100%); aspect-ratio: 300 / 610; border: 10px solid #1B2238; border-radius: 46px; background: #0B1020; overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 60px 120px -40px rgba(35, 71, 245, .7), 0 30px 60px -30px rgba(0, 0, 0, .9);
    transform: rotateY(calc(-14deg + var(--rx, 0deg))) rotateX(calc(6deg + var(--ry, 0deg))); transition: transform .9s var(--ease); }
.story-stage { perspective: 1200px; }
.ph-notch { position: absolute; top: 10px; left: 50%; z-index: 5; width: 90px; height: 24px; border-radius: 14px; background: #1B2238; transform: translateX(-50%); }
.scr { position: absolute; inset: 0; opacity: 0; transform: translateY(24px) scale(.98); filter: blur(6px); transition: opacity .6s var(--ease), transform .7s var(--ease), filter .6s; }
.story[data-on="1"] .scr-1, .story[data-on="2"] .scr-2, .story[data-on="3"] .scr-3, .story[data-on="4"] .scr-4 { opacity: 1; transform: none; filter: none; }
.story-dots { display: flex; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.story-dots li { width: 8px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .2); transition: width .4s var(--ease), background-color .4s; }
.story[data-on="1"] .story-dots li:nth-child(1), .story[data-on="2"] .story-dots li:nth-child(2), .story[data-on="3"] .story-dots li:nth-child(3), .story[data-on="4"] .story-dots li:nth-child(4) { width: 26px; background: #12B5F0; }

/* pantalla 1: la cámara del celular apunta al hablador */
.cam { position: absolute; inset: 0; background: radial-gradient(120% 70% at 50% 110%, #5A3B26, #2A1D16 45%, #121019); }
.cam-table { position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: linear-gradient(#7A5236, #4B3221); }
.cam-tent { position: absolute; left: 50%; top: 22%; display: grid; justify-items: center; gap: 6px; width: 58%; padding: 12px 10px; border-top: 6px solid #7F1D1D; border-radius: 4px; background: #fff; transform: translateX(-50%) rotate(-2deg); box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .7); }
.cam-tent b { color: #7F1D1D; font: 800 16px/1 var(--font-d); letter-spacing: -.02em; }
.cam-tent i { display: block; width: 78%; }
.cam-tent svg { width: 100%; height: auto; }
.vf { position: absolute; left: 50%; top: 31%; width: 52%; aspect-ratio: 1; transform: translateX(-50%); }
.vf i { position: absolute; width: 22%; height: 22%; border: 3px solid #FFD43B; }
.vf i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.vf i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.vf i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.vf i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.story[data-on="1"] .vf { animation: lock 1.8s var(--ease) infinite; }
@keyframes lock { 0%, 100% { transform: translateX(-50%) scale(1.08); } 50% { transform: translateX(-50%) scale(.98); } }
.beam { position: absolute; left: 24%; right: 24%; top: 33%; height: 3px; border-radius: 3px; background: #12B5F0; box-shadow: 0 0 18px 4px rgba(18, 181, 240, .7); opacity: 0; }
.story[data-on="1"] .beam { animation: beam 1.8s ease-in-out infinite; }
@keyframes beam { 0% { top: 33%; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: 62%; opacity: 0; } }
.cam-pill { position: absolute; left: 50%; bottom: 13%; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #121A33; font-size: 12px; font-weight: 700; white-space: nowrap; transform: translate(-50%, 20px); opacity: 0; transition: transform .6s var(--spring) .6s, opacity .4s .6s; }
.cam-pill .i { width: 14px; height: 14px; color: #2347F5; }
.story[data-on="1"] .cam-pill { opacity: 1; transform: translate(-50%, 0); }

/* pantallas 2, 3 y 4: la página del negocio y las estadísticas */
.pg { position: absolute; inset: 0; display: grid; align-content: start; gap: 10px; padding: 46px 16px 16px; background: #F4F6FA; color: #121A33; font-size: 13px; }
.pg::before { content: ""; position: absolute; inset: 0 0 auto; height: 120px; z-index: 0; background: linear-gradient(135deg, #7F1D1D, #B4432F); }
.pg > * { position: relative; z-index: 1; }
.pg-ava { display: grid; place-items: center; width: 52px; height: 52px; margin: 26px auto 0; border: 3px solid #fff; border-radius: 16px; background: #7F1D1D; color: #fff; }
.pg-t { font: 700 18px/1.1 var(--font-d); text-align: center; letter-spacing: -.02em; }
.pg-s { margin-top: -6px; color: #5F6984; font-size: 12px; text-align: center; }
.pg-tabs { display: flex; justify-content: center; gap: 6px; }
.pg-tabs i { padding: 4px 10px; border-radius: 99px; background: #E6E9F1; font: normal 600 11px var(--font); }
.pg-tabs i.on { background: #121A33; color: #fff; }
.pg-row { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(18, 26, 51, .06); font-weight: 600; }
.pg-row small { display: block; color: #5F6984; font-size: 11px; font-weight: 400; }
.pg-row b { white-space: nowrap; }
.pg-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 12px; background: #128C4A; color: #fff; font-weight: 700; }
.pg-btn .i { width: 16px; height: 16px; }
.pg-row.hi { outline: 2px solid transparent; transition: outline-color .4s .5s, background-color .4s .5s; }
.story[data-on="3"] .pg-row.hi { outline-color: #FF6B4A; background: #FFF4F1; }
.pg-row.hi s { margin-right: 4px; color: #9AA3BC; font-weight: 500; }
.toast-up { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: #121A33; color: #fff; transform: translateY(30px); opacity: 0; transition: transform .6s var(--spring) .8s, opacity .4s .8s; }
.toast-up .i { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: #12804F; }
.toast-up span { display: grid; } .toast-up small { color: #B5BFDA; font-size: 11px; }
.story[data-on="3"] .toast-up { opacity: 1; transform: none; }
.pg.dash::before { height: 172px; background: linear-gradient(135deg, #2347F5, #12B5F0); }
.pg.dash { padding-top: 54px; }
.pg.dash .pg-s { margin: 0; color: rgba(255, 255, 255, .8); text-align: left; }
.big { color: #fff; font: 800 34px/1 var(--font-d); letter-spacing: -.04em; }
.big small { font: 600 13px var(--font); letter-spacing: 0; }
.up { margin-top: -4px; color: #D9F7FF; font-size: 12px; font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-top: 18px; padding: 12px; border-radius: 14px; background: #fff; }
.bars i { flex: 1; height: 4%; border-radius: 6px 6px 3px 3px; background: linear-gradient(#4F6BFF, #2347F5); transition: height .9s var(--spring); }
.bars i:last-child { background: linear-gradient(#5ED1FF, #12B5F0); }
.days { display: flex; gap: 8px; padding: 0 12px; margin-top: -6px; }
.days i { flex: 1; color: #5F6984; font: normal 600 10px var(--font); text-align: center; }

/* ---------- brillo que sigue al cursor en las tarjetas y botones magnéticos ---------- */
.glow { position: relative; isolation: isolate; }
.glow::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
    background: radial-gradient(360px circle at var(--gx, 50%) var(--gy, 50%), rgba(35, 71, 245, .12), transparent 45%); }
:root[data-theme="dark"] .glow::after { background: radial-gradient(360px circle at var(--gx, 50%) var(--gy, 50%), rgba(122, 146, 255, .18), transparent 45%); }
.glow:hover::after { opacity: 1; }
.mag { transition: transform .35s var(--spring), background-color .15s; }

/* ---------- celular y tableta ---------- */
@media (max-width: 860px) {
    .story-in { grid-template-columns: minmax(0, 1fr); }
    .story-stage { order: -1; top: 64px; z-index: 2; display: block; height: 360px; padding-top: 8px; background: linear-gradient(#060A17 86%, transparent); }
    .phone3d { width: 300px; margin: 0 auto; transform: scale(.52); transform-origin: 50% 0; }
    .story-dots { position: absolute; left: 0; right: 0; bottom: 18px; justify-content: center; margin: 0; }
    .st { min-height: 64vh; align-content: start; padding-top: 2vh; }
    .st h2 { font-size: 30px; }
    .st p { font-size: 16px; }
    .orb-a { width: 200px; height: 200px; }
}
@media (prefers-reduced-motion: reduce) {
    .floor, .story[data-on="1"] .vf, .story[data-on="1"] .beam { animation: none !important; }
    .scr, .st, .toast-up, .cam-pill, .bars i, .phone3d, .orb { transition: none !important; }
    .st { opacity: 1; transform: none; }
    .read-bar { display: none; }
}

/* celular: el texto del paso activo se muestra fijo bajo el teléfono */
.story-cap { display: none; }
@media (max-width: 860px) {
    .story-stage { height: auto; padding-bottom: 18px; }
    .phone3d { margin-bottom: -293px; }
    .story-dots { position: static; margin: 12px 0 0; }
    .story-cap { display: grid; gap: 6px; padding: 14px 4px 0; }
    .story-cap .st-k { margin: 0; }
    .story-cap b { color: #fff; font: 750 25px/1.08 var(--font-d); letter-spacing: -.035em; }
    .story-cap p { color: #B5BFDA; font-size: 15px; line-height: 1.5; }
    .story-cap.in > * { animation: capIn .5s var(--ease) both; }
    .story-cap.in b { animation-delay: .05s; } .story-cap.in p { animation-delay: .1s; }
    .st { min-height: 70vh; opacity: 0 !important; pointer-events: none; }
}
@keyframes capIn { from { opacity: 0; transform: translateY(10px); } }
