/* ──────────────────────────────────────────────────────────────────
   Hero Animation – Scene 1 (Animation_1)
   ────────────────────────────────────────────────────────────────── */

/* ─── Prevent horizontal scroll from off-screen elements ─────────── */

html,
body {
    overflow-x: hidden;
}

/* ─── Container ─────────────────────────────────────────────────── */

.er-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #000;
}

/* ─── Reveal background (Image 3) ────────────────────────────────── */

.er-reveal-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.er-reveal-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(12px);
    transform: scale(1.08) translateY(5%);
    will-change: transform, filter;
}

/* ─── Doors ──────────────────────────────────────────────────────── */

.er-doors {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    pointer-events: none;
}

.er-door {
    position: relative;
    width: 50%;
    height: 100%;
    overflow: hidden;
    will-change: transform;
}

.er-door img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Left door image aligns to right edge, right door to left edge
   so together they form one seamless visual when closed */
.er-door--left img {
    object-position: right center;
}

.er-door--right img {
    object-position: left center;
}

/* ─── Overlay content ────────────────────────────────────────────── */

.er-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.er-overlay__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    pointer-events: auto;
    will-change: transform;
    padding: 0 24px;
    /*
     * ┌──────────────────────────────────────────────────────┐
     * │  ADJUSTABLE – Initial vertical position              │
     * │  More negative = higher on screen before scroll      │
     * │  Current: -5vh                                       │
     * └──────────────────────────────────────────────────────┘
     */
    transform: translateY(-8vh);
}

/* ─── Logo ───────────────────────────────────────────────────────── */

.er-logo {
    margin-bottom: 10px;
    will-change: transform, opacity;
}

.er-logo img {
    max-width: 65px;
    height: auto;
    display: block;
}

/* ─── Title ──────────────────────────────────────────────────────── */

.er-title {
    font-family: 'Futura', 'Century Gothic', 'AppleGothic', sans-serif;
    font-size: clamp(26px, 6vw + 0.5rem, 80px);
    line-height: 1.1;
    margin: 0 0 30px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0 18px;
}

.er-title__text {
    color: #ffffff;
    font-weight: 300;
    font-style: normal;
    text-transform: none;
    /* Respect original casing */
}

/* ─── Keyword rotator ────────────────────────────────────────────── */

.er-title__keywords {
    position: relative;
    display: inline-block;
    min-width: 2ch;
    /* prevents layout shift */
}

.er-keyword {
    color: #FF8DA1;
    font-weight: 600;
    font-style: normal;
    text-transform: none;
    position: absolute;
    left: 0;
    top: 0;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.er-keyword.is-active {
    position: relative;
    opacity: 1;
}

/* ─── Buttons ────────────────────────────────────────────────────── */

.er-buttons {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.er-btn {
    font-family: 'Futura', 'Century Gothic', 'AppleGothic', sans-serif;
    font-size: clamp(14px, 1.5vw + 0.5rem, 22px);
    font-weight: 700;
    font-style: normal;
    text-transform: none;
    /* Respect original casing */
    padding: 10px 30px;
    border-radius: 30px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    line-height: 1.3;
}

.er-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Primary button (Button 1) */
.er-btn--primary {
    background-color: #FF8DA1;
    color: #000000;
    border: none;
}

/* Outline button (Button 2) */
.er-btn--outline {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid #FF8DA1;
}

/* ──────────────────────────────────────────────────────────────────
   Scene 2 – Toast Hands (Animation_2)
   ────────────────────────────────────────────────────────────────── */

.er-hands {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    /* behind overlay (z-index 3), above reveal-bg (z-index 1) */
    display: flex;
    align-items: flex-end;
    opacity: 0;
    will-change: transform, opacity;
    pointer-events: none;
}

.er-hand {
    position: relative;
    flex-shrink: 0;
}

.er-hand--left {
    width: 50%;
    z-index: 1;
}

.er-hand--right {
    width: 51%;
    margin-left: -1%;
    /* 2% overlap on the left hand */
    z-index: 2;
    /* right hand on top of left */
}

.er-hand img {
    width: 100%;
    height: auto;
    /* maintain aspect ratio, no stretching */
    display: block;
}

/* ──────────────────────────────────────────────────────────────────
   Scene 3 – Gallery Grid (Animation_3)
   ────────────────────────────────────────────────────────────────── */

.er-gallery {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: end;
    gap: 6px;
    width: 100%;
    opacity: 0;
    will-change: transform;
}

.er-gallery__col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.er-gallery__item {
    overflow: hidden;
    border-radius: 4px;
    position: relative;
}

.er-gallery__item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: filter 0.4s ease;
}

/* Hover: grayscale + blur */
.er-gallery__item:hover img {
    filter: grayscale(100%) blur(3px);
}

/* ─── Gradient Top (fades gallery behind title) ──────────────────── */

.er-gradient-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40vh;
    z-index: 9;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.85) 40%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    opacity: 0;
}

