This story originally appeared in bioGraphic, an online magazine about nature and sustainability powered by the California Academy of Sciences.

If you were to somehow snorkel up the Sixaola River from the Caribbean Sea to its source in Costa Rica’s Talamanca Mountains — charging up rapids, scaling waterfalls, and gaining more than 10,000 feet of elevation in the process—you would notice an apparent paradox: The further from the ocean you ventured, the more marine fish you would encounter.

Costa Rica’s streams are dominated by amphidromous fish and shrimp, creatures that split their curious lives between fresh water and salt. Species like river gobies (Awaous banana), mountain mullet (Agonostomus monticola) and banded shrimp (Macrobrachium heterochirus) lay their eggs in downstream reaches; once hatched, their larvae wash to the ocean, where they develop until they are large enough to reenter their natal rivers and ascend to the headwaters, maturing as they travel. Navigating these vertiginous streams requires extraordinary adaptations: Gobies in the genus Sicydium, for instance, inch up sheer rock faces using pelvic fins that evolution has modified into suction cups. The climb eventually weeds out all but the hardiest migrants, animals whose stamina would impress a salmon. The Sixaola and other Costa Rican rivers thus function as what scientists refer to as “altitudinal biological corridors” — ties that bind the mountains with the ocean, the highlands with the low.

The Sixaola and its tributaries provide sustenance and spiritual passageways as well as ecological connections. As you travel upriver, you will pass through the valle de Talamanca, a lush, sloping bottomland whose Indigenous residents, the Bribri, cultivate bananas, plantains, cacao and yucca. The river sustains the Bribri, furnishing drinking water and edible fish like bobos and lisas, species of mullet. It’s also fundamental to cultural life: According to Jairo Sanchez, a Bribri member who lives in the valley, rivers serve as trails that guide “spiritual helpers” through the world, and thus deserve respect.

“Humans can’t live without water. Water can get by without us,” Sanchez says. “That’s why we should feel a little less than water. We are not bigger than it.”

Not everyone, however, shares his reverence. Nearly 400 dams are currently proposed for Central America’s rivers, including several that would flood the Talamanca Valley and collectively displace 60 percent of its Native inhabitants. “We will lose land and jobs,” warns Yin David Ellis, a Bribri man in the village of Tsoki. “It’s as if I went to your house and took your home without your permission.”

For now, however, the valley’s rivers remain free-flowing. That’s thanks largely to a feisty Indigenous resistance — as well as a nonprofit that, for nearly two decades, has been assembling one of the tropical world’s most voluminous troves of biological data.

Bill McLarney first came to Costa Rica in 1967, a fish biologist from upstate New York drawn to Central America for reasons that mystified even him. Enchanted by the tropics, McLarney bought land near the Panamanian border and, in 1971, founded a small environmental nonprofit with a Honduran emigrant named Jeronimo Matute Hernández. Soon after the organization launched, Talamanca’s cacao trees, the source of the valley’s most important cash crop, succumbed to frosty pod rot, a fungal disease that destroyed 95 percent of the harvest. McLarney, Matute and their small but growing team scoured the global tropics for fruit trees that could weather Costa Rica’s climate, then set about helping local farmers establish agro-ecology systems featuring new crops like guava and sapote.

As the nonprofit, now called the Asociación ANAI, expanded, it supported a diverse array of sustainable development initiatives: establishing wildlife refuges, reforesting stream corridors, attracting ecotourists. Apprehensive about perpetuating conservation imperialism, McLarney strived to train and empower locals, remaining, where possible, in the background of his own organization. “The idea is to develop capacity in local people to the point where we are not necessary,” he says.

That strategy is epitomized by ANAI’s Stream Bio-Monitoring Program. McLarney is first and foremost a fish biologist who, in 1990, established a biological surveying project in North Carolina, scouring the Little Tennessee River watershed with teams of volunteers for creatures like the greenfin darter (Etheostoma chlorobranchium) and the spotfin chub (Erimonax monachus). In 2001, he started a similar program in Costa Rica, training locals to conduct habitat assessments, scoop up aquatic insects, and survey fish via snorkels and electrofishing (a research method that entails running direct current through the water to temporarily stun fish). The goal was to develop what McLarney calls a library, a long-term record of biodiversity that ANAI could use to plan restoration projects, educate residents and track environmental change.

“Nature is always speaking,” says Maribel Mafla, a Colombian biologist who has coordinated the program nearly since its inception. “Science is the language in which we can make the translation.”

Mafla’s most important job is recruiting the next generation of translators. ANAI teaches field-based aquatic science lessons for 32 local schools and has trained more than 20 “bioeducators,” Indigenous students well-versed in fish research and education. Take Jairo Sanchez, who, as a child, ran away crying the first time he met McLarney, a gruff white man with a drooping mustache. Today Sanchez, 34, is a skilled naturalist who’s teaching his own son, Manuel, the tricks of the stream-survey trade.

