ויהי מקץ ימים ויבא קין מפרי האדמה מחנה ליקוק: והבל הביא גם-הוא מבכרות צאנו ומחלבהן וישע אל-הבל ואל-מנחתו: ואת-קין ואל-מנחתו לא שעה ויחר לקין מאד ויפלו פניו
And it was at the end of some days that Kayin brought from the fruit of the land as an offering to Hashem. Hevel also brought from the firstborn of his flock and from their fats, and Hashem accepted Hevel and his offering. [Yet] Hashem didn’t accept Kayin nor his offering, and this upset Kayin very much, and his face fell
Our Sages note the contrast between the offerings brought by Kayin and his brother Hevel. Hevel brought from the firstborn of his flock, and the fattiest parts of them, as a slaughtered offering to Hashem. On the other hand, Kayin simply brought from the produce of his land. Why didn’t he also bring an animal offering, like his brother did?
Our Sages make a logical argument that a fatally injured animal, known as a treifah, is invalid for a Temple offering. The argument is that if a treifah is forbidden for human consumption, as it’s deemed not-kosher for Jews, then all the more so it’s improper to bring as an offering for Hashem. Now, even though the laws of kashrus didn’t exist in the times of Adam and Chava and their sons Kayin and Hevel, still, this argument could equally apply. We are taught that Adam was forbidden from consuming animals. It would make sense then that Kayin would argue that if animals are forbidden for human consumption, then how could he bring it as an offering to Hashem? As such, he brought offerings from his simple produce.
The thing is, the gemarra rejects this logical argument. What’s the problem with it? Something called cheilev. Cheilev are specific fats that are in an animal which are also deemed not-kosher, and yet they are intrinsic to many of the Torah’s offerings. We see then that just because it’s not kosher doesn’t make it invalid for an offering. It is for this reason that Hevel brought offerings from his animals. More than that, the verse says he brought from their fats. This could also be read that he brought proof from their fats that it’s permissible to bring animals as an offering, with the same proof that the gemarra uses. Even though animals were forbidden for Kayin and Hevel to consume, they were perfectly valid to bring as an offering.
 Based on Chanukas HaTorah parshas Bereishis § 6
 Genesis 4:3-5
 Rashi ad. loc. brings that he even brought from the worst of his produce. The Chanukas HaTorah doesn’t seem to go with this approach
 Menachos 5b
 Genesis 1:29 with Rashi
 It’s unclear to me according to the Chanukas HaTorah why Hashem would reject Kayin’s offering. Since Kayin made a logical argument, believing he was forbidden from bringing an animal offering, why should he be faulted? He should have realized the mistake in his argument? He should have realized that cheilev will be valid as an offering in the future?