TEHRAN — Far from the flashing cameras and microphones in Vienna, where Secretary of State John Kerry is joining Iranian and United States diplomats in a final push to reach a compromise on Tehran’s nuclear program, a different sort of political drama unfolded in the Iranian capital this week: Hard-liners got together to criticize the objects of their “worries,” as they put it, the moderates advocating a deal.

“My brothers, we are in danger,” one of the conference organizers, Ali Hassanzadeh, told the audience, as a video portrayed the moderate president, Hassan Rouhani, and his negotiators as gullible tools of the United States.

In Iran, the final decision on a nuclear deal lies with Ayatollah Ali Khamenei, the supreme leader. And if history is an accurate guide, the real debate over an accord, should one be reached, will not begin to unfold until after it is announced. When that debate gets underway, the voices of the hard-liners — the clerics, Revolutionary Guards commanders, conservative lawmakers and others who are by and large closest to the supreme leader — will be raised against any compromise on Iran’s right to enrich uranium.

But there is another developing line of thought in Iran that is far more hopeful, and reflects the desires of many urban Iranians. Some insiders say that a nuclear deal is being planned by powerful figures in the Iranian leadership as the start of a fundamental shift in Iran’s ideology, aimed not only at normalizing relations with the world but also at rebranding the now 35-year-old Islamic Revolution, turning away from its founding principles of anti-imperialism, anti-Americanism and strict limits on personal freedoms.