/* Layout Basics */
html,
body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    /* Allow vertical scroll for GSAP */
    margin: 0;
    padding: 0;
}

/* Main Horizontal Container */
#scroll-container {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    /* Hide horizontal scrollbar, GSAP transforms it */
}

#scroll-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* Individual Sections (Chapters) */
.chapter {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

/* Grid Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.h-full {
    height: 100%;
}

/* Fixed UI Elements */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 3rem;
    z-index: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    /* Let clicks pass through */
}

#site-header>* {
    pointer-events: auto;
    /* Re-enable clicks on buttons */
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    font-family: var(--font-heading);
}

#menu-toggle {
    background: none;
    border: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: currentColor;
    margin-bottom: 5px;
}

.hamburger span:last-child {
    margin-bottom: 0;
}

#chapter-indicator {
    position: fixed;
    bottom: 3rem;
    left: 3rem;
    z-index: 100;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.current {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.total {
    opacity: 0.6;
}

/* Nav Overlay */
#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

#nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.full-nav {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
}

.full-nav .nav-link {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s;
}

.full-nav .nav-link:hover {
    color: red;
    /* To be refined */
    color: var(--color-accent-red);
}

.full-nav .nav-link span {
    font-size: 1.5rem;
    vertical-align: middle;
    margin-right: 1rem;
    opacity: 0.5;
}

#close-menu {
    position: absolute;
    top: 2rem;
    right: 3rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Responsive Overhaul */
@media (max-width: 1023px) {
    #scroll-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .chapter {
        width: 100%;
        height: auto;
        min-height: 100vh;
        flex: none;
        scroll-snap-align: none;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    #site-header {
        padding: 1.5rem 1.5rem;
    }

    #chapter-indicator {
        display: none;
    }

    /* Work Page Overrides */
    .project-item {
        direction: ltr !important;
        gap: 2rem !important;
    }
    
    .project-details {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    #work-hero {
        min-height: 40vh !important;
        padding: 4rem 2rem !important;
    }
    
    #work-hero h1 {
        font-size: 3rem !important;
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 1.2rem;
    }
}