:root {
    --site-header-height: 64px;
    --site-content-width: 1120px;
    --site-content-inline-space: 80px;
    --site-header-background: rgba(251, 251, 253, 0.92);
    --site-header-ink: #1d1d1f;
    --site-header-muted: #6e6e73;
    --site-header-border: rgba(210, 210, 215, 0.78);
    --site-brand-mark-size: 30px;
}

.site-header {
    width: 100%;
    height: var(--site-header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex: 0 0 var(--site-header-height);
    background: var(--site-header-background);
    border-bottom: 1px solid var(--site-header-border);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.site-header-inner {
    width: min(var(--site-content-width), calc(100% - var(--site-content-inline-space)));
    height: 100%;
    margin-inline: auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Online-tool pages use the same horizontal rail as homepage/download content. */
.tool-shell {
    width: min(var(--site-content-width), calc(100% - var(--site-content-inline-space)));
}

.site-brand {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: var(--site-header-ink);
    font-size: 17px;
    font-weight: 680;
    line-height: 1;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.site-brand-mark {
    width: var(--site-brand-mark-size);
    height: var(--site-brand-mark-size);
    display: grid;
    flex: 0 0 var(--site-brand-mark-size);
    place-items: center;
    color: #fff;
    background: var(--site-header-ink);
    border-radius: 9px;
    font-size: 15px;
    font-weight: 760;
    line-height: 1;
    letter-spacing: normal;
}

.site-header-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.site-header-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    color: var(--site-header-muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    opacity: 1;
    transition: color 0.2s ease;
}

.site-header-link:hover {
    color: var(--site-header-ink);
}

.site-brand:focus-visible,
.site-header-link:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.28);
    outline-offset: 2px;
    border-radius: 8px;
}

.site-header .home-link::before {
    content: none;
}

/* The shared header is in normal flow; preserve the established first-screen positions. */
.navbar.site-header + main .hero {
    padding-top: 76px;
}

.navbar.site-header + .detail-main {
    padding-top: 28px;
}

.navbar.site-header + .not-found-page {
    padding-top: 66px;
}

@media (max-width: 768px) {
    :root {
        --site-content-inline-space: 40px;
    }

    .site-header-nav {
        gap: 14px;
    }

    .site-header-link {
        font-size: 13px;
    }

    .navbar.site-header + main .hero {
        padding-top: 36px;
    }
}

@media (max-width: 640px) {
    :root {
        --site-header-height: 56px;
        --site-brand-mark-size: 28px;
    }

    .site-brand {
        min-height: 36px;
        font-size: 15px;
    }

    .site-brand-mark {
        border-radius: 8px;
        font-size: 13px;
    }

    .site-header-nav {
        gap: 10px;
    }

    .site-header-link {
        min-height: 36px;
    }

    .navbar.site-header + main .hero {
        padding-top: 44px;
    }

    .navbar.site-header + .detail-main {
        padding-top: 36px;
    }

    .navbar.site-header + .not-found-page {
        padding-top: 74px;
    }
}

@media (max-width: 360px) {
    .site-header-link--secondary {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-header-link {
        transition: none;
    }
}
