Tracing the evolutionary origins of fish to shallow ocean waters