Dylan O’Brien, left, and James Sweeney in Twinless (Roadside Attractions)

Roman (Dylan O’Brien) may not be the brightest, but he’s an earnest, puppy dog-eyed thirtysomething mourning the recent accidental death of his identical twin, gay brother Rocky (also O’Brien). Dennis (the film’s writer and director James Sweeney) is the opposite: deadpan, sardonic, and shifty. But Roman and Dennis slowly begin a friendship outside of their small support group for those who have lost twin siblings, starting with casual trips to the grocery store and ending with a trip to a hockey game.

Dennis may be an enigma to Roman and others, including his perpetually bubbly coworker Marcie (Aisling Franciosi), but after a credit sequence 20 minutes into the film, Sweeney’s incisive, enveloping film reveals the roots of Dennis’s roiling obsession for both Roman and Rocky.

The plot could have been a run-of-the-mill, pulpy Single White Female tale about predatory obsession, but the script is consistently funny and astutely written, where sorrow often collides with humor. A laughably awful, out-of-tune violin performance of “Danny Boy” at Rocky’s funeral sets the tone right away.

This self-aware film never tips over into excessive coyness. It constantly references popular culture duos like Abbott and Costello, the Olsen twins, and a bag of Pop Tarts. When Roman opens a bag that houses not the usual two, but strangely only one, it reminds him of his loss. The soundtrack includes Jennifer Paige’s “Crush” and a car sing-along to identical twin duo Evan and Jaron’s “Crazy for This Girl,” one-hit wonders that these millennial characters would probably know well—and songs that also describe Dennis’s longing.

Complicated, richly drawn characters, performed by the ensemble, ground the story. Sweeney smartly doesn’t keep Marcie locked in her cheery state for too long, and Franciosi is excellent at portraying her character’s open-faced innocence as well as her cunning intelligence. Even though it is a small role, Lauren Graham is affecting as Roman and Rocky’s mother. In a poignant moment, she describes herself as a “storage unit” hanging onto her dead son’s things.

The movie seems written for O’Brien to shine and take up most of its emotional energy, which is perhaps why Sweeney is fittingly overshadowed in his wake. O’Brien balances both roles with acute characterizations. Roman, with his charming, stunted way of talking and his misspeaks—like saying “ladder move” instead of “lateral move”—is a well-realized, intricate character. Though taciturn and halting in his support group, Roman finally unloads his grief to Dennis in a great piece of acting by O’Brien. His Rocky is the opposite of Roman: smooth, talky, worldly, and seemingly at ease with himself. In this year alone, O’Brien has shown tremendous range and a sense of playfulness between this film and his sleazy drug pusher turn in Ponyboi.

One could see how Twinless could have been an effective stage play, moving through its rich dialogue and plot mechanics at a quicker pace, but there are so many wonderful cinematic touches here. Reminiscent of Edward Hopper’s city paintings, Greg Cotten’s distinctive cinematography emphasizes the story’s elements of alienation for both Roman and Dennis in the pristine, artificially lit modern urban locales of its Portland setting: late hours at a tech office; a lone diner at a table in the window of a restaurant; and sleek, soulless apartments in the sky. In the use of split-screen, Sweeney also employs one of the most enjoyable elements of Brian DePalma, well known for his thrillers about twins and doubles.

I first viewed Twinless at the Provincetown Film Festival earlier this summer. Despite the narrative surprise at its crux, the movie continues to work on subsequent viewings, with its pangs of unrequited queer desire remaining potent, and its sly camp elements amusing.