/* ============================================================
   THM Motorcycle - Showroom shutter loading screen
   The page renders behind a rolling shutter; when ready, the
   shutter lifts to reveal the page. No progress bar or percent.
   ============================================================ */

html.thm-loading,
html.thm-loading body {
    overflow: hidden;
}

.thm-preloader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    overflow: hidden;
    font-family: 'Roboto', Arial, sans-serif;
    color: var(--text-primary, #ffffff);
    background: transparent;
}

/* Roll-up shutter covering the page */
.thm-shutter {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #090909;
    background-image:
        radial-gradient(ellipse at 50% 45%, rgba(230, 0, 18, 0.14) 0%, rgba(230, 0, 18, 0.03) 34%, transparent 62%),
        repeating-linear-gradient(
            180deg,
            #1b1b1b 0px,
            #161616 2px,
            #101010 9px,
            #0a0a0a 18px,
            #050505 21px,
            #0d0d0d 23px,
            #1b1b1b 26px
        );
    box-shadow:
        inset 0 0 150px rgba(0, 0, 0, 0.92),
        inset 0 0 40px rgba(0, 0, 0, 0.7),
        0 34px 70px rgba(0, 0, 0, 0.8);
    transform: translateY(0);
    transition: transform 0.65s cubic-bezier(0.76, 0, 0.24, 1);
    will-change: transform;
}

/* Side and top/bottom vignette */
.thm-shutter::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.62) 0%, transparent 14%, transparent 86%, rgba(0, 0, 0, 0.62) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 18%, transparent 82%, rgba(0, 0, 0, 0.62) 100%);
    pointer-events: none;
}

/* Red leading edge at the bottom of the shutter */
.thm-shutter::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--yamaha-red, #e60012) 18%, #ff5a63 50%, var(--yamaha-red, #e60012) 82%, transparent);
    box-shadow: 0 0 26px rgba(230, 0, 18, 0.65);
    transition: height 0.2s ease, box-shadow 0.2s ease;
}

.thm-shutter-brand {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

/* Soft spotlight behind the logo */
.thm-shutter-brand::before {
    content: "";
    position: absolute;
    width: min(92vw, 760px);
    height: min(92vw, 760px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(230, 0, 18, 0.18) 0%, rgba(230, 0, 18, 0.05) 38%, transparent 68%);
    filter: blur(12px);
    z-index: -1;
    pointer-events: none;
    animation: thmShutterHalo 3s ease-in-out infinite;
}

.thm-shutter-kicker {
    margin-bottom: 1.25rem;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.46em;
    text-indent: 0.46em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

.thm-shutter-logo {
    width: clamp(220px, 35vw, 360px);
    height: auto;
    filter:
        drop-shadow(0 18px 36px rgba(0, 0, 0, 0.85))
        drop-shadow(0 0 30px rgba(230, 0, 18, 0.12));
    animation: thmShutterLogoIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    user-select: none;
}

.thm-shutter-rule {
    position: relative;
    display: block;
    width: 76px;
    height: 2px;
    margin-top: 1.8rem;
    background: linear-gradient(90deg, transparent, var(--yamaha-red, #e60012), transparent);
    opacity: 0.8;
}

.thm-shutter-rule::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 150%;
    height: 22px;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center, rgba(230, 0, 18, 0.45) 0%, transparent 70%);
    filter: blur(6px);
    animation: thmShutterPulse 1.8s ease-in-out infinite;
}

/* Ready: the leading light comes alive just before the lift */
.thm-preloader.is-ready .thm-shutter::after {
    height: 4px;
    box-shadow: 0 0 38px rgba(230, 0, 18, 0.95);
}

.thm-preloader.is-ready .thm-shutter-brand {
    transform: translateY(-4px);
    transition: transform 0.3s ease;
}

.thm-preloader.is-ready .thm-shutter-rule {
    opacity: 1;
}

/* Opening: the shutter rolls upward and reveals the page */
.thm-preloader.is-open .thm-shutter {
    transform: translateY(-100%);
}

@keyframes thmShutterLogoIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes thmShutterHalo {
    0%,
    100% {
        opacity: 0.55;
        transform: scale(0.96);
    }
    50% {
        opacity: 1;
        transform: scale(1.04);
    }
}

@keyframes thmShutterPulse {
    0%,
    100% {
        opacity: 0.35;
        transform: translate(-50%, -50%) scaleX(0.8);
    }
    50% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scaleX(1.15);
    }
}

@media (max-width: 520px) {
    .thm-shutter-brand {
        padding: 1.5rem;
    }

    .thm-shutter-logo {
        width: min(72vw, 290px);
    }

    .thm-shutter-rule {
        margin-top: 1.5rem;
    }
}

@media (max-height: 480px) {
    .thm-shutter-kicker {
        margin-bottom: 0.8rem;
    }

    .thm-shutter-logo {
        width: min(50vw, 250px);
    }

    .thm-shutter-rule {
        margin-top: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .thm-shutter-logo,
    .thm-shutter-brand::before,
    .thm-shutter-rule::after {
        animation: none;
    }

    .thm-preloader.is-open .thm-shutter {
        transform: none;
        opacity: 0;
        transition: opacity 0.2s ease;
    }
}
