Designing 'smart' crystalline membranes for graded molecular sieving