/* App-style splash — homepage entry only */
body.splash-lock {
    overflow: hidden;
    height: 100%;
}

body.splash-lock .store-main {
    visibility: hidden;
}

body.splash-reveal .store-main {
    visibility: visible;
    animation: splashContentIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

.app-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f0f12;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.65s step-end;
}

.app-splash.is-exiting {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.65s step-end 0.65s;
}

.app-splash__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(201, 162, 91, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 100% 100% at 50% 100%, rgba(255, 255, 255, 0.04) 0%, transparent 50%),
        linear-gradient(165deg, #1a1a22 0%, #0d0d10 45%, #121218 100%);
    opacity: 0;
    animation: splashBgIn 0.9s ease-out forwards;
}

.app-splash.is-exiting .app-splash__bg {
    animation: splashBgOut 0.65s ease-in forwards;
}

@keyframes splashBgIn {
    from { opacity: 0; transform: scale(1.08); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes splashBgOut {
    to { opacity: 0; transform: scale(1.04); }
}

.app-splash__shine {
    position: absolute;
    inset: -50%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.06) 48%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.06) 52%,
        transparent 60%
    );
    transform: translateX(-100%) rotate(12deg);
    animation: splashShine 1.2s ease-out 0.35s forwards;
    pointer-events: none;
}

@keyframes splashShine {
    to { transform: translateX(100%) rotate(12deg); }
}

.app-splash__frame {
    position: relative;
    width: min(92vw, 420px);
    aspect-ratio: 1;
    border-radius: 28px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 24px 80px rgba(0, 0, 0, 0.55),
        0 8px 32px rgba(201, 162, 91, 0.12);
    opacity: 0;
    transform: scale(0.88) translateY(24px);
    animation: splashFrameIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.app-splash.is-exiting .app-splash__frame {
    animation: splashFrameOut 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes splashFrameIn {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes splashFrameOut {
    to {
        opacity: 0;
        transform: scale(1.06) translateY(-12px);
        filter: blur(6px);
    }
}

.app-splash__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.app-splash__loader {
    position: absolute;
    bottom: max(28px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    opacity: 0;
    animation: splashLoaderIn 0.5s ease-out 0.55s forwards;
}

.app-splash.is-exiting .app-splash__loader {
    animation: splashLoaderOut 0.3s ease-in forwards;
}

@keyframes splashLoaderIn {
    to { opacity: 1; }
}

@keyframes splashLoaderOut {
    to { opacity: 0; transform: translateX(-50%) translateY(8px); }
}

.app-splash__bar {
    width: 120px;
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
}

.app-splash__bar-fill {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #c9a25b, #e8d5a8, #c9a25b);
    border-radius: 999px;
    animation: splashProgress 3.2s cubic-bezier(0.4, 0, 0.2, 1) 0.75s forwards;
}

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

.app-splash__label {
    font-family: 'Tajawal', 'Inter', sans-serif;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

@media (prefers-reduced-motion: reduce) {
    .app-splash__bg,
    .app-splash__frame,
    .app-splash__shine,
    .app-splash__loader,
    .app-splash__bar-fill,
    body.splash-reveal .store-main {
        animation: none !important;
        transition: none !important;
    }

    .app-splash__frame { opacity: 1; transform: none; }
    .app-splash__loader { opacity: 1; }
}
