/* Header */
.header {
    background: #272b34;
    color: white;
    padding: 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal overflow */
    overflow-y: visible; /* Allow header to expand if needed */
    min-height: 80px;
}

.nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1rem; /* Increased space between logo and nav-links */
    padding-left: 2rem;
    padding-right: 2rem;
    min-width: 0; /* Allow flexbox to shrink */
    box-sizing: border-box;
    overflow: hidden; /* Contain all content within nav */
    width: 100%; /* Use full width up to max-width */
    min-height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    white-space: nowrap;
    height: 100%;
    padding: 0;
}

.logo-icon {
    height: 100%;
    max-height: 80px;
    width: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Ledger', serif;
    font-optical-sizing: auto;
}


.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    padding-right: 0; /* Will be set via nav padding */
    flex-shrink: 1; /* Allow slight shrinking if needed */
    flex-wrap: nowrap; /* Prevent wrapping until column layout */
    min-width: 0; /* Allow flexbox to shrink */
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    position: relative;
    font-family: 'Ledger', serif;
    letter-spacing: -0.01em;
    font-optical-sizing: auto;
    white-space: nowrap;
    flex-shrink: 0; /* Prevent links from shrinking */
}

.nav-links li:last-child a {
    margin-right: 0; /* Ensure no extra margin that could cause clipping */
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Hamburger Menu Button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    position: relative;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    margin: 4px 0;
    transition: all 0.3s ease;
}

.menu-toggle span:nth-child(1) {
    transform-origin: 0% 0%;
}

.menu-toggle span:nth-child(2) {
    transform-origin: 0% 50%;
}

.menu-toggle span:nth-child(3) {
    transform-origin: 0% 100%;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(0px, 0px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(0px, 0px);
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background: #272b34;
    z-index: 1002;
    transition: right 0.3s ease;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    padding: 5rem 2rem 2rem;
}

.menu-overlay.active {
    right: 0;
}

/* Close Button in Menu Overlay */
.menu-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1003;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: background 0.2s ease, transform 0.2s ease;
}

.menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.menu-close svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

/* Backdrop */
.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Menu Links in Overlay */
.menu-overlay .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0;
}

.menu-overlay .nav-links li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-overlay .nav-links a {
    display: block;
    padding: 1.5rem 1rem;
    font-size: 1.1rem;
    width: 100%;
    border-radius: 0;
    transition: background 0.2s ease;
}

.menu-overlay .nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

/* Responsive Navigation Styles - 85% Scaling */
@media (max-width: 1285px) {
    /* Scale navigation bar to 85% */
    .header {
        min-height: 68px;
    }
    
    .nav {
        min-height: 68px;
        padding: 0 1.7rem !important;
    }
    
    .logo-icon {
        max-height: 68px;
    }
    
    .logo-text {
        font-size: 1.53rem !important;
    }
    
    .nav-links a {
        font-size: 0.85rem !important;
        padding: 0.425rem 0.85rem;
    }
    
    .nav-links {
        gap: 1.7rem;
    }
}

/* Responsive Navigation Styles - 75% Scaling */
@media (max-width: 1035px) {
    /* Scale navigation bar to 75% */
    .header {
        min-height: 60px;
    }
    
    .nav {
        min-height: 60px;
        padding: 0 1.5rem !important;
    }
    
    .logo-icon {
        max-height: 60px;
    }
    
    .logo-text {
        font-size: 1.35rem !important;
    }
    
    .nav-links a {
        font-size: 0.75rem !important;
        padding: 0.375rem 0.75rem;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
}

/* Responsive Navigation Styles - Drawer Mode Only */
@media (max-width: 919px) {
    /* Show hamburger menu button */
    .menu-toggle {
        display: block !important;
        transform: scale(0.75);
        transform-origin: center;
    }

    /* Hide regular nav links */
    .nav .nav-links {
        display: none !important;
    }

    /* Adjust nav for hamburger menu */
    .nav {
        justify-content: space-between !important;
        padding: 0 1.5rem !important;
        flex-direction: row !important;
    }
}

