/* =========================================
       LIQUID GLASS HEADER — scoped to site header
       ========================================= */
    .bfs-header {
        --glass-bg: rgba(255, 255, 255, 0.18);
        --glass-border: rgba(255, 255, 255, 0.45);
        --glass-shadow: rgba(0, 0, 0, 0.1);
        --glass-highlight: rgba(255, 255, 255, 0.8);
        --glass-caustic: rgba(255, 255, 255, 0.4);
        --reflection-start: rgba(255, 255, 255, 0.6);
        --reflection-end: rgba(255, 255, 255, 0.0);
        --glare-color: rgba(255, 255, 255, 0.5);
        --pill-bg: rgba(255, 255, 255, 0.72);
        --pill-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05), inset 0 1px 1px rgba(255,255,255,0.8);
        --icon-color: rgba(0, 0, 0, 0.52);
        --icon-active: rgba(0, 0, 0, 0.95);
        --divider: rgba(0, 0, 0, 0.14);
        --accent: #ec761d;
        --icon-size: 20px;
        --dropdown-bg: rgba(255, 255, 255, 0.72);
        --mobile-panel-bg: rgba(255, 255, 255, 0.55);
        font-family: Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
        -webkit-font-smoothing: antialiased;
    }

    html.dark .bfs-header,
    [data-theme="dark"] .bfs-header {
        --glass-bg: rgba(30, 30, 35, 0.48);
        --glass-border: rgba(255, 255, 255, 0.16);
        --glass-shadow: rgba(0, 0, 0, 0.8);
        --glass-highlight: rgba(255, 255, 255, 0.25);
        --glass-caustic: rgba(255, 255, 255, 0.05);
        --reflection-start: rgba(255, 255, 255, 0.16);
        --reflection-end: rgba(255, 255, 255, 0.0);
        --glare-color: rgba(255, 255, 255, 0.16);
        --pill-bg: rgba(60, 60, 65, 0.82);
        --pill-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.2), inset 0 1px 1px rgba(255,255,255,0.2);
        --icon-color: rgba(255, 255, 255, 0.55);
        --icon-active: #ffffff;
        --divider: rgba(255, 255, 255, 0.16);
        --dropdown-bg: rgba(28, 28, 32, 0.78);
        --mobile-panel-bg: rgba(18, 18, 22, 0.72);
    }

    .bfs-header {
        position: sticky;
        top: 0;
        z-index: 50;
        width: 100%;
        background: transparent;
    }

    .bfs-header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        width: 100%;
    }

    .bfs-logo img {
        height: 40px;
        width: auto;
        display: block;
    }

    @media (min-width: 768px) {
        .bfs-logo img { height: 48px; }
    }

    /* Full-width liquid glass bar */
    .liquid-nav {
        position: relative;
        display: flex;
        align-items: center;
        width: 100%;
        padding: 10px 0;
        border-radius: 0;
        background: var(--glass-bg);
        backdrop-filter: blur(50px) saturate(200%);
        -webkit-backdrop-filter: blur(50px) saturate(200%);
        box-shadow:
            0 24px 50px -20px var(--glass-shadow),
            0 8px 20px -10px var(--glass-shadow),
            inset 0 2px 3px -1px var(--glass-highlight),
            inset 0 -2px 4px -1px var(--glass-caustic),
            inset 0 0 0 1px var(--glass-border);
        transition: background 0.5s ease, box-shadow 0.5s ease;
        z-index: 10;
    }

    .liquid-nav::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 46%;
        border-radius: 0;
        background: linear-gradient(180deg, var(--reflection-start) 0%, var(--reflection-end) 100%);
        pointer-events: none;
        z-index: 6;
        transition: background 0.5s ease;
    }

    .liquid-glare-container {
        position: absolute;
        inset: 0;
        border-radius: 0;
        overflow: hidden;
        pointer-events: none;
        z-index: 5;
    }

    .liquid-glare {
        position: absolute;
        inset: 0;
        opacity: 0;
        transition: opacity 0.3s ease;
        background: radial-gradient(circle 90px at var(--x, 50%) var(--y, 50%), var(--glare-color) 0%, transparent 100%);
        mix-blend-mode: overlay;
    }

    .liquid-nav:hover .liquid-glare {
        opacity: 1;
    }

    .nav-items {
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px;
        z-index: 3;
    }

    .active-pill {
        position: absolute;
        top: 0;
        left: 0;
        height: 44px;
        background: var(--pill-bg);
        border-radius: 99px;
        box-shadow: var(--pill-shadow);
        transition: transform 0.5s cubic-bezier(0.34, 1.2, 0.64, 1),
                    width 0.5s cubic-bezier(0.34, 1.2, 0.64, 1),
                    background 0.5s ease, box-shadow 0.5s ease;
        z-index: 1;
        pointer-events: none;
    }

    .nav-btn {
        position: relative;
        display: inline-flex;
        align-items: center;
        background: transparent;
        border: none;
        padding: 0 18px;
        height: 44px;
        border-radius: 99px;
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: -0.01em;
        color: var(--icon-color);
        cursor: pointer;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.3s ease;
        outline: none;
        z-index: 2;
        white-space: nowrap;
    }

    .nav-btn:hover {
        color: var(--accent);
    }

    .nav-btn.active {
        color: var(--icon-active);
    }

    .nav-btn.active:hover {
        color: var(--accent);
    }

    .btn-content {
        display: flex;
        align-items: center;
        gap: 8px;
        pointer-events: none;
        transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .nav-btn:active .btn-content {
        transform: scale(0.92);
    }

    .bfs-header .nav-icon {
        width: var(--icon-size);
        height: var(--icon-size);
        flex-shrink: 0;
        stroke-width: 2;
    }

    .nav-btn svg.nav-icon {
        width: var(--icon-size);
        height: var(--icon-size);
    }

    .nav-chevron {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
        transition: transform 0.2s ease;
    }

    #bfs-info-btn[aria-expanded="true"] .nav-chevron {
        transform: rotate(180deg);
    }

    .nav-btn .nav-label-full { display: none; }
    .nav-btn .nav-label-short { display: inline; }

    .nav-drop {
        position: relative;
    }

    .liquid-dropdown {
        display: none;
        position: absolute;
        left: 0;
        top: calc(100% + 10px);
        min-width: 240px;
        padding: 8px;
        border-radius: 16px;
        background: var(--dropdown-bg);
        backdrop-filter: blur(40px) saturate(180%);
        -webkit-backdrop-filter: blur(40px) saturate(180%);
        box-shadow:
            0 24px 50px -16px var(--glass-shadow),
            inset 0 1px 1px var(--glass-highlight),
            inset 0 0 0 1px var(--glass-border);
        z-index: 60;
    }

    .liquid-dropdown.is-open { display: block; }

    .liquid-dropdown-pointer {
        position: absolute;
        top: -5px;
        left: 22px;
        width: 10px;
        height: 10px;
        background: var(--dropdown-bg);
        border-left: 1px solid var(--glass-border);
        border-top: 1px solid var(--glass-border);
        transform: rotate(45deg);
    }

    .liquid-dropdown a,
    .liquid-dropdown .fly-trigger {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 10px 12px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        font-family: inherit;
        font-size: 13.5px;
        font-weight: 600;
        color: var(--icon-active);
        text-align: left;
        text-decoration: none;
        cursor: pointer;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .liquid-dropdown a:hover,
    .liquid-dropdown a.active-sub,
    .liquid-dropdown .fly-trigger:hover,
    .fly-item.is-open > .fly-trigger {
        background: color-mix(in srgb, var(--accent) 12%, transparent);
        color: var(--accent);
    }

    .liquid-dropdown svg.nav-icon {
        width: var(--icon-size);
        height: var(--icon-size);
        stroke-width: 2;
        flex-shrink: 0;
    }

    .fly-item { position: relative; }

    .fly-trigger .fly-caret {
        margin-left: auto;
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    .fly-panel {
        display: none;
        position: absolute;
        left: calc(100% + 6px);
        top: 0;
        min-width: 180px;
        padding: 8px;
        border-radius: 16px;
        background: var(--dropdown-bg);
        backdrop-filter: blur(40px) saturate(180%);
        -webkit-backdrop-filter: blur(40px) saturate(180%);
        box-shadow:
            0 24px 50px -16px var(--glass-shadow),
            inset 0 1px 1px var(--glass-highlight),
            inset 0 0 0 1px var(--glass-border);
        z-index: 70;
    }

    .fly-item:hover > .fly-panel,
    .fly-item.is-open > .fly-panel { display: block; }

    .mobile-sub a,
    .mobile-sub .mobile-fly-toggle {
        padding-left: 44px;
        font-size: 14px;
        font-weight: 500;
    }

    .mobile-fly-panel a { padding-left: 60px; }

    .divider {
        width: 1px;
        height: 24px;
        background: var(--divider);
        margin: 0 8px;
        z-index: 3;
        transition: background 0.5s ease;
        flex-shrink: 0;
    }

    .theme-btn,
    .icon-link,
    .hamburger-btn {
        position: relative;
        background: transparent;
        border: none;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        color: var(--icon-color);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        z-index: 3;
        outline: none;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.3s ease;
        text-decoration: none;
        flex-shrink: 0;
    }

    .theme-btn:hover,
    .theme-btn:active,
    .icon-link:hover,
    .hamburger-btn:hover {
        color: var(--icon-active);
    }

    .icon-link {
        color: var(--accent);
    }

    .theme-icon-wrapper {
        position: relative;
        width: var(--icon-size);
        height: var(--icon-size);
        pointer-events: none;
        transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .theme-btn:active .theme-icon-wrapper {
        transform: scale(0.8);
    }

    .theme-icon-wrapper svg {
        position: absolute;
        top: 0;
        left: 0;
        width: var(--icon-size);
        height: var(--icon-size);
        transition: transform 0.5s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.4s ease;
        stroke-width: 2;
    }

    .bfs-header .sun { opacity: 1; transform: rotate(0deg) scale(1); }
    .bfs-header .moon { opacity: 0; transform: rotate(-90deg) scale(0); }

    html.dark .bfs-header .sun,
    [data-theme="dark"] .bfs-header .sun {
        opacity: 0;
        transform: rotate(90deg) scale(0);
    }

    html.dark .bfs-header .moon,
    [data-theme="dark"] .bfs-header .moon {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }

    .mobile-tools {
        display: flex;
        align-items: center;
        gap: 2px;
        flex-shrink: 0;
        z-index: 20;
        position: relative;
    }

    .hamburger-btn {
        color: var(--icon-active);
    }

    .hamburger-btn svg {
        display: block;
        width: 22px;
        height: 22px;
        stroke: currentColor;
    }

    .hamburger-btn .icon-close { display: none; }
    .hamburger-btn.is-open .icon-bars { display: none; }
    .hamburger-btn.is-open .icon-close { display: block; }

    .liquid-mobile-panel {
        display: none;
        border-top: 1px solid var(--glass-border);
        background: var(--mobile-panel-bg);
        backdrop-filter: blur(40px) saturate(180%);
        -webkit-backdrop-filter: blur(40px) saturate(180%);
    }

    .liquid-mobile-panel.is-open {
        display: block;
    }

    .mobile-sub {
        display: none;
    }

    .mobile-sub.is-open {
        display: block;
    }

    #bfs-info-toggle.is-open #bfs-info-caret {
        transform: rotate(180deg);
    }

    .mobile-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        border-radius: 14px;
        font-size: 15px;
        font-weight: 600;
        color: var(--icon-active);
        text-decoration: none;
        transition: background 0.2s ease, color 0.2s ease;
    }

    button.mobile-link {
        appearance: none;
        -webkit-appearance: none;
        margin: 0;
        background: transparent;
        border: 0;
        width: 100%;
        text-align: left;
        font: inherit;
        font-size: 15px;
        font-weight: 600;
        color: var(--icon-active);
        cursor: pointer;
        box-shadow: none;
    }

    button.mobile-link #bfs-info-caret {
        margin-left: auto;
        width: 16px;
        height: 16px;
        flex-shrink: 0;
        color: inherit;
    }

    .mobile-link:hover,
    .mobile-link.active {
        background: color-mix(in srgb, var(--accent) 12%, transparent);
        color: var(--accent);
    }

    .mobile-link svg.nav-icon {
        width: var(--icon-size);
        height: var(--icon-size);
        flex-shrink: 0;
        stroke-width: 2;
    }

    .icon-link svg.nav-icon {
        width: var(--icon-size);
        height: var(--icon-size);
    }

    .hamburger-btn svg {
        width: var(--icon-size);
        height: var(--icon-size);
    }

    .mobile-sub a {
        padding-left: 44px;
        font-size: 14px;
        font-weight: 500;
    }

    [x-cloak] { display: none !important; }

    .desktop-cluster {
        display: none;
        align-items: center;
        min-width: 0;
        flex: 1 1 auto;
        justify-content: flex-end;
    }

    @media (max-width: 1023px) {
        .desktop-cluster { display: none !important; }
        .mobile-tools { display: flex !important; }
    }

    @media (min-width: 1024px) {
        .desktop-cluster { display: flex; }
        .mobile-tools { display: none !important; }
        .liquid-mobile-panel { display: none !important; }
    }

    @media (min-width: 1280px) {
        .nav-btn {
            padding: 0 20px;
            font-size: 15px;
        }
        .nav-items {
            gap: 12px;
        }
        .nav-btn .nav-label-full { display: inline; }
        .nav-btn .nav-label-short { display: none; }
    }

    @media (min-width: 1536px) {
        .nav-btn {
            padding: 0 22px;
        }
        .nav-items {
            gap: 14px;
        }
    }

/* Survive Perch wrappers and missing utility classes */
.bfs-header .liquid-dropdown:not(.is-open),
.bfs-header .liquid-mobile-panel:not(.is-open),
.bfs-header .mobile-sub:not(.is-open) {
    display: none !important;
}
.bfs-header .nav-items {
    flex-wrap: nowrap;
}
.bfs-header .liquid-dropdown {
    flex-direction: column;
}

/* Minimal utilities so the header works without Tailwind on Perch pages */
.bfs-header .container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}
.bfs-header .mx-auto { margin-left: auto; margin-right: auto; }
.bfs-header .px-4 { padding-left: 1rem; padding-right: 1rem; }
.bfs-header .py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.bfs-header .flex { display: flex; }
.bfs-header .flex-shrink-0 { flex-shrink: 0; }
.bfs-header .space-y-1 > * + * { margin-top: 0.25rem; }
.bfs-header .transition-transform { transition: transform 0.2s ease; }