Regarding brown sugar that’s gone hard and clumpy, I just put a slice of bread into the bag of sugar, and in about a day the brown sugar is as soft and moist as when it was purchased. I’ve read that if you need to use hardened brown sugar right away, place a moist paper towel into the bag and then microwave it for 20 seconds or so until it softens up. I haven’t tried the microwave method since I just keep a slice of bread in the bag. If it sits for a while, and both the bread and sugar harden again, just use a new slice of bread.
I guess bread might work though.
I reseal the ziplock bags the sugar comes in and squeeze as much air out as I can. Then I have them packed into a gallon ice cream container. It's not dark like the cupboard but the bottom container (have stacks of flours and stuff in ice cream containers).