/* Preloader full screen overlay */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff; /* light mode bg */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

/* Dark mode background */
.dark-mode .preloader {
    background-color: #1a1a2e;
}

/* Hide when fade-out applied */
.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Loader wrapper (keeps it centered) */
.loader-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Worm Loader */
.ip {
    width: 12em;
    height: 6em;
}
.ip__track {
    stroke: #ddd;
}
.ip__worm1,
.ip__worm2 {
    animation: worm1 2s linear infinite;
}
.ip__worm2 {
    animation-name: worm2;
}

/* Animation */
@keyframes worm1 {
    from { stroke-dashoffset: 0; }
    50% { animation-timing-function: steps(1); stroke-dashoffset: -358; }
    50.01% { animation-timing-function: linear; stroke-dashoffset: 358; }
    to { stroke-dashoffset: 0; }
}
@keyframes worm2 {
    from { stroke-dashoffset: 358; }
    50% { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -358; }
}
