function Nav() {
const [scrolled, setScrolled] = React.useState(false);
const [menuOpen, setMenuOpen] = React.useState(false);
React.useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 20);
onScroll();
window.addEventListener('scroll', onScroll, { passive: true });
return () => window.removeEventListener('scroll', onScroll);
}, []);
// Lock body scroll when mobile menu is open
React.useEffect(() => {
document.body.style.overflow = menuOpen ? 'hidden' : '';
return () => { document.body.style.overflow = ''; };
}, [menuOpen]);
const links = [
{ href: '#about', label: 'About' },
{ href: '#products', label: 'Products' },
{ href: '#industries', label: 'Industries' },
{ href: '#quality', label: 'Quality' },
{ href: '#insights', label: 'Insights' },
{ href: '#contact', label: 'Contact' },
];
return (
<>