Q: how do you log random ideas when lying awake in bed
A: the best way might be to use an audio recording device. i think all smartphones have them, but if you don't feel like buying a smartphone you could just buy an audio recording device for probably way cheaper