import { Html, Head, Main, NextScript } from 'next/document'; // Set the theme before first paint to avoid a light/dark flash. const themeScript = `(function(){try{var t=localStorage.getItem('theme');if(!t){t=window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'}document.documentElement.dataset.theme=t}catch(e){}})();`; export default function Document() { return (