- Calibrate separate ink tokens (--text-teal, --text-gold) for light and dark surfaces to guarantee >= 4.5:1 contrast.
- Execute a tiny synchronous head script before first paint to eliminate dark-to-light theme flicker.
- Pair CSS custom properties with Tailwind CSS v4 @variant dark for zero-runtime theme switching.
Why Brand Colors Fail Contrast on Light Backgrounds
Electric cyan (#00D4B2) looks crisp on Deep Obsidian (#060B14) but fails WCAG contrast on pure white. Mapping semantic ink tokens—deep teal (#0F766E) in light mode and electric teal (#00D4B2) in dark mode—keeps brand identity intact while staying accessible.
Zero-Flash Theme Hydration in Next.js
Reading localStorage inside a blocking inline script in the root layout applies the active theme class before the browser paints frame one, preventing jarring white flashes in dark mode.