// ── Tabs ─────────────────────────────────────────────────────────── function switchTab(name, btn) { document.querySelectorAll('.tab-pane').forEach(p => p.classList.remove('active')); document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active')); document.getElementById('tab-' + name).classList.add('active'); const button = btn || document.getElementById(name); if (button) button.classList.add('active'); window.location.hash = name; } function handleHashChange() { const hash = window.location.hash.slice(1); if (hash && ['how', 'about', 'usage', 'build'].includes(hash)) { switchTab(hash); } } // ── Init ─────────────────────────────────────────────────────────── window.addEventListener('hashchange', handleHashChange); document.addEventListener('DOMContentLoaded', () => { handleHashChange(); });