/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Roboto', Arial, Helvetica, sans-serif;
    background-color: #000; /* Fallback black background */
    color: #8F8F8F;
    scroll-behavior: smooth;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- Header --- */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0,0,0,0);
    z-index: 1000;
    padding: 2rem 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: background-color 0.3s ease;
}

body.nav-open #site-header {
    background-color: rgba(0,0,0,0.8);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Adjusted to align with logo top */
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1001;
    background-color: transparent; /* Explicitly set to transparent */
}

.logo-container {
    position: fixed;
    top: 1rem;
    left: 1rem; /* Reverted left position */
    z-index: 1002;
    max-height: 50vh; /* Limit logo height to 50% of viewport height */
    background-color: transparent; /* Explicitly set to transparent */
}

.custom-logo {
    max-width: 500px; /* Reverted width */
    max-height: 60vh; /* Reverted height */
    padding: 10px;
    display: block; /* Ensure proper rendering */
    background-color: transparent; /* Explicitly set to transparent */
}

/* --- Burger Menu Button --- */
#burger-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1005;
    position: absolute; /* Position relative to header-content */
    top: 2rem;
    right: 1rem; /* Moved back to right side */
}

#burger-menu-btn:focus {
    outline: none;
}

.burger-icon,
.burger-icon::before,
.burger-icon::after {
    content: '';
    width: 30px;
    height: 3px;
    background: #8F8F8F;
    border-radius: 5px;
    transition: all 0.3s linear;
    position: relative;
}

.burger-icon::before {
    top: -8px;
}

.burger-icon::after {
    top: 8px;
}

/* Burger Menu Open State */
body.nav-open #burger-menu-btn .burger-icon {
    transform: rotate(-45deg);
}

body.nav-open #burger-menu-btn .burger-icon::before {
    transform: rotate(90deg) translate(-8px, 0px);
    top: 0;
}

body.nav-open #burger-menu-btn .burger-icon::after {
    transform: rotate(90deg) translate(8px, 0px);
    top: 0;
}

/* --- Navigation Menu (Mobile First) --- */
#site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1002; /* Ensure nav is below burger button (1005) */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 60px;
    opacity: 0;
    visibility: visible;
    transform: translateX(-100%);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

body.nav-open #site-nav {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    display: flex;
}

#site-nav a {
    color: #FFFFFF;
    text-decoration: none;
    margin: 1rem 0;
    font-size: 1.5rem;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    width: 100%;
    text-align: center;
}

#site-nav a:hover {
    color: #87CEFA;
}

body.nav-open main {
    pointer-events: none;
}

/* Page Sections */
.page-section {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 80px 20px;
    z-index: 1;
}

/* Adjust padding for the first section */
#home.page-section {
    padding-top: 80px;
    padding-bottom: 80px;
    min-height: 80vh;
}

/* Override min-height for Contact section */
#contact.page-section {
    min-height: auto !important;
}

/* Video Background Styling */
.custom-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.background-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: none;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* Content Styling */
.section-content-wrapper {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    border-radius: 8px;
}

.section-content h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: #8F8F8F;
    text-align: left;
}

.section-content h3 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    color: #8F8F8F;
}

.section-content p {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #8F8F8F;
    max-width: 800px;
    text-align: left;
}

/* Home Section Specifics */
#home .section-content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

#home .section-content {
    text-align: center;
}

#home .section-content h3 {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    margin-top: 3rem;
}

/* Marquee Styling */
.video-marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: absolute;
    bottom: calc(30px + 3rem);
    left: 0;
    right: 0;
    z-index: 3;
}

.video-marquee-blend {
    display: inline-block;
    animation: marquee-flow 110s linear infinite;
    pointer-events: none;
}

.marquee-element {
    font-size: 12rem;
    font-weight: 700;
    color: rgba(120,120,120,0.16);
    text-transform: uppercase;
    display: inline-block;
    padding-right: 16rem;
    mix-blend-mode: screen;
    pointer-events: none;
}

@keyframes marquee-flow {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

.video-marquee-container:hover .video-marquee-blend {
    animation-play-state: paused;
}

/* Services Section Specifics */
#services .section-content {
    margin-top: 0;
}

#services .section-content-wrapper {
    padding-top: 10px; /* Reduce from the default 20px to move the header up */
}

#services .section-content h1 {
    margin-top: -2rem; /* Pull the header up further if needed */
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: #8F8F8F;
    text-align: left;
}

.services-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: -1rem;
}

.service-item {
    background-color: rgba(255, 255, 255, 0.02);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.service-item h3 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #8F8F8F;
}

.service-item p {
    font-size: 1rem;
    color: #8F8F8F;
    margin-bottom: 0;
    text-align: justify;
}

/* About Section Specifics */
#about {
    min-height: auto;
    padding-bottom: calc(88px + 16.5vh);
}

.about-content p {
    max-width: none;
    text-align: justify;
}

.about-content a {
    color: #FFFFFF;
    text-decoration: none;
}

.about-content a:hover {
    text-decoration: underline;
}

.about-modules-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.about-module-item {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    color: #8F8F8F;
}

.about-module-item h3 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #8F8F8F;
}

.about-module-item p {
    font-size: 1rem;
    color: #8F8F8F;
    margin-bottom: 1rem;
    max-width: none;
    text-align: justify;
}

.about-module-item p:last-child {
    margin-bottom: 0;
}

.about-module-item ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 1rem;
    color: #8F8F8F;
    text-align: justify;
}

.about-module-item li {
    margin-bottom: 0.5rem;
    color: #8F8F8F;
    text-align: justify;
}

