// Nexus Theme — Synchronous dark mode init (load in <head> before CSS)
// Reads theme from localStorage to prevent FOUC (flash of unstyled content)
(function(){
  try{
    if(localStorage.getItem('nexus_theme')==='light'){
      document.documentElement.classList.remove('dark');
    }else{
      document.documentElement.classList.add('dark');
    }
  }catch(e){
    document.documentElement.classList.add('dark');
  }
})();
