A geometric basis for surface habitat complexity and biodiversity