Tehran - Hard-liners batter President Hassan Rouhani over his faltering nuclear deal, sending his popularity plummeting. Women in the streets film themselves removing their mandatory headscarves, or hijabs, in protest. Meanwhile, state television airs moments from a major corruption trial.

Welcome to the topsy-turvy world of Iranian politics.

Ahead of the 40th anniversary of Iran’s Islamic Revolution, the country’s government is allowing more criticism to bubble up to the surface. Analysts say that may serve as a relief valve in this nation of 80 million people, which already has seen widespread, leaderless protests rock the country at the start of the year.

But limits still clearly exist in Iran’s Shiite theocracy, ensnaring lawyers, activists and others in lengthy prison terms handed down in closed-door trials. And the frustration people feel may not be satiated by complaining alone, especially as US sanctions on Iran’s oil industry take effect in November.

“If we continue like this, the situation will be more complicated, because people are very tired and they have less tolerance,” Faezeh Hashemi, the activist daughter of Iran’s late President Akbar Hashemi Rafsanjani, told The Associated Press. “I don’t think that the majority of people are after regime change . because everybody is worried what may happen next. But people are after their demands.”

Perhaps the person in the biggest lurch in Iran now is Rouhani. America appears poised to further sanction Iran despite Tehran abiding by Rouhani’s nuclear deal with world powers, which saw Iran limit its enrichment of uranium in exchange for sanctions being lifted.

In response, Rouhani has slowly replaced his message of rapprochement with the West with hard-line hints about Iran’s ability to close off the Strait of Hormuz, through which a third of all oil traded by sea passes.

Part of that may be a hedge over his political future. The 69-year-old Rouhani, himself a Shiite cleric, could potentially be considered when Iran picks its third-ever supreme leader. It isn’t out of the realm of possibility: Iran’s current supreme leader, Ayatollah Ali Khamenei, served two four-year terms as president before becoming leader after the death of Ayatollah Ruhollah Khomeini, the Islamic Republic’s founder.

“From (Rouhani’s) perspective, the most important thing is to come through the presidency in one piece and keep himself in the running for the ultimate job, the supreme leadership, which will be up for grabs the day the 79-year-old Khamenei dies,” recently wrote Alex Vatanka, an analyst at the Washington-based Middle East Institute.

But popular anger continues to rise against Rouhani, threatening whatever mandate he could claim in the future.

Social media photos of children of the country’s elite enjoying luxuries the average Iranian can’t have sparked outrage.

“Such stories suggest that the Islamic Republic may be approaching an existential crisis, where its core values such as adopting a simple lifestyle and observing Islam strictly are widely promoted by the establishment but not necessarily followed by the elite,” analyst Sara Bazoobandi recently wrote for the Arab Gulf States Institute in Washington. “The hypocrisy of the elite that has become apparent through these scandals has prompted widespread public anger in Iran.”

Iran saw nationwide protests in late December and early January over its worsening economic situation, which resulted in nearly 5,000 reported arrests and at least 25 people being killed. Iran’s economy only has gotten worse since President Donald Trump withdrew America from the nuclear deal, with the rial going from 62,000 to one US dollar to as low as 150,000 rial to $1. Also, an attack by Arab separatists Saturday on a military parade in the country’s southwest killed at least 25 people.

Meanwhile, social change can be seen on any street in Tehran, as some young women wear their state-mandated hijabs loosely over their hair. Some even shrug it down to their shoulders while driving. An image of a young woman, her head uncovered and waving her hijab like a flag in Tehran’s main Enghelab Street while standing on a telephone junction box, became famous during the economic protests.

In the time since, authorities have welded slanted roofs over such junction boxes to stop women from carrying out similar protests. Tehran’s police meanwhile have said they won’t arrest women for not observing the Islamic dress code. However, online videos of women being harassed continue to circulate on social media.

A public referendum on the hijab and other issues, such as whether Iran should re-establish relations with the US, could be one way to address the public’s concerns, said Hashemi, who learned politics from her father while growing up in a home only steps away from Khomeini’s own.

Noting nearly 40 years have passed since the Islamic Revolution, she added: “The world and the situation have changed.”

“People have reached a point that they have nothing to lose,” said Hashemi, who herself has served prison time over her comments and activism. “Usually you only fear things for the first time, when things happen once you are no longer worried, and you get a bit braver, and you raise your demands more freely.”