﻿#preloader {
    position: fixed;
    inset: 0;
    background-color: var(--bg-color);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

body.is-initiated #preloader {
    animation: hidePreloader 0.8s ease 1s forwards;
    pointer-events: none;
}

.fluid-orb {
    width: 60px;
    height: 60px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

body.is-initiated .fluid-orb {
    animation: collapseOrb 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fluid-orb::before, .fluid-orb::after, .orb-inner {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    border: 2px solid var(--accent-glow);
    box-shadow: 0 0 15px rgba(186, 230, 253, 0.3);
    animation: fluidRotate 1.5s linear infinite;
}

.fluid-orb::after {
    border-color: rgba(255, 255, 255, 0.6);
    border-width: 1px;
    animation-duration: 2s;
    animation-direction: reverse;
}

.orb-inner {
    border: none;
    background: rgba(186, 230, 253, 0.2);
    animation-duration: 1.2s;
    filter: blur(4px);
}

.initiate-text {
    position: absolute;
    top: calc(50% + 70px);
    font-family: 'Syne', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.5rem;
    color: rgba(186, 230, 253, 0.8);
    text-transform: uppercase;
    animation: pulseText 2s infinite alternate;
}

body.is-initiated .initiate-text {
    opacity: 0 !important;
    transition: opacity 0.1s ease;
    animation: none;
}

.preloader-blast {
    position: absolute;
    width: 0;
    height: 0;
    border: 2px solid var(--accent-glow);
    border-radius: 50%;
    opacity: 0;
}

body.is-initiated .preloader-blast {
    animation: ringBlast 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes fluidRotate {
    0% {
        transform: rotate(0deg);
        border-radius: 40% 60% 60% 40% / 70% 30% 70% 30%;
    }

    50% {
        border-radius: 70% 30% 40% 60% / 30% 70% 40% 60%;
    }

    100% {
        transform: rotate(360deg);
        border-radius: 40% 60% 60% 40% / 70% 30% 70% 30%;
    }
}

@keyframes collapseOrb {
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.1);
    }
}

@keyframes ringBlast {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
        border-width: 6px;
    }

    100% {
        width: 150vmax;
        height: 150vmax;
        opacity: 0;
        border-width: 1px;
    }
}

@keyframes hidePreloader {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes pulseText {
    0% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
        text-shadow: 0 0 15px rgba(186,230,253,0.8);
    }
}
