FOR Adriana Graciano, leaving her violent partner meant losing custody of her children to him, since she lacked both a job and a home. Now she is training as a bricklayer with Mão na Massa (roughly, “Get your hands dirty”), a non-profit outfit that since 2007 has been teaching women from favelas (slums) trades such as plumbing, house-painting and bricklaying. Of the 94 women who finished its courses in the first two years, two-thirds are working in the industry. Their average earnings have risen from just 44 reais ($21) before they joined the scheme to 631 reais a month.

Ms Graciano, who hopes soon to have a job, a home, and her children back, is one of many Brazilian women whose lives are being transformed. In 1960 just 17% worked outside the home, among the lowest rates in Latin America; now two-thirds have jobs, one of the region's highest. That is partly because they have far fewer children than in the past. In 1960 Brazilian women had six children each; now they average 1.9, fewer than anywhere else in Latin America except Cuba.

Big rises in the minimum wage, an increase in formal jobs and entry into fields long dominated by men all mean the gap between the pay of poorly educated women and that of their male peers has started to shrink. At the same time, more Brazilian women are well-qualified than ever before. Girls are staying at school longer than boys, and three-fifths of recent university graduates are women.

Research by the Centre for Talent Innovation, a New York think-tank, found that 59% of college-educated Brazilian women described themselves as “very ambitious”, compared with just 36% in the United States. The speed of the shift in attitudes has taken businesses by surprise. “Global companies still think women in emerging markets are all barefoot and pregnant, and many Brazilian firms are run by older men with traditional views,” says Sylvia Ann Hewlett, the think-tank's president.

A tight labour market and a shortage of talent are leading employers to look beyond their prejudices. It helps that a country where women have long been sidelined in politics is now governed by one. Though Dilma Rousseff owes her arrival in the presidency to a man—her predecessor and mentor, Luiz Inácio Lula da Silva—in office she has shown herself to be her own woman. An anti-corruption drive, predictably described by the media as “housecleaning”, has seen her sack many of the mediocre men she inherited, and raise the share of women in her cabinet above a quarter. She is slowly replacing the politicians running state-controlled businesses with better-qualified people—again, often women where men were before. Graça Foster, who took over as boss of Petrobras earlier this year, has degrees in chemical and nuclear engineering, an MBA and three decades in the oil industry. If Ms Rousseff seeks and wins a second term, it would be on her own record.

For clever, hardworking women, Brazil's system of open examinations for many public-sector jobs offers a starting point. But in the past many ruled themselves out. In the 1990s, when the sole female minister, Claudia Costin, studied women's career paths in the public service, she found that often potential candidates would not enter for the exam if the job might mean moving. Ms Costin, who is now Rio de Janeiro's municipal education secretary, says that once in work the barriers Brazilian women face are fewer than they might imagine—though she thinks it is still difficult for a Brazilian woman in the public eye to have a private life.

Women managers are suddenly no longer exceptional. Fernanda Montenegro, the assistant human-resources director at São Paulo's Grand Hyatt Hotel, moved to Switzerland to train in 2001 and has worked in Europe and the United States. When she started working at the Grand Hyatt in 2008, standing in for her boss at executive-council meetings meant being the only woman; now the sales director is also a woman, and in the past five years the number of female job applicants she deals with has soared. The negative reactions she has encountered come from outside work. Her mother frets that at 31 she is still unmarried. Male acquaintances say that a “half-gringa” like her would naturally neglect home and children.

But Brazilian machismo can be surprisingly easy to ignore. That may be because for men, too, work has never been better. Though the economy has slowed to a crawl, as yet there is little sign of a weaker jobs market. Salaries have risen strongly in real terms for years, and unemployment is at a record low.

Norma Sá of Mão na Massa says its alumnae have faced little prejudice on-site: “Men don't worry that it's competition for ‘their' jobs, because there is so much work for everyone.” If that changes, attitudes may harden. For professional women, a more immediate obstacle may be the rising cost of domestic help. Few Brazilian men lift a finger at home. But of the 7.2m Brazilians working as domestics, nearly all are women—women who have more options than ever before.