To do an effect like this, I'd start with Chapter 4 of Encyclopedia of Card Tricks, followed by Chapter 17 and then look at the works of Kirk Charles and/or Si Stebbins / Juan Tamariz / Simon Aronson. For the Katy Perry version, you could just use the knowledge from Encyclopedia of Card Tricks.