By Luke Baker
ISTANBUL (Reuters) - Looking across Istanbul's skyline, it is impossible not to be struck by the array of red-and-white, star-and-crescent flags fluttering from buildings, monuments, bridges and flagpoles.
Patriotism in Turkey has always been strong, but in the wake of July's failed coup by members of the military, President Tayyip Erdogan has tapped freely into the populist, banner-draped fervor to remould the nation in his image.
The questions are, what sort of Turkey does Erdogan want, and what steps will this powerful and sometimes unpredictable leader take to achieve his vision?
The answers could have far-reaching implications for the global role played by the Muslim-majority NATO member, whose assistance is seen in the West as vital in the war against Islamic State and in tackling the migrant crisis.
At one level, diplomats and analysts say, Erdogan has made his aims perfectly clear. In the three months since the coup attempt, authorities have suspended or dismissed 100,000 civil servants, judges, lecturers, military personnel and police - purging some of the most established pillars of society.
Anyone with suspected links to U.S.-based cleric Fethullah Gulen, who Erdogan accuses of masterminding the putsch, is a possible target. Gulen has denied plotting against the state and any involvement in the coup.
More than 30,000 people have been arrested. Five percent of the entire police force has been removed from duty. Whole ministerial departments have been shut down.
Some Western allies fear creeping authoritarianism and a shift toward a political model built around a strong leader and dominant single party but lacking checks and balances in Turkey, whose size, military power and location between Europe, the Middle East and Asia give it significant strategic clout.
"He wants a Turkey where he is the undisputed, unchallenged decider without the constraints of a normal democratic system," said James Jeffrey, a former U.S. ambassador to Ankara and a senior fellow at the Washington Institute.
"He won't overturn the constitution or get rid of democracy, but he wants to render the opposition incapable of challenging him and to exercise clear power over them," he told Reuters.
By contrast, Erdogan's loyal supporters see him as the champion of the pious masses, forging a proud and independent nation that will not be dictated to by outside powers.
The president and his aides bristle at the notion he is dictatorial. They point to his succession of election victories, first as leader of the ruling AK Party, and then in Turkey's first popular presidential election in 2014.
But Erdogan's ambitions likely go further than taking back control and projecting authority.
While the 62-year-old may have no desire to recreate the Ottoman empire, political analysts and diplomats say he wants to draw on that sense of greatness to craft a Turkey that bestrides the world, respected and perhaps a little feared by neighbors and peers.
In speeches and comments before and since the failed putsch, Erdogan has frequently referenced the Ottoman period, when Turkey's forefathers held territory stretching from southeast Europe to the Caucasus, North Africa and Iraq.
He often laments the concessions made by Turkish leaders after World War One, with the signing of the Treaty of Lausanne that brought modern Turkey into being in 1923, as if to suggest only he can restore the nation's illustrious past.
"What you're witnessing in Turkey is tied up with an almost constant desire to reclaim the heritage of the Ottoman empire, which was of course a polyglot, multi-ethnic entity," said Bulent Aliriza, director of the Turkey project at the Center for Strategic and International Studies in Washington.
"In almost every one of Erdogan's speeches there are these themes: You can be proud you are a Turk, proud that you are a Muslim, we have influence in our region and beyond. The expression 'Great Turkey' is used almost all the time."
In August, with great symbolism and fanfare, Erdogan inaugurated a new bridge over the Bosphorus between Europe and Asia. The span, the third over the strait, was named after a 16th-century Ottoman ruler, Yavuz Sultan Selim. "Be proud of your power, Turkey," announced adverts on television.
At the U.N. General Assembly in September, the most high-profile speech Erdogan has made abroad since the failed coup, he expanded on two of his favorite themes: how Turkey helps the oppressed and serves as a role model in the Muslim world, and how power at the United Nations is too narrowly held.
"The world is greater than five," he said, referring to the five permanent members of the U.N. Security Council. "A Security Council that does not represent the entire world can never serve to re-establish peace and justice around the world."
Since coming to power in 2003, first as prime minister and then as president, Erdogan has overseen a period of rapid economic growth and increased regional influence.
While he may have no territorial ambitions, Turkey does have troops in northern Syria, is training militias in Iraq - to the growing concern of the government in Baghdad - and has hopes of turning itself into a regional energy hub, a crossroads between Russia, Iran and the East Mediterranean.
"He's trying to exercise influence in the region by dint of Turkey's large and powerful economy and its claim to be an Islamic power," said Jeffrey. "There is a bit of going back to Ottoman times and going back to Turkish dominance of the region - he wants a more Islamic alternative to the West."
It appears a popular formula. A poll in late July, two weeks after the coup attempt, showed Erdogan with two-thirds approval among Turkey's 78 million people, his highest rating ever.
Yet in striving for that more self-confident and perhaps more feared Turkey, Erdogan has at times walked a thin line, straining ties with the European Union and the wider West, which are wary of what they see as his creeping authoritarianism.
Turkey's $720 billion economy is fueled in large part by trade and investment with Europe. Its working week runs from Monday to Friday to align with business in London and New York, not the rest of the Muslim world. In theory, Turkey still plans to join the European Union and is a central player in NATO.
The country's annual average growth rate has been tapering, to around 3 percent from 5 percent, and there is a need for a new impetus to bring unemployment down among millions of younger Turks. That requires staying open to the West.
Andrew Duff, a former member of the European Parliament who was vice-chairman of the Turkey-EU joint parliamentary committee, sees Erdogan as "entirely fickle" regarding Europe and focused for now on exploiting Islam and nationalism.
"I'm afraid this is only going to get worse," said Duff, who has been accused by Turkish authorities of being a "Gulenist", a charge he dismisses with a laugh. "I'm sure Erdogan's aim is to remain in power at least until 2023, the centenary of the founding of the republic."
Duff does not think Erdogan will pivot to the East permanently. But for now, Europe, NATO and the West find themselves with a volatile partner.
"From the historical point of view, it's fascinating because Turkey is really poised," said Aliriza. "Whether it continues to look to its nation-state past and its opening to the West, or a hoped-for glorious future in which Turkey will draw closer to its brethren in the East. It's at a critical juncture."
(Writing by Luke Baker; Editing by Nick Tattersall and Pravin Char)