:root {
    --shell-header-height: 82px;
}

body.menu-open {
    overflow: hidden;
}

.site-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    border-bottom: 1px solid transparent;
    transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.site-nav.scrolled,
.site-nav.menu-open {
    border-color: var(--line);
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    box-shadow: 0 8px 30px rgba(23, 33, 31, .05);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.nav-inner {
    position: relative;
    min-height: var(--shell-header-height);
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-nav .brand {
    position: relative;
    z-index: 2;
    min-height: 48px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
}

.nav-links > a,
.nav-dropdown > summary {
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: color .2s ease;
}

.nav-links > a:hover,
.nav-links > a[aria-current="page"],
.nav-dropdown > summary:hover,
.nav-dropdown[open] > summary {
    color: var(--green-deep);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown > summary {
    list-style: none;
}

.nav-dropdown > summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown > summary::after {
    width: 7px;
    height: 7px;
    content: "";
    border-left: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(-45deg);
    transition: transform .2s ease;
}

.nav-dropdown[open] > summary::after {
    transform: translateY(2px) rotate(135deg);
}

.nav-dropdown-panel {
    position: absolute;
    top: calc(100% + 7px);
    right: -18px;
    width: 280px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.nav-dropdown-panel a {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 11px 12px;
    border-radius: 11px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.nav-dropdown-panel a:hover,
.nav-dropdown-panel a[aria-current="page"] {
    color: var(--green-deep);
    background: var(--green-soft);
}

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

.theme-toggle,
.menu-toggle {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink);
    background: var(--surface);
    cursor: pointer;
}

.theme-toggle svg,
.menu-toggle svg {
    width: 19px;
    height: 19px;
}

.menu-toggle {
    display: none;
}

.menu-toggle .close-icon,
.menu-toggle[aria-expanded="true"] .menu-icon {
    display: none;
}

.menu-toggle[aria-expanded="true"] .close-icon {
    display: block;
}

.page-breadcrumb {
    padding-top: calc(var(--shell-header-height) + 24px);
}

.page-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    color: var(--ink-soft);
    font-size: 12px;
    list-style: none;
}

.page-breadcrumb li:not(:last-child)::after {
    margin-right: 8px;
    content: "←";
    color: color-mix(in srgb, var(--ink-soft) 65%, transparent);
}

.page-breadcrumb a {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.page-breadcrumb a:hover {
    color: var(--green-deep);
}

.site-footer {
    padding: 70px 0 28px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.site-footer .footer-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr 1fr;
    gap: 42px;
}

.site-footer .footer-brand p {
    max-width: 330px;
}

.preferred-source {
    max-width: 330px;
    margin-top: 20px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
}

.preferred-source p {
    margin: 0 0 10px;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.7;
}

.preferred-source-button {
    min-height: 48px;
    direction: ltr;
}

.preferred-source-fallback {
    display: none;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--surface);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
}

.preferred-source-fallback.visible {
    display: inline-flex;
}

.site-footer .footer-title {
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 800;
}

.site-footer .footer-links {
    display: grid;
    gap: 9px;
}

.site-footer .footer-links a,
.site-footer address a {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    color: var(--ink-soft);
    font-size: 12px;
    text-decoration: none;
}

.site-footer .footer-links a:hover,
.site-footer address a:hover {
    color: var(--green-deep);
}

.page-shell {
    min-height: 62vh;
    padding: 70px 0 110px;
}

.page-shell-card {
    max-width: 850px;
    padding: clamp(28px, 5vw, 60px);
    border: 1px solid var(--line);
    border-radius: 32px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.page-shell-card h1 {
    margin: 12px 0 18px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.25;
}

.page-shell-card p {
    max-width: 700px;
    margin: 0 0 26px;
    color: var(--ink-soft);
}

.page-shell-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 1120px) {
    .menu-toggle {
        display: grid;
    }

    .nav-actions {
        margin-right: auto;
    }

    .nav-links {
        position: fixed;
        top: var(--shell-header-height);
        right: 14px;
        left: 14px;
        max-height: calc(100vh - var(--shell-header-height) - 28px);
        display: none;
        align-items: stretch;
        gap: 2px;
        margin: 0;
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 20px;
        background: var(--surface);
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
    }

    .site-nav.menu-open .nav-links {
        display: grid;
    }

    .nav-links > a,
    .nav-dropdown > summary {
        min-height: 48px;
        padding: 0 10px;
        border-radius: 10px;
        font-size: 14px;
    }

    .nav-links > a:hover,
    .nav-dropdown > summary:hover {
        background: var(--surface-soft);
    }

    .nav-dropdown-panel {
        position: static;
        width: auto;
        margin: 0 10px 8px;
        padding: 4px 10px;
        border: 0;
        border-right: 2px solid var(--green-soft);
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .nav-dropdown-panel a {
        font-size: 13px;
    }

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

@media (max-width: 720px) {
    :root {
        --shell-header-height: 70px;
    }

    .nav-inner {
        gap: 9px;
    }

    .nav-actions .nav-login {
        min-height: 48px;
        padding: 8px 12px;
        font-size: 11px;
    }

    .theme-toggle,
    .menu-toggle {
        width: 48px;
        height: 48px;
    }

    .socials a {
        width: 48px;
        height: 48px;
    }

    .feature-index a {
        min-height: 48px;
        display: inline-flex;
        align-items: center;
    }

    main small,
    main figcaption,
    .product-window-label,
    .landing-proof span,
    .security-chip,
    .legal-meta span,
    .choice-chip,
    .choice-primary p,
    .choice-cta,
    .choice-meta,
    .choice-secondary p,
    .choice-group-label {
        font-size: 11px !important;
    }

    .footer-bottom {
        font-size: 11px;
    }

    .page-breadcrumb {
        padding-top: calc(var(--shell-header-height) + 18px);
    }

    .site-footer {
        padding-top: 55px;
    }

    .site-footer .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .page-shell {
        padding: 45px 0 80px;
    }

    .page-shell-actions .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-nav,
    .nav-dropdown > summary::after {
        transition: none;
    }
}
