/* =====================================================================
   Header — 1:1 with atlas5.co components/nav.tsx.
   Floating glass pill fixed 16px from the top; firms up past 30px of
   scroll (.is-scrolled); below 1024px the links move into a dropdown panel
   over a scrim (.is-open). Behaviour in assets/js/header.js.
   ===================================================================== */

.a5-nav-float {
    position: fixed; top: 1rem; left: 0; right: 0; z-index: 1000;
    display: flex; flex-direction: column; align-items: center; gap: 0.625rem;
    padding: 0 1.25rem; pointer-events: none;
}
body.admin-bar .a5-nav-float { top: calc(32px + 1rem); }
@media (max-width: 782px) { body.admin-bar .a5-nav-float { top: calc(46px + 1rem); } }

.a5-nav {
    pointer-events: auto; box-sizing: border-box;
    width: 100%; max-width: 73.75rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1.375rem;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    border: 1px solid rgba(33, 28, 85, 0.08); border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(1.25rem) saturate(180%);
    backdrop-filter: blur(1.25rem) saturate(180%);
    box-shadow: inset 0 0.0625rem 0 rgba(255, 255, 255, .7), var(--a5-shadow-md);
    transition: background-color .35s ease, box-shadow .35s ease, border-color .35s ease;
}
@media (min-width: 640px) { .a5-nav { padding: 0.625rem 1.25rem; } }
.a5-nav-float.is-scrolled .a5-nav {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(33, 28, 85, 0.1);
}

/* Shrinkable like the site's logo link, so a tight bar never overflows. */
.a5-nav-logo { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; }
.a5-nav-logo img { display: block; height: 1.625rem; width: auto; max-width: 100%; }

.a5-nav-links { display: none; gap: 1.875rem; }
/* Seven links (the site's six + Blog) need more room than the site's 860px
   breakpoint gives, so the desktop bar starts at 1024px, with a tighter gap
   until the pill reaches full width. */
@media (min-width: 1024px) { .a5-nav-links { display: flex; } }
@media (min-width: 1024px) and (max-width: 1219px) { .a5-nav-links { gap: 1.25rem; } }

.a5-nav-link,
.a5-nav-link:visited {
    position: relative; padding: 0.25rem 0;
    font-family: var(--a5-font-sans); font-size: var(--a5-text-small); font-weight: 500; line-height: 1.5;
    color: var(--a5-ink);
}
.a5-nav-link::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: var(--a5-primary); transform: scaleX(0); transform-origin: left;
    transition: transform .25s ease;
}
.a5-nav-link:hover { color: var(--a5-ink); }
.a5-nav-link:hover::after,
.a5-nav-link[aria-current="page"]::after { transform: scaleX(1); }
.a5-nav-link[aria-current="page"] { color: var(--a5-primary); }

.a5-nav-actions { display: flex; align-items: center; gap: 0.625rem; }
.a5-nav-cta { display: none; }
/* As on the site, the chevron gives way first when the bar runs out of room. */
.a5-nav-cta .a5-icon-1em { flex-shrink: 1; min-width: 0; }
@media (min-width: 1024px) { .a5-nav-cta { display: inline-flex; } }

/* Burger */
.a5-burger {
    display: flex; flex-direction: column; gap: 0.3125rem;
    width: auto; margin: 0; padding: 0.75rem; border: 0; border-radius: var(--a5-radius-sm);
    background: var(--a5-surface); color: var(--a5-ink); cursor: pointer; transition: none;
}
/* The site's burger has no hover/focus fill; this cancels Hello's pink one. */
.a5-burger:hover, .a5-burger:focus { background: var(--a5-surface); color: var(--a5-ink); }
@media (min-width: 1024px) { .a5-burger { display: none; } }
.a5-burger span {
    display: block; width: 1.25rem; height: 2px; border-radius: 2px; background: var(--a5-ink);
    transition: transform .25s ease, opacity .25s ease;
}
.a5-nav-float.is-open .a5-burger span:nth-child(1) { transform: translateY(0.4375rem) rotate(45deg); }
.a5-nav-float.is-open .a5-burger span:nth-child(2) { opacity: 0; }
.a5-nav-float.is-open .a5-burger span:nth-child(3) { transform: translateY(-0.4375rem) rotate(-45deg); }

/* Mobile panel */
.a5-mobile-menu {
    box-sizing: border-box; width: 100%; max-width: 26.25rem;
    display: flex; flex-direction: column; padding: 0.625rem;
    border: 1px solid rgba(33, 28, 85, 0.08); border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(1.25rem) saturate(180%);
    backdrop-filter: blur(1.25rem) saturate(180%);
    box-shadow: var(--a5-shadow-md);
    opacity: 0; transform: translateY(-0.625rem) scale(.98); pointer-events: none;
    transition: opacity .28s var(--a5-ease), transform .28s var(--a5-ease);
}
.a5-nav-float.is-open .a5-mobile-menu { opacity: 1; transform: none; pointer-events: auto; }
@media (min-width: 1024px) { .a5-mobile-menu { display: none; } }

.a5-mobile-link,
.a5-mobile-link:visited {
    padding: 0.875rem 1rem; border-radius: var(--a5-radius-sm);
    font-size: var(--a5-text-small); font-weight: 500; line-height: 1.5; color: var(--a5-ink);
}
.a5-mobile-link:hover,
.a5-mobile-link[aria-current="page"] { background: var(--a5-surface); color: var(--a5-ink); }
.a5-mobile-link[aria-current="page"] { color: var(--a5-primary); }
.a5-mobile-cta { margin: 0.625rem 0.375rem 0; font-size: var(--a5-text-body); line-height: 1.6; }

/* Scrim */
.a5-scrim {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(33, 28, 85, 0.28);
    opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.a5-scrim.is-open { opacity: 1; pointer-events: auto; }
@media (min-width: 1024px) { .a5-scrim { display: none; } }
