/* Basic Reset & Body Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f7f6; /* Consider if this should be dark */
    color: #333; /* Default text color - adjust if background is dark */
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
    /* Add transition for potential background changes if nav opens */
    /* transition: background-color 0.3s ease; */
}

/* Class to add via JS when mobile nav is open */
body.nav-open {
    /* Optional: Prevent scrolling when mobile menu is open */
    /* overflow: hidden; */
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit; /* Inherits color from parent */
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
    padding: 0;
}

.mouse-trail-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10; /* Should be below text/buttons (which are often 3-5) */
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ============================
   Preloader styles
   ============================ */

   #preloader {
    position: fixed; /* Sit on top of the page content */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Make background slightly transparent to see the blur */
    background-color: rgba(255, 255, 255, 0.01);
    /* Or use your site's main background color with transparency */
    /* background-color: rgba(25, 25, 25, 0.8); */
    z-index: 9999; /* Make sure it is on top */
    display: flex; /* Use flexbox for centering */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    opacity: 1;
    transition: opacity 0.5s ease-out; /* Fade out effect */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Style to hide the preloader */
body.loaded #preloader {
    opacity: 0;
    pointer-events: none; /* Prevent interaction after hiding */
}

/* --- BLUR EFFECT --- */
/* Select direct children of body EXCEPT the preloader */
body > *:not(#preloader) {
    /* Apply transition to the filter property for smooth removal */
    transition: filter 0.5s ease-out; /* Match spinner fade duration */
}

/* Apply blur ONLY when body does NOT have the 'loaded' class */
body:not(.loaded) > *:not(#preloader) {
    filter: blur(5px); /* Adjust blur amount (e.g., 3px, 5px, 8px) */
    /* Optional: Slightly scale down blurred content */
    /* transform: scale(0.98); */
    /* Optional: Prevent interaction with blurred content */
    /* pointer-events: none; */
}
/* --- END BLUR EFFECT --- */


/* ============================
   Header Styles (Desktop First)
   ============================ */

.hero-background-wrapper {
    background-image: linear-gradient(89.04deg, rgba(0, 0, 0, 0) 5.58%, #000000 103.19%), url('../images/landing-bg.webp'); 
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    color: white;
    padding-top: 90px;
}

header {
    padding: 15px 0;
    width: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0.8));
    /* === MODIFICATIONS FOR SCROLL BEHAVIOR === */
    position: fixed; /* Make the header fixed at the top */
    top: 0; /* Start at the top */
    left: 0; /* Align to the left */
    z-index: 1000; /* Ensure header is above other content */
    transition: transform 0.3s ease; /* Smooth transition for hiding/showing */
    /* === END MODIFICATIONS === */
}

/* === NEW CLASS TO HIDE HEADER === */
.header--hidden {
    transform: translateY(-100%); /* Move the header up by its own height */
    /* Optionally add opacity: 0; or visibility: hidden; if needed */
}
/* === END NEW CLASS === */


.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 70px;
    display: block;
    transition: height 0.3s ease; /* Smooth resize */
}

.main-nav ul {
    list-style: none;
    display: flex;
    margin: 0; /* Reset margin */
    padding: 0; /* Reset padding */
}

.main-nav ul li {
    margin-left: 30px;
}

.main-nav ul li a {
    color: #ccc; /* Light color for dark background */
    font-size: 1rem;
    padding: 5px 0; /* Add some vertical padding for easier clicking */
    transition: color 0.3s ease;
    display: block; /* Better for padding */
}

.main-nav ul li a:hover,
.main-nav ul li a:focus { /* Add focus state */
    color: #fff;
}

.cta-button {
    background-color: #3498db; /* Blue */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 0.9rem;
    white-space: nowrap; /* Prevent button text wrapping */
}

.cta-button:hover,
.cta-button:focus { /* Add focus state */
    background-color: #2980b9; /* Darker blue */
    transform: scale(1.05); /* Slight grow effect */
}

/* Hide Mobile Menu Toggle on Desktop */
.menu-toggle {
    display: none; /* Hidden by default */
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 10px; /* Make it easier to tap */
    z-index: 1010; /* Above nav */
    margin-left: 15px; /* Space from nav/CTA */
}

