Going from 9 to 5

Hi! so i had a question, i’m 17 and i would say about a year ago i used to have really painful heavy periods that would last up to 9 days, they were awful 😩 but now my periods are relatively medium on the first day (i still am in pain but it’s not as bad as before) and lighter on the following days. I don’t know what i’m doing to make my period light to only last 5 days but i love it. Has this happened to anyone else before? Do you have a reason you think this happened? Maybe it’s diet cause i am not exercising and quarantining for a year now. Please let me know so i know that my body is normal and this happens to other girls