/* HEADER — Fixed top bar and primary navigation. */

header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(254, 254, 254, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 2rem 0;
    border-bottom: 3px double rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

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

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: #000000;
    text-decoration: none;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 3rem;
}

.nav-links a {
    text-decoration: none;
    color: #333333;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: #000000;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 50%;
    background: repeating-linear-gradient(
    90deg,
    #000000 0px,
    #000000 5px,
    transparent 5px,
    transparent 8px
    );
    transition: all 0.4s ease;
    transform: translateX(-50%);
}

.nav-links a:hover::after {
    width: 100%;
}

@media (max-width: 1024px) {
    nav {
        padding: 0 2rem;
    }
}

/* Hamburger: hidden on desktop, the only nav control on small screens. */
.nav-toggle {
    display: none;
    width: 48px;
    height: 48px;
    padding: 0;
    background: transparent;
    border: 3px solid #000000;
    cursor: pointer;
    position: relative;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 3px;
    margin: 0 auto;
    background: #000000;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.nav-toggle span + span {
    margin-top: 4px;
}

/* Collapse the three bars into a cross while the menu is open. */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        padding: 1rem 2rem 2rem;
        background: #fefefe;
        border-bottom: 3px solid #000000;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        display: block;
        padding: 1rem 0;
        font-size: 1rem;
        border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
    }

    /* The sliding underline is a pointer affordance; it has no place in a
       stacked touch menu. */
    .nav-links li:last-child a {
        border-bottom: none;
    }

    .nav-links a::after {
        display: none;
    }
}
