Mirabelle Buttersfield is a sensitive soul, a painter, the kind of woman who would have a cat named after Sylvia Plath. She’s also the kind of woman who sleeps with both a 50-year-old socialite and a dork she meets at the laundromat. These mysterious aspects of Mirabelle and many others are explored in Steve Martin’s invigorating new film, “Shopgirl,” a romantic comedy that finally gets love right.

Instead of trying to explain relationships, the film delights in the confusion of affection and growing up. Martin has a hawk’s eye for truth and detail, writing from a position of experience about young-adulthood. Mirabelle (Claire Danes), a young glove saleswoman at Saks Los Angeles, feels vacant and unfulfilled. One day she meets Jeremy (Jason Schwartzman), an awkward but likeable stencil enthusiast. Both lonely, they decide to ignore their differences and have a one-night stand. Mirabelle moves on, but Jeremy can’t stop thinking about her.

Enter Ray Porter (Steve Martin), a rich logician. He sweeps Mirabelle off her feet with expensive gifts and great sex. Meanwhile, Jeremy goes on the road with a rock band. Both engage in a struggle of identity and must make a decision about the kind of love they really need.

Putting “Garden State” to shame, “Shopgirl” gets at the pain and confusion of the decade between childhood and adulthood commonly referred to as our twenties. Pinpricks of truth shock through the normal comfort zone of comedy — it is clear that Martin is reaching for the hard stuff of life, the uncomfortable hidden emotions.

Danes helps him mine these depths with a superb performance. Glowing, yet so sad, Mirabelle hides her true self like a wrapped present. Despite baring her emotions, she always remains enigmatic. At odds with the predictable trajectory of the film’s love story, it is never quite clear what Mirabelle will do. She is the wild card, the great mystery.

Director Anaud Tucker infuses the entire film with this beautiful ambiguity. “Shopgirl” is about magic, the real kind, that unexplainable connection we make with somebody else. Emphasizing this, Tucker’s sweeping pans and zooms elegantly link disparate elements, although he sometimes goes overboard. He gently directs the film with slow shots and beautiful close-ups, exploring the L.A. landscape in a new, welcoming way. Barrington Pheloung’s warm, textured score and Peter Suschitzky’s luminous cinematography fit each other like hand and glove, collectively conjuring the film’s fairy tale atmosphere.

“Shopgirl” is also charming for the things it doesn’t explain.

The film is full of factual inconsistencies: Mirabelle looks through a pair of binoculars down at L.A. and happens to see Jeremy, Jeremy dials Mirabelle when her phone is off the hook and she picks up. But these “mistakes,” when paired with such a deeply personal script, seem to celebrate the coincidences in life. True to that spirit, Martin’s characters change off-screen as well as on, demonstrating that the personal moments of life sometimes resist capture.

Sophisticated without avoiding the down-and-dirty topic of sex, “Shopgirl” treats its fragile characters with dignity. Danes’ sex scenes with over-the-hill Steve Martin would be shocking if they weren’t treated so tenderly and honestly. Likewise, her sex scene with Jeremy, in which he pounces on her like a caged animal, manages to be not pathetic, but uncomfortably familiar.

“Shopgirl” isn’t without flaws. A stupid subplot involving Jeremy and an Anna Nicole Smith-esque Saks employee could have been cut out of the film entirely. Also, Martin’s oddly dispersed narrative sequences jar the mood somewhat.

But the film’s triumph lies in its refusal to be ironic or guarded. Like “Closer,” “Shopgirl” doesn’t put up with posturing, but rather illustrates the dirty mechanics of relationships.

“Shopgirl” takes place in an adult world, one born out of L.A. freeways and the isolation of city life. And yet Mirabelle’s story is both illuminating and magical, a trip into the wonderful, yet painful, realities of another life very much like our own. Her journey to find love unmasks our common loneliness and shows that it is simply another part of life.