/* ============================================================ APP — routing state + global controls + Tweaks ============================================================ */ const DEFAULTS = /*EDITMODE-BEGIN*/{ "palette": "brass", "lang": "en", "darkNav": false }/*EDITMODE-END*/; function App() { const [tweak, setTweak] = useTweaks(DEFAULTS); const [page, setPage] = React.useState("home"); // home | buy | rent | area | agent | contact const [lead, setLead] = React.useState({ open: false, kind: "viewing", ctx: null }); // Expose helper for Logo etc to nav home window.__nav = (p) => { setPage(p); scrollTo({ top: 0, behavior: "instant" }); }; // Whenever page changes, scroll to top React.useEffect(() => { window.scrollTo({ top: 0, behavior: "auto" }); }, [page]); // Apply palette + RTL to body React.useEffect(() => { document.body.classList.toggle("palette-marine", tweak.palette === "marine"); document.documentElement.setAttribute("dir", tweak.lang === "ar" ? "rtl" : "ltr"); document.documentElement.setAttribute("lang", tweak.lang); }, [tweak.palette, tweak.lang]); const lang = tweak.lang; const t = I18N[lang] || I18N.en; function openLead(kind, ctx = null) { setLead({ open: true, kind, ctx }); } function closeLead() { setLead(l => ({ ...l, open: false })); } function go(p) { setPage(p); } // Dark nav for area and agent hero start const darkNav = false; return (