Igusa stacks and the cohomology of Shimura varieties