/* =========================
   NAVBAR
   ========================= */

.nav-root {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);

    background-color: rgba(6, 12, 20, 0.8);
    /* Semi-transparent base */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);

    z-index: 1000;
}

.nav-inner {
    max-width: 1400px;
    /* Standardize max-width */
    height: 100%;
    margin: 0 auto;
    padding: 0 48px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo img {
    height: 48px;
    /* Slightly smaller for cleaner look */
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
    /* Use gap instead of margin-left */
}

.nav-link {
    text-decoration: none;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--accent-primary);
    text-shadow: 0 0 8px var(--accent-glow);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 5px 0;
}

/* =========================
   NAVBAR ACTIVE STATE
   ========================= */

.nav-active {
    color: var(--text-primary);
    position: relative;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.nav-active::after {
    content: "";
    position: absolute;
    bottom: -29px;
    /* Align with bottom border */
    left: 0;

    width: 100%;
    height: 2px;
    background-color: var(--accent-primary);
    box-shadow: 0 -2px 10px var(--accent-glow);
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1024px) {

    :root {
        --nav-height: 64px;
    }

    .nav-inner {
        padding: 0 24px;
        /* Reduce padding on mobile */
    }

    .nav-links {
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        gap: 0;
        max-height: calc(100vh - var(--nav-height));
        /* Prevent overflow */
        overflow-y: auto;
        /* Allow scrolling if many items */

        flex-direction: column;
        background-color: var(--bg-main);

        display: none;
        border-bottom: 1px solid var(--border-subtle);
    }

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

    .nav-link {
        width: 100%;
        padding: 20px 24px;
        /* Match nav-inner padding */
        border-top: 1px solid var(--border-subtle);
        color: var(--text-primary);
    }

    /* Fix active state on mobile */
    .nav-active::after {
        display: none;
    }

    /* Add contained background highlight instead */
    .nav-active {
        background-color: rgba(0, 164, 255, 0.1);
        color: var(--accent-primary);
        border-radius: 4px;
        /* Make it look like a button item */
        width: calc(100% - 48px);
        /* Account for padding */
        margin-left: 24px;
        /* Center it */
    }

    .nav-toggle {
        display: block;
    }
}