Text this: Universal geometric framework for black hole phase transitions