Fatema C. I had a whole reply that was saying it wasn't easily possible and to use AI, then I remembered something...
If you add a collection list to the page, link it to the CMS collection, add a new custom field to your collection called "card class" and add "card-1" to the first entry, "card-2" to the second entry, etc. Then you could make this work pretty seamlessly.
See attached where you would then link the custom card class field you created to the collection item.
Biggest downside to this approach is having to remember to add the card class to each entry.
You would need to use AI to generate some JS to help add this class dynamically if you didn't want to go this route.