“He’s like a duck and can swim well in any river,” Sanchez says of his son, “but he doesn’t have enough experience yet about nature and its richness. I always take him so he can learn and observe the various species of fish and insects.”

But biomonitoring isn’t merely an educational exercise. In fact, whether Costa Rica’s aquatic biodiversity will remain unspoiled for Manuel’s own children may depend upon it.

In the United States, the era of the mega-dam has come and gone: We largely ceased constructing concrete barriers in the 1970s, and in recent years we’ve torn out gargantuan structures on the Elwha, Penobscot and Sandy Rivers. The developing world, by contrast, is in the throes of a nascent infrastructural boom. More than 3,500 dams are currently planned or under construction worldwide, the vast majority in developing regions: Southeast Asia, South America, Africa and the Balkans. Dam advocates argue that cheap hydropower will lift poor nations out of poverty and produce crucial carbon-free electrons; opponents point to the destruction of freshwater ecosystems, the methane emissions generated by reservoirs, and the displacement of Indigenous communities.

Costa Rica and Panama are no strangers to hydropower’s dilemmas. In 2016, Costa Rica completed the Reventazón Dam, a 425-foot-high wall that permits the nation’s electric grid to run full-time on renewable energy — while simultaneously cutting off a critical migratory pathway for jaguars. And that controversy pales compared to the firestorm surrounding Panama’s Changuinola I Dam, a 325-foot-high barrier that forced the relocation of more than 1,000 Indigenous people near La Amistad World Heritage Site, a protected area that straddles Costa Rica’s border with Panama. Changuinola I, along with another large dam on the nearby Bon River, provoked the concern of the United Nations, which in 2011 asked Panama to halt construction and conduct an official environmental assessment. The request was ignored, and the dams completed.

Changuinola I did not sate Panama’s appetite for dams: The country is still contemplating an impoundment on the Rio Teribe, one of the region’s few remaining free-flowing rivers. Although Costa Rica, which has an environmentally friendly reputation to uphold, is not as impetuous as its neighbor, it has at various times considered up to 20 potential dams on four rivers in the Sixaola watershed that would flood Indigenous territories held by the Bribri and the Cabécar. “If people have to leave their farms, where would they go?” Mafla demands. “Many families who make their income through (farming) would end up at zero.”

Aquatic ecosystems would fare just as poorly. Cut off from headwaters by concrete obstacles, runs of migrating fish would collapse, says ANAI biologist Ana Maria Arias. Even if fish ladders did manage to convey gobies, eels, and other fishes past the dams, eggs and larvae would settle out and die in slow-moving reservoirs. Shrimp, which shred and break down leaf litter, would suffer as well, short-circuiting nutrient cycles. Add it all up, says Arias, and severing the connection between mountains and sea would almost certainly doom the region’s riverine biodiversity, destroying important subsistence fisheries in the process.

The potential for ecological catastrophe is, in part, what makes ANAI’s bio-monitoring so crucial. Prior to the program’s creation, McLarney says, some officials claimed that steep rapids and waterfalls prevented fish and shrimp from reaching headwater streams in La Amistad. ANAI’s proof that migratory fish occupy high-elevation streams — indeed, that the aquatic fauna in many mountain creeks is composed entirely of amphidromous animals — provides what Sanchez calls a “weapon” in the Bribri’s fight against hydropower. By driving wedges between the Talamancan lowlands and La Amistad, ANAI’s work suggests that dams could eliminate more than 90 percent of the protected area’s aquatic biodiversity.

“We’re the first ones to make that information available to local conservationists and Indigenous people, to add it to their bag of arguments against the dams,” McLarney says.

Dam proposals in the Talamanca Valley presently lie dormant, staved off for now by Indigenous activists and ANAI’s evidence. Yet the peril is far from dead. As David Brower, a man who knew a thing or two about fighting infrastructure, put it, “They only have to win once — we have to win every time.” In the meantime, the region’s rivers face an array of more quotidian problems: unmanaged livestock, trash dumping, even deliberate poisoning to catch fish. Bernandina Torres, the Bribri co-manager of a small cacao farm, is particularly concerned about the deforestation of river corridors. ANAI’s riparian plantings, she says, are often promptly hacked down for firewood, heating up streams and diminishing flows. “With lots of drought, it can get too dry and the fish can have a difficult time going up,” Torres says. “I’ve seen the importance of having shade.”

If the Sixaola and other Costa Rican and Panamanian rivers are to survive these multifarious pressures, ANAI’s work will have to long succeed McLarney himself. “The process will not be complete until my job is held by somebody local,” he says. Fortunately, there is no shortage of up-and-coming candidates. There’s Marcio Bonilla, for instance, who, says McLarney, can identify fish as well as any Western scientist. Or Yin David Ellis, who enrolled in ANAI’s bioeducator program as a student and now compares entering a river to experiencing paradise. “Maybe in the future I can be a leader for the community,” David says. “Who knows what destiny brings?”