It's hard to tell from the article, but the third church is basically what is seen today, and other than the supporting walls and an atypical six minarets, none of the construction was Moslem, and it certainly wasn't constructed as a mosque. My knee-jerk response to the Sinan architect anecdote is, the stupid bastard probably caused the flooding. Constantinople did have an artificial cistern over which part of the ancient city was constructed, but the Hagia Sophia isn't over that.
The original dome was too flat, and fell not many years after construction, during an earthquake. The replacement was rounder, but also fell in a quake. Its replacement survives in part today, but parts of that third dome fell in two different medieval quakes.
The interior engineering with its semidomes etc was a brilliant leap from then-existing Roman Empire forms, and it remained the largest dome in the world for centuries, I think until modern times, and for a while may have been the world's tallest structure as well. The Pantheon in Rome actually has a wider span as a single dome, and was not surpassed until Brunelesci (sp?) built his famous dome in Florence during the Renaissance. The Pantheon also is the oldest surviving true dome; the only older domes which come to mind offhand are the corbelled domes built by the Mycenaeans, the so-called Treasury of Atreus being the best-known example.
![Hagia Sophia](http://image.dashofer.hu/upload/epitinfo/2_hagia_sofia_belulrol.jpg)
I wonder if the explanation of the deep ditches filled with sand radiating out from the Basilican might have been for drainage rather than protection from sea earthquakes.
Makes sense if you have a building built and find it’s on a site which has serious underground water problems.
It's still one of the most stunning buildings in the world. Hope to get there and see it in person.