James Gray on the set of The Lost City of Z. Photo: Aidan Monaghan/LCOZ HOLDINGS, LLC

When people talk about how there are no more mid-budget, adult-oriented movies, they’re also talking, whether they realize it or not, about James Gray. Gray has been making films since 1994, when, at the tender age of 25, he wrote and directed Little Odessa, a gorgeous and affecting crime drama set in New York’s Brighton Beach. The film came out the same year as Pulp Fiction, but the two films couldn’t have been more different. Where Pulp Fiction practically bursts with Quentin Tarantino’s endless appetite for pop-culture history, Little Odessa is mature and existential, much in the tradition of serious European masters like Jean-Pierre Melville and Bernardo Bertolucci.

Gray would go on to make four more films set in New York City: two crime dramas, The Yards and We Own the Night, both starring Joaquin Phoenix and Mark Wahlberg; Two Lovers, starring Phoenix and Gwyneth Paltrow; and The Immigrant, starring Phoenix, Marion Cotillard, and Jeremy Renner. All five of these movies range from very good to great, but none of them seem to even hint that a movie like The Lost City of Z could be in Gray’s future.

An adaptation of David Grann’s nonfiction best seller of the same name, Lost City takes place in the jungles of the Amazon, and spans a 20-year period bisected by World War I. Plan B, the production company co-founded by Brad Pitt, asked Gray if he’d be interested in adapting the book in 2008, just before its release. “Why they thought to call me about this I have absolutely no idea — nothing in my prior body of work suggested that I would go off to Amazonia or the U.K. or anything like that,” Gray told Vulture recently. But he became fascinated by the character of Percy Fawcett, the English explorer who grows obsessed with the idea of a lost city that would prove the natives there had a culture far more advanced than Europeans had given — or wanted to give — them credit for. And it turned out, the story had just as much to do with the “Victorian chastity belts, a culture that was ossified” as it did the jungle.

“Exploration is noble, but there’s something also about wanting and needing to escape what is a very hostile and rigid culture,” Gray says. “I think part of it was that, and that appealed to me. I found that interesting, I understood it, I empathized with it in some way.”

By the time the subject of the movie finally comes up, we’d already spent half an hour discussing the ossification of our own culture. We talk about how New York City, the place in which Gray set his first five films, has changed so drastically since the mid 1990s; Gray says the Brooklyn of Little Odessa “is totally gone,” and that, while the 1920s tenements in The Immigrant are still there, they now tower above John Varvatos boutiques. Gray specifies that he’s less interested in romanticizing the crime-ridden city of the past than questioning what’s led to the kind of environment in which, he says, one of his friends seems to be the only person actually living in his apartment building on Central Park West, not using it as an investment.

The fundamental issue on Gray’s mind when we talk is how capitalism impacts our priorities as human beings. Saddled with student debt from the moment we set foot in a university, our ability to “study for the sake of learning” is over; instead, we’re “forced to become budding capitalists.” It’s a critique that received major airtime during Bernie Sanders’s campaign, and Gray’s clearly given it some serious thought. “We haven’t figured out a way to monetize integrity, and when you can’t monetize integrity, and you can’t incentivize integrity and incentivize individuality, and you pray at the god of the market, you get a very strange beast that almost consumes itself,” Gray says. “It’s almost like everyone is beholden to this market god, and nobody knows what to do.”

That, of course, has extended to the film industry. The Lost City of Z looks like, and in many ways is, a perfect example of the movies that supposedly don’t get made anymore — it’s an epic in the style of John Huston and Werner Herzog, starring brand-name actors like Charlie Hunnam, Robert Pattinson, Sienna Miller, and Tom Holland, that was shot on location in the jungle on 35mm film — and the film almost didn’t get made. It took six years from the time Gray received the book for production to begin in 2015, and the star of the movie changed three times, going from Brad Pitt — who is attached to head Gray’s next film — to Benedict Cumberbatch to Hunnam. In the meantime, Gray made a whole other movie, The Immigrant, and at one point, he’d more or less reconciled himself to the idea that it would never get made. For a director operating outside the studio system, where movies don’t have to exist in order to further a franchise or cinematic universe, every project is at the mercy of the market god, dependent on fragile financing, often cobbled together from multiple sources, and a distributor that won’t lose interest. While you can argue about whether financiers should pay for movies that can’t guarantee a profit, do we want to live in a world where profit is the only measure for green-lighting films? And based on the performance of most of the major studios, how accurate of a measure is that anyway?

More than the circumstances of its creation, though, there’s the movie itself: Unfurling toward doom, it takes on a rhythm highly unusual in contemporary film, one that promises no uplifting hero’s journey, but also no cathartic climax. Instead, Fawcett seems to fade into the fabric of his dream. It’s filmmaking as adventure: The form comes to match the function. Gray calls it his most ambitious film, and not just because of the logistics.

He could be rewarded for that ambition. While Gray has worked steadily for two decades, earning no shortage of acclaim and accolades, his movies haven’t exactly lit the box office on fire. Only one, We Own the Night, managed to make more than a few million dollars during its theatrical release; two suffered from disagreements with their distributor, Harvey Weinstein; and one, Two Lovers, had the unfortunate and incredibly bizarre luck of coming out during Joaquin Phoenix’s faux-rapper phase, which became his and Casey Affleck’s gonzo mockumentary I’m Still Here. (Phoenix was ostensibly promoting Two Lovers during his legendary Letterman appearance; Gray, ever forgiving, still cast him in his next movie.)

Just like in the rest of the American economy, Gray’s class of filmmakers is more economically precarious than ever. “You know, people assume that because I’m a director, I make tons of money. I am struggling financially,” Gray says. “Now, I’m very lucky I get to do what it is I want to do. I’ve made, good or bad, very uncompromising movies, the movies exactly that I wanted to make, and that’s a beautiful gift, so I’m not complaining about that. But I struggle. I have a hard time paying my bills. I’m 47 years old, I live in an apartment, I can’t buy a house. If I were coming of age in 1973, I would be in Bel Air. The whole reason for this is exactly what we were talking about, where the middle is gone. So now you have franchises, and you have, ‘I made a movie on my iPhone.’ This is the economic system in a nutshell, right? Five directors make Marvel, and then there’s the rest of us who are trying to scrounge around to find the money to make films. And it becomes a self-fulfilling prophecy: If the audience only gets to see Marvel, then they only want Marvel, and then if they only want Marvel, only Marvel is made. I don’t even have a problem with Marvel. The problem is not the specifics of each movie, the problem is it’s the only movie you can see now in a multiplex, and when it’s the only game in town, you’re looking at the beginning of the death throes of an art form.”

Fortunately, The Lost City of Z doesn’t feel like the death throes of an art form. It’s big, risky, and striving in a way that movies rarely attempt anymore, and it’s beautiful in a way that they rarely manage. With distribution from Amazon, which is releasing Z in conjunction with Bleecker Street, it’ll get to make its argument for the vitality of the mid-budget movie in both theaters and, eventually, on one of the major streaming services, a part of the new wave of how films are released. We might be surprised by what it finds.