/* Harupa.pro — LLM & GenAI page app. */
(function () {
  const { SiteNav, SiteFooter, useLangState, scrollToId } = window.HPChrome;

  function App() {
    const { lang, setLang, t } = useLangState("llm");
    const links = [
      { label: t("llm-cap-overline"), id: "capabilities" },
      { label: t("llm-why-overline"), id: "why" },
      { label: t("llm-stack-overline"), id: "stack" },
      { label: t("nav-contact"), id: "contact" },
    ];
    /* Contact section reuses ct-* keys; override the title/sub with llm-ct-*. */
    const tCt = (key) => {
      const map = {
        "ct-title-pre": "llm-ct-title-pre", "ct-title-em": "llm-ct-title-em",
        "ct-title-post": "llm-ct-title-post", "ct-sub": "llm-ct-sub",
      };
      return t(map[key] || key);
    };
    return (
      <React.Fragment>
        <SiteNav t={t} lang={lang} setLang={setLang} links={links} ctaId="contact" />
        <window.HPLlmHero t={t} lang={lang} onNavigate={scrollToId} />
        <window.HPLlmCaps t={t} />
        <window.HPLlmWhy t={t} />
        <window.HPLlmStack t={t} />
        <window.HPContact t={tCt} />
        <SiteFooter t={t} />
      </React.Fragment>
    );
  }
  ReactDOM.createRoot(document.getElementById("hp-app")).render(<App />);
})();
