/* ── SPLASH SCREEN ───────────────────────────────────────────────────────── */

#splash {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #020208;
    overflow: hidden;
}

/* Canvas animazione: sfondo assoluto, dietro tutto */
#splash-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Contenuto: sopra il canvas, centrato */
.splash-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.8rem;
    pointer-events: none;
    z-index: 10;
    padding-top: 6vh;
}

/* ── LOGO ────────────────────────────────────────────────────────────────── */

.splash-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.8rem, 9vw, 5.5rem);
    font-weight: 900;
    letter-spacing: 8px;
    color: #fff;
    position: relative;
    opacity: 0;
    animation: splashLogoIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both,
               splashLogoGlow 2.5s ease 1.3s infinite alternate;
}

.splash-logo span {
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 50%, #22d3ee 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.splash-logo::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #a855f7, #22d3ee, transparent);
    animation: splashLineIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.1s both;
}

/* ── TAGLINE ─────────────────────────────────────────────────────────────── */

.splash-tagline {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.55rem, 1.5vw, 0.72rem);
    letter-spacing: 5px;
    color: rgba(148, 163, 184, 0.7);
    text-transform: uppercase;
    opacity: 0;
    animation: splashFadeUp 0.5s ease 1.0s both;
}

/* ── BARRA PROGRESSO ─────────────────────────────────────────────────────── */

.splash-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    animation: splashFadeUp 0.5s ease 1.2s both;
}

.splash-bar {
    width: min(320px, 70vw);
    height: 2px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 2px;
    position: relative;
    overflow: visible;
}

.splash-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #a855f7, #3b82f6, #22d3ee);
    border-radius: 2px;
    transition: width 0.08s linear;
    position: relative;
}

.splash-bar-fill::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px 2px rgba(168,85,247,.9), 0 0 16px 4px rgba(59,130,246,.6);
}

.splash-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 3px;
    color: rgba(148, 163, 184, 0.5);
    text-transform: uppercase;
    min-height: 1em;
    transition: opacity 0.2s ease;
}

/* ── USCITA ──────────────────────────────────────────────────────────────── */

#splash.hide {
    animation: splashOut 0.8s cubic-bezier(0.4, 0, 1, 1) both;
    pointer-events: none;
}

/* ── KEYFRAMES ───────────────────────────────────────────────────────────── */

@keyframes splashLogoIn {
    0%   { opacity: 0; transform: scale(0.7) translateY(16px); }
    60%  { opacity: 1; transform: scale(1.03) translateY(-2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes splashLogoGlow {
    from { text-shadow: 0 0 20px rgba(168,85,247,.3), 0 0 60px rgba(168,85,247,.1); }
    to   { text-shadow: 0 0 30px rgba(168,85,247,.8), 0 0 80px rgba(59,130,246,.3); }
}

@keyframes splashLineIn {
    from { transform: translateX(-50%) scaleX(0); opacity: 0; }
    to   { transform: translateX(-50%) scaleX(1); opacity: 1; }
}

@keyframes splashFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes splashOut {
    0%   { opacity: 1; transform: scale(1);    filter: blur(0px); }
    100% { opacity: 0; transform: scale(1.08); filter: blur(12px); }
}
