Gorgeous and ambitious, pretentious and baffling, tightly controlled yet free-flowing, “The Tree of Life” is unlike anything you’ve ever seen before. And yet it’s very much the culmination of everything Terrence Malick has done until now — all four features he’s made over the past four decades.

All his thematic and aesthetic signatures are there from earlier films like “Badlands” and “The Thin Red Line”: the dreamlike yet precise details, an obsession with both the metaphysical and the emotional, an ability to create suspense within a languid mood.

It is simultaneously mesmerizing and maddening as it encompasses nothing less than the nature of existence itself. As writer director, Malick ranges far and wide, from intimate moments with a growing family in 1950s Texas to the dawn of time — complete with awesome images of the cosmos and, yes, those dinosaurs you’ve surely heard about — and back again.

“The Tree of Life” is deeply spiritual, but Malick isn’t one to preach. Instead, he gives you the sense that he’s genuinely asking questions to which the answers may be unknowable — he’s putting them out there for himself, and for us all. Of course, we’ll never know his intentions: Malick is notoriously elusive, which is admirable from an artistic perspective but probably frustrating for those who’d like to know what the hell he means by all this.

But if you’re open to letting the imagery wash over you, to allowing yourself to get sucked into the film’s rhythms and fluidly undulating tones, you’ll be wowed. And even if you’re not a spiritual person yourself, given to the kind of seeking that frequently marks the characters’ voiceovers in “The Tree of Life,” you’re unlikely to find the film’s religious themes alienating.

“Lord, why? Where were you?” wonders the mother in the family, played as an idealized vision of nurturing womanhood by Jessica Chastain. “Who are we to you? Answer me.”

Malick offers an intriguing contrast between these heavy, eternal concepts and prosaic childhood memories: light, wispy snippets of sight and sound, of trees and sky and grass, of a mother’s voice. (The technical elements here are just stunning, including Emmanuel Lubezki’s cinematography, Jack Fisk’s production design and Alexandre Desplat’s score). These moments are intentionally impressionistic — and “The Tree of Life” feels defiantly plotless and, sometimes, self-indulgent — but they all represent an accurate depiction of how our early recollections can come back to us in fragments. Some are idyllic, while others are frightening.

Eventually, “The Tree of Life” becomes rooted in the reality of the O’Brien family: a father (Brad Pitt), mother (Chastain), and three little boys. Pitt makes the character an intimidating figure, a capricious mix of toughness and tenderness, and it’s probably the best work of his career. Chastain, a relative newcomer to the screen, balances him out with sweetness and grace but also with a playful nature and an open, expressive face; you get the sense that she only wants happiness for her children, in whatever form it comes to them.

But Hunter McCracken, the young actor playing Jack, the eldest of the three sons, has a startlingly confident and commanding presence, especially given that this is his first film. McCracken more than holds his own opposite Pitt, with whom he repeatedly clashes: He’s truly the star. Jack will grow up to be played by Sean Penn, a Houston architect who’s still shaken by a family tragedy decades later. This is one of the chief weaknesses here: Malick has Penn available to him, and all he does is ask him to walk around moping in Armani suits.

Still, “The Tree of Life” changed my mood for the rest of the day, too — and when you see a lot of movies, most of which tend to flee your memory leaving nary a trace on your heart or mind, that’s rare. And it can’t easily be dismissed.