.topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 0;
    box-shadow: 0 6px 16px -14px rgba(15, 23, 42, 0.6);
    overflow: visible;
}

.topbar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 1;
}

.topbar.is-menu-open::after {
    opacity: 1;
}

.topbar-container {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    position: relative;
    z-index: 2;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(15, 23, 42, 0.05);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.menu-toggle:hover {
    background: rgba(15, 23, 42, 0.12);
    border-color: rgba(15, 23, 42, 0.16);
}

.menu-toggle-box {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: center;
    justify-content: center;
}

.menu-toggle-bar {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.menu-toggle.is-active .menu-toggle-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle.is-active .menu-toggle-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active .menu-toggle-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 150;
}

body.menu-open .menu-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.menu-open {
    overflow: hidden;
}

.brand {
    display: inline-flex;
    align-items: center;
    font-weight: 800;
    color: var(--text);
    font-size: 1.25rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand-text {
    display: inline-block;
    font-weight: inherit;
    color: var(--text);
}

/* Align header logo typography with footer while keeping unique coloring */
.topbar .brand {
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    letter-spacing: -0.01em;
    text-transform: none;
}

.topbar .brand-text {
    color: #111827;
    background-image: none;
    -webkit-background-clip: initial;
    background-clip: initial;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
    .brand-text {
        background-image: linear-gradient(
            150deg,
            #2d7ff8 0 38%,
            var(--primary) 38% 60%,
            var(--primary-dark) 60% 100%
        );
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-weight: 600;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}

.main-nav:empty {
    display: none;
}

.nav-link {
    position: relative;
    color: var(--text-muted);
    padding: 0.35rem 0;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.nav-link::after {
    content: "";
    position: absolute;
    inset: auto 0 -0.35rem 0;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--text);
}

.nav-link:hover::after,
.nav-link:focus::after {
    transform: scaleX(1);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-left: auto;
}

.topbar-actions .button {
    min-width: auto;
    justify-content: center;
}

.topbar-inline-nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

.menu-close {
    display: none;
}

.menu-drawer {
    position: fixed;
    top: 0;
    left: 50%;
    width: min(420px, calc(100% - 2.5rem));
    max-height: min(640px, calc(100vh - 1.5rem));
    padding: 3.2rem 1.9rem 1.9rem;
    background: #fff;
    border: 1px solid rgba(17, 52, 94, 0.12);
    border-radius: 26px;
    box-shadow: 0 22px 48px -20px rgba(15, 23, 42, 0.45);
    transform: translate(-50%, -24px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.75rem;
    pointer-events: none;
    z-index: 260;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: opacity 0.22s ease, transform 0.24s ease, visibility 0.22s ease;
    text-align: center;
}

.menu-drawer[aria-hidden="false"],
.topbar.is-menu-open ~ .menu-drawer {
    transform: translate(-50%, 10px) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.menu-drawer__actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-drawer__actions .button {
    width: 100%;
}

.menu-drawer__actions .button.clean {
    justify-content: center;
}

.menu-drawer__panel-button {
    background: rgba(29, 112, 247, 0.12);
    border: 1px solid rgba(29, 112, 247, 0.25);
    color: var(--primary-dark);
    border-radius: 16px;
    padding: 0.8rem 1.2rem;
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.menu-drawer__panel-button:hover,
.menu-drawer__panel-button:focus-visible {
    background: rgba(29, 112, 247, 0.22);
    border-color: rgba(29, 112, 247, 0.35);
    color: var(--primary);
}

.menu-drawer__panel-links {
    border-top: 1px solid rgba(17, 52, 94, 0.08);
    margin-top: 0.25rem;
    padding-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

.menu-drawer__panel-title {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.menu-drawer__panel-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(17, 52, 94, 0.08);
    background: rgba(248, 250, 252, 0.92);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.menu-drawer__panel-link:hover,
.menu-drawer__panel-link:focus-visible {
    border-color: rgba(17, 52, 94, 0.16);
    background: rgba(237, 242, 247, 0.95);
    color: var(--primary-dark);
}

.menu-drawer__logout {
    margin-top: 0.5rem;
}

@media (min-width: 1025px) {
    .menu-drawer {
        display: none;
    }
}

@media (max-width: 1024px) {
    .topbar-container {
        gap: 1rem;
    }

    .menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .topbar-inline-nav {
        display: none;
    }

    .topbar-actions {
        display: none;
    }

    .menu-close {
        position: absolute;
        top: 1.1rem;
        right: 1.1rem;
        width: 40px;
        height: 40px;
        border-radius: 999px;
        border: 1px solid rgba(17, 52, 94, 0.12);
        background: rgba(248, 250, 252, 0.92);
        color: var(--text);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        font-weight: 600;
        line-height: 1;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }

    .menu-close:hover,
    .menu-close:focus {
        background: rgba(241, 245, 249, 1);
        border-color: rgba(17, 52, 94, 0.18);
        transform: scale(1.02);
    }

    .menu-drawer .main-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        width: 100%;
    }

    .menu-drawer .nav-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.8rem 1rem;
        font-size: 1.05rem;
        color: var(--text);
        border: 1px solid rgba(17, 52, 94, 0.12);
        border-radius: 14px;
        background: rgba(248, 250, 252, 0.92);
    }

    .menu-drawer .nav-link::after {
        display: none;
    }
}

@media (max-width: 640px) {
    .topbar {
        padding: 0.75rem 0;
    }

    .brand {
        font-size: 1.05rem;
    }

    .menu-drawer {
        width: min(360px, calc(100% - 2rem));
        padding: 2rem 1.6rem 1.6rem;
        border-radius: 22px;
        max-height: min(460px, calc(100vh - 2.5rem));
    }

    .nav-link {
        font-size: 1.02rem;
    }
}

.footer {
    position: relative;
    margin-top: 0;
    background: #081226;
    color: rgba(226, 232, 240, 0.9);
}

.footer a {
    color: inherit;
    text-decoration: none;
}

.footer-top {
    padding: 4rem 0 2.75rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
    align-items: flex-start;
}

.footer-column h4 {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(226, 232, 240, 0.7);
}

.footer-column p {
    margin: 0 0 1rem;
    color: rgba(226, 232, 240, 0.75);
    line-height: 1.6;
}

.footer-brand .footer-logo {
    margin: 0.5rem 0 1.2rem;
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    color: rgba(144, 179, 255, 0.95);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
}

.footer-brand__note {
    color: rgba(226, 232, 240, 0.68);
    max-width: 360px;
}

.footer-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.footer-cta:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.footer-links a {
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.96rem;
}

.footer-links a:hover {
    color: #fff;
}

.footer-contact {
    display: grid;
    gap: 0.6rem;
    font-style: normal;
    color: rgba(226, 232, 240, 0.75);
}

.footer-contact span {
    font-size: 0.9rem;
    color: rgba(203, 213, 225, 0.6);
}

.footer-link {
    color: rgba(226, 232, 240, 0.85);
}

.footer-link:hover {
    color: #fff;
}

.footer-bottom {
    padding: 1.75rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.footer-bottom__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    color: rgba(191, 219, 254, 0.7);
    font-size: 0.85rem;
}

.footer-copy {
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(226, 232, 240, 0.9);
}

.footer-bottom__links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.92rem;
}

.footer-bottom__links a {
    color: rgba(191, 219, 254, 0.75);
}

.footer-bottom__links a:hover {
    color: #fff;
}

.footer-anchors {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.footer-anchors span {
    display: block;
    height: 0;
    width: 0;
}

@media (max-width: 1200px) {
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }

    .footer-bottom__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-bottom__links {
        gap: 1rem;
    }

    .footer-cta {
        width: 100%;
        justify-content: center;
    }
}
html {
    overflow-x: hidden;
}
