/* =============================================================
   solidlab.ai — front page (v2, light design shared with solidlab.no)
   All visitor-facing text lives in content.js (window.CONTENT).
   ============================================================= */
const { useState, useEffect, useRef } = React;
const C = window.CONTENT;

/* ---------- Helpers ---------- */
function stickyHeight() {
  const h = document.querySelector(".sl-header");
  return h && getComputedStyle(h).position === "sticky" ? h.getBoundingClientRect().height : 0;
}

/* Scrolls so the element sits in the middle of the visible area under the sticky header.
   Elements taller than that area are aligned to the top instead. */
function scrollToCenter(el) {
  if (!el) return;
  const head = stickyHeight(), r = el.getBoundingClientRect(), room = window.innerHeight - head;
  const offset = r.height < room ? head + (room - r.height) / 2 : head + 8;
  window.scrollTo({ top: Math.max(0, r.top + window.scrollY - offset), behavior: "smooth" });
}

function scrollToId(id) {
  const el = document.getElementById(id);
  if (!el) return;
  const y = el.getBoundingClientRect().top + window.scrollY - stickyHeight() - 8;
  window.scrollTo({ top: Math.max(0, y), behavior: "smooth" });
}

/* Opens Jens (jens.jsx) with an optional first message */
function openJens(message) {
  window.dispatchEvent(new CustomEvent("sl:jens", { detail: { message } }));
}

/* ---------- Typewriter ---------- */
function Typewriter({ words, typeSpeed = 75, deleteSpeed = 40, pauseAfterType = 2000, pauseAfterDelete = 300, initialPause = 1000 }) {
  const [display, setDisplay] = useState("");
  const [wordIndex, setWordIndex] = useState(0);
  const [phase, setPhase] = useState("initial");
  useEffect(() => {
    const word = words[wordIndex % words.length];
    let t;
    if (phase === "initial") t = setTimeout(() => setPhase("typing"), initialPause);
    else if (phase === "typing") {
      if (display.length < word.length) t = setTimeout(() => setDisplay(word.slice(0, display.length + 1)), typeSpeed);
      else t = setTimeout(() => setPhase("deleting"), pauseAfterType);
    } else if (phase === "deleting") {
      if (display.length > 0) t = setTimeout(() => setDisplay(word.slice(0, display.length - 1)), deleteSpeed);
      else t = setTimeout(() => { setWordIndex(i => i + 1); setPhase("typing"); }, pauseAfterDelete);
    }
    return () => clearTimeout(t);
  }, [display, phase, wordIndex, words]);
  return (
    <span className="sl-typewriter" aria-live="polite" aria-atomic="true">
      <span className="sl-typewriter__text">{display}</span>
      <span className="sl-typewriter__cursor" aria-hidden="true">|</span>
    </span>
  );
}

/* ---------- Icons (own stroke set — 1.5px on a 24px grid) ---------- */
const ICONS = {
  web: (<g><rect x="2.5" y="4" width="19" height="14" rx="2"/><path d="M2.5 8.5h19"/><circle cx="5.6" cy="6.2" r="0.7"/><circle cx="8" cy="6.2" r="0.7"/><path d="M8 21h8"/></g>),
  shop: (<g><path d="M4 7h16l-1.5 11a2 2 0 0 1-2 1.7H7.5a2 2 0 0 1-2-1.7z"/><path d="M9 10V6a3 3 0 0 1 6 0v4"/></g>),
  app: (<g><rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><path d="M17.5 14v7M14 17.5h7"/></g>),
  systems: (<g><rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/><path d="M10 6.5h3a2 2 0 0 1 2 2v5"/><path d="M6.5 10v3a2 2 0 0 0 2 2h5"/></g>),
  discovery: (<g><circle cx="10.5" cy="10.5" r="6.5"/><path d="M15.2 15.2 21 21"/></g>),
  recommendation: (<g><path d="M6 3h9l4 4v14H6z"/><path d="M14 3v5h5"/><path d="M9.5 13h6M9.5 16.5h4"/></g>),
  build: (<g><path d="M3 20h18"/><path d="M6 20V9l6-4 6 4v11"/><path d="M10 20v-5h4v5"/></g>),
  handover: (<g><path d="M4 12h13"/><path d="m12.5 7 5 5-5 5"/><path d="M20 4v16"/></g>),
};

