/* Router root */
function Root() {
  const [route] = useRoute();
  const r = route || '/';

  if (r === '/' || r === '') return <LandingPage/>;
  if (r.startsWith('/lab')) return <AtlasDetailPage/>;
  if (r.startsWith('/atlas')) return <AtlasDetailPage/>;
  if (r.startsWith('/demo')) return <DemoPage/>;
  if (r.startsWith('/about')) return <AboutPage/>;
  if (r.startsWith('/impressum')) return <ImpressumPage/>;
  if (r.startsWith('/datenschutz')) return <DatenschutzPage/>;
  if (r.startsWith('/contact')) return <ContactPage/>;

  return (
    <div className="min-h-screen flex flex-col items-center justify-center text-center px-8">
      <div className="mono text-[10px] text-mute">404 · NOT FOUND</div>
      <h1 className="mt-3 text-[36px] font-semibold tracking-tight">Route doesn't exist.</h1>
      <a href="#/" className="mt-6 rounded-full bg-ink text-paper px-5 py-2.5 text-[13px]">Back home</a>
    </div>
  );
}
ReactDOM.createRoot(document.getElementById('root')).render(<Root/>);
