/* Header Styles */

.header {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 1);
    backdrop-filter: none;
    padding: 0.7rem 0;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Scrolled state: when the page is scrolled down */
.header.scrolled {
    background: rgba(255,255,255,1);
    padding: 0.35rem 0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    backdrop-filter: none;
}

/* Hidden state: hide header when user scrolls down */
.header.hidden {
    transform: translateY(-120%);
    transition: transform 0.35s cubic-bezier(0.2,0,0,1);
}

/* Shrink logo and tighten nav when scrolled */
.header.scrolled .logo {
    letter-spacing: 0.03em;
}

.header.scrolled .nav-menu {
    gap: 1.5rem;
}

.header.scrolled .nav-menu a {
    color: var(--text-color);
}

/* Ensure smooth transitions for elements inside header */
.header .logo,
.header .nav-menu a,
.header .mobile-menu-toggle {
    transition: var(--transition);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--white);
    text-decoration: none;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: var(--font-title);
    display: flex;
    align-items: center;
}

.logo-image {
    height: 63px;
    width: auto;
    transition: var(--transition);
}

.header.scrolled .logo-image {
    height: 48px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    font-family: var(--font-subtitle);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    color: var(--primary-color);
}

/* Responsive Header */
@media (max-width: 968px) {
    .header {
        background: rgba(255, 255, 255, 1);
        backdrop-filter: none;
        padding: 0.6rem 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .header.scrolled {
        background: rgba(255, 255, 255, 1);
        backdrop-filter: none;
        box-shadow: 0 6px 18px rgba(0,0,0,0.12);
        padding: 0.5rem 0;
    }

    .nav-container {
        padding: 0 1.5rem;
        align-items: center;
    }

    .logo {
        display: flex;
        align-items: center;
        padding-top: 0.3rem;
    }

    .logo-image {
        height: 40px;
    }

    .header.scrolled .logo-image {
        height: 32px;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        line-height: 1;
        padding: 0;
        height: 40px;
    }

    .header.scrolled .mobile-menu-toggle {
        height: 32px;
        font-size: 1.3rem;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: calc(40px + 1.2rem);
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        padding: 1.5rem 0;
        gap: 1.2rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .header.scrolled .nav-menu {
        top: calc(32px + 1rem);
    }

    .nav-menu a {
        color: var(--text-color);
        font-size: 0.85rem;
    }

    .nav-menu.active {
        left: 0;
    }
}

@media (max-width: 968px) and (orientation: landscape) {
    .header {
        padding: 0.5rem 0;
    }

    .header.scrolled {
        padding: 0.4rem 0;
    }

    .logo-image {
        height: 32px;
    }

    .header.scrolled .logo-image {
        height: 28px;
    }

    .mobile-menu-toggle {
        height: 32px;
        font-size: 1.3rem;
    }

    .header.scrolled .mobile-menu-toggle {
        height: 28px;
        font-size: 1.2rem;
    }

    .nav-menu {
        top: calc(32px + 1rem);
        padding: 1rem 0;
        gap: 0.8rem;
    }

    .header.scrolled .nav-menu {
        top: calc(28px + 0.8rem);
    }

    .nav-menu a {
        font-size: 0.8rem;
    }
}
