Quantum dot states and optical excitations of edge-modulated graphene nanoribbons