We know D.C. Get our free newsletter to stay in the know.

It is best if you go into Palm Springs without knowing anything. Its surprises are a big part of its charm, and yet previews for the film make no attempt to hide its bizarre premise. Rather than being spoiler-free, this review will assume you’re either aware of its plot, or don’t care that it is revealed to you. This is a love story about two depressed, anxiety-ridden people whose mental states are constantly deteriorating. But it is also demented, charming, and funny as hell.

Andy Samberg is Nyles, and he is a guest at a wedding in California. His behavior is erratic. He seems aloof and drunk—he is wearing swim trunks and a Hawaiian shirt, while everyone else is in a suit—and yet he is somehow able to predict the future. This casual bravado intrigues Sarah (Cristin Milioti), so she agrees to leave the wedding for a casual hookup. Then things get really strange: Both she and Nyles are sucked into a glowing cave, and they wake up in the exact same place they were the day before. They are stuck in a time loop. Nyles has likely been in it for years, while Sarah just started. Now that Nyles has a partner in crime, he is able to share his strange existence with someone else, and possibly develop feelings for her.

The most obvious reference point is Groundhog Day, and yet no one in the film references it. Screenwriter Andy Siara and director Max Barbakow realize that kind of self-awareness would cheapen Sarah’s slow discovery of her predicament and eliminate crucial character beats. More importantly, the sense of humor in Palm Springs is more absurd and dark. Nyles was probably given that name because it sounds like “nihilist,” and indeed he wanders through the wedding as if nothing matters. He decides the time loop is liberating because the alternative is too much to bear, so that leads to scenes of mayhem, like when he and Sarah steal a plane or plant a bomb at the wedding reception. Sarah has her own dark impulses, and part of the film’s charm is how carefully they’re revealed.

All the characters in Groundhog Day sound like sitcom characters. They are clever and pithy when they need to be, and the big emotional beats are overwritten in a reassuring way. But in Palm Springs, Siara really digs into what might happen to people who are stuck in a time loop for eternity. Nyles’ dialogue sounds articulate, at least until you stop and think about what he is saying for a moment, and realize his brain must have atrophied. There is a sad, strange scene where he realizes he cannot remember what he does for a living. Sarah goes the other way, using the time loop for a specific kind of growth. Their impasse represents two contradictory, yet recognizable impulses in human nature.

Aside from the philosophical and psychological aspects, Palm Springs is also engaging as a romantic comedy. Samberg and Milioti are evenly matched, with his slacker energy serving as a foil for her destructive type-A impulses. Their common ground is their predicament, and a commitment to drinking alcohol (the characters almost always have beer in their hand). J. K. Simmons plays Roy, another key character, and he adds a gnawing sense of suspense and surprise to every scene. He and Nyles have a curious relationship, and that subplot resolves in a resonant way that does not rob the characters of their edge.

Palm Springs arrives at a time when our weeks and months have blended together. There is prescience to the film, although I suspect many of us would rather be stuck in a California hotel with a nice pool, instead of our homes full of frozen meals and unfinished puzzles. Barbakow finds the right look for film, imbuing it with yellow hues, like the characters are hungover from too much sun. And everyone’s deadpan nihilism comes with a weary sense of acknowledgement. It is hard to imagine a riff on Groundhog Day being much better than this.

Palm Springs is available to stream on Hulu starting July 10.