/* v2 root — sells-first sequence: Hero → Trap → Two Paths → Launch Map → Platform → Audience → Partnership → Why UAE → Why us → Credibility → Final CTA → Form. */

function App() {
  const [formIntent, setFormIntent] = React.useState({ value: "", hint: "" });

  const scrollTo = (id) => {
    const el = document.getElementById(id);
    if (el) {
      const top = el.getBoundingClientRect().top + window.scrollY - 64;
      window.scrollTo({ top, behavior: "smooth" });
    }
  };

  const handlePickScenario = (kind) => {
    if (kind === "brief") {
      setFormIntent({ value: "", hint: "Product brief intake" });
    } else if (kind === "deck") {
      setFormIntent({ value: "Partnership / LOI", hint: "Capability deck request" });
    } else if (kind === "launchmap") {
      setFormIntent({ value: "UAE Launch Map", hint: "UAE Launch Map request" });
    }
    scrollTo("contact");
  };

  return (
    <>
      <TopNav onScrollTo={scrollTo} />
      <Hero onScrollTo={scrollTo} onPickScenario={handlePickScenario} />
      <MarketEntryTrap />
      <TwoPaths onScrollTo={scrollTo} />
      <LaunchMapSection onScrollTo={scrollTo} />
      <ExecutionPlatformSection />
      <AudienceSection />
      <PartnershipModelSection onScrollTo={scrollTo} />
      <WhyUAESection />
      <WhyUsSection />
      <CredibilitySection />
      <FinalCTASection onScrollTo={scrollTo} />
      <LeadForm initialIntent={formIntent.value} intentHint={formIntent.hint} />
      <Footer />
      <MobileStickyBar onScrollTo={scrollTo} />
    </>
  );
}

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