.about-module-item li:last-child {
    margin-bottom: 0;
}

/* Contact Section Specifics */
#contact {
    padding-bottom: 100px;
}

.contact-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 2rem;
}

.contact-info {
    flex: none;
    width: 100%;
    min-width: auto;
}

.contact-info p {
    margin-bottom: 0.8rem;
}

.contact-info a {
    color: #FFFFFF;
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Footer Styling */
#site-footer {
    padding: 40px 20px 30px 20px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(143, 143, 143, 0.6);
    position: relative;
    z-index: 5;
}

#site-footer.video-section {
    padding: 40px 20px 20px 20px;
}

#site-footer .section-content {
    text-align: center;
    display: flex; /* Use flexbox to center content */
    flex-direction: column; /* Stack children vertically */
    align-items: center; /* Center horizontally */
}

.footer-logo {
    max-width: 300px; /* Adjusted size as needed */
    height: auto;
    margin-bottom: 20px; /* Space between logo and text */
    display: block;
}

#site-footer .section-content p {
    text-align: center;
    max-width: none;
    margin-bottom: 0.5rem;
    color: inherit;
}

#site-footer .section-content-wrapper {
    margin: 0 auto;
}

.section-content-wrapper.needs-top-padding {
    padding-top: 100px;
}

#site-footer .section-content-wrapper.needs-top-padding {
    padding-top: 20px;
}

#about .section-content-wrapper.needs-top-padding {
    padding-top: 220px;
}

#contact .section-content-wrapper.needs-top-padding {
    padding-top: 100px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    /* Mobile Logo Adjustments */
    .logo-container {
        position: fixed; /* Ensure it stays in place */
        top: 0.5rem; /* Adjust position */
        left: 0.5rem; /* Keep original mobile left position */
        z-index: 1004; /* Ensure it's above header backdrop (1001) and nav (1002) */
        max-height: none; /* Remove max height restriction */
    }

    .custom-logo {
        max-width: 300px; /* Reverted mobile width */
        max-height: 200px; /* Reverted mobile height */
        padding: 1px; /* Adjust padding */
    }

    #site-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform: translateX(-100%);
        visibility: hidden;
        opacity: 1;
        transition: transform 0.3s ease-out, visibility 0.3s ease;
        padding-top: 80px;
        background-color: rgba(0, 0, 0, 0.6);
    }

    body.nav-open #site-nav {
        transform: translateX(0);
        visibility: visible;
    }

    #site-nav a {
        margin: 1rem 0;
        font-size: 1.5rem;
        padding: 0.5rem 1rem;
        width: 100%;
        text-align: center;
    }

    #site-nav a:hover {
        color: #FFFFFF;
    }

    .page-section {
        min-height: auto;
        padding-top: 80px;
        padding-bottom: 40px;
    }

    #home {
        min-height: 60vh;
    }

    #home .section-content {
        padding-top: 1.05rem;
    }

    #services {
        margin-top: 0;
    }

    #about {
        min-height: auto;
        margin-top: 0;
        padding-bottom: calc(44px + 16.5vh);
    }

    .page-section {
        padding: 80px 15px 40px 15px;
    }

    #home.page-section {
        padding-top: 80px;
        padding-bottom: 40px;
    }

    #site-footer.video-section {
        padding: 40px 15px 20px 15px;
    }

    #contact {
        margin-top: 0;
        padding-bottom: 100px;
    }

    #site-footer {
        margin-top: 0;
    }

    .section-content-wrapper {
        padding: 15px;
    }

    .section-content-wrapper.needs-top-padding {
        padding-top: 60px;
    }

    #site-footer .section-content-wrapper.needs-top-padding {
        padding-top: 10px;
    }

    #about .section-content-wrapper.needs-top-padding {
        padding-top: 40px;
    }

    #contact .section-content-wrapper.needs-top-padding {
        padding-top: 60px;
    }

    .section-content h1 {
        font-size: 2rem;
    }

    .section-content h3 {
        font-size: 1.5rem;
    }

    .marquee-element {
        font-size: 6rem;
    }

    .video-marquee-container {
        bottom: calc(30px + 1.5rem);
    }

    .services-grid-container {
        grid-template-columns: 1fr;
    }

    .contact-content {
        flex-direction: column;
        gap: 20px;
    }

    #contact-form, .contact-info {
        min-width: auto;
        flex: none;
        width: 100%;
    }

    .name-fields {
        flex-direction: column;
        gap: 15px;
    }
}

@media (min-width: 769px) {
    #site-nav {
        position: fixed;
        top: 70px;
        right: 0;
        left: auto;
        width: 250px;
        height: calc(100vh - 70px);
        background-color: rgba(0, 0, 0, 0.5);
        padding: 20px;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-end;
        transform: translateX(100%);
        visibility: hidden;
        opacity: 1;
        transition: transform 0.3s ease-out, visibility 0.3s ease;
        display: flex;
        padding-top: 20px;
    }

    body.nav-open #site-nav {
        transform: translateX(0);
        visibility: visible;
    }

    #site-nav a {
        color: #8F8F8F;
        text-decoration: none;
        margin: 0.5rem 0;
        font-size: 1.2rem;
        padding: 0.5rem 0;
        width: auto;
        text-align: right;
        transition: color 0.3s ease;
    }

    #site-nav a:hover {
        color: #FFFFFF;
    }

    #about {
        margin-top: -24rem;
    }

    #contact {
        margin-top: -6rem;
        padding-bottom: 400px;
    }

    #site-footer.video-section {
        margin-top: -3rem;
    }

    #about .section-content {
        padding-top: 5.6rem;
    }
}
