/* Navigation and its dropdowns; the existing home page styles stay untouched. */
.site-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    background: #eff0f6;
}

.header-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 22px;
    width: min(1180px, calc(100% - 48px));
    min-height: 56px;
    margin: 0 auto;
    padding: 0;
}

.site-brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    line-height: 0;
}

.site-brand img {
    display: block;
    width: 108px;
    height: auto;
    max-height: 38px;
    object-fit: contain;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.nav-toggle .icon-close {
    display: none;
}

.nav-toggle:focus-visible {
    outline: 2px solid rgba(30, 86, 212, .42);
    outline-offset: -3px;
}

.primary-nav {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: clamp(4px, 1.1vw, 18px);
    min-width: 0;
}

.primary-nav a {
    text-decoration: none;
}

.nav-dropdown {
    position: static;
    display: block;
}

.nav-dropdown>summary,
.nav-direct {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 56px;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--menu-button);
    font-family: 'JakartaSemiBold', 'Inter', sans-serif;
    font-size: 0.875rem;
    line-height: 1;
    white-space: nowrap;
    list-style: none;
    cursor: pointer;
    transition: color .16s ease;
}

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

.nav-dropdown>summary::marker,
.language-picker>summary::marker {
    content: '';
}

.nav-dropdown>summary:hover,
.nav-direct:hover,
.nav-dropdown[open]>summary {
    color: var(--menu-button-hover);
}

.chevron {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .18s ease;
}

.nav-dropdown[open]>summary .chevron,
.language-picker[open]>summary .chevron {
    transform: rotate(180deg);
}

.nav-dropdown>summary:focus-visible,
.nav-direct:focus-visible,
.language-picker>summary:focus-visible {
    outline: 2px solid rgba(30, 86, 212, .42);
    outline-offset: -3px;
}

.mega-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 1010;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    width: min(900px, calc(100vw - 40px));
    min-height: 260px;
    overflow: hidden;
    transform: translateX(-50%);
    border: 1px solid #e3e5eb;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(23, 31, 49, .18);
    animation: menu-in .16s ease-out both;
}

.solutions-menu {
    width: min(930px, calc(100vw - 40px));
}

.developers-menu {
    width: min(900px, calc(100vw - 40px));
}

.mega-links {
    display: grid;
    align-content: center;
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 20px 24px;
}

.solutions-menu .mega-links,
.developers-menu .mega-links {
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
}

.mega-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 62px;
    padding: 9px 10px;
    border-radius: 5px;
    color: var(--text-ink);
    transition: background .16s ease, color .16s ease;
}

.mega-link:hover,
.mega-link:focus-visible {
    outline: none;
    background: #f4f6fa;
    color: var(--menu-button-hover);
}

.mega-icon {
    width: 38px;
    height: 38px;
    display: grid;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid #e7eaf1;
    border-radius: 7px;
    background: #f5f6fa;
    color: var(--text-icon-muted);
}

.mega-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mega-link:hover .mega-icon {
    border-color: #d5e1fa;
    background: #eaf0fc;
    color: var(--text-blue-active);
}

.mega-link strong {
    display: block;
    margin-bottom: 3px;
    font-family: 'JakartaSemiBold', 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
}

.mega-link small {
    display: block;
    color: var(--text-subtle);
    font-family: 'JakartaSans', 'Inter', sans-serif;
    font-size: 0.75rem;
    line-height: 1.45;
}

.code-icon {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
}

.mega-feature {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 260px;
    overflow: hidden;
    padding: 27px 25px;
    background: #f0f2f8;
}

.mega-feature::before,
.mega-feature::after {
    position: absolute;
    right: -54px;
    bottom: -110px;
    width: 230px;
    height: 230px;
    border: 1px solid rgba(33, 38, 57, .08);
    border-radius: 50%;
    content: '';
    pointer-events: none;
}

