Why was Cain angry and downcast in Gen 4:5?

This seems obvious on first glance: the creator of the universe preferred his younger brother over him. But on a second glance one must add: he felt entitled to approval, perhaps, for being both older and the first to make an offering; and it certainly seems that he was viciously proud. But (and on this see above) plainly, God’s approval is not to be won merely by offerings or sacrifices but by what the offerings are supposed to indicate and underscore: a righteous, contrite, and humble heart.