/* global React, ReactDOM */ const { useState, useEffect, useRef } = React; /* ---------------- Nav ---------------- */ function Nav() { const [scrolled, setScrolled] = useState(false); const [activeLink, setActiveLink] = useState(null); // no link active until user clicks one useEffect(() => { const on = () => setScrolled(window.scrollY > 40); window.addEventListener("scroll", on, { passive: true }); on(); return () => window.removeEventListener("scroll", on); }, []); const links = [ { href: "#work", label: "Work" }, { href: "#services", label: "Services" }, { href: "#process", label: "Process" }, { href: "#capabilities", label: "Capabilities" }, { href: "#contact", label: "Contact" }, ]; return ( ); } function ArrowSm() { return ( ); } function ArrowLg({color = "white"}) { return ( ); } /* ---------------- Hero Lamp ---------------- */ function HeroLamp() { const [theme, setTheme] = useState( (typeof document !== "undefined" && document.documentElement.getAttribute("data-theme")) || "light" ); const [animKey, setAnimKey] = useState(0); const [mounted, setMounted] = useState(false); useEffect(() => { setMounted(true); const obs = new MutationObserver(() => { const next = document.documentElement.getAttribute("data-theme") || "light"; setTheme(next); setAnimKey((k) => k + 1); }); obs.observe(document.documentElement, { attributes: true, attributeFilter: ["data-theme"], }); return () => obs.disconnect(); }, []); const src = theme === "dark" ? "assets/dark-mode.png" : "assets/light-mode.png"; return ( <> {/* Ambient glow rendered on via portal — escapes .hero overflow */} {mounted && ReactDOM.createPortal(