David Haller is plucked from a mental hospital, his illness redefined as a power. Illustration by Keith Negley

Noah Hawley’s “Legion,” on FX, the latest Marvel production based on the X-Men, has an aesthetic that might be described as caustic whimsy. It’s a sleek, stylized diorama of alarming imagery, as much about fear orange and misery avocado and rage yellow as it is about anything else. You don’t actually have to understand much about the X-Men to enjoy watching it.

This is good news, since the X-Men, a byzantine superhero mythology that launched, in 1963, as a comic-book series, has always intimidated me. I’ve got a layman’s knowledge of the movies, and I enjoyed Marvel franchises like “Jessica Jones” and “Luke Cage,” spinoffs from adjacent mythologies. On occasion, I’ve tried to absorb the Wikipedia page about the comic books, a document that makes the Talmud look like SparkNotes. The central concept—mutants who are troubled by their own powers, which emerge in adolescence—is a reliably effective device. But it’s hard to keep those suckers straight. There are dozens (maybe hundreds?) of X-Men, working in teams, tackling global crises. Society’s cruelty to mutants can be a metaphor for racism, or homophobia, or totalitarianism, or all at the same time. It’s big.

“Legion” is not small, exactly, but it’s dreamy and precise, with an Ionesco wit and Red Bull energy. It’s the backstory of one of the mutants, Legion, a fringe X-Man who is a mentally unstable anti-hero: he has varying selves and more than one power, which he has trouble controlling. On the show, however, we are introduced to him simply as David Haller (played with a smeary boyish charisma by Dan Stevens, whom most Americans know from “Downton Abbey”; a lucky few know him from “High Maintenance”), a twitchy fellow who has been medicated into dullness.

The series opens with a montage of David’s life, scored to the dread-pop of the Who’s “Happy Jack”: first he’s a baby, then a sweet little kid, then a beaming soccer player. Then, suddenly, he’s a wild-eyed tween cackling as his science experiment goes up in flames; a smirking anarchist; a party boy grinding toward suicide. He’s a raging twenty-something, surrounded by whirling knives. He’s an adolescent, clutching his ears as a crowd forms a circle to scream at him, as if he were Frankenstein’s monster. And, finally, he’s a mental patient, locked in an asylum as stylized as what’s come before—“Clockworks Psychiatric Hospital,” filmed as if it were surveillance footage.

These uncanny images will be repeated again and again, a pattern that the show keeps wheeling back to, solving for the sources of David’s anger as if struggling to finish a Rubik’s Cube. David has been taught that he’s schizophrenic, but in reality he has supernatural powers, among them the ability to move things with his mind. At the hospital, he’s buddies with a kohl-eyelinered junkie-lesbian (Aubrey Plaza, from “Parks and Recreation”), and he falls for another patient, Rachel Keller’s Syd Barrett (yes, that’s her name), who can’t be touched. As David walks through the halls, we get slippery cuts to his distorted perceptions, although we can’t tell whether they’re flashbacks or hallucinations or a reality that others can’t see. All we know is that they are beautiful, the colors and shapes treated as visual rhymes. There’s a shot of a man buried in emerald-green shrubbery, then a shot of dark-green ivy on a hospital wall; a horror-film flash of a Hitler-like mask mimics the mod black-and-white outfits worn by the orderlies. This gemstone surreality turns everything into theatre; it also forces us, like David, to absorb what we see without knowing if we can trust our perceptions.

The showrunner, Noah Hawley, created the Coen-brothers pastiche “Fargo” for FX. The first season of that series was visually dazzling but ultimately nihilistic, an exercise in hollow machismo; the second season was original and ambitious, a darkly funny exploration of domestic evil. Evil is clearly Hawley’s thing. When FX asked him to adapt a Marvel property, he selected Legion, a character so disturbing that, in 1991, one of the X-Men comic-book writers refused to write him in, judging him too dysfunctional for the team. One of the show’s producers has described Hawley’s vision for “Legion” as akin to “Breaking Bad,” a villain’s origin story, and he has cited influences that include “Alice in Wonderland” and David Lynch. There’s Wes Anderson in there, too, along with traces of “Eternal Sunshine of the Spotless Mind” and Edgar Allan Poe.

But, unlike some other recent flashily directed series about bad men—“Boardwalk Empire,” “True Detective,” “Vinyl”; I could go on—“Legion,” so far, doesn’t feel like empty virtuosity. Hawley finds contemporary ways to explore ancient, potentially hokey ideas, particularly the notion that sanity and madness are not that far apart. Three episodes in, it’s hard to say where the plot is going, other than down the rabbit hole of David’s worst thoughts. But “Legion” is a nightmare absorbing enough that you don’t feel the need to question the endgame. It’s likely to appeal to fans of Bryan Fuller’s greatly missed “Hannibal,” another show that was as much about ritual as about story, and that didn’t bother to explain everything along the way.

The bravura final sequence of “Legion” ’s first episode features David ducking down beneath the safe, amniotic blue surface of a swimming pool—an image that glimmers with allusions to everything from “The Graduate” to the album cover of Nirvana’s “Nevermind.” There’s a blast of magic fire and a brilliant escape, with the help of fellow-mutants, from the hospital. As it turns out, David’s being taken to another sort of hospital: a pricey rehab, metaphorically speaking. Although it’s called Summerland, it feels very much like the most famous place in the X-Men series: the X-Mansion, or Xavier’s School for Gifted Youngsters. Like the hospital, it’s a pleasure to gaze at. It’s idyllic and woodsy, full of modernist pale-wood furniture and a New Age therapeutic vibe.

Once he’s there, David is encouraged to revisit his memories—the Nazi puppet, the whirling knives—and to find out who he is. Every time it gets too difficult, his companions (including the wonderful Jean Smart, who was also in the second season of “Fargo”) tell him, in so many words, to “keep working the program.” “Legion” is one of those shows that treat mental illness, and addiction, as a metaphor for being special, so if you have a problem with that approach it will not be your jam. But it taps a fantasy that’s everywhere in the culture. It’s a story about being rescued from anonymity, like Harry Potter, or the horny teen-agers on “The Magicians,” or Elliot, on “Mr. Robot,” or even Olivia Pope’s Gladiators, on “Scandal.” It’s about learning that your freakishness—the damage that has made society reject you—can be redefined as a special power. It’s about being part of an élite team, learning things about the world that others don’t—and, often, having outsiders think you’re crazy. It’s about proving them wrong.

Frequently, such stories are about solidarity, about finding the people with whom one might team up to fight fascism or evil. But these mythologies are equally about the craving to be healed. This is true whether you are a naturally gifted orphan whose parents were killed by Voldemort or a homeless assassin who used to drill people to death for SD-6. The mental hospital where David was trapped is run by conspirators who want to trick him into thinking he’s sick. But the woodland facility is also run by psychiatrists, just a more benign set. If this were a certain kind of story, we’d watch David become a hero, learning to control his powers and to use them for good. That’s the version that people often lean on during hard times, for inspiration and escape.

The trick of “Legion” is that we know that it can’t be that kind of story: unless the Wikipedia pages are wrong, David won’t save the world—he has a different destiny. Not every character gets a happy ending; some of us are just fated to be a hot mess. ♦