After the trillionth commercial for a film that features animals chanting “Look at her butt,” a parent might well despair of anything worth watching — or even enduring — with a kid. But “Kubo and the Two Strings” is a phenomenal film for persons of any age, with its challenging, mythical story and stunning stop-action animation. From Laika Studios, which gave us “Coraline” and “The Boxtrolls,” this is another masterpiece set in a miniature world.

In ancient Japan, young Kubo lives a solitary existence with his mother. She is haunted by their past, in which they fled his grandfather, the Moon King, a vengeful god who stole Kubo’s eye and killed his warrior father. Kubo spends his days in the village, telling tales of adventure using magical origami paper that thrills the villagers (and viewers). His mother is often catatonic, but occasionally tells him stories of his father, and warns him not to stay out after dark.

Eventually, of course, Kubo does stay out after dark, and is set upon by his terrifying twin aunts (Rooney Mara), who are still their father’s henchwomen. His mother engages with her sisters in battle, and Kubo is sent on a quest, accompanied by a monkey talisman come to life (Charlize Theron) and his origami creations. They meet a giant beetle (Matthew McConaughey) and form a makeshift family. The voice performances crackle with warmth and chemistry, and a script based in myth feels very relatable.

Beyond the stunning set pieces — such as a glorious boat made of leaves, a gigantic skeleton and an underwater garden of eyeballs — there is a thoughtful, inspiring story about death, grieving and memory. Laika’s films have never been afraid to tackle scary subject matter and always in a beautiful, quirky way. Think of the terrifying Other Mother in “Coraline,” who gives you want you think you want but makes you her prisoner. “Paranorman” is all about the afterlife. These stories look at these subjects, but give kids and adults comfort if they watch long enough.

So, too, does “Kubo and the Two Strings,” which launches its plot from a graveyard where the living are paying tribute to and communing with the dead. Plenty of kids’ stories feature dead parents, but this one really intersects with both “the afterlife” and life after death, for the living left behind. It is exceptionally moving — utterly fantastic but also emotionally realistic. As Kubo admits at the end of the film, “This is a happy story, but it could be happier.”

But don’t let me sell short the fun and excitement of Kubo’s adventures. An austere opening sequence on the ocean, reminiscent of the famous Japanese block print “The Great Wave off Kanagawa,” soon gives way to Kubo’s wonderful street performances with his magical origami paper and the film is off to a delightful start. Plenty of animal antics kept my 5-year-old son laughing, and battles were fierce and thrilling. Meanwhile, my 10-year-old daughter grasped the film’s many details that lead to its surprising and ultimately profound conclusion.

Thematically, “Kubo and the Two Strings” is more challenging than some kids’ movies, but the rewards are also greater. Most kids will remember the gigantic skeleton and his glowing eyes, but the story’s deeper meaning will last a long time, and the comfort it offers at the death of a loved one is more than many “grown-up” stories can provide. Both the story itself and the visual magnificence with which it is presented make this nothing short of a masterpiece.

“Kubo and the Two Strings” is currently available to rent.