The arithmetic of Fermat curves