/* =========================================================================
   Site header (partials/bf-navbar.hbs), matched to the getmaxim.ai landing
   page nav: a 41px banner and a 68px bar, both sticky. The full bar shows
   at 1200px and up; below that the links fold into a stacked menu.
   ========================================================================= */

:root {
    --bfn-banner-h: 41px;
    --bfn-bar-h: 68px;
    --bfn-line: rgba(34, 34, 34, 0.1);
    --bfn-muted: #8f8f8f;
    --bfn-muted-hover: #525252;
    --bfn-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ------------------------------------------------------------------ Banner */

.bfn-banner {
    position: sticky;
    top: 0;
    z-index: 52;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: var(--bfn-banner-h);
    padding: 8px 0;
    overflow: hidden;
    background: #5f9e89;
}

.bfn-banner-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: fill;
}

.bfn-banner-art {
    position: absolute;
    top: calc(51.2195% - 22.5px);
    left: -900px;
    right: -900px;
    z-index: 0;
    display: none;
    height: 45px;
    min-width: 3000px;
}

.bfn-banner-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    width: 1px;
    max-width: 560px;
    height: 25px;
    align-items: center;
    justify-content: center;
    gap: 2px;
    overflow: clip;
}

.bfn-banner-copy {
    position: relative;
    display: flex;
    width: min-content;
    max-width: 350px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: clip;
}

.bfn-banner .bfn-banner-text {
    position: relative;
    z-index: 1;
    margin: 0;
    font-family: var(--bf-mono);
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: pre;
    color: #fff;
}

