/* ============================================================ Header — fixed chrome (AIR pattern) left: menu pill + heart square · right: primary capsule center stays empty (the hero tagline sits top-center; the giant А|Л letters are the wordmark) ============================================================ */ function Header({ onMenu, onContact }) { const { t } = useT(); const [onDark, setOnDark] = React.useState(true); const [scrolled, setScrolled] = React.useState(false); React.useEffect(() => { const onScroll = () => { let d = false; const home = document.querySelector('[data-screen-label="Home"]'); if (home) { const r = home.getBoundingClientRect(); if (r.bottom > 88) d = true; } const res = document.querySelector('[data-screen-label="Results"]'); if (res) { const r = res.getBoundingClientRect(); if (r.top <= 70 && r.bottom >= 40) d = true; } setOnDark(d); setScrolled(window.scrollY > 40); }; window.addEventListener("scroll", onScroll, { passive: true }); onScroll(); return () => window.removeEventListener("scroll", onScroll); }, []); const lightPill = onDark ? { background: "var(--paper-on-ink)", color: "var(--ink)" } : null; return (
{/* left cluster */}
{/* language switcher (replaces the old heart); hides on scroll so it never collides with the collapsing А|Л monogram */}
{/* right cluster: account + primary capsule */}
{ window.location.href = "course.html#enroll"; }}>{t("common.enroll")}
); } Object.assign(window, { Header });