WITH bearded baristas and furniture cobbled together from wooden crates, Curto Café in Rio de Janeiro is a typical outpost of Brazil’s nascent hipster scene. Aficionados of its organic coffee do not pay set prices; instead they pay what they think reasonable—or what they can afford. This, says Gabriel Magalhães, one of Curto’s founders, is less and less. Like other Brazilians, cariocas (as Rio residents are known) are pinching their pennies.

Brazil is suffering its worst recession since the 1930s, perhaps of all time. On June 1st the government reported that GDP contracted by 0.3% in real terms in the first quarter of this year; it is 5.4% smaller than it was a year earlier (see chart). Over that period GDP per person dropped by more than it did during the hyperinflationary “lost decade” from 1981 to 1992, notes Alberto Ramos of Goldman Sachs, an investment bank. Over two years the number of jobless Brazilians rose from 7m to 11m. It is a “downright depression”, says Mr Ramos. The task of pulling Brazil out of this morass falls to Michel Temer, who took over as interim president after the Senate voted in May to try President Dilma Rousseff on impeachment charges. Politically, his government has had a rough start. Two of the ministers in his all-white, all-male cabinet, including the one in charge of fighting corruption, had to step aside after recordings were leaked in which they appeared to criticise prosecutors’ investigation of the massive corruption scandal surrounding Petrobras, the state-controlled oil company. They say they were misinterpreted.

Mr Temer’s economic programme is faring better. His heavyweight team, led by Henrique Meirelles, a former governor of the Central Bank, has proposed the most ambitious overhaul of Brazil’s economic governance in decades. Public spending, including on the unaffordable pension system, is to be slashed, though the government has yet to say just how. Enterprise-crushing regulations are to be lifted, starting in the oil and gas sector. Mr Meirelles says the government will consider reforming Mussolini-era labour laws and the Byzantine tax code. Privatisation, long a taboo, is a possibility for the first time since the 1990s. Such ideas are a radical break from the left-wing interventionism practised by Ms Rousseff’s government, which is largely responsible for the economic mess. They offer hope of a way out of it.

The centrepiece of Mr Temer’s plan is a constitutional amendment to freeze public spending in real terms. Even health and education—which consume more than a quarter of government revenue without providing commensurate benefits—may not be spared. The government is expected to present a draft to Congress within the next two weeks.

The idea is to cure the government of one of its principal vices. Public spending has grown by an annual average of 6% for the past 20 years, much faster than GDP. The central government’s primary fiscal balance (before interest payments) went from a surplus of 2.2% of GDP in 2010 to a deficit of 2.3% in the year to April 2016, the highest level yet. This, and the prospect of deficits stretching far into the future, keeps interest rates high, which further worsens the deficit. The government’s interest bill is a massive 7% of GDP. Brazil’s high taxes thus pay for past profligacy rather than effective government.

The spending cap, if approved by majorities of three-fifths in both houses of Congress, will lead to lower deficits as soon as growth and tax revenues revive. It could help even sooner, says Arthur Carvalho of Morgan Stanley, an investment bank. That is because confidence that Brazil will reduce its debt could lower long-term interest rates, cutting the government’s interest bill. As important, the spending cap will force the government to undertake other reforms, though in the long run it may prove impossible to maintain as the population grows. Currently, the constitution and other legislation protect 90% of spending from cuts, no matter how unproductive it is. If the government is not to breach its self-imposed ceiling, those laws will have to change.

Such prospects are already stirring hopes among unhappy entrepreneurs and investors. Bond yields have fallen from about 17% in January to 13%; the cost of insuring against default is down by a third since December. With more than a third of industrial capacity idle, production could revive quickly if sentiment improves. “In six months we may look back at today as an inflection point,” says Marcelo Carvalho of BNP Paribas, a bank. But only if Mr Temer delivers what he has promised.

Waxing and waning: Brazil's economic woes, in charts That “will be tough”, admits Mr Meirelles, the finance minister. He hopes to enact some reforms, including the spending cap, before next year’s budget is submitted to Congress, which must happen by August 31st. With important local elections looming in October, few politicians will be in the mood to vote for less spending on schools and hospitals. But members of Mr Temer’s team, several of whom left lucrative private-sector jobs to help rescue the economy, dispute that. They think the political and economic crisis has made both voters and congressmen more receptive to proposals for radical change. A billboard put up by the National Confederation of Industry at the airport in Brasília, the national capital, demands: “Pension reform now!” In theory, Mr Temer can count on 356 votes in the 513-seat lower house of Congress, and 56 in the 81-seat Senate, more than enough to amend the constitution. Unlike Ms Rousseff, who also enjoyed solid nominal majorities in Congress, Mr Temer knows how to charm and cajole his allies. Unencumbered by past commitments, he has more perks and patronage to offer politicians who formerly supported Ms Rousseff. Despite watching two ministers sink into the quicksand of the Petrobras scandal, Mr Temer has managed to keep his government functioning. That may be in part because Brazilians have low expectations. A handful of other members of his cabinet are under investigation, as is Renan Calheiros, the president of the Senate and a member of Mr Temer’s Party of the Brazilian Democratic Movement, who features in the leaked recordings. But neither Congress nor the voters are demanding the toppling of Mr Temer’s government. The howls of rage from Ms Rousseff and her allies have so far had little effect.

A survey published this week by IMD, a business school, puts Brazil in last place out of 61 countries in the efficiency of its government, behind war-torn Ukraine and, astoundingly, bankrupt and autocratic Venezuela. Brazilians are not expecting moral purity from Mr Temer’s interim government, which will probably continue in office until after elections are held in 2018. But they are hoping for relief from their economic pain. The early signs are that Mr Temer knows how to provide it.