This gives me a silly idea for an "accessibility" mode, where absolutely everything on the page is invisible to sighted people, but clearly, and perfectly readable to screen readers etc.
I did some professional services work years ago, very early in my career for a public-sector client that wanted accessibility features given absolute care and attention.
It really gave me some perspective and I've tried to be conscious of it ever since; though I'm purely back-end nowadays so it doesn't apply as much.
Went through similar in the eLearning space as well as on some govt adjacent work. A surprising amount is just common sense when using a well flushed out component library.
What's fun is making an app that explicitly requires well sightedness (scanned documents), and meeting accessibility requirements for literally everything in the app beyond that.
Aside: I wouldn't mind seeing a library where you can give a text weight and text color, with the background color you want to use, but it returns the closest background color that will meet accessibility/contrast requirements.