.hamburger-icon {
    display: block;
    position: relative;
    width: 25px;
    height: 3px;
    background-color: #fff; /* Hamburger color */
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #fff; /* Hamburger color */
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.hamburger-icon::before {
    top: -8px; /* Space out the lines */
}

.hamburger-icon::after {
    top: 8px; /* Space out the lines */
}

/* Hamburger Animation (when nav-open class is on body) */
body.nav-open .hamburger-icon {
    background-color: transparent; /* Middle line disappears */
}

body.nav-open .hamburger-icon::before {
    transform: translateY(8px) rotate(45deg);
}

body.nav-open .hamburger-icon::after {
    transform: translateY(-8px) rotate(-45deg);
}


/* ============================
   Tablet & Mobile Breakpoints
   ============================ */

/* Medium Screens / Tablets (e.g., 992px and below) */
@media (max-width: 991.98px) {
    .main-nav {
        /* Prepare for absolute positioning */
        position: absolute; /* Keep absolute for positioning below header */
        top: 100%; /* Position below the header */
        left: 0;
        width: 100%;
        background-color: #2c3e50; /* Dark background for mobile menu */
        /* Use transform for smoother slide-in/fade-in */
        /* Initially hidden */
        visibility: hidden;
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        z-index: 999; /* Ensure nav is below header but above content */
    }

    /* Show nav when body has .nav-open class (toggled by JS) */
    body.nav-open .main-nav {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
    }


    .main-nav ul {
        flex-direction: column; /* Stack list items vertically */
        padding: 10px 0; /* Add padding inside the mobile menu */
    }

    .main-nav ul li {
        margin-left: 0; /* Remove left margin */
        width: 100%; /* Make list items full width */
        text-align: center;
    }

    .main-nav ul li a {
        padding: 15px 20px; /* Increase padding for easier tapping */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Separator */
        color: #ecf0f1; /* Ensure light text on dark menu */
        font-size: 1.1rem;
    }
     .main-nav ul li:last-child a {
        border-bottom: none; /* Remove border from last item */
     }

    .main-nav ul li a:hover,
    .main-nav ul li a:focus {
        background-color: rgba(255, 255, 255, 0.05); /* Subtle hover */
        color: #fff;
    }

    /* Show the Menu Toggle Button */
    .menu-toggle {
        display: block; /* Show hamburger */
    }

    /* Optional: Hide Header CTA on medium screens or move it */
    /* .header-cta {
        display: none;
    } */
    /* OR adjust its margin if kept */
     .header-cta {
         margin-left: auto; /* Push it left before the hamburger */
         margin-right: 15px;
     }

     /* Adjust logo size slightly */
     .logo img {
         height: 60px;
     }

     /* Adjust hero padding top to account for smaller header height */
     .hero-background-wrapper {
         padding-top: 85px; /* Adjust based on header height */
     }
}

/* Small Screens / Phones (e.g., 768px and below) */
@media (max-width: 767.98px) {
    .header-container {
        /* Reduce padding on very small screens if needed */
        /* padding: 0 15px; */
    }

    .logo img {
        height: 50px; /* Smaller logo */
    }

    .cta-button {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    /* Hide Header CTA completely on small screens? (Common pattern) */
    .header-cta {
       display: none; /* Hide button, rely on Contact link in menu */
    }
     /* Adjust menu toggle margin if CTA is hidden */
     .menu-toggle {
         margin-left: auto; /* Push hamburger to the far right */
     }


    /* Adjustments from your original 768px rules that might still apply */
     .hero-background-wrapper {
         padding-top: 70px; /* Re-evaluate this based on fixed/sticky header and logo height */
         text-align: center;
     }

    .hero-inner-container {
        flex-direction: column;
        justify-content: center;
    }

    .hero-content {
        flex-basis: auto;
        padding-right: 0;
        margin-bottom: 30px;
        order: 2;
    }

    .hero-graphic {
        flex-basis: auto;
        margin-bottom: 20px;
        order: 1;
        max-width: 70%; /* Slightly larger than before */
        margin-left: auto; /* Center graphic */
        margin-right: auto;
    }
     .hero-graphic img {
        max-width: 100%;
    }

    .vertical-slider {
       display: none;
    }
}

/* Extra Small Screens (e.g., 480px and below) */
@media (max-width: 479.98px) {
     .container {
        padding: 0 10px; /* Less padding on very small screens */
    }

    .logo img {
        height: 45px; /* Even smaller logo */
    }

    .main-nav ul li a {
        font-size: 1rem;
        padding: 4px 15px;
    }

    /* Adjustments from your original 480px rules */
     .hero-content h1 {
        font-size: 1.8rem; /* Adjust heading size */
    }
     .hero-graphic {
         max-width: 80%;
     }
}

@media (max-width: 426px) {
    .header-container{
        padding: 0 18px;
    }

}