How should I best target dynamically served content?

I think it depends on whether you want it to be unique for each of the four “highlighted” project columns on the homepage, or whether you want each “highlighted project” to be different.

Does that make sense?

E.g. if you just want each of the four project “columns” on the homepage to look different then I’d use CSS to achieve this : nth-of-type perhaps.

But if you wanted Project A (when highlighted on the homepage) to have a unique background colour regardless of what column it appears in, then Id use PHP to add the post->ID as a class in addition to portfolio-item and then use CSS to style that.