/* global React */ /* ============================================================ Chrome — Nav, Footer, lightweight ecosystem rail ============================================================ */ const { useEffect: cEffect, useState: cState } = React; const NAV_ITEMS = [ { label: 'Philosophy', href: '/#philosophy' }, { label: 'The Audit', href: '/audit' }, { label: 'Engagements', href: '/#engagements' }, { label: 'Field Notes', href: '/insights' }, { label: 'Speaking', href: '/speaking' }, ]; function Nav() { const { path, go } = useRouter(); const [scrolled, setScrolled] = cState(false); const [drawerOpen, setDrawerOpen] = cState(false); cEffect(() => { const f = () => setScrolled(window.scrollY > 8); window.addEventListener('scroll', f, { passive: true }); f(); return () => window.removeEventListener('scroll', f); }, []); // close drawer on route change cEffect(() => { setDrawerOpen(false); }, [path]); // lock body scroll when drawer open cEffect(() => { document.body.style.overflow = drawerOpen ? 'hidden' : ''; return () => { document.body.style.overflow = ''; }; }, [drawerOpen]); // escape closes drawer cEffect(() => { if (!drawerOpen) return; const onKey = (e) => { if (e.key === 'Escape') setDrawerOpen(false); }; window.addEventListener('keydown', onKey); return () => window.removeEventListener('keydown', onKey); }, [drawerOpen]); const onNavClick = (e, href) => { e.preventDefault(); if (href.includes('#') && path === '/') { // smooth in-page scroll, no router push const id = href.split('#')[1]; const el = document.getElementById(id); if (el) el.scrollIntoView({ behavior: 'smooth', block: 'start' }); return; } if (href.includes('#')) { go(href.split('#')[0]); // wait a tick then scroll setTimeout(() => { const id = href.split('#')[1]; const el = document.getElementById(id); if (el) el.scrollIntoView({ behavior: 'smooth', block: 'start' }); }, 80); return; } go(href); }; return ( <>
{ e.preventDefault(); go('/'); }} style={{ display: 'flex', alignItems: 'center', gap: 14, textDecoration: 'none', borderBottom: 'none', }}>
The Daniel Pledger Executive Authority Advisory
setDrawerOpen(false)} /> ); } /* ============================================================ Footer — quiet, with restrained ecosystem rail ============================================================ */ function Footer() { const { go } = useRouter(); return ( ); } function FooterCol({ title, items, accent }) { const { go } = useRouter(); return (
{title}
); } Object.assign(window, { Nav, Footer });