/* Nav — glass pill row + full-width mega menu (Services, Industries). Cases & About direct. */ function LangToggle({ lang, setLang }) { const langs = ['en','pt','es']; return (
{langs.map((l, i) => ( {i > 0 && |} ))}
); } function ThemeToggle({ theme, setTheme }) { const [h, setH] = useState(false); return ( ); } function Nav({ t, lang, setLang, theme, setTheme, active, heroDark = true }) { const [scrolled, setScrolled] = useState(false); const [open, setOpen] = useState(false); // mobile drawer const [mega, setMega] = useState(null); // 'services' | 'industries' | null const closeTimer = useRef(null); useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 24); onScroll(); window.addEventListener('scroll', onScroll, { passive:true }); return () => window.removeEventListener('scroll', onScroll); }, []); const openMega = (k) => { clearTimeout(closeTimer.current); setMega(k); }; const scheduleClose = () => { clearTimeout(closeTimer.current); closeTimer.current = setTimeout(()=>setMega(null), 90); }; const P = window.PAGES; const N = t.nav; // solid surface whenever scrolled OR a mega panel is open (so the full-width bar reads clearly) const solid = scrolled || !!mega; const topWhite = !solid && heroDark; const topVars = topWhite ? { '--text-1':'#fff', '--text-2':'rgba(255,255,255,.8)', '--text-3':'rgba(255,255,255,.62)', '--border-1':'rgba(255,255,255,.2)', '--border-2':'rgba(255,255,255,.3)' } : {}; const logoVariant = topWhite ? 'paper' : (theme==='light' ? 'gradient' : 'paper'); const megaItems = mega==='services' ? N.servicesItems : mega==='industries' ? N.industriesItems : []; return (
{/* Full-width mega bar — seamlessly attached below the pill row */} {mega && (
openMega(mega)} style={{ borderTop:'1px solid var(--border-1)', animation:'bneMegaIn .2s var(--ease-out)' }}>
{mega==='services' ? N.services : N.industries}
{megaItems.map(it => )}
)}
{/* Mobile drawer with accordions */}
setOpen(false)} style={{ position:'absolute', inset:0, background:'rgba(10,5,20,.5)', opacity: open?1:0, transition:'opacity var(--dur)' }}>
); } function mobileLink(active) { return { color: active ? 'var(--purple-light)' : '#fff', textDecoration:'none', fontFamily:'var(--font-display)', fontWeight:700, fontSize:23, padding:'13px 0', letterSpacing:'-.01em', borderBottom:'1px solid rgba(255,255,255,.1)' }; } function MegaTrigger({ label, open, active, onOpen }) { return ( ); } function MegaItem({ it }) { const [h, setH] = useState(false); return ( setH(true)} onMouseLeave={()=>setH(false)} style={{ display:'flex', alignItems:'center', gap:13, padding:'13px 14px', borderRadius:10, textDecoration:'none', background: h ? 'rgba(123,47,190,.12)' : 'transparent', transition:'background var(--dur)' }}> {it.label} ); } function MobileAccordion({ label, items, onNav }) { const [exp, setExp] = useState(false); return (
{items.map(it => ( {it.label} ))}
); } function NavLink({ href, label, active, onHover }) { const [h, setH] = useState(false); return ( { setH(true); onHover && onHover(); }} onMouseLeave={()=>setH(false)} style={{ color: active ? 'var(--accent)' : (h ? 'var(--text-1)' : 'var(--text-2)'), textDecoration:'none', fontFamily:'var(--font-body)', fontSize:15, fontWeight:500, transition:'color var(--dur)', position:'relative', paddingBottom:3 }}> {label} {active && } ); } Object.assign(window, { Nav, LangToggle, ThemeToggle });