@media (max-width: 1120px) {
    .nav-shell {
        gap: 18px;
    }

    .nav-links a {
        padding-right: 9px;
        padding-left: 9px;
        font-size: 13px;
    }

    .account-details {
        display: none;
    }

    .dashboard-link {
        display: none;
    }
}

@media (max-width: 900px) {
    .site-header {
        position: sticky;
    }

    .nav-shell {
        min-height: 70px;
    }

    .brand-logo {
        width: 190px;
        height: 50px;
    }

    .brand-copy strong {
        font-size: 20px;
    }

    .nav-toggle {
        display: block;
    }

    .primary-nav {
        position: fixed;
        top: 70px;
        right: 0;
        bottom: 0;

        width: min(88vw, 390px);

        padding: 22px;

        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;

        gap: 22px;

        background: rgba(255, 255, 255, 0.985);

        border-left:
            1px solid rgba(7, 26, 53, 0.08);

        box-shadow:
            -20px 20px 50px rgba(4, 24, 53, 0.14);

        transform: translateX(105%);

        visibility: hidden;

        transition:
            transform 0.24s ease,
            visibility 0.24s ease;
    }

    .primary-nav.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .nav-links {
        width: 100%;

        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 3px;
    }

    .nav-links a {
        width: 100%;

        padding: 13px 14px;

        border-radius: 10px;

        font-size: 14px;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: var(--slate-50);
    }

    .nav-links a.active::after {
        top: 50%;
        right: auto;
        bottom: auto;
        left: 2px;

        width: 3px;
        height: 22px;

        transform: translateY(-50%);
    }

    .nav-account {
        width: 100%;

        padding-top: 20px;

        display: flex;
        flex-direction: column;
        align-items: stretch;

        border-top:
            1px solid var(--slate-100);
    }

    .nav-account .btn {
        width: 100%;
        min-height: 46px;
    }

    .btn-login {
        background: var(--slate-50);
    }

    .account-link {
        width: 100%;

        padding: 11px;

        background: var(--slate-50);

        border:
            1px solid var(--slate-100);

        border-radius: 13px;
    }

    .account-details {
        min-width: 0;

        display: flex;
        flex: 1;
    }

    .plan-badge {
        margin-left: auto;
    }

    .dashboard-link,
    .logout-button {
        width: 100%;

        padding: 11px 12px;

        display: block;

        text-align: left;

        border-radius: 9px;
    }

    .dashboard-link:hover,
    .logout-button:hover {
        background: var(--slate-50);
    }

    .nav-toggle.is-active span:nth-child(1) {
        transform:
            translateY(7px)
            rotate(45deg);
    }

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

    .nav-toggle.is-active span:nth-child(3) {
        transform:
            translateY(-7px)
            rotate(-45deg);
    }

    .footer-shell {
        grid-template-columns:
            1.5fr 1fr 1fr;

        gap: 36px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .nav-shell {
        width: calc(100% - 28px);
    }

    .brand-logo {
        width: 165px;
        height: 46px;
    }

    .brand-symbol {
        width: 39px;
        height: 39px;

        font-size: 19px;
    }

    .brand-copy strong {
        font-size: 18px;
    }

    .brand-copy small {
        font-size: 9px;
    }

    .primary-nav {
        width: 100%;

        border-left: 0;
    }

    .footer-shell {
        width: calc(100% - 32px);

        padding: 48px 0 38px;

        grid-template-columns:
            repeat(2, 1fr);

        gap: 34px 24px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-brand p {
        margin-top: 16px;
    }

    .footer-bottom {
        width: calc(100% - 32px);

        padding: 20px 0 24px;

        flex-direction: column;
        align-items: flex-start;

        gap: 6px;
    }
}

@media (max-width: 420px) {
    .brand-logo {
        width: 150px;
    }

    .footer-shell {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Dark header logo */

.site-header .brand-logo {
    filter:
        brightness(0)
        invert(1)
        brightness(1.35);
}

/* Mobile navigation dark theme */

@media (max-width: 900px) {
    .site-header {
        background: #07172c;
        border-bottom:
            1px solid rgba(255, 255, 255, .09);
    }

    .nav-shell {
        min-height: 68px;
    }

    .site-header .brand-logo {
        width: 175px;
        height: 52px;
    }

    .nav-toggle {
        display: block;
        background:
            rgba(255, 255, 255, .06);
        border:
            1px solid rgba(255, 255, 255, .08);
        border-radius: 10px;
    }

    .nav-toggle span {
        background: #ffffff;
    }

    .primary-nav {
        position: fixed;
        z-index: 2000;
        top: 68px;
        right: 0;
        bottom: 0;

        width: min(88vw, 390px);
        padding: 22px;

        background: #07172c;

        border-left:
            1px solid rgba(255, 255, 255, .08);

        box-shadow:
            -20px 25px 60px rgba(0, 0, 0, .32);

        backdrop-filter: none;
    }

    .nav-links a {
        color: #c2d1e2;
        background: transparent;
    }

    .nav-links a:hover,
    .nav-links a.active {
        color: #ffffff;
        background:
            rgba(255, 255, 255, .06);
    }

    .nav-account {
        border-top:
            1px solid rgba(255, 255, 255, .09);
    }

    .btn-login {
        color: #ffffff;
        background:
            rgba(255, 255, 255, .06);
        border:
            1px solid rgba(255, 255, 255, .10);
    }

    .account-link {
        color: #ffffff;
        background:
            rgba(255, 255, 255, .05);
        border:
            1px solid rgba(255, 255, 255, .08);
    }

    .account-details strong {
        color: #ffffff;
    }

    .dashboard-link,
    .logout-button {
        color: #a9bbcf;
    }
}

/* Hero typography correction */

@media (min-width: 981px) {
    .hero-copy-new h1 {
        font-size:
            clamp(50px, 4.35vw, 70px);
        letter-spacing: -.055em;
    }
}

@media (max-width: 640px) {
    .site-header .brand-logo {
        width: 155px;
        height: 48px;
    }

    .primary-nav {
        width: 100%;
    }
}

/* Preserve original logo colors */

.site-header .brand-logo {
    filter: none !important;
}

/* ==================================================
   Mobile navigation solid drawer override
   ================================================== */

@media (max-width: 900px) {

    .site-header {
        position: relative;
        z-index: 5000;
        background: #07172c !important;
    }

    .nav-shell {
        position: relative;
        z-index: 5002;
        background: #07172c;
    }

    .nav-toggle {
        position: relative;
        z-index: 5004;
    }

    /*
     * The mobile menu must be an opaque panel.
     * Do not allow the hero page to show through it.
     */
    .primary-nav {
        position: fixed !important;
        z-index: 5001 !important;

        top: 68px !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;

        width: min(88vw, 390px) !important;
        height: calc(100% - 68px) !important;

        margin: 0 !important;
        padding: 24px 20px 32px !important;

        background: #07172c !important;
        background-color: #07172c !important;
        background-image:
            linear-gradient(
                180deg,
                #07172c 0%,
                #081b34 100%
            ) !important;

        border: 0 !important;
        border-left:
            1px solid rgba(255, 255, 255, .10) !important;

        border-radius: 0 !important;

        box-shadow:
            -22px 0 55px rgba(0, 0, 0, .42) !important;

        opacity: 1;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .primary-nav::before {
        content: "";
        position: absolute;
        z-index: -1;
        inset: 0;

        background:
            linear-gradient(
                180deg,
                #07172c,
                #081b34
            );

        opacity: 1;
        pointer-events: none;
    }

    .nav-links {
        position: relative;
        z-index: 2;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .nav-links a {
        width: 100%;
        min-height: 50px;

        padding: 0 15px;

        display: flex;
        align-items: center;

        color: #d9e7f6 !important;
        background: transparent !important;

        border-bottom:
            1px solid rgba(255, 255, 255, .07);

        border-radius: 9px;

        font-size: 14px;
        font-weight: 700;
    }

    .nav-links a:hover,
    .nav-links a:focus,
    .nav-links a.active {
        color: #ffffff !important;

        background:
            rgba(31, 135, 255, .15) !important;
    }

    .nav-account {
        position: relative;
        z-index: 2;

        width: 100%;
        margin-top: 20px;
        padding-top: 20px;

        display: flex;
        flex-direction: column;
        gap: 10px;

        border-top:
            1px solid rgba(255, 255, 255, .10) !important;
    }

    .nav-account .btn,
    .nav-account .btn-login,
    .nav-account .btn-register {
        width: 100%;
        min-height: 48px;

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

    .btn-login {
        color: #ffffff !important;

        background:
            rgba(255, 255, 255, .07) !important;

        border:
            1px solid rgba(255, 255, 255, .13) !important;
    }

    .btn-register {
        color: #ffffff !important;

        background:
            linear-gradient(
                135deg,
                #176bff,
                #18cfe4
            ) !important;

        border-color: transparent !important;
    }
}

@media (max-width: 640px) {

    .primary-nav {
        width: 100% !important;
        max-width: none !important;
    }
}

/* ==================================================
   Mobile navigation viewport root fix
   ================================================== */

@media (max-width: 900px) {

    /*
     * A backdrop-filter ancestor can change the
     * containing block of fixed descendants.
     */
    .site-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 9000 !important;

        background: #07172c !important;

        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;

        filter: none !important;
        transform: none !important;
        perspective: none !important;
    }

    .nav-shell {
        position: static !important;
        background: #07172c !important;
    }

    /*
     * Closed drawer
     */
    .primary-nav {
        position: fixed !important;

        top: 68px !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;

        z-index: 9100 !important;

        width: min(88vw, 390px) !important;
        height: auto !important;
        min-height: calc(100% - 68px) !important;

        margin: 0 !important;
        padding: 24px 20px 40px !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 20px !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;

        background: #07172c !important;

        border-left:
            1px solid rgba(255, 255, 255, .10) !important;

        border-radius: 0 !important;

        box-shadow:
            -24px 0 60px rgba(0, 0, 0, .45) !important;

        opacity: 1 !important;

        transform: translateX(105%) !important;
        visibility: hidden !important;

        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;

        transition:
            transform .26s ease,
            visibility .26s ease !important;
    }

    /*
     * Open drawer
     */
    .primary-nav.is-open {
        background: #07172c !important;
        background-color: #07172c !important;

        opacity: 1 !important;

        transform: translateX(0) !important;
        visibility: visible !important;
    }

    /*
     * Dark page overlay
     */
    body.nav-open::before {
        content: "";

        position: fixed;
        z-index: 8990;

        top: 68px;
        right: 0;
        bottom: 0;
        left: 0;

        background: rgba(1, 8, 20, .68);

        pointer-events: none;
    }

    body.nav-open {
        overflow: hidden !important;
    }

    /*
     * Menu contents
     */
    .primary-nav .nav-links {
        width: 100% !important;

        display: flex !important;
        flex-direction: column !important;

        gap: 4px !important;
    }

    .primary-nav .nav-links a {
        width: 100% !important;
        min-height: 52px !important;

        padding: 0 16px !important;

        display: flex !important;
        align-items: center !important;

        color: #d8e7f7 !important;

        background: transparent !important;

        border-bottom:
            1px solid rgba(255, 255, 255, .07) !important;

        border-radius: 9px !important;

        font-size: 15px !important;
        font-weight: 700 !important;
    }

    .primary-nav .nav-links a:hover,
    .primary-nav .nav-links a:focus,
    .primary-nav .nav-links a.active {
        color: #ffffff !important;

        background:
            rgba(29, 127, 244, .16) !important;
    }

    .primary-nav .nav-account {
        width: 100% !important;

        margin-top: 6px !important;
        padding-top: 20px !important;

        display: flex !important;
        flex-direction: column !important;

        gap: 10px !important;

        border-top:
            1px solid rgba(255, 255, 255, .10) !important;
    }

    .primary-nav .nav-account .btn {
        width: 100% !important;
        min-height: 50px !important;
    }

    .primary-nav .btn-login {
        color: #ffffff !important;

        background:
            rgba(255, 255, 255, .07) !important;

        border:
            1px solid rgba(255, 255, 255, .13) !important;
    }

    .primary-nav .btn-primary {
        color: #ffffff !important;

        background:
            linear-gradient(
                135deg,
                #176bff,
                #18cfe4
            ) !important;

        border: 0 !important;
    }
}

@media (max-width: 640px) {

    .primary-nav,
    .primary-nav.is-open {
        width: 100% !important;
        max-width: none !important;
    }
}
