An essential job of great epic cinema is to conjure the unimaginable for viewers, to create glorious sights and give them depth and context, to try and take in the beauty of the natural world while also grappling with its terrifying force. James Gray’s The Lost City of Z succeeds in this task. A film about venturing into the unknown, it delves into mysteries that will never fully be solved and digs into the mindset of an explorer. But beyond that, it wants to depict the search for meaningful fulfillment, to try and understand why someone might risk life and limb in pursuit of the sublime.

The Lost City of Z is a miraculous movie, at once moving, intimidating, and gorgeous to behold. It’s a tale of colonial exploration that’s aware of the sins of the past, and a portrait of a driven, obsessive, flawed male protagonist that avoids the clichés of the genre. It feels like a work of classic Hollywood cinema, but without the arch, mannered quality that can come with a contemporary director trying to harken back to the past. Gray’s film is beguiling and poetic, capable of gluing you to the screen for every second of its languorous 150-minute running time and lingering in the brain for weeks after.

Adapted from David Grann’s 2009 work of non-fiction, The Lost City of Z follows Percy Fawcett (Charlie Hunnam), a British military man-turned-explorer who first ventured into the Amazon rainforest at the turn of the century. At first, Fawcett was dispatched as a surveyor, but eventually he became convinced there was evidence of a lost civilization hidden in the jungle, one as technologically advanced as any in the ancient world. Accompanied by a salty aide-de-camp, Henry Costin (Robert Pattinson), and, later, by his own son Jack (Tom Holland), Percy returned again and again to the Amazon in search of evidence he could bring home, flying in the face of then-held beliefs about the intellectual limits of “primitive” societies.

I haven’t gravitated toward Hunnam as an actor in the past, since he’s so often slotted into handsome leading-man roles entirely lacking in dimensionality (as in Pacific Rim). But as Percy, he’s sensational. His character is driven and haunted, but not insane or unfulfilled, given his happy marriage to Nina (Sienna Miller) and his obvious love for his three children. Hunnam portrays Percy’s fixation on the Amazon as something that’s not easily dismissed: A mix of ego, a desire for fame, and genuine intellectual fascination keeps pulling him back into a life of danger and long separation from his family.

His repeated trips find him boating down the Amazon river on simple rafts with Costin and other local guides, navigating the complicated political landscapes of Bolivia and Brazil as the region is ravaged by rubber tycoons, warring colonial powers, and the creeping threat of industrialization. Gray makes it clear that Percy is a white invader in a land he doesn’t understand, while recognizing that his contentions—that Amazonian societies had farmed the earth, built complex structures, and created pottery and art—were seen as absurd and borderline offensive in Great Britain.

The notion that such advanced civilizations could have existed in South America was widely dismissed in the West, but Percy had an empathy for the region that was unusual. While others are seeking to strip the Amazon’s resources away, he wants only to witness its ancient artifacts. Industrial-scale expeditions bring guns into the jungle to do battle with local tribes, but Percy simply tries to reason with them, looking to find common ground so that they can help him search more deeply into the jungle.

Gray captures all of these dynamics with appropriate subtlety. He doesn’t dismiss the danger that Percy and his crew face around every river bend, or inadvertent harm they could do to the rainforest by attracting more Westerners with their discoveries. But he also emphasizes that Percy’s fascination with the region borders on the religious, as if discovery of these ancient wonders will finally answer some formless question gnawing at his soul. How else to comprehend the mind of the explorer who returns to the Amazon over and over again with little more than a pack full of food and a compass?

Just as incredible, and unusual, is the amount of time Gray spends with Nina, who’s far from the lifeless stereotype of a wife at home that Miller has played many times before (in films like American Sniper and Foxcatcher). She’s a well-rounded partner to Percy, an idiosyncratic figure who strains against the sexism of her era while still supporting her husband in whatever way she can. Gray is committed to the emotional depth of every character, from the guide who leads Percy down the river to the self-important, prideful James Murray (Angus Macfadyen), a fellow explorer who accompanies him on a later trip, to the inscrutable but faithful Costin (easily Pattinson’s best screen performance to date).

At the same time, the director never loses sight of the natural wonders he’s trying to capture, or of the nebulous mysteries Percy is trying to fathom. Gray has long been a favorite of cineastes, but I’ve often found his work (such as 2007’s crime thriller We Own the Night or 2013’s period drama The Immigrant) gorgeous but frustratingly remote, technically well executed but emotionally distant. The Lost City of Z bridges those gaps—it’s beautiful to look at, but what makes it unforgettable is its deep compassion for its characters and their inner lives. It’s the best film of the year thus far, and it’ll be a hard one to top.