/* These are not modules. Every section is a plain <script type="text/babel">
   that assigns itself onto window, so eslint sees them as undefined globals —
   which is why this file already carried 35 no-undef errors before the hero
   landed. Declaring them fixes the two the hero would have added AND clears
   the pre-existing 35, rather than ratcheting the debt one notch wider. */
/* global HeroCinematic, SectionRest, SectionPillars, SectionProblem, SectionBigIdea, SectionWheel, SectionJourney, SectionExplore, SectionOutcomes, SectionCTA, FilmLightbox, GMTweaks */

/* ============================================================
 * App V2 — the cinematic hero over the existing page
 *
 * The hero is HeroCinematic (full-bleed generated plate + Seedance loop),
 * ported from homepage-v4. Everything BELOW it is untouched: the rest of the
 * page is still the v2 sections, and the v4 film block that sat under the hero
 * was deliberately NOT brought across.
 *
 * FilmLightbox has to be here even though there is no film section — the
 * hero's "Watch the film" button calls window.__gmOpenFilm(), which the
 * lightbox registers on mount. Without it the CTA is inert.
 *
 * SectionHeroV2 (photo + phone) is retired but left in the tree, so reverting
 * is a one-line swap if the cinematic hero does not survive contact.
 * ============================================================ */

const AppV2 = () => {
  const [tweaks, setTweaks] = useState(window.__GM_TWEAKS__);

  useLayoutEffect(() => {
    document.documentElement.setAttribute("data-theme", tweaks.theme);
    document.documentElement.setAttribute("data-density", tweaks.density);
    document.documentElement.style.setProperty("--accent", tweaks.accent);
    document.documentElement.style.setProperty(
      "--accent-glow",
      `color-mix(in srgb, ${tweaks.accent} 22%, transparent)`
    );
    // Drops body's 68px nav offset and turns the fixed nav transparent so the
    // plate runs under it. Also scopes the nav's cream-on-dark inversion.
    document.documentElement.classList.add("has-cine-hero");
  }, []);

  return (
    <>
      <SectionNav current="home" />
      <HeroCinematic />
      <SectionRest />
      <SectionPillars />
      <SectionProblem />
      {/* The omnichannel wheel sits here deliberately. SectionProblem
          ends on "hotels do not lack tools, they lack a system"; this
          is that system, drawn. The channel cards immediately below
          then detail the channels sitting on its rim. */}
      <SectionWheel />
      <SectionBigIdea tweaks={tweaks} />
      <SectionJourney />
      {/* Inbox, Voice, Brain and Engine were removed from the homepage on
          2026-08-12. They existed from when this was the ONLY page; every
          one of them now has its own product page reachable from the mega
          menu, so the homepage was arguing the same case twice at ~3,400
          lines of weight. The files remain in the repo and in git history —
          nothing was deleted, only unmounted here. SectionExplore replaces
          them: eight cards, one per mega-menu destination, whose job is to
          send people there.

          SectionIntegrations STAYS. It is the partner-logo wall, not a
          product pitch, so it has no mega-menu page duplicating it — it
          was swept up in the removal by mistake and put back. It sits
          after Explore so the partner proof lands just before outcomes. */}
      <SectionExplore />
      <SectionIntegrations />
      <SectionOutcomes />
      <SectionCTA />
      <SectionFooter />
      <FilmLightbox />
      <GMTweaks onChange={setTweaks} />
    </>
  );
};

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