Ligand-lipid and ligand-core affinity control the interaction of gold nanoparticles with artificial lipid bilayers and cell membranes.