.bf-chrome a.bfn-banner-link {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bf-chrome a.bfn-banner-link:hover {
    text-decoration: none;
}

.bfn-banner-plain,
.bfn-banner-cta {
    display: none;
}

.bfn-banner-arrow {
    position: relative;
    display: block;
    width: 12px;
    aspect-ratio: 1;
    background: #fff;
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 0 12 L 6 6 L 0 0' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' transform='translate(9 6)'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 0 12 L 6 6 L 0 0' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' transform='translate(9 6)'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (min-width: 810px) {
    .bfn-banner-art { display: block; }
    .bfn-banner-inner { gap: 8px; }
    .bfn-banner-copy { max-width: none; gap: 12px; }
    .bfn-banner-link--phone,
    .bfn-banner-arrow { display: none; }
    .bfn-banner-plain { display: inline; }
    .bfn-banner-cta { display: block; }
}

/* ------------------------------------------------------------------ Header */

body:not(.is-head-stacked) .gh-head,
body.is-head-stacked .gh-head,
#gh-head.bfn {
    position: sticky;
    top: var(--bfn-banner-h);
    z-index: 50;
    display: block;
    height: auto !important;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.bfn-bar {
    position: relative;
    padding: 20px 24px;
    background: #f9f9f9;
}

.bfn-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.bfn-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
}

.bfn-logo-wrap {
    position: relative;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.bfn-logo {
    position: relative;
    display: block;
    flex-shrink: 0;
    width: 90px;
    height: 24px;
    overflow: clip;
    outline: none;
}

.bfn-logo svg {
    position: absolute;
    top: -1px;
    left: 0;
    display: block;
    width: 90px;
    height: 21px;
}

.bfn-logo:focus-visible {
    outline: 2px solid var(--bf-primary);
    outline-offset: 3px;
}

.bfn-main {
    display: none;
}

/* ------------------------------------------------------------- Nav links */

.bfn-links {
    display: flex;
    flex: 1;
    width: 1px;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.bfn-item {
    position: relative;
    display: flex;
    flex-shrink: 0;
}

.bfn .bfn-link {
    position: relative;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin: 0;
    padding: 4px;
    border: 0;
    border-radius: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.bfn button.bfn-link {
    gap: 6px;
}

.bfn .bfn-link--flush {
    gap: 10px;
    padding: 0;
}

.bfn-link-text {
    position: relative;
    font-family: var(--bf-mono);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4em;
    letter-spacing: 0.04em;
    white-space: pre;
    color: var(--bfn-muted);
    user-select: none;
    transition: color 0.3s var(--bfn-ease);
}

.bfn-chevron {
    position: relative;
    display: block;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

/* Hover plate: grows from the centre with 4px corner brackets. */
.bfn-hover {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: 0;
    width: 1px;
    opacity: 0;
    filter: blur(3px);
    transform: translateX(-50%);
    pointer-events: none;
    background:
        linear-gradient(#7f7f7f, #7f7f7f) 0 0 / 4px 1px no-repeat,
        linear-gradient(#7f7f7f, #7f7f7f) 0 0 / 1px 4px no-repeat,
        linear-gradient(#7f7f7f, #7f7f7f) 100% 0 / 4px 1px no-repeat,
        linear-gradient(#7f7f7f, #7f7f7f) 100% 0 / 1px 4px no-repeat,
        linear-gradient(#7f7f7f, #7f7f7f) 0 100% / 4px 1px no-repeat,
        linear-gradient(#7f7f7f, #7f7f7f) 0 100% / 1px 4px no-repeat,
        linear-gradient(#7f7f7f, #7f7f7f) 100% 100% / 4px 1px no-repeat,
        linear-gradient(#7f7f7f, #7f7f7f) 100% 100% / 1px 4px no-repeat,
        #f0f0f0;
    transition: width 0.3s var(--bfn-ease), opacity 0.3s var(--bfn-ease), filter 0.3s var(--bfn-ease);
}

.bfn-link--flush .bfn-hover {
    top: -4px;
    bottom: -3px;
}

.bfn-link:hover .bfn-hover,
.bfn-link:focus-visible .bfn-hover,
.bfn-item.is-open > .bfn-link .bfn-hover {
    width: 100%;
    opacity: 1;
    filter: blur(0);
}

.bfn-link:hover .bfn-link-text,
.bfn-link:focus-visible .bfn-link-text,
.bfn-item.is-open > .bfn-link .bfn-link-text {
    color: var(--bfn-muted-hover);
}

.bfn .bfn-link:focus-visible {
    outline: none;
}

.bfn-item.is-open > .bfn-link .bfn-chevron {
    transform: rotate(180deg);
}

/* -------------------------------------------------------------- Dropdowns */

.bfn-pop {
    position: absolute;
    top: 100%;
    z-index: 50;
    padding-top: 16px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}

.bfn-item.is-open > .bfn-pop {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s;
}

.bfn-pop--products {
    left: -200px;
    width: 900px;
}

.bfn-pop--company {
    left: 50%;
    transform: translate(-50%, -6px);
}

.bfn-item.is-open > .bfn-pop--company {
    transform: translateX(-50%);
}

.bfn-panel {
    position: relative;
    background: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.bfn-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.bfn-products {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
}

.bfn-product-col {
    display: flex;
    flex: 1;
    width: 1px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.bfn .bfn-drop-item {
    position: relative;
    display: flex;
    width: 100%;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.bfn-item-hover {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    background:
        linear-gradient(#6fc3a8, #6fc3a8) 0 0 / 8px 1px no-repeat,
        linear-gradient(#6fc3a8, #6fc3a8) 0 0 / 1px 8px no-repeat,
        linear-gradient(#6fc3a8, #6fc3a8) 100% 0 / 8px 1px no-repeat,
        linear-gradient(#6fc3a8, #6fc3a8) 100% 0 / 1px 8px no-repeat,
        linear-gradient(#6fc3a8, #6fc3a8) 0 100% / 8px 1px no-repeat,
        linear-gradient(#6fc3a8, #6fc3a8) 0 100% / 1px 8px no-repeat,
        linear-gradient(#6fc3a8, #6fc3a8) 100% 100% / 8px 1px no-repeat,
        linear-gradient(#6fc3a8, #6fc3a8) 100% 100% / 1px 8px no-repeat,
        #f0f8f4;
    transition: opacity 0.2s ease;
}

.bfn-drop-item:hover .bfn-item-hover,
.bfn-drop-item:focus-visible .bfn-item-hover {
    opacity: 1;
}

.bfn .bfn-drop-item:focus-visible {
    outline: none;
}

.bfn .bfn-product {
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
}

.bfn-product-icon-wrap {
    position: relative;
    display: flex;
    flex-shrink: 0;
    width: 16px;
    padding-top: 4px;
}

.bfn-product-icon {
    display: block;
    width: 16px;
    height: 16px;
}

.bfn-product-copy {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.bfn-product-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--bf-sans);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3em;
    white-space: pre;
    color: #141414;
}

.bfn-product-desc {
    font-family: var(--bf-sans);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45em;
    white-space: pre-wrap;
    color: #787878;
}

.bfn-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 6px;
    border: 1px solid #8dd7c3;
    font-family: var(--bf-mono);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2em;
    letter-spacing: 0.04em;
    color: #0e7a61;
}

.bfn .bfn-evals {
    position: relative;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: #fafafa;
    font-family: var(--bf-sans);
    font-size: 12px;
    line-height: 1.3em;
    color: #3c3c3c;
    text-decoration: none;
}

.bfn-evals-cta {
    font-weight: 500;
    color: #141414;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bfn .bfn-evals:hover .bfn-evals-cta {
    text-decoration: none;
}

.bfn-company {
    display: flex;
    width: 156px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px;
}

.bfn .bfn-company-item {
    align-items: center;
    gap: 10px;
    padding: 8px;
}

.bfn-company-label {
    position: relative;
    width: 100%;
    font-family: var(--bf-sans);
    font-size: 14px;
    line-height: 1.3em;
    color: #141414;
}

/* ---------------------------------------------------------------- Buttons */

.bfn-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
}

.bfn .bfn-btn {
    position: relative;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 12px;
    background: #f5f5f5;
    color: #282828;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.bfn .bfn-btn:hover {
    background: #f0f0f0;
}

.bfn-btn-text {
    font-family: var(--bf-mono);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: pre;
    color: #282828;
}

.bfn-btn-icon {
    display: block;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.bfn-btn-icon--github {
    width: 14px;
    height: 14px;
}

.bfn-btn-corner {
    position: absolute;
    width: 6px;
    height: 6px;
    pointer-events: none;
}

.bfn-btn-corner--tl { top: -1px; left: -1px; }
.bfn-btn-corner--tr { top: -1px; right: -1px; }
.bfn-btn-corner--bl { bottom: -1px; left: -1px; }
.bfn-btn-corner--br { right: -1px; bottom: -1px; }

.bfn .bfn-demo {
    position: relative;
    display: flex;
    flex-shrink: 0;
    width: 123px;
    text-decoration: none;
}

.bfn-demo-face {
    position: relative;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 12px;
    background: #33c09e;
    box-shadow:
        0 0 6px rgba(72, 213, 151, 0.4),
        0 2px 2px rgba(0, 0, 0, 0.08),
        inset 2px 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.12);
    transition: background-color 0.4s ease-out;
}

.bfn-demo-face::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

.bfn-demo:hover .bfn-demo-face,
.bfn-demo:active .bfn-demo-face {
    background: #33a68b;
}

.bfn-demo-text {
    font-family: var(--bf-mono);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: 0.04em;
    white-space: pre;
    color: #fff;
}

.bfn-demo-corner {
    position: absolute;
    width: 4px;
    height: 4px;
    pointer-events: none;
}

.bfn-demo-corner svg {
    position: absolute;
    inset: 0;
    display: block;
    width: 4px;
    height: 4px;
}

.bfn-demo-corner--tl { top: 0; left: 0; }
.bfn-demo-corner--bl { bottom: 0; left: 0; transform: rotate(-90deg); }
.bfn-demo-corner--br { right: 0; bottom: 0; transform: rotate(180deg); }
.bfn-demo-corner--tr { top: 0; right: 0; transform: rotate(90deg); }

.bfn .bfn-btn:focus-visible,
.bfn .bfn-demo:focus-visible,
.bfn .bfn-m-row:focus-visible {
    outline: 2px solid var(--bf-primary);
    outline-offset: 2px;
}

.bfn .bfn-full {
    width: 100%;
}

/* ------------------------------------------------------- Menu button */

.bfn .bfn-toggle {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 4px;
    border: 0;
    background: #f9f9f9;
    overflow: clip;
    cursor: pointer;
}

.bfn-toggle-open,
.bfn-toggle-close {
    display: block;
    width: 16px;
    height: 16px;
}

.bfn-toggle-close,
.bfn.is-open .bfn-toggle-open {
    display: none;
}

.bfn.is-open .bfn-toggle-close {
    display: block;
}

.bfn-toggle-icon {
    display: block;
    width: 16px;
    height: 16px;
}

/* ------------------------------------------------------------ Phone menu */

.bfn.is-open .bfn-bar {
    max-height: calc(100vh - var(--bfn-banner-h));
    max-height: calc(100dvh - var(--bfn-banner-h));
    padding-bottom: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.bfn-mobile {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1000px;
    margin: 24px auto 0;
}

.bfn-mobile[hidden] {
    display: none;
}

.bfn-m-list {
    display: flex;
    width: 100%;
    flex-direction: column;
    border-bottom: 1px solid var(--bfn-line);
}

.bfn-m-group,
.bfn-m-sub {
    display: flex;
    width: 100%;
    flex-direction: column;
}

.bfn-m-sub[hidden] {
    display: none;
}

.bfn .bfn-m-row {
    position: relative;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 12px 4px;
    border: 1px solid var(--bfn-line);
    border-bottom: 0;
    border-radius: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.bfn-m-text {
    position: relative;
    font-family: var(--bf-mono);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4em;
    letter-spacing: 0.04em;
    white-space: pre;
    color: var(--bfn-muted);
    user-select: none;
    transition: color 0.3s var(--bfn-ease);
}

.bfn-m-row:hover .bfn-m-text {
    color: var(--bfn-muted-hover);
}

.bfn-m-row[aria-expanded="true"] .bfn-chevron {
    transform: rotate(180deg);
}

.bfn-m-actions {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--bfn-line);
}

.bfn-m-action {
    width: 100%;
}

@media (min-width: 810px) {
    .bfn-bar {
        padding-left: 40px;
        padding-right: 40px;
    }

    .bfn.is-open .bfn-bar {
        padding-bottom: 40px;
    }

    .bfn-m-actions {
        flex-direction: row;
        gap: 8px;
    }

    .bfn-m-action {
        flex: 1 0 0;
        width: 1px;
    }
}

/* --------------------------------------------------------- Full bar */

@media (min-width: 1200px) {
    .bfn-bar {
        padding: 20px 100px;
    }

    .bfn-inner {
        justify-content: flex-start;
    }

    .bfn-main {
        display: flex;
        flex: 1;
        width: 1px;
        align-items: center;
        justify-content: center;
        gap: 2px;
    }

    .bfn .bfn-toggle,
    .bfn-mobile,
    .bfn-mobile[hidden] {
        display: none;
    }

    .bfn.is-open .bfn-bar {
        max-height: none;
        padding-bottom: 20px;
        overflow: visible;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bfn-hover,
    .bfn-link-text,
    .bfn-chevron,
    .bfn-pop,
    .bfn-item-hover,
    .bfn-demo-face,
    .bfn-m-text {
        transition: none;
    }
}
