/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.story-header,
.story-footer {
    padding: 4rem 2rem;
    text-align: center;
    background: #fff;
    z-index: 10;
    position: relative;
}

.story-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Scrolly Sections */
.scrolly-section {
    position: relative;
    width: 100%;
}

/* Video Section */
#video-section {
    /* Height is now determined by the scrolling steps content */
}

/* Image Sequence Section - Grid Layout for Overlap */
#image-section,
#video-section {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    /* Height is now determined by content (steps) */
}

/* Ensure both children occupy the same grid cell to overlap */
.sticky-wrapper,
.scrolling-steps {
    grid-column: 1;
    grid-row: 1;
}

.sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    /* Behind text */
}

/* Video Styling */
#scrolly-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    z-index: 1;
}

/* Overlay Text Logic */
.overlay-text {
    position: absolute;
    z-index: 10;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    transform: translateY(20px);
    pointer-events: none;
    /* Let clicks pass through */
}

/* Image Sequence Styles */
#image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #000;
}

.scrolly-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.1s ease;
    /* Smooth crossfade */
}

/* --- MOBILE VIEWPORT TWEAKS --- */
@media (max-width: 768px) {
    
    /* Shift the focal point of the satellite images */
    .scrolly-img {
        /* < 50% shifts the image right (shows more of the left side)
           > 50% shifts the image left (shows more of the right side)
           Adjust the 25% value until it looks right for your specific images.
        */
        object-position: 67% center; 
    }

    /* Optional: If you also want to shift the video in the first section 
    #scrolly-video {
        object-position: 25% center;
    } */
}

.scrolly-img:first-child {
    opacity: 1;
    /* Start visible */
}

.scrolling-steps {
    position: relative;
    z-index: 10;
    /* Above images */
    pointer-events: none;
    /* Let clicks pass through if needed, but text selectable? */
}

/* Re-enable pointer events for text boxes themselves */
.text-box {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 4px;
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 1.2rem;
    max-width: 600px;
    /* Remove display:none as we want them visible always now, scrolling up */
    display: block;
}

.step {
    /* Each step takes up full viewport height to space out the story */
    height: 200vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Optional: alternating positions or centered */
}

/* Active class utilities */
.visible {
    opacity: 1;
    transform: translateY(0);
}
