// Theme helpers (THEME_STORAGE_KEY, getInitialTheme) live in theme.jsx so the
// legal pages (privacy.html, terms.html, refund.html) can reuse the same
// bootstrap without pulling in the main App.

function App() {
  const [theme, setTheme] = React.useState(window.getInitialTheme);

  React.useEffect(() => {
    document.documentElement.dataset.theme = theme;
    try { localStorage.setItem(window.THEME_STORAGE_KEY, theme); } catch (_) {}
  }, [theme]);

  return (
    <>
      <div className="mesh-bg"></div>
      <div className="grain"></div>

      <Nav theme={theme} setTheme={setTheme} />
      <Hero />
      <HowItWorks />
      <SmartActions />
      <Performance />
      <Pricing />
      <Changelog />
      <Footer />
    </>
  );
}

ReactDOM.createRoot(document.getElementById("root")).render(<App />);
