:root {
  --negro: #000;
  --fondo: #111111;
  --azul: #94c6f8;
  --azul-fuerte: #5aa6f2;
  --blanco: #ffffff;
  --gris: rgba(255, 255, 255, .62);
  --vidrio: rgba(20, 20, 20, .55);
  --borde: rgba(255, 255, 255, .14);
  --wa: #25d366;
  --titulo: "Krona One", "Arial Black", sans-serif;
  --texto: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
  --seguro-arriba: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--negro); color: var(--blanco); font-family: var(--texto); overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; }
[hidden] { display: none !important; }

.capa { position: fixed; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s linear .6s; }
.capa.activa { opacity: 1; visibility: visible; transition: opacity .6s ease; }

/* ---------- 1. Intro: motor de conexión ---------- */
#intro { background: var(--negro); display: grid; place-items: center; }
#particulas { position: absolute; inset: 0; width: 100%; height: 100%; }
.motor { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(340px, 86vw); opacity: 0; transform: scale(.94); transition: opacity .5s, transform .8s cubic-bezier(.2, .8, .2, 1); }
#intro.encendido .motor { opacity: 1; transform: none; }
.wifi { width: 120px; height: 100px; overflow: visible; }
.arco { fill: none; stroke: rgba(148, 198, 248, .15); stroke-width: 9; stroke-linecap: round; transition: stroke .35s, filter .35s; }
.punto { fill: rgba(148, 198, 248, .25); transition: fill .3s; }
.wifi.s0 .punto, .wifi.s1 .punto, .wifi.s2 .punto, .wifi.s3 .punto { fill: var(--azul); filter: drop-shadow(0 0 8px var(--azul)); }
.wifi.s1 .a1, .wifi.s2 .a1, .wifi.s2 .a2, .wifi.s3 .arco { stroke: var(--azul); filter: drop-shadow(0 0 10px rgba(148, 198, 248, .8)); }
.wifi.buscando .arco { animation: barrido 1.1s infinite; }
.wifi.buscando .a2 { animation-delay: .15s; }
.wifi.buscando .a3 { animation-delay: .3s; }
@keyframes barrido { 0%, 100% { stroke: rgba(148, 198, 248, .12); } 50% { stroke: rgba(148, 198, 248, .55); } }
.red { font-family: var(--mono); font-size: 12px; letter-spacing: .18em; color: var(--azul); opacity: .85; }
.pct { font-family: var(--titulo); font-size: 64px; line-height: 1; letter-spacing: -.02em; text-shadow: 0 0 30px rgba(148, 198, 248, .45); }
.pct small { font-size: 22px; margin-left: 4px; color: var(--azul); }
.pct.glitch { animation: glitch .18s steps(2) 3; }
@keyframes glitch { 0% { transform: translate(2px, -1px); text-shadow: -3px 0 #ff3d6e, 3px 0 var(--azul); } 100% { transform: translate(-2px, 1px); text-shadow: 3px 0 #ff3d6e, -3px 0 var(--azul); } }
.barra { width: 100%; height: 3px; background: rgba(255, 255, 255, .1); border-radius: 3px; overflow: hidden; }
.barra i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--azul-fuerte), #fff); box-shadow: 0 0 12px var(--azul); }
.log { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; min-height: 76px; font-family: var(--mono); font-size: 12px; color: var(--gris); }
.log li { padding: 2px 0; animation: entra .3s ease both; }
.log li b { color: var(--azul); font-weight: 500; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } }
.entrar { position: relative; margin-top: 10px; padding: 16px 30px; border-radius: 999px; background: var(--blanco); color: #000; font-weight: 700; font-size: 17px; letter-spacing: .01em; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .5s, transform .5s; }
.entrar.visible { opacity: 1; transform: none; pointer-events: auto; }
.entrar .anillo { position: absolute; inset: -6px; border-radius: inherit; border: 2px solid var(--azul); animation: pulso 1.6s infinite; }
@keyframes pulso { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.25); } }

/* ---------- 2. Logo ---------- */
#logo { background: var(--negro); display: grid; place-items: center; overflow: hidden; }
#logo img { position: relative; width: min(70vw, 360px); filter: drop-shadow(0 0 24px rgba(148, 198, 248, .55)); transform: scale(.86); opacity: 0; }
#logo.activa img { animation: logo 1.1s cubic-bezier(.2, .8, .2, 1) forwards; }
#logo .rayos { position: absolute; width: 200vmax; height: 200vmax; background: repeating-conic-gradient(from 0deg, rgba(148, 198, 248, .12) 0 6deg, transparent 6deg 18deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 45%); mask: radial-gradient(circle, #000 0, transparent 45%); opacity: 0; }
#logo.activa .rayos { animation: rayos 1.4s ease-out forwards; }
@keyframes logo { 0% { opacity: 0; transform: scale(.86); filter: blur(8px) drop-shadow(0 0 0 transparent); } 60% { opacity: 1; filter: blur(0) drop-shadow(0 0 40px rgba(148, 198, 248, .9)); } 100% { opacity: 1; transform: scale(1); } }
@keyframes rayos { from { opacity: 0; transform: rotate(0) scale(.6); } 40% { opacity: 1; } to { opacity: .5; transform: rotate(25deg) scale(1); } }

