/* Shared finalized navigation for the homepage and document pages. */
:root {
    --navigation-edge: 20px;
    --navigation-inner-padding: 20px;
    --navigation-max-width: 1400px;
    --navigation-top: 48px;
}

.alternative-header {
    position: absolute;
    inset: var(--navigation-top) var(--navigation-edge) auto;
    z-index: 60;
    max-width: var(--navigation-max-width);
    margin-inline: auto;
    border-radius: 16px;
    color: #ffffff;
    pointer-events: none;
    transition: background-color .25s ease, box-shadow .25s ease, color .25s ease;
}

.alternative-header[data-sticky] { position: fixed; }
.alternative-header[data-static] {
    position: relative;
    inset: auto;
    width: calc(100% - 2 * var(--navigation-edge));
    margin-block: var(--navigation-top) 0;
}
.alternative-nav, .alternative-nav-brand-slot { pointer-events: auto; }

.alternative-header-inner {
    min-height: 64px;
    padding: 12px var(--navigation-inner-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.alternative-header.is-docked {
    background: #fbfaf8;
    color: #143c29;
    box-shadow:
        0 8px 32px rgb(10 33 24 / 12%),
        inset 0 1px 0 rgb(255 255 255 / 75%),
        inset 0 -1px 0 rgb(20 60 41 / 6%);
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
    .alternative-header.is-docked {
        background: linear-gradient(135deg, rgb(255 255 255 / 24%), transparent 55%), rgb(251 250 248 / 91%);
        -webkit-backdrop-filter: blur(12px) saturate(1.1);
        backdrop-filter: blur(12px) saturate(1.1);
    }
}

@media (prefers-reduced-transparency: reduce) {
    .alternative-header.is-docked {
        background: #fbfaf8;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

.alternative-brand { display: block; width: fit-content; transform-origin: top left; }
.alternative-brand .hero-wordmark { display: block; width: 351px; height: auto; margin: 0; }
.alternative-brand .hero-wordmark > path:nth-of-type(-n + 2) { fill: #ffffff; }
.alternative-header .hero-wordmark { width: 180px; }
.alternative-header .hero-wordmark > path:nth-of-type(-n + 2) { fill: #143c29; }
.alternative-nav-brand-slot:empty { display: none; }

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

.alternative-nav a {
    position: relative;
    padding-block: 10px;
    color: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

/* Hover underline grows out from the centre; the contact button carries it under its label. */
.alternative-nav-label { position: relative; display: inline-block; }
.alternative-nav a:not(.alternative-nav-contact)::after,
.alternative-nav-label::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6px;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 300ms cubic-bezier(.2, .7, .2, 1);
    pointer-events: none;
}
.alternative-nav-label::after { bottom: -4px; }
.alternative-nav a:not(.alternative-nav-contact):is(:hover, :focus-visible)::after,
.alternative-nav-contact:is(:hover, :focus-visible) .alternative-nav-label::after { transform: scaleX(1); }
.alternative-nav a:not(.alternative-nav-contact):is(:hover, :focus-visible) { color: inherit; }
.alternative-header a:focus-visible { outline-color: #2bbf78; }

.alternative-nav .alternative-nav-contact {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
    padding: 10px 16px;
    background: #ffffff;
    color: #143c29;
}

.is-docked .alternative-nav-contact { background: #143c29; color: #ffffff; }

.legal-page {
    width: calc(100% - 2 * var(--navigation-edge));
    max-width: var(--navigation-max-width);
    padding-inline: var(--navigation-inner-padding);
}

@media (min-width: 1200px) {
    .alternative-nav { gap: 30px; }
    .alternative-nav a { font-size: 15.5px; }
}

@media (min-width: 901px) and (max-width: 1199px) {
    .alternative-nav { gap: 24px; }
    .alternative-nav a { font-size: 14.5px; }
}

@media (max-width: 1100px) {
    :root { --navigation-top: 36px; }
}

@media (max-width: 700px) {
    :root {
        --navigation-edge: 12px;
        --navigation-inner-padding: 12px;
        --navigation-top: 24px;
    }
    .alternative-header { border-radius: 12px; }
    .alternative-header-inner { padding-block: 10px; gap: 8px; min-height: 56px; }
    .alternative-header .hero-wordmark { width: 150px; }
    .alternative-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px 16px; }
    .alternative-nav a { min-width: 0; font-size: 13px; line-height: 1.5; }
    .alternative-nav .alternative-nav-contact { padding: 8px 10px; gap: 6px; }
    .alternative-nav-contact svg { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
    .alternative-header { transition: none; }
    .alternative-nav a::after, .alternative-nav-label::after { transition: none; }
}
