/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-md);
    z-index: 1000;
    transition: background-color var(--transition-base), backdrop-filter var(--transition-base);
}

.header.scrolled {
    background-color: rgba(15, 15, 15, 0.6);
    /* Lighter than black (0a0a0a) but darker than before (303030), per request */
    /* Lighter for better contrast */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle border for separation */
}

.logo {
    display: flex;
    align-items: center;
    z-index: 1001;
    /* Ensure logo is above mobile menu bg */
}

.logo img {
    height: 25px;
    width: auto;
    object-fit: contain;
}

/* Desktop Nav */
.nav {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    /* Fix vertical alignment */
}

.nav-link {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.nav-link:hover {
    opacity: 1;
}

.nav-icon {
    color: var(--color-text);
    opacity: 0.7;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
}

.nav-icon:hover {
    opacity: 1;
}

.nav-btn-external:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1 !important;
}

/* Hamburger Menu Button (Hidden on Desktop) */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1002;
    /* Above everything */
    padding: 0;
}

.hamburger-menu span {
    width: 100%;
    height: 2px;
    background-color: var(--color-text);
    transition: all 0.3s ease;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        /* Full width or partial? User asked for "vertical", standard is full for immersive */
        height: 100vh;
        background-color: rgba(10, 10, 10, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--spacing-lg);
        transform: translateY(-100%);
        /* Slide down or from right. Let's do fade/slide from top or side */
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        z-index: 1000;
        /* Behind logo/hamburger */
        padding-top: 60px;
        /* Space for header */
    }

    .nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        font-size: var(--text-xl);
        opacity: 1;
    }

    /* Mobile Social & External Link */
    .nav-social-group {
        margin-left: 0 !important;
        margin-top: 20px;
        gap: 25px !important;
    }

    .nav-icon svg {
        width: 28px !important;
        height: 28px !important;
    }

    .nav-btn-external {
        margin-left: 0 !important;
        margin-top: 10px;
        font-size: 1rem !important;
        padding: 8px 15px !important;
    }

    /* Hamburger Animation */
    .hamburger-menu.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* Footer */
.footer {
    padding: var(--spacing-lg) 0;
    background-color: #050505;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: var(--spacing-xl);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-col h3 {
    font-size: var(--text-base);
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

.footer-col p {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* =========================================
   [CONSOLIDATED MOBILE STYLES] 
   (Moved from index_web3d.html)
   ========================================= */
@media (max-width: 768px) {

    /* --- 1. Global Section Spacing (Force 100px) --- */
    #web3d,
    #interactive,
    #gallery,
    #contact,
    .web3d-section,
    .interactive-section,
    .gallery-section,
    .contact-section {
        margin-bottom: 100px !important;
        padding-bottom: 0 !important;
        min-height: auto !important;
        /* Override PC 100vh */
        height: auto !important;
    }

    /* --- 2. Header & Layout Adjustments --- */
    .web3d-header {
        padding: 15px 5% !important;
        /* [Fix] Add 5% left/right padding for alignment */
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        background: #0b0b0b !important;
        z-index: 5 !important;
        box-sizing: border-box !important;
    }

    /* --- 3. Interactive Section Layout --- */
    #interactive {
        background: transparent !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* [CRITICAL FIX] Target the wrapper div between Section and Content to ensure it has height */
    #interactive>div:not(.web3d-header) {
        position: relative !important;
        height: auto !important;
        min-height: 60vh !important;
        /* Force visibility */
        top: 0 !important;
        width: 100% !important;
    }

    /* Video Background Fix */
    #interactive .video-bg {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        transform: none !important;
        /* Fix centering issue */
        object-fit: cover !important;
        z-index: 0 !important;
        opacity: 0.6 !important;
    }

    /* Content Container */
    #interactive .container-interactive {
        position: relative !important;
        z-index: 2 !important;
        flex-direction: column !important;
        justify-content: center !important;
        padding: 40px 5% !important;
        /* Add vertical padding for content breathing room */
        width: 100% !important;
        height: auto !important;
    }

    /* Interactive Text & Titles */
    .interactive-left,
    .interactive-right {
        width: 100% !important;
        text-align: center !important;
        align-items: center !important;
        padding: 0 !important;
    }

    .interactive-title-group {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .interactive-main-title {
        font-size: 2.0rem !important;
        white-space: normal !important;
    }

    .interactive-desc-list-desktop {
        display: none !important;
    }

    .interactive-desc-list-mobile {
        display: block !important;
        margin: 20px auto !important;
        text-align: left !important;
        width: fit-content !important;
    }

    .youtube-wrapper {
        width: 100% !important;
    }


    /* --- 4. Contact Section Fixes (Right Padding 60px) --- */
    #contact .contact-content {
        flex-direction: column !important;
        gap: 40px !important;
        padding-right: 20px !important;
        /* [Fixed] Reduced from 30px to 20px for max width */
        box-sizing: border-box !important;
        align-items: flex-end !important;
        /* Right Align Children */
    }

    /* Force Children to Align Right & Full Width */
    #contact .contact-text,
    #contact .contact-info,
    #contact .contact-details {
        width: 100% !important;
        text-align: right !important;
        padding-right: 0 !important;
        /* Reset child padding */
        margin-right: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
    }

    /* Text & Dividers */
    #contact h3,
    #contact p,
    #contact .contact-details p {
        text-align: right !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 2px 0 !important;
    }

    #contact .contact-desc {
        font-size: 0.95rem !important;
        white-space: normal !important;
        word-break: keep-all !important;
        max-width: none !important;
        /* Full width */
    }

    #contact .contact-divider {
        width: 100% !important;
        /* [Fixed] Use 100% to fill the now-wider container */
        max-width: none !important;
        margin: 10px 0 20px 0 !important;
    }

    /* Spacing between About and Info */
    #contact .contact-text {
        margin-bottom: 40px !important;
    }
}