.mega-feature::after {
    right: -20px;
    bottom: -76px;
    width: 160px;
    height: 160px;
    border-color: rgba(255, 140, 0, .25);
}

.feature-kicker {
    position: relative;
    z-index: 1;
    color: var(--text-secondary);
    font-family: 'JakartaSemiBold', 'Inter', sans-serif;
    font-size: 0.625rem;
    letter-spacing: 1.4px;
}

.feature-orbit {
    position: absolute;
    top: 28px;
    right: 31px;
    color: var(--front-orange);
    font-size: 1.375rem;
}

.mega-feature h3 {
    position: relative;
    z-index: 1;
    max-width: 245px;
    margin: 20px 0 8px;
    color: var(--bg-container);
    font-family: 'JakartaSemiBold', 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.24;
}

.mega-feature p {
    position: relative;
    z-index: 1;
    max-width: 235px;
    margin: 0;
    color: var(--text-secondary);
    font-family: 'JakartaSans', 'Inter', sans-serif;
    font-size: 0.75rem;
    line-height: 1.6;
}

.feature-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 19px;
    color: var(--text-blue-active);
    font-family: 'JakartaSemiBold', 'Inter', sans-serif;
    font-size: 0.75rem;
}

.feature-link span {
    color: var(--front-orange);
    font-size: 1rem;
    transition: transform .16s ease;
}

.feature-link:hover span {
    transform: translate(2px, -2px);
}

.language-picker {
    position: relative;
    display: block;
    flex: 0 0 auto;
    align-self: stretch;
}

.language-picker>summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 54px;
    height: 100%;
    padding: 0 13px;
    background: #e6e9ef;
    color: var(--text-ink);
    list-style: none;
    cursor: pointer;
}

.language-picker>summary img {
    display: block;
    width: 17px;
    height: 17px;
}

.current-language {
    display: block;
    font-family: 'JakartaSemiBold', 'Inter', sans-serif;
    font-size: 0.75rem;
    white-space: nowrap;
}

.language-picker>summary .chevron {
    width: 11px;
    height: 11px;
}

.language-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1020;
    width: 202px;
    max-height: min(460px, calc(100vh - 82px));
    overflow-y: auto;
    padding: 7px;
    border: 1px solid #e3e5eb;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(25, 32, 46, .2);
    animation: popover-in .14s ease-out both;
}

.language-popover button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-slate);
    font-family: 'JakartaSans', 'Inter', sans-serif;
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
}

.language-popover button:hover,
.language-popover button:focus-visible {
    outline: none;
    background: #f3f5f9;
    color: var(--menu-button-hover);
}

.language-popover button span {
    color: var(--menu-button-hover);
    opacity: 0;
}

.language-popover button[aria-pressed="true"] {
    color: var(--menu-button-hover);
}

.language-popover button[aria-pressed="true"] span {
    opacity: 1;
}

.site-footer {
    margin-top: 0;
    padding: 48px max(24px, calc((100% - 1180px)/2)) 20px;
    border-top: 1px solid #e7e9ef;
    background: #f8f9fb;
    color: var(--text-slate-dark);
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(190px, 1.35fr) repeat(4, minmax(115px, 1fr));
    gap: 32px;
    max-width: 1180px;
    margin: 0 auto;
}

.footer-brand-block img {
    display: block;
    width: 130px;
    height: 31px;
    object-fit: contain;
    object-position: left center;
}

.footer-brand-block p {
    max-width: 230px;
    margin: 14px 0 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.65;
}

.footer-links-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.footer-links-column strong {
    margin-bottom: 5px;
    color: var(--text-heading-alt);
    font-family: 'JakartaSemiBold', 'Inter', sans-serif;
    font-size: 0.875rem;
}

.footer-links-column a {
    color: var(--text-slate);
    font-family: 'JakartaSans', 'Inter', sans-serif;
    font-size: 0.8125rem;
    line-height: 1.4;
    text-decoration: none;
}

