Transition from aquatic to terrestrial habitats