There’s a reason dead people are called “stiffs.”
Once the last little bit of energy is used up in muscle cells they get stiff until enzymes created through decomposition begin to break them down. The Latin term is rigor mortis or hard death.
The chemistry is complicated, but rigidity starts soon after death and lasts for days, depending on heat and humidity.