// App — wires everything up

const { Nav, Hero, ProofStrip, Services, Industries, About, ServiceArea, Trust, CTA, Footer, TweaksPanel, useReveal } = window;

function App() {
  useReveal();
  // Re-render on tweaks change
  const [_, force] = React.useState(0);
  React.useEffect(() => {
    const on = () => force(x => x + 1);
    window.addEventListener('tweaks-changed', on);
    // Apply saved accent on load
    const accent = window.TWEAKS?.accentColor;
    if (accent === 'brass') document.documentElement.style.setProperty('--accent', '#c4a66b');
    if (accent === 'royal') document.documentElement.style.setProperty('--accent', '#003594');
    return () => window.removeEventListener('tweaks-changed', on);
  }, []);

  return (
    <>
      <Nav dark={true} />
      <Hero />
      <ProofStrip />
      <Services />
      <Industries />
      <About />
      <ServiceArea />
      <Trust />
      <CTA />
      <Footer />
      <TweaksPanel />
    </>
  );
}

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