function Icon({ name, size = 24 }) {
  return (
    <svg className="sl-ikon" width={size} height={size} viewBox="0 0 24 24" fill="none"
         stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"
         aria-hidden="true" focusable="false">{ICONS[name]}</svg>
  );
}

/* ============ HEADER + SIDE MENU ============ */
const MENU = [
  { k: "services", label: C.menu.items.services },
  { k: "method",   label: C.menu.items.method },
  { k: "advisory", label: C.menu.items.advisory },
  { k: "toolkit",  label: C.menu.items.toolkit },
  { k: "about",    label: C.menu.items.about },
  { k: "contact",  label: C.menu.items.contact },
];

function Header() {
  const [open, setOpen] = useState(false);
  const [atTop, setAtTop] = useState(true);

  useEffect(() => {
    document.body.style.overflow = open ? "hidden" : "";
    return () => { document.body.style.overflow = ""; };
  }, [open]);

  /* Escape closes; Tab stays inside the panel while it is open */
  useEffect(() => {
    if (!open) return;
    const panel = document.getElementById("sl-panel");
    const onKey = (e) => {
      if (e.key === "Escape") { setOpen(false); return; }
      if (e.key !== "Tab" || !panel) return;
      const f = panel.querySelectorAll("a[href], button:not([disabled])");
      if (!f.length) return;
      const a = f[0], b = f[f.length - 1];
      if (e.shiftKey && document.activeElement === a) { e.preventDefault(); b.focus(); }
      else if (!e.shiftKey && document.activeElement === b) { e.preventDefault(); a.focus(); }
    };
    document.addEventListener("keydown", onKey);
    const t = setTimeout(() => { const f = panel && panel.querySelector("a[href], button"); if (f) f.focus(); }, 320);
    return () => { document.removeEventListener("keydown", onKey); clearTimeout(t); };
  }, [open]);

  useEffect(() => {
    const onScroll = () => setAtTop(window.scrollY < 24);
    onScroll();
    window.addEventListener("scroll", onScroll, { passive: true });
    return () => window.removeEventListener("scroll", onScroll);
  }, []);

  const go = (k) => { setOpen(false); setTimeout(() => scrollToId(k), 10); };

  return (
    <>
      <header className={"sl-header" + (atTop ? " sl-header--top" : "")}>
        <div className="shell sl-header__inner">
          <a className="sl-wm" href="/" onClick={(e) => { e.preventDefault(); window.scrollTo({ top: 0, behavior: "smooth" }); }}>
            <span className="sl-wm__solid">solid</span><span className="sl-wm__lab">lab</span><span className="sl-wm__ai">.ai</span>
          </a>
          <div className="sl-header__right">
            <button className="sl-meny-knapp" aria-label={C.menu.open} aria-expanded={open} aria-controls="sl-panel" onClick={() => setOpen(true)}>
              <span className="sl-meny-knapp__strek" aria-hidden="true"><i></i><i></i></span>
              <span className="sl-meny-knapp__ord">{C.menu.button}</span>
            </button>
          </div>
        </div>
      </header>

      <div className={"sl-sidemenu" + (open ? " sl-sidemenu--open" : "")} aria-hidden={!open}>
        <div className="sl-sidemenu__backdrop" onClick={() => setOpen(false)}></div>
        <aside className="sl-sidemenu__panel" id="sl-panel" role="dialog" aria-modal="true" aria-label="Menu">
          <div className="sl-sidemenu__head">
            <span className="sl-slash">{C.menu.title}</span>
            <button className="sl-sidemenu__close" aria-label={C.menu.closeAria} onClick={() => setOpen(false)}>
              <span className="sl-sidemenu__close-x">×</span>
              <span className="sl-sidemenu__close-label">{C.menu.close}</span>
            </button>
          </div>
          <nav className="sl-sidemenu__nav">
            {MENU.map((i, n) => (
              <a key={i.k} href={"#" + i.k} className="sl-sidemenu__link" style={{ "--n": n }}
                 onClick={(e) => { e.preventDefault(); go(i.k); }}>
                <span className="sl-sidemenu__nr">{String(n + 1).padStart(2, "0")}</span>
                <span className="sl-sidemenu__ord">{i.label.replace("/ ", "")}</span>
                <span className="sl-sidemenu__pil" aria-hidden="true">→</span>
              </a>
            ))}
          </nav>
          <div className="sl-v2-menu-foot">
            <a href={"mailto:" + C.contact.email}>{C.contact.email}</a>
            <span className="sl-slash">{C.menu.follow}</span>
            <a href="https://www.linkedin.com/company/115796478" target="_blank" rel="noopener noreferrer">{C.footer.linkedin}</a>
            <a href="https://www.facebook.com/people/Solidlabai/61566190246544/" target="_blank" rel="noopener noreferrer">{C.footer.facebook}</a>
          </div>
        </aside>
      </div>
    </>
  );
}

