/* TOP NAVIGATION */
.top-nav {
    position: relative;
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    width: 100vw;
    max-width: none;
    min-height: 72px;
    margin: -8px 0 28px 50%;
    padding: 0 max(28px, calc((100vw - 1280px) / 2 + 28px));
    transform: translateX(-50%);
    border-radius: 0;
    background: rgba(7, 12, 25, 0.78);
    border: 1px solid rgba(176, 190, 220, 0.16);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 240px;
    min-width: 0;
}

.nav-logo-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(176, 190, 220, 0.14);
    overflow: hidden;
}

.nav-logo-icon img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
}

.nav-brand-text {
    color: #f5f7ff;
    font-size: 18px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
}

.nav-center {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
}

.nav-link {
    position: relative;
    color: rgba(226, 232, 248, 0.72);
    text-decoration: none;
    font-size: 17px;
    line-height: 1;
    font-weight: 700;
    padding: 11px 14px;
    border-radius: 0;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease;
}

.nav-link:hover {
    color: #f5f7ff;
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(176, 190, 220, 0.10);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 5px;
    height: 2px;
    border-radius: 0;
    background: rgba(126, 170, 255, 0.78);
}

.nav-link.active {
    color: #f5f7ff;
    background: rgba(126, 170, 255, 0.10);
    border-color: rgba(126, 170, 255, 0.18);
}

.nav-right {
    position: relative;
    z-index: 41;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 1 1 240px;
    min-width: 0;
}

.top-nav .creators-support {
    justify-content: flex-end;
}

.top-nav .creators-support-button {
    min-height: 42px;
    padding: 9px 14px;
    border-radius: 0;
    border: 1px solid rgba(176, 190, 220, 0.16);
    background: rgba(255, 255, 255, 0.035);
    box-shadow: none;
    color: rgba(226, 232, 248, 0.86);
    font-size: 16px;
    font-weight: 750;
}

.top-nav .creators-support-button:hover {
    transform: none;
    border-color: rgba(176, 190, 220, 0.26);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: none;
    color: #f5f7ff;
}

@media (max-width: 980px) {
    .top-nav {
        min-height: auto;
        flex-wrap: wrap;
        gap: 12px 14px;
        padding: 12px max(18px, calc((100vw - 1280px) / 2 + 18px));
    }

    .nav-logo {
        flex: 1 1 auto;
    }

    .nav-center {
        order: 3;
        flex: 1 1 100%;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nav-center::-webkit-scrollbar {
        display: none;
    }

    .nav-right {
        flex: 0 0 auto;
    }
}

@media (max-width: 640px) {
    .top-nav {
        width: 100vw;
        max-width: 100vw;
        margin: -8px 0 20px 50%;
        padding: 10px 12px;
        border-radius: 0;
        transform: none;
        translate: -50% 0;
    }

    .nav-logo-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .nav-logo-icon img {
        width: 29px;
        height: 29px;
    }

    .nav-brand-text {
        font-size: 16px;
    }

    .nav-link {
        font-size: 15px;
        padding: 8px 10px;
    }

    .top-nav .creators-support-button span {
        display: none;
    }

    .top-nav .creators-support-caret {
        display: none;
    }

    .top-nav .creators-support-button {
        width: 38px;
        padding: 6px;
        justify-content: center;
        min-height: 36px;
    }

    /* Stack and simplify layout so links don't overflow */
    .nav-logo { order: 1; flex: 0 0 auto; }
    .nav-right { order: 2; flex: 0 0 auto; }
    .nav-center { order: 3; flex: 1 1 100%; justify-content: space-around; overflow-x: visible; }

    /* Prevent page-level horizontal overflow introduced by older centering technique */
    body { overflow-x: hidden; }
}
