I need a CMS for my portfolio but I don’t want to ruin the pureness of my html code with tons of unnecessary tags, classes and ids.
So just create a template with the HTML structure you require. Don’t use any core functions that spit out unnecessary classes/id’s or whatever. No matter what CMS you go with I don’t see this being an issue. Having said that, if you go with WordPress the only thing that might need adjusting is Walker Class for the menu.