// init global tagline before React boots
window.__tagline = (window.__TWEAKS && window.__TWEAKS.tagline) || 'Hukukta yapay zeka çağı.';

function App() {
  React.useEffect(() => {
    // Reveal on scroll — section'ları viewport'a girdikçe fade+slide
    const prefersReduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
    if (prefersReduce) return;

    // Hero dışındaki tüm section'lara .reveal ekle
    const targets = document.querySelectorAll('section:not(.hero), .mod-block, .modules-bridge, .footer');
    targets.forEach(el => el.classList.add('reveal'));

    const io = new IntersectionObserver((entries) => {
      entries.forEach(e => {
        if (e.isIntersecting) {
          e.target.classList.add('revealed');
          io.unobserve(e.target);
        }
      });
    }, { rootMargin: '0px 0px -10% 0px', threshold: 0.08 });

    targets.forEach(el => io.observe(el));
    return () => io.disconnect();
  }, []);

  return (
    <>
      <Nav/>
      <Hero/>
      <Features/>
      <HowItWorks/>
      <Modules/>
      <KararArama/>
      <Imza/>
      <Pricing/>
      <About/>
      <Faq/>
      <Demo/>
      <Footer/>
      <Tweaks/>
    </>
  );
}

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