@import url('/assets/fonts/plus-jakarta-sans/plus-jakarta-sans.css');
@import url('/assets/fonts/vazirmatn/vazirmatn.css');

.splash-page {
    --splash-bg: #060d1f;
    --splash-bg-mid: #0c1e4a;
    --splash-blue: #3b82f6;
    --splash-cyan: #22d3ee;
    --splash-orange: #f97316;
    --splash-amber: #fbbf24;
    --splash-card: rgba(8, 16, 40, 0.72);
    --splash-card-edge: rgba(96, 165, 250, 0.18);
    --splash-word-accent: #7dd3fc;
    margin: 0;
    min-height: 100dvh;
    overflow: hidden;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', 'Vazirmatn', system-ui, sans-serif;
    background:
        radial-gradient(ellipse 90% 70% at 50% 0%, rgba(59, 130, 246, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 80%, rgba(249, 115, 22, 0.12), transparent 50%),
        radial-gradient(ellipse 60% 45% at 0% 70%, rgba(34, 211, 238, 0.08), transparent 45%),
        linear-gradient(168deg, var(--splash-bg) 0%, var(--splash-bg-mid) 42%, #123777 100%);
    color: #fff;
}

html.theme-dark .splash-page,
.splash-page.theme-dark {
    --splash-bg: #020617;
    --splash-bg-mid: #0f172a;
    --splash-card: rgba(4, 10, 28, 0.82);
}

.splash-noise {
    position: fixed;
    inset: 0;
    opacity: 0.035;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.splash-aurora {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    opacity: 0.45;
    animation: splashAurora 12s ease-in-out infinite;
}

.splash-aurora--blue {
    width: 320px;
    height: 320px;
    top: -80px;
    left: -60px;
    background: rgba(59, 130, 246, 0.35);
}

.splash-aurora--orange {
    width: 280px;
    height: 280px;
    right: -40px;
    bottom: 10%;
    background: rgba(249, 115, 22, 0.28);
    animation-delay: -4s;
}

@keyframes splashAurora {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    50% { transform: translate(20px, -16px) scale(1.08); opacity: 0.55; }
}

.splash-stage {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2.5rem 1.5rem 3rem;
}

.splash-circuit-wrap {
    width: min(400px, 92vw);
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    animation: splashReveal 1s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.splash-circuit {
    width: 100%;
    height: auto;
    display: block;
}

.splash-trace-bg {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1.6;
    fill: none;
}

.splash-trace-flow {
    stroke-width: 1.8;
    fill: none;
    stroke-dasharray: 36 320;
    stroke-dashoffset: 356;
    filter: drop-shadow(0 0 5px currentColor);
    animation: splashTraceFlow 2.8s cubic-bezier(0.45, 0, 0.85, 1) infinite;
}

.splash-trace-flow--blue {
    stroke: var(--splash-blue);
    color: var(--splash-blue);
}

.splash-trace-flow--cyan {
    stroke: var(--splash-cyan);
    color: var(--splash-cyan);
    animation-delay: 0.35s;
}

.splash-trace-flow--orange {
    stroke: var(--splash-orange);
    color: var(--splash-orange);
    animation-delay: 0.7s;
}

.splash-trace-flow--amber {
    stroke: var(--splash-amber);
    color: var(--splash-amber);
    animation-delay: 1.05s;
}

@keyframes splashTraceFlow {
    to { stroke-dashoffset: 0; }
}

.splash-node {
    fill: rgba(255, 255, 255, 0.35);
    animation: splashNodePulse 2.4s ease-in-out infinite;
}

.splash-nodes circle:nth-child(2) { animation-delay: 0.2s; }
.splash-nodes circle:nth-child(3) { animation-delay: 0.4s; }
.splash-nodes circle:nth-child(4) { animation-delay: 0.15s; }
.splash-nodes circle:nth-child(5) { animation-delay: 0.35s; }
.splash-nodes circle:nth-child(6) { animation-delay: 0.55s; }

@keyframes splashNodePulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
}

.splash-chip {
    animation: splashChipPulse 3.2s ease-in-out infinite;
}

@keyframes splashChipPulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.35)); }
    50% { filter: drop-shadow(0 0 14px rgba(249, 115, 22, 0.45)); }
}

