A nonconforming building existing at the time of the enactment or amendment of this chapter may be retained except as follows: (1) No building other than a single-family detached dwelling may be enlarged, or altered except in conformance with this chapter, but it may be repaired to the extent necessary to maintain it in a safe and sanitary condition. (2) No building other than a single-family detached dwelling shall be rebuilt, altered or repaired after damage exceeding 75 percent of its replacement cost at the time of destruction, except in conformity with this chapter.