function App() {
  const [editMode, setEditMode] = React.useState(false);
  React.useEffect(() => {
    const handler = (e) => {
      if (e.data?.type === '__activate_edit_mode') setEditMode(true);
      if (e.data?.type === '__deactivate_edit_mode') setEditMode(false);
    };
    window.addEventListener('message', handler);
    window.parent.postMessage({ type: '__edit_mode_available' }, '*');
    return () => window.removeEventListener('message', handler);
  }, []);

  React.useEffect(() => {
    const v = window.GS_TWEAKS?.variant || 'aurora';
    document.body.setAttribute('data-variant', v);
  }, []);

  return (
    <>
      <a href="#top" className="floating-logo" aria-label="Generative Solutions — inicio">
        <img src="assets/logo.png?v=4" alt="Generative Solutions" width="128" height="128" />
      </a>
      <Nav />
      <main>
        <Hero />
        <Services />
        <Process />
        <Roi />
        <Chatbot />
        <Faq />
        <Contact />
      </main>
      <Footer />
      <Tweaks enabled={editMode} />
    </>
  );
}

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