// App — compose the full marketing page
function detectInitialLang() {
  try {
    const saved = localStorage.getItem('jk-lang');
    if (saved === 'de' || saved === 'pl') return saved;
  } catch (e) {}
  const prefs = (navigator.languages && navigator.languages.length) ? navigator.languages : [navigator.language || 'de'];
  for (const p of prefs) {
    const code = (p || '').toLowerCase().slice(0, 2);
    if (code === 'pl') return 'pl';
    if (code === 'de') return 'de';
  }
  return 'de';
}

function App() {
  const [lang, _setLang] = React.useState(detectInitialLang);
  const setLang = (v) => {
    _setLang(v);
    try { localStorage.setItem('jk-lang', v); } catch (e) {}
  };
  React.useEffect(() => { document.documentElement.lang = lang; }, [lang]);
  return (
    <>
      <Nav lang={lang} setLang={setLang}/>
      <Hero lang={lang}/>
      <Services lang={lang}/>
      <Packages lang={lang}/>
      <Process lang={lang}/>
      <Footer lang={lang}/>
    </>
  );
}

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