Along the San Francisco Bay, just beyond the din of gridlock, industry and residential lawn mowers, an ecological transformation is quietly unfolding. A glance at satellite images or out of the flight window reveals a striking quilted landscape of green, red, orange and yellow colors hemmed to Silicon Valley.

The colors are from solar evaporation ponds used to make salt—greens from algae in low salinity ponds, orange hues from brine shrimp as the water gets saltier, and deep reds from pigments formed on the Dunaliella algae in the ponds where it's so salty it's called pickle. These are the remnants of the Bay's centuries-old industry of evaporating water to refine salt. And they are slowly yielding to a curious human-driven experiment.

The South Bay Salt Pond Restoration Project has been converting more than fifteen thousand acres of these ponds has been converting more than fifteen thousand acres of these ponds—an area slightly larger than Manhattan—back into tidal marshland. The landscape brings the bay area's past, present and future in the same frame. At the edge of one pond are the ruins of windmills fitted with Archimedes screw pumps to move brines from pond to pond. PG&E transmission lines run across the edge of the ponds. Avocets and stilts forage through the marsh waters of the wildlife refuge overlaid on a historic saltern. The project is part of the largest tidal wetland restoration on the West Coast and the biggest chunk of a fifty year, $1.4 billion effort that started in 2003.

Biodiversity is not the only thing at stake. The sea level in the region is projected to exponentially rise up to 1.4 meters by 2100. That puts at risk housing built on reclaimed land, police and fire stations, schools, hospitals, two international airports, Google, Yahoo, LinkedIn and Facebook. A 100-year flood event – the kind that is said to have a one in 100 chance of occurring any year – will affect 270,000 people and cost over US$60 billion in repairs, according to a 2012 Pacific Institute paper. Last month, a group of researchers at the University of Georgia and Stetson University published a letter in Nature warning that millions of people across the United States will be affected by sea level rise by 2100. One of the worst affected counties in the country is San Mateo, which hugs the San Francisco Bay. Storms come and go, but a sea level rise is a new normal, increasing the vulnerability of the shoreline to flooding.

Current flood protection mechanisms are generally a mix of old mud levees and sea walls, flood control channels, pumping stations and tide gates. Future integrated flood management systems will likely have all that and new engineered levees. But a restored marshland is a promising front line armor. Besides being a biodiversity hotspot, marshes are cheap and effective insurance. They are natural, resilient buffers against rising water. They dissipate the wave energy, absorb tidal waters like a sponge, and slowly release the water back into the bay.

Marshes depend on mud. Once the levees are breached, the tides wash in mud, twice a day, day after day. This mud brings nutrients. Then, with the addition of light and carbon dioxide, a chain of events sets off in the estuary. First, phytoplankton like cyanobacteria and green algae spread through the muddy waters. Krill drift around and feed on the phytoplankton. Snails, shellfish, California bay shrimp and worms eat up the mud they live in. Shorebirds like avocets, willets and godwit swoop in and dig their beaks deep in the mud for the worms. Striped bass and the chinook salmon swim in and out to feed on worms and crustaceans. Over the years, peregrine falcons and leopard sharks start to hang out at levee breaches for the smaller fish and birds. When there's enough sediment, the plants will start growing. Endangered species like the salt marsh harvest mice and Ridgway's rail start foraging around the marsh. Marshland is born again, ever eager for more mud.

“Sediment is critical to wetland. It means life,” said Letitia Grenier, the lead scientist on a 2015 report that addresses the effects of climate change to the bay's ecosystem. Mud is the architect, scaffold and fuel for a marsh, all rolled into one. Which means that much depends on having enough mud – a sufficiently thick foundation at the start to help it peek above the tides, and then a steady trickle for years of sculpting. The mud needs for the project are huge: more than 53 million cubic meters of sediment, just to start tidal restoration on 90 percent of the ponds, without accounting for sea level rise. That is a lot of filling in – more than the volume of 50 million Empire State Buildings packed with mud. To understand why, we need to go back in time.