/* ============ HERO ============ */
function Hero() {
  const H = C.hero;
  return (
    <section className="sl-hero">
      <div className="shell sl-hero__grid">
        <div className="sl-hero__left">
          <div className="sl-hero__eyebrow sl-slash">{H.eyebrow}</div>
          <h1 className="sl-hero__title sl-hero__title--stacked">
            <span className="sl-hero__light sl-hero__line1">{H.titleLight}</span>
            <span className="sl-hero__line2"><span className="sl-hero__bold">{H.titleBold}</span> <span className="sl-hero__light"><span className="sl-typewriter__text">{H.titleWord}</span></span></span>
          </h1>
          <p className="sl-hero__sub">{H.sub}</p>
          <div className="sl-hero__cta">
            <a className="sl-btn sl-btn--primary" href="#contact" onClick={(e) => { e.preventDefault(); scrollToId("contact"); }}>{H.ctaPrimary}</a>
            <a className="sl-btn sl-btn--ghost" href="#services" onClick={(e) => { e.preventDefault(); scrollToId("services"); }}>{H.ctaSecondary}</a>
          </div>
          <div className="sl-band" aria-label={H.bandLabel + ": " + H.band.join(", ")}>
            <span className="sl-band__label" aria-hidden="true">{H.bandLabel}</span>
            <div className="sl-band__vindu">
              <div className="sl-band__spor">
                {[0, 1].map(set => (
                  <span className="sl-band__sett" key={set} aria-hidden="true">
                    {H.band.map(b => <span className="sl-band__ord" key={b}>{b}</span>)}
                  </span>
                ))}
              </div>
            </div>
          </div>
        </div>
        <div className="sl-hero__right">
          <div className="sl-hero__diagramknapp sl-v2-mascot">
            <video className="sl-hero__mascot" autoPlay muted loop playsInline poster="/assets/hero/hero-mascot-poster.jpg" aria-hidden="true">
              <source src="/assets/hero/hero-mascot.webm" type="video/webm"/>
              <source src="/assets/hero/hero-mascot.mp4" type="video/mp4"/>
            </video>
          </div>
        </div>
      </div>
    </section>
  );
}

/* ============ 01 — WHAT WE DO ============ */
/* Lead sentence shown prominently; the rest stays in the DOM (SEO) but collapses behind "Read more". */
function ServiceBody({ text }) {
  const [open, setOpen] = useState(false);
  const m = text.match(/^(.+?[.!?])\s+(.+)$/s);
  if (!m) return <p className="sl-service__lead">{text}</p>;
  return (
    <div className={"sl-service__text" + (open ? " is-open" : "")}>
      <p className="sl-service__lead">{m[1]}</p>
      <div className="sl-service__more" aria-hidden={!open}><div><p className="sl-service__body">{m[2]}</p></div></div>
      <button type="button" className="sl-service__toggle" aria-expanded={open} onClick={() => setOpen(!open)}>
        {open ? C.services.readLess : C.services.readMore}<span aria-hidden="true">{open ? " −" : " +"}</span>
      </button>
    </div>
  );
}

