So how do we build dense cities that can function with less electricity, or even off-grid? Here a Dutch street, mid-18th century, let's look at it in detail.
Notice the windows, tall, vertical to allow maximum light. The lower they are on the street, the taller the window gets. Ground floor windows go right up to the ceiling.
A little bit tricky to see, but the tall narrow buildings mean no elevators and narrow stairs, so goods and furniture and building material was hoisted by windlasses on special hoisting beams, right at the left edge of this image. Big doors made it easy to pull in the goods.
The hoisting beams came in sizes and designs, to fit the style of the building itself, and the kind of goods that could be expected to be raised.
Here is a row of these "Hijsbalken" (hoisting beams), very plain ones, in Amsterdam. Each house had their own.
Another way to maximize space is to make use of basements. Not completely buried basements like in many modern houses, but half-basements that could be let cheaply to business like pubs, shoe makers, kiosks, ticket offices, etc.
All the materials used in building this street can be recycled. You could knock it over like scrambled eggs reuse everything except the paint on the signs. Bricks, lime mortar, lead roofs, ashlar stone, glass, iron hooks. With a modern town you would not even recycle 2%.
The question of transport always comes up. You can't see them in the picture but canals are still the most cost effective method of moving goods and natural resources over short, medium and long distances. Flat bottom barges means they don't even have to be very deep.
Another thing that is not obvious from the drawing are the plot layouts and sizes. The medieval burgage plots (long and narrow giving as many plots as possible access to valuable street fronts while leaving open space in the rear) have proven to be wildly successful for cities.
You can compare the above medieval plot layout illustrated in a 1853 map with the current layout today (the gif is a bit heavy...). Notice the green spaces! The scale is 1:1250, the area shown is Prinsengracht to Achtergracht, Amsterdam of course.