Hello
The Arduino libraries are released as LGPL , this means that any code you write (completely by youself) is yours even if it uses arduino libraries.
If you modify any of the libraries you have to release your changes.
If you make a board based on Arduino you can sell it as long as you don't call it arduino. Give that the reference design is licensed CC-SA any derivatives of Arduino should also release the CAD files.
Last remark, the use of the Arduino name is subjected to our approval.
m