* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: sans-serif;
    scroll-behavior: smooth;
    overflow-x: hidden;
    background-color: #111;
    color: #f88;
}

/* Parallax section with desktop and mobile compatibility */
.parallax {
    height: 100vh;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Enable parallax scrolling effect */
    will-change: transform;
    background-color: #222; /* Fallback color */
}

/* Safari-specific fix for parallax effect */
@supports (-webkit-overflow-scrolling: touch) {
    .parallax {
        background-attachment: scroll; /* Override fixed for Safari */
    }
}

/* Ensure images scale properly on all devices */
.parallax img {
    width: 100%;
    height: auto;
    max-width: 100%; /* Prevent images from exceeding their container width */
    object-fit: cover; /* Ensures the image covers the container */
    display: block;
}

/* On desktop, hide image and use background */
@media (min-width: 769px) {
    .parallax img {
        display: none;
    }
}

/* On mobile, disable fixed background and use img */
@media (max-width: 768px) {
    .parallax {
        background-attachment: scroll; /* Fallback for mobile devices */
        background-size: cover;
        background-position: center;
    }

    .parallax img {
        display: block;
        width: 100%;
        height: auto;
        max-width: 100%;
        object-fit: contain;
    }
}

/* General section styling */
.section {
    padding: 3rem 2rem;
    background: #111;
    color: #f88;
    text-align: center;
}

/* Ensure sections stack properly */
section {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Add spacing between sections */
.section + .parallax, 
.parallax + .section {
    margin-top: 0;
}

/* Desktop: expand short sections */
@media (min-width: 769px) {
    .section {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Nav styling */
nav a {
    color: #f88;
    margin: 0 15px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
}

nav a:hover {
    color: #fff;
}
