Environmentally sensitive theory of electronic and optical transitions in atomically thin semiconductors | Synapse