html:has(.nav-toggle:checked),
body:has(.nav-toggle:checked),
html.nav-scroll-locked,
body.nav-scroll-locked {
    overflow: hidden;
    overscroll-behavior: none;
}

body.nav-scroll-locked {
    position: fixed;
    right: 0;
    left: 0;
    width: 100%;
}

@view-transition {
    navigation: auto;
}

main {
    view-transition-name: main-content;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

::view-transition-group(main-content) {
    overflow: clip;
    animation-duration: 0.32s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(main-content) {
    animation: main-content-out 0.18s cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(main-content) {
    animation: main-content-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes main-content-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes main-content-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    main {
        view-transition-name: none;
    }

    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 1ms;
    }
}

.topbar {
    display: none;
    background: var(--ink);
    color: #ffffff;
    font-size: 14px;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    gap: 18px;
}

.topbar a {
    color: var(--lavender);
    font-weight: 800;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(248, 251, 255, 0.72);
    border-bottom: 1px solid rgba(103, 112, 133, 0.16);
    backdrop-filter: blur(18px);
}

.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 800;
    letter-spacing: 0;
}

.brand:hover {
    color: var(--ink);
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 6px 18px rgba(24, 34, 56, 0.16);
}

.desktop-nav {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.desktop-nav > a,
.nav-item > a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    border-radius: 8px;
    padding: 0 14px;
    color: #2e3951;
    font-weight: 600;
}

.desktop-nav > a:hover,
.nav-item:hover > a,
.nav-item:focus-within > a {
    color: var(--ink);
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(24, 34, 56, 0.08);
}

.nav-item {
    position: relative;
}

.nav-panel {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    display: grid;
    width: 330px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-item:hover .nav-panel,
.nav-item:focus-within .nav-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.nav-panel a {
    display: grid;
    gap: 4px;
    border-radius: 8px;
    padding: 13px;
    color: var(--ink);
}

.nav-panel a:hover {
    background: #fdf7fb;
}

.nav-panel span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-link {
    color: #44506a;
    font-weight: 700;
}

.button-small {
    min-height: 42px;
    padding: 0 16px;
    font-size: 14px;
}

.button-small:hover {
    color: #ffffff;
}

.menu-button,
.close-button,
.nav-toggle,
.mobile-menu {
    display: none;
}

@media (max-width: 980px) {
    .topbar {
        display: none;
    }

    .desktop-nav,
    .nav-actions .text-link,
    .nav-actions .button-small {
        display: none;
    }

    .menu-button {
        display: grid;
        width: 44px;
        height: 44px;
        gap: 4px;
        align-content: center;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #ffffff;
        cursor: pointer;
    }

    .menu-button span {
        display: block;
        width: 20px;
        height: 2px;
        border-radius: 999px;
        background: var(--ink);
    }

    .mobile-menu {
        position: fixed;
        inset: 0;
        z-index: 30;
        display: block;
        overflow: hidden;
        overscroll-behavior: contain;
        pointer-events: none;
    }

    .mobile-scrim {
        position: absolute;
        inset: 0;
        display: block;
        background: rgba(18, 26, 45, 0.42);
        opacity: 0;
        transition: opacity 0.18s ease;
    }

    .mobile-drawer {
        position: absolute;
        top: 0;
        right: 0;
        display: grid;
        align-content: start;
        gap: 8px;
        width: min(390px, 88vw);
        max-width: 100%;
        max-height: 100dvh;
        min-height: 100%;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 18px;
        background: #f8fbff;
        box-shadow: -20px 0 60px rgba(18, 26, 45, 0.18);
        transform: translateX(100%);
        transition: transform 0.22s ease;
    }

    .nav-toggle:checked ~ .mobile-menu {
        pointer-events: auto;
    }

    .nav-toggle:checked ~ .mobile-menu .mobile-scrim {
        opacity: 1;
    }

    .nav-toggle:checked ~ .mobile-menu .mobile-drawer {
        transform: translateX(0);
    }

    .mobile-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
    }

    .close-button {
        position: relative;
        display: grid;
        width: 42px;
        height: 42px;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #ffffff;
        cursor: pointer;
        color: transparent;
        font-size: 0;
    }

    .close-button::before,
    .close-button::after {
        position: absolute;
        width: 20px;
        height: 2px;
        border-radius: 999px;
        background: var(--ink);
        content: "";
    }

    .close-button::before {
        transform: rotate(45deg);
    }

    .close-button::after {
        transform: rotate(-45deg);
    }

    .mobile-drawer > a:not(.button) {
        display: none;
        border-bottom: 1px solid var(--line);
        padding: 17px 2px;
        color: #2e3951;
        font-size: 20px;
        font-weight: 800;
    }

    .mobile-drawer > a[href="support.html"] {
        display: block;
    }

    .mobile-drawer .button {
        margin-top: 16px;
    }
}

@media (max-width: 620px) {
    .nav-shell {
        min-height: 66px;
    }

    .brand {
        font-size: 15px;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
    }
}
