body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: black;
    overflow-x: hidden;
}

html {
    scroll-behavior: auto;
}

body {
    overflow-y: hidden;
}

.scroll-container {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

.video-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    scroll-snap-align: start;
    min-height: 100vh; /* Ensure the section fills the viewport height */
    background-color: #000;
}

.poster-image {
    opacity: 1;          /* Fully visible initially */
    z-index: 2;          /* Layered above the video */
}

.bg-video {
    opacity: 1;
    z-index: 1;          /* Behind the poster */
}

.bg-video, .poster-image {
    position: absolute;
    top: 50%;
    left: 50%;
    width: auto;
    height: auto;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    will-change: opacity;
}

/* Media Queries for Responsive Video Scaling */
/* For Viewports Wider than the Video's Aspect Ratio*/
@media (min-aspect-ratio: 16/9) {
    .poster-image,
    .bg-video {
        width: 100%;
        height: auto;
    }
}

/* For Viewports Narrower than the Video's Aspect Ratio */
@media (max-aspect-ratio: 16/9) {
    .poster-image,
    .bg-video{
        width: auto;
        height: 100%;
    }
}

/* Overlay Text Styling */
.overlay {
    position: absolute;
    width: 100%;
    max-height: 90%;
    left: 55px;
    text-align: left; 
    display: flex;
    justify-content: left;
    align-items: flex-start;
    bottom: 15%;
    z-index: 100;
    opacity: 0;
    will-change: opacity, transform;
}

.overlay-link{
    display: block;
    text-decoration: none;
    color: inherit;
}

.text-and-image-container {
    display: flex;
    flex-direction: column;
    align-items: left;
    position: relative;
}

.overlay h1 {
    color:#ffffff;
    font-size: 2.5em;
    font-family: "spectral", sans-serif;
    font-weight: 200;
    font-style: italic;
    text-transform: lowercase;
}

#section1 .overlay h2 {
    margin-bottom: -15px;
}

#section2 .overlay h2 {
    margin-bottom: -5px;
    margin-left: 2px;
}

#section3 .overlay h2 {
    margin-bottom: -5px;
    margin-left: 3px;
}

#section4 .overlay h2 {
    margin-bottom: -7px;
    margin-left: 2px;
}

#section4 .image-container {
    margin-top: -5px;
    margin-left: -5px;
}

#section6 .overlay h2 {
    margin-bottom: -7px;
    margin-left: 2px;
}

.overlay h2 {
    font-size: 0.9em;
    font-family: "greycliff-cf", sans-serif;
    font-weight: 200;
    font-style: normal;
    text-transform: lowercase;
    color: #ffffff;
}


#section1 .image-container {
    margin-top: 5px;
    margin-left: -5px;
}

.overlay-image {
    max-width: 250px;
    height: auto;
    display: block;

}

/* Reuse existing arrow styling and adjust for the down-pointing arrow */
.arrow-icon {
    bottom:2%;
    right: 50%;
    transform: translateX(50%);
    background: transparent;
    height: 2.8em;
    width: 2.8em;
    display: block;
    padding: 0.5em;
    margin: 1em auto;
    position: absolute;
    cursor: pointer;
    border-radius: 4px;
    z-index: 5;
    opacity: 1;
    scale: 0.5;
    transition: opacity 0.5s ease-in-out;
    animation: bounce 1.5s infinite; /* Add bounce animation */
}

/* Bounce animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(50%) translateY(0);
    }
    40% {
        transform: translateX(50%) translateY(-20px);
    }
    60% {
        transform: translateX(50%) translateY(-10px);
    }
}

/* Left Bar - Downward pointing */
.left-bar {
    position: absolute;
    top: 12px; /* Adjust position for down arrow */
    left: 38px;
    transform: rotate(-45deg); /* Adjust for down direction */
}

/* Right Bar - Downward pointing */
.right-bar {
    position: absolute;
    top: 12px; /* Adjust position for down arrow */
    left: 12px;
    transform: rotate(45deg); /* Adjust for down direction */
}

/* Rest of your styling for the bars (keep the same) */
.left-bar:after {
    content: "";
    background-color: white;
    width: 40px;
    height: 4px;
    display: block;
    border-radius: 6px 10px 10px 6px;
    transition: all 0.5s cubic-bezier(.25, 1.7, .35, .8);
}

.right-bar:after {
    content: "";
    background-color: white;
    width: 40px;
    height: 4px;
    display: block;
    border-radius: 10px 6px 6px 10px;
    transition: all 0.5s cubic-bezier(.25, 1.7, .35, .8);
}

/* Styles for mobile devices */
@media only screen and (max-width: 767px) {
    /*OLD.poster-image,
    .bg-video {
        width: 100%;
        height: auto;
        min-width: auto;
        min-height: 100%;
        object-fit: cover;
    }*/

    .poster-image,
    .bg-video {
        position: absolute;
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Adjust the overlay position */
    .overlay {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: auto;
        bottom: auto;
        text-align: center;
        max-width: 90%;
        padding: 0; /* Remove padding */
        margin: 0;  /* Remove margin */
    }

    /* Adjust text sizes */
    .overlay h1,
    .overlay h2 {
        flex-shrink: 0; /* Prevent text from shrinking */
        /*white-space: nowrap;*/
    }
    
    .overlay h1 {
        font-size: clamp(24px, 60vw, 65px);
        font-family: "greycliff-cf", sans-serif;
        font-weight: 600;
        font-style: normal;
        line-height: 1;
    }
    .overlay h2 {
        font-size: 1.2em;
        font-family: "spectral", sans-serif;
        font-weight: 200;
        font-style: italic;
    }

    #section1 .image-container {
        margin-top: 10px;
        transform: translateX(20px);
    }

    #section3 .overlay h1 {
        margin-top: 10px;
    }    
    
    #section3 .image-container {
        margin-top: 10px;
        transform: translateX(150px);
    }
    
    #section4 .overlay h1 {
        margin-top: 10px;
    }    

    #section4 .image-container {
        margin-top: 10px;
        transform: translateX(40px);
    }

    #section6 .overlay h1 {
        margin-top: 10px;
    }

    #section7 .overlay h1 {
        margin-top: 10px;
    }

    /* Adjust image sizes */
    .overlay-image {
        max-width: 250px;
    }

    /* Adjust arrow icon */
    .arrow-icon {
        bottom: 5%;
        scale: 0.8;
    }

    /* Left Bar - Downward pointing */
    .left-bar {
        top: 12px; /* Adjust position for down arrow */
        left: 23px;
    }

    /* Right Bar - Downward pointing */
    .right-bar {
        top: 12px; /* Adjust position for down arrow */
        left: 0px;
    }

    /* Rest of your styling for the bars (keep the same) */
    .left-bar:after {
        width: 35px;
        height: 5px;
        border-radius: 0px;
    }

    .right-bar:after {
        width: 35px;
        height: 5px;
        border-radius: 0px;
    }

    .arrow-icon {
        bottom: 1%;
    }

}

