In the northeastern United States, so-called “witch windows” are said to foil evil crones soaring on broomsticks. Meanwhile, halfway around the world, Chinese “dragon gates” are designed not to block but rather encourage the passage of fantastical beasts, allowing them to freely fly back and forth between mountains above and seas below.

Regional architecture is shaped by all kinds of things, including weather, soil conditions, available materials, building codes and construction traditions. But there’s a subset of culture-specific designs associated with much less tangible (or explicable) factors — approaches aimed at warding off ghosts, appeasing spirits and otherwise handling apparitions and characters of myth and legend.

When it comes to “witch windows,” the idea is that witches can’t fly through the tilted frame, but there is some debate as to how these angled openings became popular. Some theorize that the tilt was originally employed to allow for larger windows, and thus more natural light. Another nickname suggests a different origin story — “coffin windows” may have been designed to allow caskets in and out of upper stories. Regardless, somewhere along the way these openings (by whichever name) became associated with crones and caskets, whether by design or (perhaps more likely) as part of a retroactive explanation.

The idea that design choices can have supernatural ramifications can be found in other parts of the United States, too. In the American south, blue “haint paint” on the ceilings of porches is said to ward off spirits. According to associated legends, the blue is confused for impassible water. As with witch windows, the actual origin is uncertain. It could be a throwback to Victorian traditions of incorporating natural colors into homes. It may also be an attempt to ward off insects, but the mechanism here is debated — they may confuse paint for sky, or it might have worked historically when blue paints were made with lye.

In China, curved roofs (as well as winding paths) are said to confuse evil spirits, which can only travel in straight lines. Following numeric superstitions, there are also buildings constructed in China (or aimed at Chinese buyers elsewhere) without 4th or 13th or other floors. Houses with lucky number addresses have also been known to sell for more.

Across the water in Japan, the northeast corner, dubbed the kimon or “demon gate,” is said to be the direction from which spirits approach. Some traditions call for keeping that angle free of doors and windows.

In Thailand and other Southeast Asian countries, purpose-built structures known as “spirit houses” are constructed to appease the dead. Instead of trying to keep their spirits out of normal homes, this approach cleverly invites them to stay in an alternative dwelling.

In the Philippines, ghosts are sometimes believed to gather in low places, requiring special exit routes out of basements to avoid having them collect over time — a spiritual drainage system, if you will.

In some cases, the targeted spectres are thought to not be interested in homes so much as the materials used to build them. “Topping out” ceremonies in Scandinavia, for example, are thought to appease the tree-dwelling spirits by thanking them for the use of their lumber.

If many of these examples seem remote or subtle, consider the highly visible gargoyle. Used for centuries to drain water away from the sides of churches and other tall structures, these stone creatures have supernatural connotations, too. As is often the case, though, it is hard to say which came first: the vernacular strategy or associated folklore — historical form and function stories can be hard to separate out.

Meanwhile, for those interested in warding off evil spirits, but less inclined to rebuild their house around them: there are plenty of other wards and charms out there for the superstitious, including door-mounted horseshoes, windchimes, herbs, spices, flowers and more.