Image caption Is the sun setting on South Africa's gold mines?

Visitors flying into Johannesburg's airports gaze down upon the small, seemingly regular hills that ring the city that is known in Zulu as eGoli, "place of gold".

These mine dumps are testament to the millions of tonnes of earth that have been shifted in the search for gold around the city over the past 130 years.

But the gold mining industry that gave rise to one of Africa's biggest cities is now in crisis.

Costs, including wages, have escalated over the past two decades and the gold itself is getting harder to get to.

Some analysts describe the gold sector as in terminal decline - a sunset industry.

Turbulent times

Crucial wage negotiations start in South Africa's gold mining sector on Thursday, the outcome of which, some analysts say, will determine the future of the whole industry.

Billions of dollars in exports and tens of thousands of jobs are at stake.

South Africa's gold mines In 1970 South Africa accounted for 79% of world production - in 2012 it was 6%

In 1990 there were 1.2 million workers in the sector - in 2012 there were 514,000

South Africa still has 50% of known global gold reserves

All the world's gold ever mined would fit into a room just 17m x 17m x 17m

It's been a turbulent 18 months for South Africa's entire mining industry, not just gold, with workers across several sectors staging wildcat strikes.

The tensions over the mines has often boiled over into violence, including the most infamous day in South Africa's post-apartheid history last August, when 34 miners were shot dead by police near Lonmin's Marikana platinum mine.

The South African government is so concerned that it tasked Deputy President Kgalema Motlanthe to try to broker a stability pact for the industry. The ruling ANC faces elections next year and is keen to avoid another flare-up of violence.

While mining only contributes about 6% of South Africa's GDP (financial services and manufacturing command larger slices), it generates nearly 60% of the country's exports.

Poles apart

But the opening positions of the players involved seem to be so far apart that the negotiations are likely to be racked by tension, deadlock and possible walkouts.

The two big unions, the National Union of Mineworkers (NUM) and the Association of Mineworkers and Construction Union (AMCU), have demanded pay increases of 60% and 100% respectively.

The gold mining companies say that double-digit increases are unaffordable.

Analysts expect months of industrial action on a scale that could be worse than that seen last year.

Image caption More than 80% of mineworkers are unionised

That would leave the entire sector in a precarious position and would have severe knock-on consequences for the South African economy as a whole.

The ratings agencies Standard & Poors and Moody's downgraded the country's debt last year, partly due to worries over the mining sector.

Sunset industry?

The Chamber of Mines, which represents the mining houses, says a widespread strike in the gold mines would mean a loss of 349m rand ($34m; £23m) for each day of lost production.

Meanwhile, the loss of miners' wages in a strike would result in the government losing 9m rand in tax revenues every day.

Much of the easily accessible gold has already been taken out of the ground. That which lies in the deeper reefs is becoming increasingly costly and dangerous to get at.

In addition to this, over the past five years, wages have increased by an average of 12.3% per year, compared with an average inflation rate of 5.9%.

During the same time, gold production fell by 21%. Last year, the average worker produced 1.18kg of gold. In 2007, that figure was 1.49kg.

'Ruse'

Last month, the World Gold Council released new guidelines for calculating the true cost of producing the metal.

The new "all-in" measure takes account of capital expenditure and licensing for the first time, as well as the day-to-day running costs.

This significantly raises the cost of producing an ounce of gold.

Gold Fields chief executive Nick Holland said the new method would mean an ounce of gold would cost nearly $1,400 to produce. At a time when the gold price has fallen to about $1,200, this makes many mines unprofitable.

Image caption Wildcat strikes are common in South Africa's mines

But Loane Sharp, a labour analyst with Adcorp, says the complaints made by the mining companies about the price of gold (over which they have no control) are somewhat overdone. For example, 10 years ago the price of gold was closer to $300 an ounce and many mines were still profitable.

"In many cases complaints about the gold price are a ruse, since the uncontrollable gold price allows mine management to divert attention from their own role in mine profitability, namely control of costs," he says.

Mechanisation

Unless the wage talks reach an outcome that reflects the balance-sheet realities, neither companies nor workers can salvage [the] gold industry Association of Mineworkers and Construction Union

Analysts say if the mining companies are forced to grant high wage increases, they will simply counter this with massive layoffs.

Firms have also embarked on programmes of mechanisation, basically replacing workers with machines.

Loane Sharp points out that while mine production between 1990 and 2012 increased, the labour force shank from 1.2 million to 514,000 - the result of mechanisation.

Both sides in the wage negotiations recognise the need to reach common ground.

"We believe the minerals of this country must now benefit the people," AMCU said in its demands to the gold companies.

"But unless the wage talks reach an outcome that reflects the balance sheet realities, neither companies nor workers can salvage a gold industry crushed between a toppling price and climbing costs."

While Mark Cutifani, chief executive of Anglo American and the president of the Chamber of Mines, said: "The future of the mining industry is in our collective hands and by working together we can ensure its sustainability and return it to profitability for the benefit of all South Africans."

But while the public statements by the players talk of solutions found collectively, there will be hard bargaining and tough decisions made in the coming months. Much is at stake in an industry that could be entering its twilight years.