/* Alfa Network Academy — personalidad y animación (solo estética; mismos colores) */

/* Entrada / salida de página */
main, .site-footer { animation: pageIn .6s ease both; }
body.leaving main, body.leaving .site-footer { opacity: 0; transition: opacity .22s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Barra de progreso de scroll */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 3000; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--accent-soft)); box-shadow: 0 0 12px rgba(182,255,92,.6); pointer-events: none; }

/* Marca */
.site-nav .brand span { display: inline-block; animation: dotpulse 2.4s ease-in-out infinite; }
@keyframes dotpulse { 0%,100% { transform: scale(1); text-shadow: none; } 50% { transform: scale(1.35); text-shadow: 0 0 12px var(--accent); } }

/* Menú: subrayado que crece */
.site-nav ul li:not(:last-child) a { position: relative; background: transparent !important; }
.site-nav ul li:not(:last-child) a::after { content: ""; position: absolute; left: 15px; right: 15px; bottom: 14px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.site-nav ul li:not(:last-child) a:hover::after, .site-nav ul a[aria-current="page"]::after { transform: scaleX(1); }

/* Texto con brillo y palabra que se escribe */
.shimmer { background: linear-gradient(100deg, var(--accent) 20%, #eaffcc 45%, var(--accent) 70%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; animation: shimmer 4.5s linear infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -100% 0; } }
.typed { white-space: nowrap; position: relative; }
.typed::after { content: ""; position: absolute; right: -.14em; top: .12em; width: .07em; height: .85em; background: var(--accent); animation: blink 1s steps(1) infinite; }

/* Hero: lluvia de código y orbes */
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .5; -webkit-mask-image: linear-gradient(180deg, #000 20%, transparent 95%); mask-image: linear-gradient(180deg, #000 20%, transparent 95%); }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; opacity: .22; background: var(--accent); }
.orb.o1 { width: 340px; height: 340px; top: -120px; right: 6%; animation: float1 14s ease-in-out infinite; }
.orb.o2 { width: 240px; height: 240px; bottom: -90px; left: 8%; opacity: .12; animation: float2 18s ease-in-out infinite; }
@keyframes float1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-50px,40px); } }
@keyframes float2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(60px,-30px); } }

/* Terminal con inclinación suave */
.terminal-window { transition: transform .2s ease-out, box-shadow .3s; transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); will-change: transform; }
.terminal-window:hover { box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 40px rgba(182,255,92,.12); }

/* Tarjetas: luz que sigue al cursor + icono vivo */
.card-x { position: relative; isolation: isolate; }
.card-x::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s; background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(182,255,92,.14), transparent 60%); pointer-events: none; }
.card-x:hover::before { opacity: 1; }
.card-x .icon { display: inline-block; transition: transform .35s cubic-bezier(.3,1.6,.5,1), text-shadow .3s; }
.card-x:hover .icon { transform: translateY(-4px) rotate(-8deg) scale(1.12); text-shadow: 0 0 18px rgba(182,255,92,.55); }
.card-x .foot a { transition: letter-spacing .25s; }
.card-x .foot a:hover { letter-spacing: .04em; }

/* Botones: destello */
.btn-primary, .btn-dark, .btn-ghost { position: relative; overflow: hidden; }
.btn-primary::after, .btn-dark::after { content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); transition: left .6s ease; pointer-events: none; }
.btn-primary:hover::after, .btn-dark:hover::after { left: 130%; }

/* Franja con marquesina y cifras */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-soft); overflow: hidden; }
.marquee { overflow: hidden; padding: 16px 0; border-bottom: 1px solid var(--line); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; gap: 14px; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: var(--mono); font-size: .85rem; color: var(--muted); padding: 6px 16px; border: 1px solid var(--line); border-radius: 30px; white-space: nowrap; transition: color .2s, border-color .2s; }
.marquee-track span:hover { color: var(--accent); border-color: var(--accent); }
@keyframes marquee { to { transform: translateX(calc(-50% - 7px)); } }
.stats { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 16px; padding: 28px 0; }
.stats div { text-align: center; min-width: 120px; }
.stats b { display: block; font-size: clamp(2rem, 5vw, 2.8rem); color: var(--accent); line-height: 1; font-weight: 700; }
.stats span { color: var(--muted); font-size: .85rem; font-family: var(--mono); }

/* Revelado escalonado */
.js .reveal { transition-delay: calc(var(--d, 0) * 90ms); }

/* Login */
.auth-wrap { max-width: 480px; margin: 0 auto; }
.tablist { display: flex; gap: 6px; margin-bottom: 22px; padding: 4px; background: #0a0f0a; border: 1px solid var(--line); border-radius: 10px; }
.tablist button { flex: 1; background: transparent; border: 0; color: var(--muted); padding: 10px; border-radius: 7px; cursor: pointer; font-family: inherit; font-weight: 600; transition: background .2s, color .2s; }
.tablist button[aria-selected="true"] { background: var(--accent); color: #0d110d; }
.auth-wrap [hidden] { display: none !important; }
.login-msg.ok { color: var(--accent); }
.login-msg.bad { color: #ff8a80; }

@media (prefers-reduced-motion: reduce) {
    main, .site-footer { animation: none; }
    .shimmer { animation: none; -webkit-text-fill-color: initial; background: none; color: var(--accent); }
    .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
    .hero-canvas, .orb { display: none; }
}
