/* global React, ReactDOM, useTweaks, TweaksPanel, TweakSection, TweakRadio, TweakSelect */ const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "theme": "light", "fontSet": "editorial", "density": "normal", "heroLayout": "split", "palette": "parchment" }/*EDITMODE-END*/; const PALETTES = { parchment: { "--bg": "#F5F1EB", "--surface": "#FFFFFF", "--surface-warm": "#EFE9DD", "--ink": "#1B1A17", "--ink-2": "#2B2925", "--muted": "#736D62", "--hairline": "#E2DBCE", "--hairline-strong": "#CFC6B4", "--oak": "#B58A63", "--oak-deep": "#8E6948", "--forest": "#3B4A3F" }, cloud: { "--bg": "#F2F2F0", "--surface": "#FFFFFF", "--surface-warm": "#E8E8E5", "--ink": "#15151A", "--ink-2": "#26262C", "--muted": "#6D6D74", "--hairline": "#DEDEDB", "--hairline-strong": "#C2C2BE", "--oak": "#8C8C7E", "--oak-deep": "#5F5F54", "--forest": "#3C4441" }, forest: { "--bg": "#EFEDE5", "--surface": "#F8F6F0", "--surface-warm": "#E2E0D5", "--ink": "#1A1F1A", "--ink-2": "#2A312A", "--muted": "#6B7068", "--hairline": "#D4D2C6", "--hairline-strong": "#B8B5A6", "--oak": "#7A8270", "--oak-deep": "#4F5A4A", "--forest": "#2E3A2E" }, earth: { "--bg": "#F2EAE0", "--surface": "#FFF8EE", "--surface-warm": "#E8DCC9", "--ink": "#1F1714", "--ink-2": "#2F2520", "--muted": "#7A6A5C", "--hairline": "#DDCFB9", "--hairline-strong": "#C7B499", "--oak": "#C28455", "--oak-deep": "#9A5F34", "--forest": "#4A3525" } }; function applyPalette(root, paletteKey, theme) { const p = PALETTES[paletteKey] || PALETTES.parchment; for (const k in p) { if (theme === "dark") { root.style.removeProperty(k); } else { root.style.setProperty(k, p[k]); } } } function App() { const [tweaks, setTweak] = useTweaks(TWEAK_DEFAULTS); const [lang, setLang] = React.useState("el"); const [stickyVisible, setStickyVisible] = React.useState(false); React.useEffect(() => { document.documentElement.setAttribute("data-theme", tweaks.theme); document.documentElement.setAttribute("data-font-set", tweaks.fontSet); document.documentElement.setAttribute("data-density", tweaks.density); applyPalette(document.documentElement, tweaks.palette, tweaks.theme); }, [tweaks.theme, tweaks.palette, tweaks.fontSet, tweaks.density]); React.useEffect(() => { function onScroll() { const calc = document.getElementById("calculator"); const hero = document.getElementById("top"); if (!calc || !hero) return; const scrollY = window.scrollY; const heroH = hero.offsetHeight; const calcTop = calc.offsetTop; const calcBottom = calcTop + calc.offsetHeight; setStickyVisible(scrollY > heroH * 0.6 && (scrollY < calcTop - 600 || scrollY > calcBottom)); } window.addEventListener("scroll", onScroll, { passive: true }); onScroll(); return () => window.removeEventListener("scroll", onScroll); }, []); const t = window.I18N[lang]; const scrollTo = (id) => { const el = document.getElementById(id); if (el) window.scrollTo({ top: el.offsetTop - 60, behavior: "smooth" }); }; return (