With just two movies, the 31-year-old writer-director Ari Aster has carved out a special place for himself. He’s making luxuriously dread-infused art horror films for the megaplex. It’s not necessarily a unique place: Jordan Peele got there first — and it’s telling that in the work of both filmmakers, you can feel the thread of ’60s and ’70s horror (“Rosemary’s Baby,” “The Stepford Wives,” “The Wicker Man”) running through a gripping new consciousness. Yet Aster, in last year’s domestic ghost-story shocker “Hereditary,” and in his new movie, the epic pastoral Swedish commune creep-out “Midsommar,” has created a niche that’s destined to be controversial, because he’s throwing mainstream audiences curveballs right and left.

“Hereditary” was the rare horror film that had an ambition as deep, wide, and complexly disturbing as that of any independent feature. In “Midsommar,” Aster’s reach is even bolder — he has made a sun-dappled socio-pagan cult nightmare that connects to our time in ways that explode in your head long after the movie is over. Yet in both films, especially the new one, there are elements of indulgence to his method.

Last year, I saw “Hereditary” with a mainstream audience on opening weekend, and by the end there was visible head-scratching hostility. The film was a success (it grossed $44 million, making it the most widely seen film ever distributed by A24), but as I wrote at the time, it tapped into the cinematic equivalent of a blue state/red state divide: audiences open to its mysteries, as well as those angered by its refusal to play by the cut-and-dried rules of consumer horror.

With “Midsommar,” the divide is likely to get even more pronounced. To watch (or, at least, enjoy) this movie, you’ve got to sign on for its vision and look past its flaws — the 2-hour-and-27-minute running time, and (more notably) the storytelling nuts and bolts that the movie sometimes fudges. As Andrew Barker pointed out in his Variety review, there are ways that “Midsommar” doesn’t quite work. Yet I‘d still characterize it as a must-see. Aster is out to unsettle us in primal ways, and he does — with “Midsommar,” he has made a movie that leaps ahead of the curve in addressing the real-world horror that America, and maybe the world, now faces.

I’m one of those viewers who was blown away by the ending of “Hereditary,” in which we finally got to see why the film’s central figure, a bewildered high-school stoner (Alex Wolff), was being plagued by catastrophes, dream signs, lurid premonitions. Usually in a movie, when the ghosts are haunting you, there’s a war between good (you) and evil (them). But in “Hereditary,” it turned out that the hero wasn’t being attacked — he was being wooed, prepared for his new role. The film’s finale was a freak-out that submerged the audience in the Other Side more indelibly than “Poltergeist” or a hundred other “Hello, we’re the paranormal!” thrillers. As I said at the time, what I glimpsed in that surreal step through the looking glass was the ghost of “The Wicker Man,” the 1973 British mystery-thriller that’s one of the singular horror movies of its era.

It’s a film set on an island in the Scottish Hebrides, full of gnarly blokes in pubs, that turns out to be a secret sect of Celtic pagan worship. There are dances around the maypole and nymphs leaping through fire, and there is Christopher Lee, sinister in a benevolent sherry-club way, as if he were presiding over a kinky episode of “Fantasy Island,” as the commune’s lord and master. There’s period kitsch in “The Wicker Man,” yet the movie taps into something memorable: a death cult that wears a gleaming smile, as if it were the missing link between Charles Manson’s followers and the Jonestown horde. In spirit, the film takes off from the last scene of “Rosemary’s Baby,” with all those devil worshippers gathered for a party in the Castavets’ apartment — a terrifying vision of middle-class evil. Yet “The Wicker Man” lands, if anything, in an even more unruly place. Watching it, you can’t see the devil, but you can see the scary power of mass belief.

“The Wicker Man” was one of a handful of films that “Hereditary” drew upon, but “Midsommar” is a veritable remake of it. It’s about a small, close-knit group of American grad students who follow their friend and colleague, the smooth-talking Euro hipster Pelle (Vilhelm Blomgren), on a trek to the Swedish countryside to visit the Hårga commune he grew up on. The commune’s members are about to launch a once-every-90-years version of their midsummer solstice festival, though the real reason that Pelle’s friends are tagging along is that they’ve got visions of Swedish erotic bliss dancing in their heads. They may be intellectual academics (one, played by William Jackson Harper, is doing his anthropology thesis on European cult rituals), but they’re also bros out for adventure. That’s why it’s such an inconvenience when Christian, played by Jack Reynor (who’s like Chris Pratt’s brainy brother), feels that he’s got to take along his girlfriend, Dani (Florence Pugh), who is still recovering from a hideous family trauma.