/* ---------- 3. Feed tipo reels ---------- */
#app { background: var(--negro); }
.fondo-desktop { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(.35); transition: background-image .6s; }
.telefono { position: relative; height: 100%; width: 100%; margin: 0 auto; overflow: hidden; background: var(--negro); }
@media (min-width: 700px) {
  .telefono { width: min(460px, calc(100vh * 9 / 16 + 40px)); height: calc(100% - 40px); margin-top: 20px; border-radius: 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 0 1px var(--borde); }
}
.barra-top { position: absolute; z-index: 5; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(12px + var(--seguro-arriba)) 16px 30px; background: linear-gradient(rgba(0, 0, 0, .55), transparent); pointer-events: none; }
.barra-top > * { pointer-events: auto; }
.marca { height: 22px; width: auto; }
.tabs { display: flex; gap: 16px; font-weight: 600; font-size: 16px; }
.tabs span, .tabs a { color: var(--gris); text-decoration: none; padding-bottom: 4px; }
.tabs .on { color: var(--blanco); border-bottom: 2px solid var(--blanco); }
.conectado { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--azul); background: rgba(148, 198, 248, .12); border: 1px solid rgba(148, 198, 248, .35); padding: 4px 9px; border-radius: 999px; }
.conectado i { width: 7px; height: 7px; border-radius: 50%; background: var(--azul); box-shadow: 0 0 8px var(--azul); }
@media (max-width: 360px) { .conectado { display: none; } }

