// App — page dispatcher. // Each HTML file sets window.EVE_RICHE_PAGE = 'home' | 'about' | 'books' | 'series' | 'bonuses' | 'warnings'. // Header, footer, background, cursor, and modals are shared across all pages. const { useState, useEffect, useMemo } = React; function App() { const [t, setTweak] = useTweaks(window.EVE_RICHE_DEFAULTS); const [bookOpen, setBookOpen] = useState(null); const page = (window.EVE_RICHE_PAGE || 'home').toLowerCase(); const featured = useMemo(() => { if (t.seriesMode === 'gods') return BOOKS.find((b) => b.id === 'taint'); if (t.seriesMode === 'cuc') return BOOKS.find((b) => b.id === 'cuc-1'); return BOOKS.find((b) => b.id === 'what-we-bury'); }, [t.seriesMode]); function signup() { scrollToId('newsletter'); setTimeout(() => { const input = document.querySelector('.er-form input'); if (input) input.focus(); }, 700); } function pickSeries(k) { setTweak('seriesMode', k); } // --- background-preview mode (dev only) ------------------- if (t.bgOnly) { return (