Eden (Kirsten Dunst) and Adam (Jim Sturgess) are lovers on twin planets with opposite gravity fields in “Upside Down.” (Image courtesy of Millennium Entertainment)

The sci-fi love story “Upside Down” features a Romeo and Juliet separated not by a family feud, but by gravity.

Adam (Jim Sturgess) lives on a planet that has a twin — a neighboring world with an equal and opposite gravitational pull. Poetically, if rather preposterously, the two orbs are just close enough so that mountains on the surface of each world almost brush against each other. This is how Adam meets Eden (Kirsten Dunst), whom he discovers hanging upside down one day, like a pretty blond bat, from a rocky outcropping on her world.

His “up” is her “down,” and vice versa. And because of a fluke of physics — in which all matter must obey the gravity of the world it came from — they can never be together. Like a magnet to steel, Adam is forever tethered to his home, a slumlike wasteland, and Eden to hers, a land of plenty. Clever use of a rope allows the lovebirds a temporary reprieve from these cruel laws of attraction and social immobility.

It’s a clever idea, if not a unique one. One of this year’s Oscar-nominated animated shorts, “Head Over Heels,” had essentially the same premise. But in “Upside Down,” writer-director Juan Solanas takes the gimmick about as far as it can go, rendering the metaphor of longing and separation in effective, and richly visual, terms.

If anything, however, he goes too far.

Soon, Adam is visiting Eden in her world, thanks to the use of counterweights, which help keep him from being pulled back to his planet. Known as “inverse matter,” any material from one world — such as a metal bar — can be used to offset the gravitational pull of the other world. The problem is that after about an hour of contact between matter and inverse matter, the counterweights burst into flames, making Cinderella’s coach turning into a pumpkin look like nothing.

Strict laws also prohibit the intermixing of people between worlds, though that doesn’t prevent Adam from making friends with Bob (Timothy Spall), a fellow malcontent from Eden’s world.

Worst of all, though, Eden has developed amnesia, and doesn’t know Adam from, well, Adam.

That’s more than enough plot for one movie. But Solanas also introduces a mysterious pink bee pollen, produced by insects that feed on flowers from both worlds. Because of its anti-gravitational properties, Adam begins to experiment on it as an anti-aging cream, going to work for the evil corporation that keeps his people in poverty, and Eden’s in wealth.

And you thought this was just a story of unrequited love, not a political allegory. The problem is, it’s a bit of both, not to mention a sci-fi thriller.

That love story works beautifully, because the metaphor works. There are some really pretty special effects, too, such as rain that falls up. (The same thing happens to Adam when he tries to use a urinal on Eden’s planet, to more comedic effect.)

And the cinematography, which renders everything in a cool, blue pallor, is simply gorgeous.

But the rest of “Upside Down” ultimately gets weighed down by its own ponderous, and increasingly contradictory, logic. If matter and inverse matter burst into flames, for instance, why doesn’t Adam get a terrible case of heartburn — let alone spontaneous combustion — every time he eats or drinks something from Eden’s planet?

“Upside Down” paints a pretty picture, as long as you don’t think about it too much.

PG-13. At Landmark’s E Street Cinema. Contains some violence. 103 minutes.