/* ================================================
   Homepage Intro Preloader (index.php only)
   Logo transformation + locations + auto/continue
================================================= */

.home-preloader-lock {
    overflow: hidden !important;
    height: 100%;
}

.home-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #eef5ec 0%, #ffffff 55%, #fdf3e8 100%);
    overflow-y: auto;
    padding: 40px 20px;
    opacity: 1;
    visibility: visible;
    transition: opacity .5s ease, visibility .5s ease;
}

.home-preloader.is-closing {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.home-preloader__progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(91, 140, 81, .15);
    z-index: 2;
}

.home-preloader__progress span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--theme-color), var(--theme-color-2));
}

.home-preloader__progress span.is-running {
    width: 100%;
    transition: width 6s linear;
}

.home-preloader__inner {
    max-width: 640px;
    width: 100%;
    margin: auto;
    text-align: center;
}

/* ---- Logo transformation: old logo dissolves away in a closing
   iris wipe while the new logo blooms into view underneath it ---- */
.logo-morph {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
}

.logo-morph__ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px dashed rgba(91, 140, 81, .35);
    animation: hpRingSpin 12s linear infinite;
}

.logo-morph__stage {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 10px 30px rgba(10, 40, 3, .12);
    overflow: hidden;
}

.logo-morph__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
}

/* Old logo holds for 1.5s, then dissolves into the new logo over ~0.5s
   (kept in sync with HOLD_BEFORE_TRANSFORM_MS in home-preloader.js) */
.logo-morph__img--new {
    opacity: 0;
    transform: scale(.82);
    animation: hpNewReveal .6s cubic-bezier(.34, 1.56, .64, 1) 1.4s forwards;
}

.logo-morph__img--old {
    z-index: 2;
    clip-path: circle(150% at 50% 50%);
    animation: hpOldDissolve .5s cubic-bezier(.65, 0, .35, 1) 1.5s forwards;
}

.logo-morph__sheen {
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: 50%;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, .85) 50%, transparent 58%);
    transform: translateX(-130%);
    animation: hpSheen .3s ease 2.05s forwards;
}

@keyframes hpOldDissolve {
    0% {
        clip-path: circle(150% at 50% 50%);
    }

    100% {
        clip-path: circle(0% at 50% 50%);
    }
}

@keyframes hpNewReveal {
    0% {
        opacity: 0;
        transform: scale(.82);
    }

    60% {
        opacity: 1;
        transform: scale(1.06);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes hpSheen {
    to {
        transform: translateX(130%);
    }
}

@keyframes hpRingSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ---- Text ---- */
.home-preloader__eyebrow {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 14px;
    font-weight: 700;
    color: var(--theme-color-2);
    margin-bottom: 6px;
}

.home-preloader__brand {
    font-size: 42px;
    font-weight: 900;
    color: var(--header);
    margin-bottom: 24px;
}

/* ---- Locations ---- */
.home-preloader__locations-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    color: var(--theme-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    margin-bottom: 14px;
}

.location-cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 30px;
}

.location-card {
    flex: 1 1 260px;
    max-width: 320px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 20px;
    text-align: left;
    box-shadow: 0 8px 20px rgba(10, 40, 3, .05);
}

.location-card h4 {
    font-size: 16px;
    font-weight: 800;
    color: var(--header);
    margin: 0 0 6px;
    white-space: nowrap;
}

.location-card p {
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.5;
}

.home-preloader__btn {
    border: none;
    cursor: pointer;
}

/* ---- Staggered fade-up reveal ---- */
.hp-fade {
    opacity: 0;
    transform: translateY(16px);
    animation: hpFadeUp .4s ease forwards;
}

.hp-fade--1 {
    animation-delay: 2.2s;
}

.hp-fade--2 {
    animation-delay: 2.3s;
}

.hp-fade--3 {
    animation-delay: 2.4s;
}

.hp-fade--4 {
    animation-delay: 2.5s;
}

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

@media (max-width: 575px) {
    .logo-morph {
        width: 130px;
        height: 130px;
    }

    .home-preloader__brand {
        font-size: 28px;
    }

    .home-preloader__eyebrow {
        font-size: 12px;
    }

    .location-cards {
        gap: 12px;
    }

    .location-card {
        padding: 14px 16px;
        flex: 1 1 100%;
        max-width: 320px;
    }

    .location-card h4 {
        white-space: normal;
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .logo-morph__img--new,
    .logo-morph__ring,
    .hp-fade {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .logo-morph__img--old,
    .logo-morph__sheen {
        display: none;
    }
}
