In some ways, a search for a new Turkish identity was inevitable. Kemalism is a rigid, early 20th-century revolutionary ideology that forged a modern state. But it also repressed pious peasants from the heartland, along with ethnic minorities like Kurds. The fact that the Turkish identity is evolving is natural.

So far, Turkish society looks about the same. Women have not been required to wear head scarves, and while an order to do so seems unlikely, some liberals like Mr. Engin worry that it could happen, particularly in light of Mr. Erdogan’s recent exhortation for Turkish women to have more children. Pious Turks like his vision, perhaps more for the combative stance he takes against the West than for his references to the Ottoman past.

“Europe is cracking, but Turkey is still on its feet,” said Mahmoud Atlas, a 47-year-old cleaning company owner from Mersin who attended a large Ramadan dinner in Istanbul where Mr. Erdogan spoke last month. “Sorry, but the U.S. and Europe can’t break him,” he said of the president.

Mr. Erdogan’s working-class roots also have broad appeal. “He’s coming from below, like us,” Emre Bozkurt, 22, said. “He can sit and have tea with poor people. These things make us love him. When people look at him, they see themselves.”

Mr. Erdogan and his party reliably have received between 40 percent and 50 percent of the vote for most of his nearly 15-year tenure. A chunk of that support comes from pragmatic voters who are more interested in their pocketbooks than politics.

“They fear an economic crisis more than anything else,” Hakan Altinay, the director of the European School of Politics at Bogazici University in Istanbul, said of the government. “The deal is: You don’t mess with how I govern you, and I deliver you the goods. But if I don’t deliver, you send me an overdue bill with compounded interest.”