The San Francisco Bay formed some ten thousand years ago, when the glaciers of the last ice age thawed, their waters overtaking the land. About four thousand years ago, the rate of sea-level rise slowed enough for sediment to accumulate around the edges of the bay and form the first tidal marshes. By the early nineteenth century, about 200,000 acres of marsh hemmed the water’s edge. It was one of the richest ecosystems between Alaska and Mexico, home to 500 species of birds, fish, mammals, reptiles, and amphibians.

Then, the mid-century gold and silver rushes dramatically altered the bay’s geography. Between 1849 and 1884, gold prospectors in the Sierra Nevada used hydraulic water jets to displace about 750 million cubic yards of mountain sediment, which swept down the Sacramento and San Joaquin Rivers. The water of the San Francisco Bay became murky, and some places gained almost a meter in elevation.

Settlers also diked the wetlands to produce salt, an essential component in refining mined ore. Decades of diking and draining for salt production and dredging for navigation channels depleted the sediment. Many areas of the shoreline also subsided because of excessive groundwater pumping over the last seventy years for agriculture and development. Which brings us to today, with two forces working in opposite directions. The water is rising. And mud is far below the amount needed for a marsh to grow on.

There are two ways to bridge this mud deficit. One is to rely on tidal flow. Natural marshes in the region grow at about three to five millimeters every year. And in a recent study of a pond under restoration, researchers found that the young marsh was adding more than 20 cm of sediment every year. That is plenty mud. But the rate is bound to slow down as the marsh matures. Plus, natural sedimentation is highly dependent on a host of variables like location, wind direction and current and rain patterns. A deficit of 45 million cubic meters could take as much as 600 years to fill up, according to a 2013 USGS paper that estimated using sediment deposition rates from 2009 and 2010. Hundreds of years is a time line that is out of sync with decades of sea-level rise.

So, the other way to get mud is to get humans to dump it. The bay is seeing the last trickle of mud delivered by the Gold Rush explorers over the last few years. So, that's out. Another option is to recycle dredged sediment thrown up by development and navigation projects. And then, there is upland dirt – sediment from construction sites across the bay area and the country. For this kickstarter dirt, the project works with brokers. Yes, dirt brokers. The dirt brokers connect construction projects that need to get rid of mud cheaply to the restoration project that desperately needs mud. “There's a lot of dirt in the market now,” said John Bourgeois, the restoration project’s executive manager.

These options would sound like a win-win situation. But turns out there are significant challenges to giving nature a hand in dumping mud. Getting dredged sediment out to the edge of the bay is not possible with just bulldozers, especially in some restoration regions where the mudflats stretch out for a couple of miles in front of the shoreline at low tide. A barge can only get so close to the land in such locations, which means extensive (and prohibitively expensive) pumping lines to the restoration site, taking into account environmental risk. For a few years, planners threw around an idea to build an aquatic transfer facility, a deep spot in the Bay where dredgers could store sediment till a restoration project came along. But that idea was shelved for environmental reasons. And as for upland dirt, even before it can be dumped, it has to go through extensive quality measurements first to scan for harmful chemicals.

And still, there isn't enough. The dredged sediment market is only a little over two million cubic meters of mud every year. The upland dirt economy is likely to muster similar volumes. And there isn't enough capacity in the market to move it to the shoreline. Just a million cubic meters will need over 260 twelve-wheeler trucks running every day of the year.

These are considerable hurdles – finding mud, finding a way to dump mud, finding money to buy, scan and dump mud. So far, the South Bay Salt Pond Restoration Project has only used a relatively small volume of recycled mud dredged from a local port onto a small restoration site. The mud deficit is the question nobody has the answer to.

But if there's mud, there's hope. Once the hurdles are overcome, once a pond is ready for restoration, once the levees are breached, gypsum-encrusted moonscapes routinely transform into an Everglades-like terrain. And perhaps the best way of grasping the remarkable changes is to look at kite-aerial photographs taken by Cris Benton, a retired Berkeley professor. A diptych he calls "Homage to Rothko" from a site called Eden Landing shows the transformations in one salt pond. One image, from 2009, is an abstract-expressionist mix of white, gray, and egg-yolk yellow. On another image just five years later, clear water ripples over aquatic grass and algae. That's the story that repeats itself every time a levee is breached. “All we got to do is kind of restore the hydrology into the marshes,” said Bourgeois. “The blueprint's there.”