(CNN) — The city of Jaipur, about an hour's flight southwest of Delhi, is best known as the "Pink City" -- so called for its salmon-hued buildings.
But a walk through the Old City will surprise travelers who might be expecting to find a labyrinth of roads and lanes like those in Old Delhi or Jodhpur.
Established in 1727, Jaipur was the first "planned" city in India.
Every tiny detail was considered before laying the foundation stone, from the orientation of gates to the manuscript scrawled above each shop.
The precision can be traced to the city's founder Maharaja Sawai Jai Singh II, a scholarly prince who was passionate about astronomy, mathematics and science.
"He wanted the city to be prosperous and safe, with a peaceful environment and a place for everything," says Pankaj Sharma, former chief curator at the City Palace Museum in Jaipur.
"At the time, other cities were just going on and on, expanding in all directions with no plan. But due to the surrounding mountains (to the north and east), he didn't have scope for expansion. He had to be very smart about how to engineer his city."
India's first planned city
Amber Fort, outside Jaipur, served as the royal residence during the Mughal Empire.
Back in the 1700s, during the Mughal empire, Amber City -- set in the mountains near Jaipur -- served as the capital and royal residence.
But Amber's ongoing droughts led the rulers to scout for a new plot of land with a plan to move their capital city.
That's where Jaipur came in.
Though it was unconventional at the time to build on flat terrain, the area was strategic on many levels.
First, the surrounding mountains would provide both protection and water.
In addition, the location would be more accessible for lucrative trade and commerce.
To develop a plan, Jai Singh studied European cities, collected maps from all over the world and enlisted esteemed Indian architect Vidyadhar Bhattacharya as the chief planner.
The pair developed a strict blueprint for Jaipur and based the city's grid-like design on Vastu Shastra -- an ancient Hindu architectural doctrine.
Principles of Vastu Shastra
Meaning "science of architecture" the principles aim to meld architecture and nature, as well as incorporate ancient patterns, sunlight and symmetry.
While there are no rigid codes to adhere to, the concept usually calls for sites to be divided into square grids, called "mandalas," for organization.
"We have a complete manuscript (in Sanskrit) on the 'science of architecture' -- Vastu Shastra," says Sharma.
"If you follow the principles of Vastu Shastra, there is a place for each and every thing -- a place for water, temples, homes, everything."
Symbolism and symmetry
In the walled city center, a detail of a doorway at the City Palace.
Robert Cianflone/Getty Images
When arriving in Jaipur's Old City, you'll immediately feel a sense of calm despite the year-round crowds.
That's partly because it's extremely easy to navigate: Jai Singh divided the city into nine squares -- symbolizing nine planets.
Fortified by 20-foot-high walls, each block contains a grid of streets marked by cardinal direction. The main streets measure 110 feet in length, while smaller market streets are 55 feet long, according to UNESCO.
He earmarked two squares in the north for the palace, while the other seven were used for organized clusters of government buildings, homes, shops and temples.
There are seven gates, most of which are named after a celestial body -- the "Sun" gate faces East, while the "Moon" gate faces west.
Known as Dhruv Pol (north gate), the most important gate faces the ancestral capital of Amber City.
"Sawai Jai Singh was a great astronomer, so he made decisions based on the celestial bodies," says Sharma.
"For example, he believed all of the temples should be constructed facing the north, and all entrances should be to the east."
Devil's in the details
The city is built in a precise grid system, where each block is 111 feet long and 111 feet wide.
Bhattacharya, head of the building department, was also in charge of ensuring that each house and shop appeared uniform, from floor plans to calligraphy to white floral motifs on the walls.
"At the time, the building department took care of the painting, carpentry, masonry -- they took care of all the details, so it was always consistent," says Sharma.
"For each and every building, they actually had a very detailed plan on how it should be built, the height, the depth ... everything. Every plan was based on the grid, so the laborers could follow the instructions easily."
As for the salmon-pink paint? Sharma says the original color was already a pinkish shade, because buildings were constructed with white limestone and Indian red brick powder.
Looking to welcome the Prince of Wales in 1876 -- Jaipur was a British protectorate -- the then ruler of Jaipur, Maharaja Sawai Ram Singh II, re-painted the entire city terracotta pink. The color is meant to symbolize hospitality and also mollify the glaring sunlight.
"After the Prince came to visit, Sawai Ram Singh II passed an order to all shopkeepers and households to maintain the now famous pink color," says Sharma. "The tradition continues to this day."
The 'Supreme Instrument' at Jantar Mantar was built in the 18th century using local marble.
Travelers can also witness Jai Singh's attention to detail and passion for science at one of the city's most popular landmarks: Jantar Mantar.
One of five observatories across India built by the astronomer prince, this UNESCO-listed site was established in the early 18th century.
It remains the best-preserved ancient observatory in India, home to more than a dozen working astronomical instruments -- all made with beautiful local marble -- designed to track constellations, time and horoscopes.
"You will find highly precise calculations that still work after hundreds of years," says Sharma.
"Using the instruments, you can calculate the time, position of the sun and moon, wind direction, astronomical signs and even forecast rain."
Impossible to miss is the towering Samrat Yantra. Also known as "The Supreme Instrument," the beautiful white marble piece features a 90-foot stairwell that seems to climb toward the heavens.
It's one of the world's largest sundials and, still today, is accurate within two seconds.
Another star is the immense Jai Prakash Yantra, which consists of two inverted domes set into the ground.
Like a road map to the stars, each showcases a celestial hemisphere and measures the rotation of the sun.