// app.jsx — composes the site and manages the lead modal
function App() {
  const { SiteNav, Hero, TrustStrip, Agents, Channels, AgentCore, Workflow, Solutions, Testimonials, Faq, CtaBand, SiteFooter, LeadModal } = window.DZ;
  const [modal, setModal] = React.useState(false);
  const openModal = () => setModal(true);

  React.useEffect(() => { window.lucide && window.lucide.createIcons(); });

  return (
    <React.Fragment>
      <SiteNav onCta={openModal} />
      <main>
        <Hero onCta={openModal} />
        <TrustStrip />
        <Agents onCta={openModal} />
        <Channels onCta={openModal} />
        <AgentCore />
        <Workflow />
        <Solutions onCta={openModal} />
        <Testimonials />
        <Faq />
        <CtaBand onCta={openModal} />
      </main>
      <SiteFooter onCta={openModal} />
      <LeadModal open={modal} onClose={() => setModal(false)} />
    </React.Fragment>
  );
}

function mount() {
  const ns = window.DelzAILabsDesignSystem_bfa572;
  const dz = window.DZ || {};
  const ready = ns && window.React && window.SITE &&
    dz.SiteNav && dz.Hero && dz.TrustStrip && dz.Agents && dz.Channels &&
    dz.Workflow && dz.Solutions && dz.Testimonials && dz.Faq &&
    dz.CtaBand && dz.SiteFooter && dz.LeadModal && dz.AgentCore;
  if (!ready) return setTimeout(mount, 40);
  ReactDOM.createRoot(document.getElementById('root')).render(<App />);
}
mount();