function Services() {
  const ICON_ORDER = ["web", "shop", "app", "systems"];
  return (
    <section className="sl-section" id="services">
      <div className="shell">
        <div className="sl-slash" style={{ marginBottom: 24 }}>{C.services.slash}</div>
        <div className="sl-section__head">
          <h2 className="sl-section__title">{C.services.title}</h2>
          <p className="sl-section__intro">{C.services.intro}</p>
        </div>
        <div className="sl-services">
          {C.services.items.map((s, i) => (
            <div key={s.title} className="sl-service">
              <div className="sl-service__top">
                <span className="sl-service__nr" aria-hidden="true">{String(i + 1).padStart(2, "0")}</span>
                <span className="sl-service__ikon"><Icon name={ICON_ORDER[i]} size={22}/></span>
              </div>
              <h3 className="sl-service__title">{s.title}</h3>
              <ServiceBody text={s.text}/>
              {s.tags && <ul className="sl-service__tags">{s.tags.map(t => <li key={t}>{t}</li>)}</ul>}
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ============ 02 — HOW WE WORK ============ */
function Method() {
  /* The line draws when the section comes into view and the steps light up with it. Runs once. */
  const [active, setActive] = useState(false);
  const listRef = useRef(null);
  useEffect(() => {
    const el = listRef.current;
    if (!el || !window.IntersectionObserver) { setActive(true); return; }
    const obs = new IntersectionObserver(([e]) => { if (e.isIntersecting) { setActive(true); obs.disconnect(); } },
      { threshold: 0.2, rootMargin: "0px 0px -60px 0px" });
    obs.observe(el);
    return () => obs.disconnect();
  }, []);
  const STEP_ICONS = ["discovery", "recommendation", "build", "handover"];
  return (
    <section className="sl-section sl-no-metode" id="method">
      <div className="shell">
        <div className="sl-slash" style={{ marginBottom: 24 }}>{C.method.slash}</div>
        <div className="sl-section__head">
          <h2 className="sl-section__title">{C.method.title}</h2>
          <p className="sl-section__intro">{C.method.intro}</p>
        </div>
        <ol className={"sl-no-steps" + (active ? " sl-no-steps--aktiv" : "")} ref={listRef}>
          {C.method.steps.map((s, i) => (
            <li key={s.title} className="sl-no-step" style={{ "--i": i }}>
              <span className="sl-no-step__ikon"><Icon name={STEP_ICONS[i]}/></span>
              <span className="sl-slash sl-no-step__num">/ {String(i + 1).padStart(2, "0")}</span>
              <h3 className="sl-no-step__title">{s.title}</h3>
              <p className="sl-no-step__body">{s.text}</p>
            </li>
          ))}
        </ol>
      </div>
    </section>
  );
}

/* ============ 03 — AI & ADVISORY ============ */
function Advisory() {
  const A = C.advisory;
  return (
    <section className="sl-advisory" id="advisory">
      <Hangtag/>
      <div className="shell">
        <div className="sl-slash sl-advisory__eyebrow">{A.slash}</div>
        <div className="sl-advisory__grid">
          <div className="sl-advisory__left">
            <h2 className="sl-advisory__title">{A.title}</h2>
            <p className="sl-advisory__sub">{A.sub}</p>
            <a className="sl-advisory__media" href="#contact" aria-label={A.mediaAria} onClick={(e) => { e.preventDefault(); openJens(C.jens.startChat); }}>
              <video autoPlay muted loop playsInline preload="metadata" poster="/assets/ki/ki-robot-poster.jpg" width="640" height="640" aria-hidden="true">
                <source src="/assets/ki/ki-robot.webm" type="video/webm"/>
                <source src="/assets/ki/ki-robot.mp4" type="video/mp4"/>
              </video>
            </a>
          </div>
          <div className="sl-advisory__right">
            {A.paragraphs.map((p, i) => <p className="sl-advisory__body" key={i}>{p}</p>)}
            <p className="sl-advisory__ctaq">{A.strong}</p>
            <a className="sl-btn sl-btn--primary sl-advisory__cta" href="#contact" onClick={(e) => { e.preventDefault(); openJens(C.jens.startChat); }}>{A.cta}</a>
          </div>
        </div>
      </div>
    </section>
  );
}

/* ============ 04 — TOOLKIT ============ */
function Toolkit() {
  const T = C.toolkit;
  return (
    <section className="sl-section" id="toolkit">
      <div className="shell">
        <div className="sl-slash" style={{ marginBottom: 24 }}>{T.slash}</div>
        <div className="sl-section__head">
          <h2 className="sl-section__title">{T.title}</h2>
          <p className="sl-section__intro">{T.intro}</p>
        </div>
        <div className="sl-v2-tools">
          {T.items.map((t, i) => (
            <div key={t.title} className="sl-v2-tool">
              <span className="sl-slash">/ {String(i + 1).padStart(2, "0")}</span>
              <h3 className="sl-v2-tool__title">{t.title}</h3>
              <p className="sl-v2-tool__text">{t.text}</p>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ============ 05 — ABOUT ============ */
function About() {
  const A = C.about;
  return (
    <section className="sl-section sl-no-metode sl-v2-about" id="about">
      <div className="shell">
        <div className="sl-slash" style={{ marginBottom: 24 }}>{A.slash}</div>
        <div className="sl-section__head">
          <h2 className="sl-section__title">{A.title}</h2>
          <div className="sl-section__intro">{A.paragraphs.map((p, i) => <p key={i}>{p}</p>)}</div>
        </div>
        <div className="sl-v2-values">
          {A.values.map((v, i) => (
            <div key={v.title} className="sl-v2-value">
              <span className="sl-slash">/ {String(i + 1).padStart(2, "0")}</span>
              <h3 className="sl-v2-value__title">{v.title}</h3>
              <p className="sl-v2-value__text">{v.text}</p>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ============ HANGTAG — doubles as "back to the top" ============ */
function Hangtag() {
  const [going, setGoing] = useState(false);
  const toTop = () => { setGoing(true); setTimeout(() => setGoing(false), 1100); window.scrollTo({ top: 0, behavior: "smooth" }); };
  return (
    <button type="button" className={"sl-padle" + (going ? " is-going" : "")} onClick={toTop} aria-label={C.hangtag.aria} title={C.hangtag.aria}>
      <img src="/assets/hangtag.svg?v=2" alt="" width="1000" height="2200"/>
    </button>
  );
}

/* ============ 06 — CONTACT ============ */
function Contact() {
  const K = C.contactSection;
  return (
    <section className="sl-contact" id="contact">
      <div className="shell">
        <div className="sl-slash" style={{ marginBottom: 32 }}>{K.slash}</div>
        <div className="sl-contact__grid">
          <div className="sl-contact__venstre">
            <h2 className="sl-contact__title">{K.titleBefore}<em>{K.titleEm}</em>{K.titleAfter}</h2>
            <button className="sl-btn sl-btn--lys sl-contact__cta" onClick={() => openJens(C.jens.startChat)}>{K.cta}</button>
          </div>
          <div className="sl-contact__meta">
            <div><span className="sl-contact__label">{K.labelEmail}</span><a href={"mailto:" + C.contact.email}>{C.contact.email}</a></div>
            {C.contact.phoneHref && <div><span className="sl-contact__label">{K.labelPhone}</span><a href={"tel:" + C.contact.phoneHref}>{C.contact.phone}</a></div>}
            <div><span className="sl-contact__label">{K.labelLab}</span><span>{K.lab}</span></div>
            <div><span className="sl-contact__label">{K.labelResponse}</span><span>{K.response}</span></div>
          </div>
        </div>
      </div>
    </section>
  );
}

/* ============ FOOTER ============ */
function Footer() {
  const F = C.footer;
  return (
    <footer className="sl-footer">
      <div className="shell sl-footer__inner">
        <div>{F.year} <span className="sl-wm sl-wm--footer"><span className="sl-wm__solid">solid</span><span className="sl-wm__lab">lab</span><span className="sl-wm__ai">.ai</span></span> <span className="sl-footer__orgnr">· {F.place}</span></div>
        <div className="sl-footer__right">
          <a href="https://www.linkedin.com/company/115796478" target="_blank" rel="noopener noreferrer">{F.linkedin}</a>
          <a href="https://www.facebook.com/people/Solidlabai/61566190246544/" target="_blank" rel="noopener noreferrer">{F.facebook}</a>
          <a href="/trust">{F.trust}</a>
          <a href="/legal/privacy">{F.privacy}</a>
          <a href="#" onClick={(e) => { e.preventDefault(); window.solidlabCookieBar && window.solidlabCookieBar.show(); }}>{F.cookies}</a>
          <a href={"mailto:" + C.contact.email}>{C.contact.email}</a>
        </div>
      </div>
    </footer>
  );
}

/* ============ "TAKE ME FURTHER" ARROW ============ */
/* A round arrow low in the left margin. It takes the visitor to the next section, and turns around at
   the last one to go back to the top. Desktop only (no margin on phones). */
function NextSectionArrow() {
  const [pos, setPos] = useState(null);
  const [going, setGoing] = useState(false);
  const [up, setUp] = useState(false);
  const [dark, setDark] = useState(false);
  const target = useRef(null);
  useEffect(() => {
    let raf = 0;
    const measure = () => {
      raf = 0;
      const vh = window.innerHeight, vw = window.innerWidth;
      const secs = [...document.querySelectorAll("#root section")].filter(s => !s.parentElement.closest("section"));
      if (vw < 1100 || !secs.length) { setPos(null); return; }
      let i = -1;
      secs.forEach((s, k) => { if (s.getBoundingClientRect().top <= vh * 0.5) i = k; });
      const cur = secs[i], next = secs[i + 1] || null;
      if (!cur) { setPos(null); return; }
      const r = cur.getBoundingClientRect();
      const shell = cur.querySelector(".shell") || cur;
      const margin = shell.getBoundingClientRect().left + (parseFloat(getComputedStyle(shell).paddingLeft) || 0);
      const shown = Math.max(0, Math.min(r.bottom, vh) - Math.max(r.top, 0));
      if (margin < 64 || shown < vh * 0.5) { setPos(null); return; }
      const jens = document.querySelector(".sl-jens-knapp");
      const jr = jens && jens.getBoundingClientRect();
      let top = jr && jr.height ? jr.top + jr.height / 2 : vh - 48;
      /* Sit above the cookie notice while it is showing */
      const cookie = document.querySelector(".sl-cookie");
      if (cookie) { const c = cookie.getBoundingClientRect(); if (c.height && c.left < margin && top + 30 > c.top - 12) top = c.top - 42; }
      target.current = next;
      setUp(!next);
      const under = document.elementsFromPoint(Math.round(margin / 2), Math.round(top)).find(el => !el.closest(".sl-next"));
      setDark(!!(under && under.closest(".sl-contact, .sl-footer")));
      setPos({ left: Math.round(margin / 2), top: Math.round(top) });
    };
    const queue = () => { if (!raf) raf = requestAnimationFrame(measure); };
    window.addEventListener("scroll", queue, { passive: true });
    window.addEventListener("resize", queue);
    const t = setInterval(queue, 800);
    queue();
    return () => { window.removeEventListener("scroll", queue); window.removeEventListener("resize", queue); clearInterval(t); cancelAnimationFrame(raf); };
  }, []);
  const go = () => {
    const next = target.current;
    setGoing(true); setTimeout(() => setGoing(false), 900);
    if (!next) { window.scrollTo({ top: 0, behavior: "smooth" }); return; }
    scrollToCenter(next.querySelector(":scope > .shell") || next);
  };
  return (
    <button type="button" className={"sl-next" + (pos ? " is-on" : "") + (going ? " is-going" : "") + (up ? " is-up" : "") + (dark ? " is-dark" : "")}
            style={pos ? { left: pos.left, top: pos.top } : undefined}
            onClick={go} aria-label={up ? C.nextArrow.ariaUp : C.nextArrow.aria} title={up ? C.nextArrow.ariaUp : C.nextArrow.aria}
            tabIndex={pos ? 0 : -1} aria-hidden={pos ? undefined : "true"}>
      <span className="sl-next__arrow" aria-hidden="true">
        <svg viewBox="0 0 16 16" width="16" height="16"><path d="M8 2.5v10M3.5 8.5 8 13l4.5-4.5" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"/></svg>
      </span>
    </button>
  );
}

/* ============ APP ============ */
function App() {
  /* Deep links like solidlab.ai/#toolkit */
  useEffect(() => {
    const id = (window.location.hash || "").slice(1);
    if (id) { const t = setTimeout(() => scrollToId(id), 300); return () => clearTimeout(t); }
  }, []);
  return (
    <>
      <Header/>
      <main>
        <Hero/>
        <Services/>
        <Method/>
        <Advisory/>
        <Toolkit/>
        <About/>
        <Contact/>
      </main>
      <Footer/>
      <NextSectionArrow/>
      <Jens/>
    </>
  );
}

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