Macbook Air screen fading randomly between off and full brightness
Could be hardware, overheating or simply a stuck function key. I would try cleaning it (especially between the screen and the base where the vent is) and making sure keys are not gummed up. Then test the hardware using

https://support.apple.com/en-us/HT201257 pre June 2013 version or

https://support.apple.com/en-us/HT202731 post June 2013

Jonah