If the world ever wants to slow the pace of global warming, we'll likely have to use far fewer fossil fuels and far more renewables.

That's why tiny Costa Rica has been getting so much attention of late — the country recently announced it went the first 75 days of the year using no fossil fuels whatsoever for electricity.

It wouldn't be easy for other countries to do what Costa Rica did

That's right: 100 percent of Costa Rica's electricity came from renewable power in January, February, and half of March, mainly from hydropower and geothermal plants. Most notably, heavy rains helped four big hydroelectric dams run above their usual capacity, allowing the country to make do without fossil-fuel generators. (This was only for electricity; Costa Rica's cars were still running on gasoline.)

It's an impressive feat — and a nice illustration of Costa Rica's incredibly ambitious environmental plans. At the same time, a closer look at the story shows just how difficult it would be for other countries to pull off something similar.

Most of Costa Rica's electricity is from hydro and geothermal

When many people think of "renewables," they tend to think of wind turbines or gleaming solar panels. But that's not what Costa Rica's relying on.

For years, roughly 80 percent of the nation's electricity has come from an old-fashioned technology — hydroelectric dams. Unlike wind or solar, hydropower can run at all hours, making it quite reliable. But the output of these dams also fluctuates with the weather, since you need enough water to keep the turbines spinning.

80 percent of Costa Rica's power comes from dams, 12 percent from geothermal

Back in 2014, Costa Rica suffered a brutal drought, and the dams produced less power, forcing grid operators to rely more heavily on diesel generators. In 2015, by contrast, the country experienced above-average rainfall at its four biggest reservoirs, allowing those hydroelectric dams to meet virtually all of the country's electricity needs.

Another 12 percent or so of Costa Rica's electricity comes from geothermal plants — power plants that tap heat deep in the Earth's crust. In 2014, after the drought, the nation's legislature approved a $958 million geothermal plant, backed by loans from Europe and Japan, that's now up and running. They also played a key role this year.

The remainder of Costa Rica's electricity needs were supplied by wind — which normally makes up about 2 percent of generation — a smaller amount of biomass, and a very minuscule bit of solar.

It's worth emphasizing that it was only Costa Rica's electricity that was coming from 100 percent renewable sources. The nation of 5.7 million people still has plenty of cars, which mostly run on gasoline. It also has two large cement plants that burn coal and petroleum coke in their kilns, producing carbon dioxide emissions.

It's also important to note that Costa Rica is still a very poor country and its per capita electricity consumption is about one-quarter that of, say, France or Belgium. If Costa Rica was richer and used more electricity, then its hydropower and geothermal plants wouldn't be enough to supply all of its needs.

Even so, this year's feat is a reflection of Costa Rica's environmental ambitions. Its state-run utility is currently building dozens of wind farms and small dams around the country, with the aim of zeroing out the use of all fossil fuels for electricity — forever. The country is also planning to balance out other emissions with a program to protect its rainforests and plant more trees. The aim? To become carbon-neutral by 2021.

Why it's harder for other countries to do what Costa Rica did

So if Costa Rica can go 100 percent renewable, why can't other countries do the same?

One obstacle is that the availability of hydropower and geothermal depends on location, and only a few nations are lucky enough to have such rich resources. Iceland gets nearly 100 percent of its electricity from those two sources. Paraguay gets almost all of its electricity from the massive Itaipú Dam. Brazil gets more than 75 percent of its power from hydropower. But those are exceptions. For most countries, hydropower is just one option among many.

The United States, for example, has already dammed up most of its suitable large rivers and still only gets 7 percent of its electricity from hydro. We could maybe eke out another 1 percent by retrofitting smaller dams that don't have power plants, but there's an upper limit here:

As for geothermal, the US could arguably do more to harvest heat deep beneath the ground — we currently only get about 0.41 percent of our electricity from this. But that's also limited by location. It could be a boon for states like California, less so for Wisconsin:

Most other countries find themselves in similar situations. Hydropower already provides 16 percent of the world's electricity. In theory, we could try to double this by damming up every last big river on Earth, but that could end up displacing millions of people, destroying habitats, and, in some cases, exacerbating climate change (decaying vegetation in poorly built dams can lead to extra methane emissions). Not so easy to do.

Which means that for most countries, clean energy will largely entail things like solar power and wind power (fast-growing but still a tiny source of electricity worldwide, and faces questions about intermittency). Or nuclear power (reliable but expensive and dogged by concerns about waste). Or fossil-fuel plants that can capture their carbon dioxide emissions and bury them underground (expensive and not yet commercialized).

This isn't impossible, and there are lots of good success stories there — the cost of wind and solar, in particular, have been tumbling all over the world. But it hasn't been easy. There's a good reason why fossil fuels still provide about 87 percent of the world's energy, a fraction that hasn't budged for over a decade. Coal, oil, and gas are environmentally destructive, yes, but also cheap and convenient.

So most countries won't be able to follow the exact same path Costa Rica did. They'll have to find their own ways to clean up.

Further reading

We're damming up every last big river on Earth. Is that really a good idea?

The costs of solar and wind keep dropping around the world.

Clean energy is growing worldwide. But fossil fuels have grown even faster.

WATCH: 'A visual tour of the world's CO2 emissions'