Nanomechanics and dynamics of tip–substrate interactions