.splash-chip-logo {
    animation: splashLogoFloat 4s ease-in-out infinite;
    transform-origin: 200px 140px;
}

@keyframes splashLogoFloat {
    0%, 100% { transform: translate(200px, 140px) scale(1); }
    50% { transform: translate(200px, 136px) scale(1.04); }
}

.splash-pin {
    fill: rgba(148, 163, 184, 0.55);
}

.splash-brand {
    text-align: center;
    opacity: 0;
    animation: splashReveal 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards;
}

.splash-title {
    margin: 0 0 0.4rem;
    font-size: clamp(2.1rem, 8vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    background: linear-gradient(125deg, #ffffff 0%, #93c5fd 40%, #fdba74 85%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.splash-tagline {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.62);
    letter-spacing: 0.02em;
}

.splash-loader-card {
    --loader-bg: var(--splash-card);
    padding: 0.85rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--splash-card-edge);
    background: var(--loader-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    opacity: 0;
    animation: splashReveal 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.55s forwards;
}

.splash-loader {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    height: 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
}

.splash-loader-label {
    flex-shrink: 0;
}

.splash-words {
    overflow: hidden;
    position: relative;
    height: 2rem;
    line-height: 2rem;
}

.splash-words::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        var(--loader-bg) 8%,
        transparent 28%,
        transparent 72%,
        var(--loader-bg) 92%
    );
    z-index: 2;
    pointer-events: none;
}

.splash-word {
    display: block;
    padding-inline-start: 0.35rem;
    color: var(--splash-word-accent);
    font-weight: 700;
    animation: splashWordCycle 4s infinite;
}

.splash-word:nth-child(2) { animation-delay: 0.05s; }
.splash-word:nth-child(3) { animation-delay: 0.1s; }
.splash-word:nth-child(4) { animation-delay: 0.15s; }
.splash-word:nth-child(5) { animation-delay: 0.2s; }

@keyframes splashWordCycle {
    0%, 8% { transform: translateY(0); }
    18%, 23% { transform: translateY(-100%); }
    33%, 38% { transform: translateY(-200%); }
    48%, 53% { transform: translateY(-300%); }
    63%, 68% { transform: translateY(-400%); }
    78%, 100% { transform: translateY(-400%); }
}

.splash-progress {
    width: min(200px, 55vw);
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    opacity: 0;
    animation: splashReveal 0.7s ease 0.75s forwards;
}

.splash-progress-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--splash-blue), var(--splash-cyan), var(--splash-orange));
    animation: splashProgressFill 3.6s cubic-bezier(0.4, 0, 0.2, 1) 0.75s forwards;
}

@keyframes splashProgressFill {
    to { width: 100%; }
}

.splash-hint {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.38);
    opacity: 0;
    animation: splashReveal 0.7s ease 1s forwards;
}

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

.splash-page.is-leaving .splash-stage {
    animation: splashStageOut 0.5s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes splashStageOut {
    to {
        opacity: 0;
        transform: scale(1.03);
        filter: blur(6px);
    }
}

@media (max-width: 480px) {
    .splash-circuit-wrap {
        width: min(340px, 94vw);
    }

    .splash-loader-card {
        padding: 0.75rem 1.15rem;
    }

    .splash-loader {
        font-size: 0.95rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .splash-aurora,
    .splash-trace-flow,
    .splash-node,
    .splash-chip,
    .splash-chip-logo,
    .splash-word,
    .splash-circuit-wrap,
    .splash-brand,
    .splash-loader-card,
    .splash-progress,
    .splash-hint {
        animation: none !important;
    }

    .splash-circuit-wrap,
    .splash-brand,
    .splash-loader-card,
    .splash-progress,
    .splash-hint {
        opacity: 1;
        transform: none;
    }

    .splash-progress-bar {
        width: 100%;
    }

    .splash-word {
        transform: none;
    }

    .splash-words .splash-word:not(:first-child) {
        display: none;
    }
}