// App shell + routing
function App() {
  const [page, setPage] = React.useState("home");
  const scrollRef = React.useRef(null);
  const nav = (p) => { setPage(p); if (scrollRef.current) scrollRef.current.scrollTo({ top: 0, behavior: "auto" }); };
  const Page = {
    home: window.HomePage,
    removal: window.RemovalPage,
    trimming: window.TrimmingPage,
    areas: window.AreasPage,
    gallery: window.GalleryPage,
    contact: window.ContactPage,
  }[page] || window.HomePage;
  return (
    <div id="kit-scroll" ref={scrollRef} style={{ height: "100vh", overflowY: "auto", overflowX: "hidden" }}>
      <window.TopBar />
      <window.Header page={page} nav={nav} />
      <window.EmergencyBar />
      <main><Page nav={nav} /></main>
      <window.Footer nav={nav} />
    </div>
  );
}
ReactDOM.createRoot(document.getElementById("root")).render(<App />);
