Text this: Photon-number-resolving detection enables single-photon LiDAR approaching the standard quantum limit