/* ──────────────────────────────────────────────────────────────────
   Scene 4 – Final Section (Animation_4)
   ────────────────────────────────────────────────────────────────── */

/* ─── Background image (behind everything) ───────────────────────── */

.er-anim4-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    opacity: 0;
}

.er-anim4-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─── Logo Shape (keyhole) ───────────────────────────────────────── */

.er-logo-shape {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 8;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

.er-logo-shape img {
    display: block;
    width: auto;
    height: auto;
    max-height: 80vh;
}

/* ─── Category Cards ─────────────────────────────────────────────── */

.er-cards {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: stretch;
    width: 90%;
    max-width: 1100px;
    opacity: 0;
    will-change: transform, opacity;
    pointer-events: none;
}

.er-cards.is-visible {
    pointer-events: auto;
}

.er-card {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    overflow: hidden;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.er-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.er-card__image {
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 30vh;
    overflow: hidden;
}

.er-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.er-card:hover .er-card__image img {
    transform: scale(1.05);
}

.er-card__title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    font-family: 'Futura', 'Century Gothic', 'AppleGothic', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 1px;
    line-height: 1.3;
    color: #ffffff;
}

/* ─── Footer Logo ────────────────────────────────────────────────── */

.er-footer-logo {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    opacity: 0;
    will-change: transform, opacity;
    pointer-events: none;
}

.er-footer-logo img {
    height: 24px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}

/* ─── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .er-logo {
        margin-bottom: 5px;
    }

    .er-logo img {
        max-width: 45px;
    }

    .er-title {
        gap: 0 10px;
        margin-bottom: 14px;
    }

    .er-btn {
        padding: 12px 28px;
    }

    .er-buttons {
        gap: 10px;
    }

    .er-gallery {
        gap: 4px;
    }

    .er-gallery__col {
        gap: 4px;
    }

    .er-logo-shape {
        top: 13%;
    }

    /* Cards: 2x2 grid on tablet */
    .er-cards {
        flex-wrap: wrap;
        width: 85%;
        gap: 10px;
        bottom: 6vh;
    }

    .er-card {
        flex: 0 0 calc(50% - 5px);
    }

    .er-card__image {
        max-height: 22vh;
        /* Reduced from 30vh to give more room for buttons */
    }

    .er-card__title {
        font-size: 13px;
        padding: 10px 8px;
        /* Tighter padding */
    }

    .er-footer-logo {
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
    }

    .er-footer-logo img {
        height: 18px;
    }
}

@media (max-width: 480px) {
    .er-btn {
        padding: 10px 20px;
    }

    .er-gallery {
        gap: 3px;
    }

    .er-gallery__col {
        gap: 3px;
    }

    .er-cards {
        width: 90%;
        gap: 8px;
    }

    .er-card {
        flex: 0 0 calc(50% - 4px);
    }

    .er-card__image {
        max-height: 20vh;
        /* Further reduced for small mobile */
    }

    .er-card__title {
        font-size: 11px;
        padding: 8px 6px;
        letter-spacing: 0.5px;
    }
}

/* ─── Height-based fixes specifically for shorter screens (like iPhone SE landscape or portrait) ─── */

@media (max-height: 750px) {
    .er-overlay__inner {
        padding: 0 16px;
    }

    .er-title {
        margin-bottom: 12px;
    }

    .er-btn {
        padding: 8px 20px;
    }

    .er-card__image {
        max-height: 22vh;
    }
}

@media (max-height: 600px) {
    .er-logo {
        margin-bottom: 5px;
    }

    .er-logo img {
        max-width: 45px;
    }

    .er-title {
        font-size: clamp(20px, 4vw, 26px);
    }

    .er-card__image {
        max-height: 18vh !important;
    }

    .er-cards {
        bottom: 4vh;
    }

    .er-card__title {
        padding: 6px 4px;
        font-size: 10px;
    }
}