Has there ever been a movie that turned evil into a bright sunshiny day the way “Midsommar” does? The characters are heading for the land of the midnight sun, and as soon as they arrive in the idyllic Swedish countryside, where they take magic mushrooms and fuse with their surroundings (Dani looks down at the grass and sees blades of it sprouting up through her feet), they’ve entered a psychedelic wildflower Eden of dread, a place overrun by shiny happy people holding hands in white-cotton Amish-hippie folkdräkt. The happier the place seems, of course, the more sinister it is.

The most radical thing that Ari Aster does in “Midsommar” is to cut out any whisper of conventional genre mechanics. Jordan Peele didn’t shun that stuff in “Get Out” — a movie, in structure and spirit, that’s a kind of cousin to this one. He crafted a head-trip nightmare that was also a tightly wound drama of retaliation and escape. “Midsommar,” by contrast, unfolds like a languid dream of blood and fear in the sun, but I actually wish that the film had been more shockingly violent — that the horrors visited upon the main characters had more of a scary-existential this is really happening vibe.

If you’ve seen “The Wicker Man,” and even if you haven’t, you sort of know what’s coming in “Midsommar” even when you don’t know. There are a lot of surprises, and I was never bored, but in a movie that starts with an hour-and-and-a half of slow-burn fuse, we ultimately want more than surprise — we want revelation. We want awe. And once we’ve seen the commune kill off two of its tribal elders in a rite of sacrificial euthanasia (“We stick our elders in nursing homes,” says Christian, trying to explain it. “I’m sure they find that really disturbing too”), we’re primed for violence. When it arrives, it’s not nearly as startling as it could be.

What is powerful about “Midsommar” is its vision of a cult of holistic extremists that connects, in unusual and resonant ways, with the emerging spirit of today. I have no idea if the Swedish commune of the Hårga has any basis in reality; it seems more like a fusion of movie tropes, from “The Wicker Man” to the maids in floral headdresses to the glowering tribal leaders to the way that key characters are named Pelle and Ingmar.

But the key element of real-world grounding is that, though the Hårga are presented as a primeval fertility cult, they’re really a counterculture commune out of the late ’60s and early ’70s — a daisy-chain fascist love-in, a vision of contemporary people embracing a trippy, sexed-out, timeless ideal of going back to nature. And though the communes of the ’60s and ’70s mostly fell apart, what remained was the counterculture vision of shared, and merged, identity. That, ironically, is the true nightmare of “Midsommar.”

The ’60s didn’t just give us a lot of progressive causes, along with quaintly dated hippie sentimentality. It gave us what was once referred to as the human potential movement, which started with things like est and the Naropa Institute, which were about people devising new ways to set aside their egos and “connect.” And that impulse has never gone away. If you’ve ever spent a weekend at a New Age retreat (or maybe a corporate seminar), you know that impulse is planted, more than ever, at the center of the culture, where it is now hooked up with the mystique of digital “connection.” What we mean when we say “the ’60s” may be ancient history, but the hidden legacy of the ’60s is that we’re increasingly a nation of sects, tribes, people obsessively seeking out those of like-minded desire. There’s a case to be made that we’re now evolving, in our thinking, into a nation of cults, which is why, when it comes to politics, rationality seems, more and more, to have vacated the building — not only on the right (though primarily there), but on the left as well. Debate, more and more, seems over. It has been replaced by the fundamentalism of belief.

The horror of “Midsommar” is that innocent people die, in gruesome ways. But the real horror of “Midsommar” is that Florence Pugh’s Dani, drawn to the center of her own shattered identity, replaces it by becoming the self-actualized queen of her surroundings. Dani, in this movie, is really all of us. She loses herself, only to find her new self. She sheds her skepticism and joins the group. She fixes her broken relationship with her lover by reducing him to a piece of timber. She heals her trauma by giving her benediction to flowers of evil. And she does it, in the end, with a smile.