With a 520-mile-long coast lined largely by teeming roads and fragile infrastructure, New York City is gingerly facing up to the intertwined threats posed by rising seas and ever-more-severe storm flooding.