The gimmick, if you want to call it that, in “Loggerheads” is that it follows three different but intertwined stories set in three different years. Internal clues tell us whether a particular plot is set in 1999, 2000 or 2001, but for maximum enjoyment, I recommend not worrying about the chronology. It is a well-acted film, and almost a beautiful one at times. If its ambition overreaches its abilities, well, there are worse crimes than that, aren’t there?

The film is set in various places in rural North Carolina, among the small towns and green forests. We first meet Mark (Kip Pardue), a young gay man without a home, passing through the seaside town of Kire Beach and occasionally sleeping on the beach itself. George (Michael Kelly), a local man with a dull job at a motel, takes a liking to Mark and gives him a place to stay.

At another time in nearby Eden, N.C., preacher Robert (Chris Sarandon) and his wife Elizabeth (Tess Harper) live a serene existence that has become increasingly marred by the intrusions of the outside world, exemplified by the new arrival of an apparently gay couple across the street, and by a nude statue that an otherwise pious neighbor has placed in her front yard.

And at another time in another nearby place, there is a woman named Grace (Bonnie Hunt) who has returned to her hometown after a breakdown and suicide attempt to find the child she gave up for adoption many years ago.

These stories don’t appear connected at all until about halfway through the film, when things start to come together and we realize what connections the people have to each other. There are some very pleasing surprises, things that make you smile and admire the masterful way in which all the threads have been tied.

Writer/director Tim Kirkman, who says the film is based on a true story, finds his theme in the loggerhead turtles, which always return to their birthplaces to lay their eggs. How a turtle knows on which patch of beach it was born when most patches of beach look about the same is a mystery, and Kirkman finds beauty in it. People, too, are drawn to their roots, even if they have consciously sought to avoid them, as some of these characters have done.

Religion is another strong theme, and I was surprised to see a modern film use a Bible verse to make a point — not ironically, and not to show the perceived hypocrisy of Christians, but sincerely. That sort of thing isn’t done often.

The cast is strong all around, though it is the women who give the most piercing performances. Tess Harper is poignant as Elizabeth, the preacher’s wife who is torn between her husband and her son, between old-fashioned ideals and modern realities. There is also a nice turn by Robin Weigert (from HBO’s “Deadwood”) as a woman who helps Grace track down her child.

But it is Grace herself who gives the film its heart and soul. Bonnie Hunt has long been treasured as a comic actress, with only a few brief dips into the dramatic pool, but her performance in “Loggerheads” shows a depth and range I didn’t know she had. Using her built-in rapport with the audience — everyone automatically loves Bonnie Hunt, after all, whether they realize it or not — she works Grace into a three-dimensional figure of sadness and melancholic optimism, a woman who hopes for things that she fears she will never have. It is impossible not to root for her.

That said, the movie tends toward melodrama at times, discovering as it goes that the line between honest emotion and sap is perilously thin. Mark and George’s story, for example, is more involving on paper than it is in the film. But Kirkman’s attention to detail and his deft handling of the interlocking plots make the film worth seeing.

B- (1 hr., 41 min.; PG-13, one F-word, some other mild profanity, some sexuality.)