TALKS to curb Iran’s nuclear programme have less than a month to run. Even now, after 12 years of sporadic argument, Iran insists that it wants civilian nuclear power and not a bomb. But nobody really believes that. If the talks break down, atomic weapons could proliferate in the Middle East; or, in a bid to stop Iran, America or Israel could launch a military attack on its infrastructure. Either outcome would be a disaster.

Plenty still separates Iran and, on the other side, the permanent members of the UN Security Council plus Germany (known as the P5+1). Much of the focus is on the mechanics of a deal (see article). The two sides cannot agree on how many centrifuges Iran should be able to use to enrich uranium, how long an agreement should last, or how fast to lift sanctions.

The gap would be easier to close if Iran and America trusted each other. One reason why the relationship is so poisonous is that popular Western views of Iran are out of date to the point of caricature. A better understanding of the country would help the talks reach a comprehensive settlement—or, at least, avoid a catastrophic collapse.

Prelude and centrifuge

Much that Iran does is wrong. It finances terrorists and militias in Lebanon and the Palestinian territories and backs the murderous regime of Bashar Assad in Syria. Its politicians routinely deny Israel’s right to exist. They treat opponents at home with cruelty and injustice. On Saturday a woman was hanged for killing the man she accused of molesting her, shortly before a UN envoy condemned a surge in executions and the treatment of Iran’s women. His colleague at the UN’s nuclear agency recently complained that Iran is failing to come clean about its nuclear research—part of a litany of evasion and deceit.

Bad as that is, however, Western denunciation casts Iran in an almost uniquely grim light. It is an implacable enemy. It was part of George W. Bush’s Axis of Evil. It is a dictatorship bent on exporting revolution and prey to a dangerous, millenarian Islam that might just be irrational enough to welcome a nuclear apocalypse. Barack Obama, America’s president, has been condemned for even talking to such a pariah.

Thirty-five years have passed since a senior American official last visited Iran. It has changed. Our special report in this issue describes a country whose revolutionary fire has been extinguished. As people have moved from their villages to the cities they have got richer and acquired a taste for consumer goods and Western technology. Over half of Iranians go to university, up from a third five years ago. The disastrous presidency of Mahmoud Ahmadinejad, the failed Green revolution—which sought to topple him in 2009—and the chaotic Arab spring have for the moment discredited radical politics and boosted pragmatic centrists. The traditional religious society that the mullahs dreamt of has receded. With the passing of time, the mosques have started to empty. The muezzins’ call to prayer is heard less often, because people complain about the noise. In Qom, the religious capital, seminaries are dwarfed by a vast shopping mall. As a caliphate takes root in Iraq and Syria, here is one Islamic state where religion is in retreat.

Iran is not a straightforward dictatorship. The supreme leader, Ayatollah Ali Khamenei, has the last word. But his role is to adjudicate between the claims of an elite made up of thousands of politicians, clerics, generals, academics and business people. They form a confusing and ever-shifting pattern of competing factions and coalitions. Although this hardly amounts to democracy, it is a political marketplace and, as Mr Ahmadinejad discovered, policies that tack away from the consensus do not last. That is why last year Iran elected a president, Hassan Rohani, who wants to open up to the world and who has reined in the hardline Islamic Revolutionary Guard Corps. Mr Rohani belongs to the establishment, naturally, but it says a lot about today’s Iran that his cabinet contains more doctorates from American universities than Barack Obama’s.

No Qompromise

What does this mean for a nuclear deal? For a start, that on balance Iran will act pragmatically, in what it sees as its own interests, rather than out of a messianic desire to pull down the world order, and is therefore worth talking to. Secondly, that power in Iran moves between factions, just as in America, so any deal must be future-proofed against the day when a hardliner returns to the presidency. And thirdly—and most important—that the world has time on its side.

The further the 1979 revolution recedes, the more normal Iran will tend to become. Dogma will be further eclipsed by everyday worries, like making money and doing business. Iran will not suddenly abandon its nuclear programme, which ordinary Iranians would see as humiliation; it is not about to become friendly to America, nor to stop meddling in its region. But if the regime comes to feel that it can escape the fate of Libya’s Muammar Qaddafi, who gave up on nuclear weapons only to be toppled, a curb will seem less of a gamble.

Time also helps because a deal is increasingly in Iran’s interests. Mr Rohani needs relief from sanctions. After growing by over 5% a year for a decade, the economy shrank by 5.8% in 2012. Oil pays the government’s bills; its recent 25% fall in price is squeezing the economy further. Iran’s region is dangerous, too. Islamic State threatens its Shia allies in Iraq, and both Mr Assad and Hizbullah, its ally in Lebanon, are engulfed by war in Syria. Iran hints that America should give ground in the nuclear talks so as to secure Iranian help in the Middle East. In fact, Shia Iran is the one who stands to gain: America would risk a backlash from its Sunni allies in Saudi Arabia and from the Sunnis it is trying to win over in Iraq and Syria.

Despite this month’s deadline, the P5+1 should be patient. The interim agreement that paved the way for talks, under which no new centrifuges are being installed, creates a pause in the nuclear programme. The world should neither break the talks with impossible demands, nor give way to Iran for fear that there will never be a better opportunity. Instead, the P5+1 should hold out for the right deal. It would be good if they got one next month, but if they don’t it will not be a disaster.