The end of the word is nigh in this enjoyably offbeat rom-com from the first-time writer-director Lorene Scafaria. Very nigh indeed – in a few short weeks, a gigantic asteroid will slam into Earth, wiping out all of mankind. Which is especially bad news for Steve Carell's newly single insurance salesman. Because the only thing worse than dying in an apocalyptic firestorm, this film suggests, is dying alone and unloved. Essentially, Scafaria has re-imagined Lars Von Trier's planet-smashing gloomfest Melancholia as a quirky road movie in the spirit of Alexander Payne's About Schmidt.

Scafaria is best known for scripting the 2008 young-adult comedy Nick and Norah's Infinite Playlist. Her directing debut is a superior effort, its slightly uneven tone redeemed by the reliably sympathetic Carell in a typically deadpan suburban everyman role. With its sharp script and bittersweet humor, the audacious premise feels fresh enough to earn a large word-of-mouth audience among moviegoers who normally would avoid a more conventional rom-com, potentially becoming a left-field breakout hit in the mode of Juno or Little Miss Sunshine.

Looking a little more gaunt and haunted than usual, Carell plays Dodge, a timid middle-rank office drone whose life clearly has been a series of quiet defeats and creeping disappointments. With the apocalypse looming, fate deals Dodge an extra slap when his wife walks out on him to spend her final few weeks with her previously secret lover. The brief cameo appearance by Carell's real offscreen wife Nancy is a neat in-joke here.

Lonely and suicidal, Dodge resists invitations from his friends to spend their final few weeks immersed in one long booze-addled swingers party. Instead, his life takes a bizarre new turn after he is saddled with an abandoned dog and becomes a reluctant love-life confidant to his emotionally fragile young English neighbor Penny, portrayed by Keira Knightley with just the right degree of irritating kookiness. A free spirit with an amusingly self-absorbed musician ex-boyfriend (Adam Brody) and a fetishistic love for the smell and sound of vintage vinyl, Penny is a kind of fantasy girl-geek designed for maximum appeal to middle-aged male indie-rock fans. Scafaria clearly knows her target audience well.

Forced from their apartment block by a rioting mob, die-hard romantic Penny persuades Dodge to take her on a cross-country road trip that potentially could reconnect her with her family and him with his long-lost childhood sweetheart, Olivia. Commandeering a stolen truck whose owner has arranged his own macabre suicide by execution, they cruise along spookily empty back roads and eerily depopulated suburban streets. Their journey becomes a succession of odd characters and eye-catching spectacles: military-trained survivalists, overzealous traffic cops, a mass baptism in the ocean. Inevitably, sexual tension develops between this odd couple of lost souls.

Just as the real subject of Melancholia was not planet-crunching sci-fi spectacle but soul-crushing depression, the true theme of Seeking a Friend is the finite nature of time and how foolishly we ignore it. Scafaria never once shows the approaching asteroid or the doomed Armageddon-style shuttle mission that fails to arrest it, instead laying out her premise with admirable economy via TV and radio news reports. Her end-of-days plot is essentially an allegory for everyone's limited lives, the accelerated deadline adding an extra edge of futility to most human activity, whether sweating at the gym or striving for promotion at work.

Shooting her nonspecific Southern California locations in bright hues and constant sunshine, Scafaria maintains a cheerfully ironic and unpredictable tone for the first half of the movie, scoffing at vanity and self-delusion with sharply observed social observation. Like the suburban dinner party that degenerates into a desperate bucket-list orgy: "Put Radiohead on!" one guest demands, "I wanna do heroin to Radiohead!" Later, in a stand-out comic set piece, Dodge and Penny visit a TGI-style roadside diner apparently staffed by a cult of free-love stoners. Amplifying the happy-clappy weirdness normally found in such places by just a few degrees, this is inspired satire.

The cynical screenplay softens a little during its final act, bowing to familiar Hollywood tear-jerking tropes -- a screen legend makes a late appearance as Dodge's estranged father, adding a superfluous twist of unresolved Daddy Issues. In fairness, Dodge's search for his lost childhood sweetheart resists cliché with an agreeably ambivalent offscreen farewell. But Scafaria's take-home message, that budding romance with a virtual stranger is the best comfort in the face of impending apocalypse, feels a little too corny.

After 100 minutes of gallows humor and surprise left turns, Seeking a Friend leaves us with a disappointingly banal observation: All you need is love. It is hard to imagine Payne or Von Trier letting such fortune-cookie whimsy sweeten life's harsh lessons. But that said, Scafaria and her two likable leads have made a witty, warm-hearted and impressively original addition to the rom-com ranks.