Jonah Hill and Emma Stone in ManiacNetflix

This article contains some spoilers through all 10 episodes of Maniac.

It’s tempting to get distracted by the details in Maniac, which glimmer and sparkle and refract the eye’s focus. The Rubik’s Cube. The discarded paperback of Don Quixote. The Statue of Extra Liberty. Trudie Styler. The rainbows. The computer-generated graphics in a groundbreaking pharmaceutical trial that recall nothing so much as the earliest iteration of Mike Tyson’s Nintendo game Punch-Out!!.

Maniac, which debuted in its 10-episode entirety on Netflix last Friday, is an amazing technicolor dreamscape—a shape-shifting, genre-flipping, drugged-out delusion of a concept about mental illness, computer-generated therapeutic breakthroughs, and a world in which technology got stuck in 1987 and stayed there. In one scene, Jonah Hill’s character, Owen, transforms into an eagle and flies into another woman’s The Lord of the Rings–inspired reverie. In another, a pop-psychologist character played by Sally Field freebases a new drug in its testing phase before being sealed in an oversize drawer to help counsel a grieving supercomputer. Patrick Somerville, the show’s creator, and Cary Joji Fukunaga, the director, layer visuals upon metaphors upon absurdities with an excess that can be exhilarating or disorienting, depending on your tolerance for metafictional television.

Underneath the pop-cultural mille-feuille, though, is an essentially simple story, and it’s what makes the final chapters of Maniac more affecting and absorbing than the earlier episodes, which can feel like being caught in a quirk-off between Spike Jonze and Slavoj Žižek. Essentially, Maniac is about the agony of isolation in an increasingly disconnected world. Owen suffers from mental illness (paranoid schizophrenia and grandiose delusions) that leads him to box himself (literally) in a nightmarish converted kitchen on Manhattan’s Roosevelt Island. The other main character, Annie (Emma Stone), is a grieving drug addict who scores an illicit, unapproved medication that lets her relive the worst time of her life over and over: the day her sister died. “I fucking love it,” Annie snarls by way of explanation. “Because I get to be with her.”

There are more prominent narrative elements: In Maniac’s main story, Annie and Owen enter a pharmaceutical trial for a new three-part drug that claims to be able to heal past trauma and fix mental disorders with the help of a supercomputer named GRTA. But again and again, the plot comes back to loneliness and its pathology. Annie’s mother abandoned the family when Annie was a child; after her sister’s death, her father retreated inside a kind of robotic isolation tank called an A-VOID that allows him to shun human interaction. Owen is the scion of a wealthy family but fits so awkwardly within it that he’s omitted from the family portrait. In some moments, he hallucinates that his hateful, abusive brother Jed (Billy Magnussen) is actually a decent person and a government handler named Grimsson who appears intermittently to remind Owen of his duty to save the world.

Dr. James K. Mantleray (Justin Theroux), the paraphiliac pioneer behind Neberdine Pharmaceutical Biotech’s experimental trauma treatment, has been booted from his own project at the beginning of the story. When viewers first meet him, he’s inside a virtual-reality porn Atlantis having sex with cartoons. James’s partner, Dr. Azumi Fujita (Sonoya Mizuno), was once romantically involved with him but the relationship ended due to his addiction to (as she puts it) “copulating with software.” He’s estranged from his mother, Dr. Greta Mantleray (Field), a celebrity therapist who publishes books with titles such as Past Lives, Present Pain and I’m OK, You’re a Bitch. And yet his biggest career project is a monument to his pain: GRTA, the computer in the Neberdine trial, is not only named after Dr. Greta but also based on her personality.

Beneath the stylistic frippery and the tonal hyperactivity, Maniac’s world is a bleak one. It seems to be set during the present moment, but in an alternate timeline that feels like the future in a Robert Zemeckis franchise. Technology is mostly retrograde (clunky mini-droids called PoopBots scour the sidewalks to clean up after dogs, and dot-matrix printers are still very much a thing), but other developments far exceed our own (like the fact that GRTA is able to connect directly into the pharma-test subjects’ brains). Some elements of Maniac’s society are plausibly absurd, in a dystopian kind of way: Lonely people can hire FPs, or FriendProxys, to interact with them. Annie earns money to fund her lifestyle by using an AdBuddy, a human who follows her around and reads commercial copy out loud. But even the AdBuddy is unhappy, to the point where an extended trip following Annie to Salt Lake City seems like the most fun she’s had in months.

After Annie and Owen enter the Neberdine trial, the show shifts modes, abandoning its oddball but meticulously constructed reality for a more surreal trip into the protagonists’ heads. GRTA, who’s grieving the death of a doctor (Rome Kanda) with whom she’d forged a meaningful romantic relationship, suffers a glitch that fuses the dreamscapes of Annie and Owen together. As they take the final two pills of the trial, which are intended to expose their behavioral traits and induce confrontation and catharsis with their inner demons, they find that their pathways are inextricably linked. One “dream” involves a crime caper on 1980s Long Island; another is set during a séance in 1947, with Annie and Owen playing con artists who are trying to steal the lost chapter of Cervantes’s Don Quixote.

The roots of their real-life traumas frequently permeate their dream worlds, like the woman with whom Owen became unhealthily fixated and the truck driver who killed Annie’s sister. But the common thread throughout the dream scenes is that the pair is stronger as a unit. In the weakest narrative escapade, a bonkers dream about aliens and NATO, Annie and Owen’s “characters” help each other triumph during a climactic gunfight. “Every time I separate them,” Dr. Fujita says at one point, exasperated, “they just find their way back together.”

These fantasy dream sequences often feel like wish fulfillment for Maniac’s creative team—the opportunity to leap through genres and eras and modes without the need for artistic cohesion. But Maniac is also clear about the purpose stories serve. As con artists, Annie and Owen seek out the lost chapter of Don Quixote because legend has it that “anyone who reads it is lost in their fantasies forever. They live in their own dream worlds until they die.” But the two don’t get lost in their dreams—they find catharsis. The drug trial provides immersive narrative frames that mimic different genres of storytelling: crime, fantasy, period drama, even absurdist Scandi-noir. Stories allow Annie and Owen to process their traumas and neuroses, Maniac suggests. Imagine what they can do for the rest of us.

As if to emphasize this point, Maniac is metafictional: It continually reminds you that it’s an invented yarn divorced from the real world (that’s in case the scenes with anthropomorphic purple koala bears playing chess didn’t already do so). In one scene, Owen’s mother (played by Trudie Styler) stands next to Jed as he serenades his fiancée (Jemima Kirke) with “Every Breath You Take,” a song written by Styler’s real-life husband, Sting. In a flashback, Annie’s sister Ellie (Julia Garner) struggles to take a picture of herself with a disposable camera and says, “They should make a stick for something like this.”

In the final two episodes, though, Maniac relaxes into something less hyperstimulating and self-aware, and focuses on its central purpose. The conclusion nods to the voice-over in the very first episode, as James narrated his vision for the Neberdine project over images of how the world began: with connection, convergence, cells coming together. “Camaraderie, communion, family, friendship, love, what have you,” Theroux says. “We’re lost without connection.” It’s a core operating principle that frequently gets lost in the scenes that follow, with their absurd humor, elaborate fantasias, and wackadoo dream sequences. But in its last moments, Maniac reminds viewers of what it’s been trying to say all along.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.