Staying aloft: Learning resiliency and specialization in volatile environments