/* ============================================
   HERO GALLERY ANIMATION OVERLAY
   Center is transparent window showing actual hero
   ============================================ */

/* Gallery Overlay Wrapper */
.hero-gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;   /* fallback */
    height: 100svh;  /* stable viewport height (mobile UI visible) */
    height: 100dvh;  /* dynamic viewport height (mobile address bar changes) */
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
}

.hero-gallery-overlay.visible {
    opacity: 1;
}

/* Gallery Grid */
.hero-gallery-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 16px;
    padding: 16px;
}

/* Gallery Items */
.hero-gallery-item {
    position: relative;
    overflow: hidden;
    opacity: 1;
    transform: scale(1) translate(0, 0);
    transition: all 0.6s cubic-bezier(0.76, 0, 0.24, 1);
}

.hero-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Center Window - Transparent to show hero behind */
.hero-gallery-item.hero-gallery-center {
    background: transparent;
    backdrop-filter: none;
    transform: scale(1) translate(0, 0);
    transition: all 0.6s cubic-bezier(0.76, 0, 0.24, 1);
}

/* Animation Out States */
.hero-gallery-item.animating-out {
    transform: scale(0.3) translate(var(--tx), var(--ty));
    opacity: 0;
}

/* Center window fades out */
.hero-gallery-item.hero-gallery-center.animating-out {
    transform: scale(1.5);
    opacity: 0;
    border-color: transparent;
}

/* ============================================\n   RESPONSIVE DESIGN\n   ============================================ */

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .hero-gallery-grid {
        gap: 10px;
        padding: 10px;
    }

}

@media (max-width: 480px) {
    .hero-gallery-grid {
        gap: 8px;
        padding: 8px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .hero-gallery-overlay {
        display: none !important;
    }

    #hero.hero-split,
    #hero.hero-section {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================
   LOADING OPTIMIZATION
   ============================================ */

.hero-gallery-item img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.hero-gallery-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-background);
    z-index: -1;
}

/* ============================================
   PAUSE BUTTON
   ============================================ */

.hero-gallery-pause-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    padding: 12px 24px;
    background: rgba(255, 68, 68, 0.9);
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, transform 0.2s ease;
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-gallery-pause-btn:hover {
    background: rgba(255, 68, 68, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.hero-gallery-pause-btn:active {
    transform: translateY(0);
}

.hero-gallery-pause-btn.paused {
    background: rgba(68, 170, 68, 0.9);
}

.hero-gallery-pause-btn.paused:hover {
    background: rgba(68, 170, 68, 1);
}

@media (max-width: 768px) {
    .hero-gallery-pause-btn {
        bottom: 15px;
        right: 15px;
        padding: 10px 20px;
        font-size: 12px;
    }
}