.footer-links-column a:hover {
    color: var(--menu-button-hover);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    max-width: 1180px;
    margin: 32px auto 0;
    padding-top: 16px;
    border-top: 1px solid #e7e9ef;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.footer-bottom a {
    color: var(--text-slate-dark);
    text-decoration: none;
}

.footer-bottom a span {
    padding-left: 5px;
    color: var(--front-orange);
}

@keyframes menu-in {
    from {
        opacity: 0;
        transform: translate(-50%, -5px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes popover-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

@media (max-width: 950px) {
    .header-inner {
        gap: 10px;
    }

    .site-brand {
        flex-basis: auto;
        width: auto;
    }

    .site-brand img {
        width: 92px;
    }

    .primary-nav {
        gap: 0;
    }

    .nav-dropdown>summary,
    .nav-direct {
        padding-inline: 9px;
        font-size: 0.8125rem;
    }

    .footer-inner {
        grid-template-columns: repeat(4, 1fr);
    }

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

@media (max-width: 860px) {
    .header-inner {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
        padding: 0 14px;
    }

    .site-brand {
        order: 1;
        min-height: 56px;
        margin-right: auto;
    }

    .language-picker {
        order: 2;
        min-height: 56px;
        display: flex;
        align-items: center;
    }

    .language-picker>summary {
        min-width: 44px;
        height: 44px;
        padding-inline: 10px;
        border-radius: 6px;
        background: transparent;
    }

    .current-language {
        display: none;
    }

    .nav-toggle {
        order: 3;
        display: inline-flex;
    }

    .site-header.nav-open .nav-toggle .icon-menu {
        display: none;
    }

    .site-header.nav-open .nav-toggle .icon-close {
        display: block;
    }

    .primary-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1005;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        max-height: calc(100dvh - 56px);
        overflow-y: auto;
        padding: 10px 16px 20px;
        border-top: 1px solid #e3e6ee;
        border-bottom: 1px solid #d9dde7;
        background: #fff;
        box-shadow: 0 18px 42px rgba(23, 31, 49, .14);
        animation: popover-in .14s ease-out both;
    }

    .site-header.nav-open .primary-nav {
        display: flex;
    }

    .nav-dropdown>summary,
    .nav-direct {
        width: 100%;
        justify-content: space-between;
        min-height: 48px;
        padding: 12px 4px;
        border-bottom: 1px solid #eef0f5;
        font-size: 1rem;
    }

    .nav-direct:last-child {
        border-bottom: 0;
    }

    .nav-dropdown>summary .chevron {
        width: 14px;
        height: 14px;
    }

    .mega-menu,
    .solutions-menu,
    .developers-menu {
        position: static;
        top: auto;
        left: auto;
        grid-template-columns: 1fr;
        width: 100%;
        min-height: 0;
        max-height: none;
        overflow: visible;
        margin: 4px 0 8px;
        border: 0;
        border-radius: 6px;
        background: #f6f7fb;
        box-shadow: none;
        transform: none;
        animation: none;
    }

    .mega-feature {
        display: none;
    }

    .mega-links {
        padding: 6px 8px;
        gap: 4px;
    }

    .solutions-menu .mega-links,
    .developers-menu .mega-links {
        grid-template-columns: 1fr;
    }

    .mega-link {
        min-height: 52px;
        padding: 10px 8px;
    }

    .mega-link small {
        font-size: 0.75rem;
    }

    .language-popover {
        top: calc(100% + 5px);
        right: 0;
        width: 204px;
    }

    .site-footer {
        padding: 32px 20px 16px;
    }

    .footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 27px 18px;
    }

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

    .footer-bottom {
        flex-direction: column;
        margin-top: 25px;
    }
}

@media (max-width: 390px) {
    .site-brand {
        flex-basis: auto;
    }

    .site-brand img {
        width: 88px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .primary-nav,
    .mega-menu,
    .language-popover,
    .chevron,
    .feature-link span {
        animation: none;
        transition: none;
    }
}
