Foundations of Photonics