.feed { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.reel { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; background: #000; }
.reel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel .sombra { position: absolute; inset: auto 0 0 0; height: 46%; background: linear-gradient(transparent, rgba(0, 0, 0, .78)); pointer-events: none; }
.reel .toque { position: absolute; inset: 0; z-index: 1; }
.pausa-ico { position: absolute; z-index: 2; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: rgba(0, 0, 0, .45); display: grid; place-items: center; opacity: 0; transform: scale(.8); transition: opacity .2s, transform .2s; pointer-events: none; }
.pausa-ico svg { width: 34px; fill: #fff; margin-left: 4px; }
.reel.pausado .pausa-ico { opacity: 1; transform: none; }
.corazon-grande { position: absolute; z-index: 3; width: 110px; height: 110px; margin: -55px 0 0 -55px; fill: #ff3d6e; pointer-events: none; filter: drop-shadow(0 6px 20px rgba(255, 61, 110, .6)); animation: corazon .9s ease-out forwards; }
@keyframes corazon { 0% { opacity: 0; transform: scale(.3) rotate(-12deg); } 25% { opacity: 1; transform: scale(1.15) rotate(-6deg); } 45% { transform: scale(.95); } 100% { opacity: 0; transform: translateY(-80px) scale(1.1); } }

/* barra lateral de acciones */
.rail { position: absolute; z-index: 4; right: 10px; bottom: calc(150px + var(--seguro-abajo)); display: flex; flex-direction: column; align-items: center; gap: 18px; }
.rail button, .rail a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); text-decoration: none; }
.rail .ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .15s; }
.rail button:active .ico { transform: scale(.88); }
.rail .ico svg { width: 26px; height: 26px; fill: #fff; }
.rail .ico.wa { background: var(--wa); }
.rail .me-gusta.on .ico svg { fill: #ff3d6e; animation: late .35s; }
@keyframes late { 50% { transform: scale(1.35); } }
.avatar { position: relative; margin-bottom: 8px; }
.avatar img { width: 50px; height: 50px; border-radius: 50%; border: 2px solid #fff; background: #000; object-fit: contain; padding: 6px; }
.avatar .mas { position: absolute; left: 50%; bottom: -9px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: var(--azul); color: #000; font-weight: 800; font-size: 16px; line-height: 22px; text-align: center; }
.disco { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle, #111 0 30%, #333 31% 34%, #111 35%); border: 7px solid #1c1c1c; animation: gira 4s linear infinite; overflow: hidden; }
.disco img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.reel.pausado .disco { animation-play-state: paused; }
@keyframes gira { to { transform: rotate(360deg); } }

/* pie del reel: perfil + texto + CTA */
.pie { position: absolute; z-index: 4; left: 0; right: 76px; bottom: 0; padding: 0 14px calc(18px + var(--seguro-abajo)); }
.perfil { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.perfil .verif { width: 16px; height: 16px; fill: var(--azul); }
.perfil .seguir { margin-left: 4px; padding: 4px 12px; border: 1px solid rgba(255, 255, 255, .7); border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; }
.descripcion { margin: 8px 0 0; font-size: 15px; line-height: 1.35; color: rgba(255, 255, 255, .92); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.descripcion.abierta { -webkit-line-clamp: unset; }
.descripcion b { font-family: var(--titulo); font-weight: 400; font-size: 12px; color: var(--azul); letter-spacing: .02em; margin-right: 6px; }
.tags { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--azul); }
.cta { margin-top: 12px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--blanco); color: #000; font-weight: 700; font-size: 16px; box-shadow: 0 8px 30px rgba(148, 198, 248, .35); }
.cta svg { width: 20px; height: 20px; fill: currentColor; }
.cta:active { transform: scale(.98); }
@media (max-height: 720px) { .tags, .musica { display: none; } .cta { padding: 12px 14px; } }
.musica { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--gris); overflow: hidden; white-space: nowrap; }
.musica svg { width: 14px; flex: none; fill: currentColor; }
.musica span { display: inline-block; padding-left: 100%; animation: marquesina 12s linear infinite; }
@keyframes marquesina { to { transform: translateX(-100%); } }
.progreso { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .18); }
.progreso i { display: block; height: 100%; width: 0; background: var(--blanco); }
.desliza { position: absolute; z-index: 4; left: 50%; bottom: 46%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); opacity: 0; transition: opacity .4s; pointer-events: none; }
.desliza svg { width: 34px; fill: #fff; animation: sube 1.2s ease-in-out infinite; }
.reel.terminado .desliza { opacity: 1; }
@keyframes sube { 50% { transform: translateY(-10px); } }
.reel.final { display: grid; place-items: center; text-align: center; padding: 90px 28px; background: radial-gradient(circle at 50% 30%, #12263a, #000 70%); }
.reel.final h2 { font-family: var(--titulo); font-weight: 400; font-size: 22px; line-height: 1.35; margin: 18px 0 10px; }
.reel.final p { color: var(--gris); font-size: 16px; line-height: 1.45; margin: 0 0 22px; }
.reel.final img { width: 72px; }
.reel.final .cta { max-width: 320px; margin: 10px auto 0; }
.reel.final .btn-linea { display: block; max-width: 320px; margin: 12px auto 0; padding: 13px 16px; border: 1px solid var(--borde); border-radius: 14px; font-weight: 600; text-decoration: none; }

/* ---------- Hoja de compartir ---------- */
.hoja { position: fixed; inset: 0; z-index: 20; }
.hoja-fondo { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); animation: aparece .25s; }
.hoja-panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; max-height: 88vh; overflow-y: auto; padding: 10px 18px calc(18px + var(--seguro-abajo)); background: #1a1a1a; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .5); animation: subeHoja .35s cubic-bezier(.2, .8, .2, 1); }
.hoja.cerrando .hoja-panel { animation: bajaHoja .25s ease-in forwards; }
.hoja.cerrando .hoja-fondo { animation: aparece .25s reverse forwards; }
@keyframes aparece { from { opacity: 0; } }
@keyframes subeHoja { from { transform: translateY(100%); } }
@keyframes bajaHoja { to { transform: translateY(100%); } }
.asa { width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); margin: 0 auto 12px; }
.hoja h2 { margin: 0; text-align: center; font-size: 18px; font-weight: 700; }
.hoja-sub { margin: 4px 0 14px; text-align: center; color: var(--gris); font-size: 14px; }
.hoja-seccion { margin: 14px 0 10px; font-size: 13px; font-weight: 600; color: var(--gris); text-transform: uppercase; letter-spacing: .06em; }
.redes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
.red-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .88); text-decoration: none; text-align: center; line-height: 1.15; }
.red-btn .c { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--bg, #333); transition: transform .15s; }
.red-btn:active .c { transform: scale(.9); }
.red-btn .c i { width: 26px; height: 26px; background: #fff; -webkit-mask: var(--icono) center / contain no-repeat; mask: var(--icono) center / contain no-repeat; }
.red-btn .c svg { width: 26px; height: 26px; fill: #fff; }
.enlace { display: flex; gap: 8px; margin-top: 18px; }
.enlace input { flex: 1; min-width: 0; padding: 12px; border-radius: 12px; border: 1px solid var(--borde); background: #111; color: var(--gris); font: 14px var(--texto); }
.enlace button { padding: 0 16px; border-radius: 12px; background: var(--azul); color: #000; font-weight: 700; }
.cancelar { display: block; width: 100%; margin-top: 12px; padding: 14px; border-radius: 14px; background: #262626; font-weight: 600; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(30px + var(--seguro-abajo)); transform: translate(-50%, 20px); max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px; background: #fff; color: #000; font-weight: 600; font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
