html.jah-loading {
    cursor: progress;
}

html.jah-loading::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: color-mix(in srgb, var(--bg, #eef2f5) 82%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;
}

html[data-theme="dark"].jah-loading::before {
    background: color-mix(in srgb, var(--bg, #071018) 88%, transparent);
}

.jah-page-loader {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100002;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    isolation: isolate;
}

html.jah-loading .jah-page-loader {
    display: flex;
}

.jah-page-loader__stage {
    position: relative;
    width: 7.25rem;
    height: 7.25rem;
    border-radius: 18px;
    background: #0a0a0a;
    overflow: hidden;
    transform: translateZ(0);
    backface-visibility: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    animation: jah-logo-load 1.1s ease-in-out infinite;
}

.jah-page-loader__logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #0a0a0a;
}

.jah-page-loader__shade {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    pointer-events: none;
    background:
        radial-gradient(
            circle at 50% 46%,
            rgba(228, 195, 90, 0.18) 0%,
            rgba(10, 8, 4, 0.28) 44%,
            rgba(0, 0, 0, 0.55) 78%
        );
    animation: jah-shade-open 1.7s ease-in-out infinite;
}

@keyframes jah-logo-load {
    0%, 100% { transform: translateZ(0) rotate(0deg); }
    45% { transform: translateZ(0) rotate(8deg); }
}

@keyframes jah-shade-open {
    0%, 100% {
        clip-path: circle(0% at 50% 46%);
        opacity: 1;
    }
    42%, 52% {
        clip-path: circle(72% at 50% 46%);
        opacity: 0.95;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jah-page-loader__stage {
        animation: none;
    }
    .jah-page-loader__shade {
        animation: none;
        clip-path: circle(0% at 50% 46%);
    }
}

@media (min-width: 900px) {
    .jah-page-loader__stage {
        width: 8.5rem;
        height: 8.5rem;
        border-radius: 20px;
    }
}
