Structured probabilistic models of proteins across spatial and fitness landscapes