How you respond to Quentin Tarantino’s dazzling elegiac fairytale Once Upon a Time in Hollywood may depend on how much you like old guys, people who see how the changing of the guard is leaving them behind, who are beginning to reckon with the ways their bodies will betray them, who have seen their profession change so much that they can barely keep a toehold in it. You’ll also need some affection for Los Angeles, past and present, for the way, unlike other American cities, it keeps its ghosts around for a long, long time: They’re poured into martini glasses at Musso & Frank, or they rush like a traveling breeze alongside the mosaic tiles of LAX’s Terminal 3. You don’t have to remember every television show—Mannix, The FBI, Bonanza, The Green Hornet—from 1969, when the film is set. Just recognize that pop culture used to be a very different creature: In the old days it didn’t come to you, parceled out in personalized packets via earbuds; you had to come to it, yielding first to its time slot and then to its charms. That, or wait for the rerun.

It also helps to have some feeling for the tragedy of one fledgling movie star who was murdered almost before anyone could get to know her name: Sharon Tate, the pregnant wife of Roman Polanski, was stabbed to death in Benedict Canyon by members of the Manson family on August 8, 1969, along with three friends, celebrity hairstylist Jay Sebring, aspiring screenwriter Wojciech Frykowski and coffee-fortune heiress Abigail Folger. (Polanski was in London working on a film.) Tate had done some TV and a handful of movies at the time of her death; as an actor, she was winsome and elegant at once—her beauty was delicate without being fragile, and she seemed to have a sense of humor about how unreally gorgeous she was. The career she didn’t have is itself a kind of ghost, and you can occasionally feel it rustling through Tarantino’s movie: It is, above all, a Valentine to her.

Once Upon a Time in Hollywood is Tarantino’s most affectionate movie since Jackie Brown (1997), the picture that remains—the idolatry surrounding Pulp Fiction notwithstanding—his masterpiece. Tarantino is at his best when he’s motivated by affection, and for that reason, Once Upon a Time in Hollywood ranks among his finest; the serrated bitterness of his last picture, The Hateful Eight, has vanished. This is a tender, rapturous film, both joyous and melancholy, a reverie for a lost past and a door that opens to myriad imagined possibilities. Like all of Tarantino’s movies, it’s filled with references you may or may not get: There are woolly, rambunctious Jack Davis caricatures from MAD magazine, nods to blond dream girls like Joey Heatherton and Anne Francis, allusions to the brutally electric spaghetti westerns of Sergio Corbucci. But what you don’t recognize, you can Google; new worlds await. This is a welcoming picture, not an alienating one, an open door into a vanished world that still feels vital.

You could also look at it as Tarantino’s own Wild Bunch, a story of outmoded gunslingers getting their last blast of glory. Leonardo DiCaprio and Brad Pitt play Rick Dalton and Cliff Booth, a fading TV star and his longtime stunt double, two aging guys who have practically grown up together. They were in clover when Rick was a ’50s TV star, on a western series with a jaunty horse-trot of a title, “Bounty Law.” But those days are gone, and Rick has been relegated to playing the heavy in random TV episodes. There’s not much for Cliff to do but to drive Rick around and keep him company, though if he occasionally shows glimmers of resentment toward his more famous pal, the loyalty between the two is unshakable. (Cliff, as the movie’s unseen narrator puts it, is “more than a brother and a little less than a wife” to Rick.)

Brad Pitt stars in Columbia Pictures Once Upon a Time in Hollywood" Andrew Cooper—CTMG, Inc.

Cliff is also the more well-adjusted of the two, even though he has less money and less status than his TV-star friend. Rick lives in a comfortably appointed house on Cielo Drive—his new neighbors, renting the house next door, are newlyweds Tate and Polanski. Cliff lives in a disheveled trailer with a pit bull named Brandy, a sweetie-pie with a satin-gold coat and jaws of steel. But while Rick is rattled by insecurity over no longer being a leading man—he cries in gratitude when a pint-sized but ineffably wise young actor compliments him on a brief scene—Cliff takes everything in stride. He tools around the city and its environs, wearing a Hawaiian shirt as if it were a tuxedo—all of his class comes from the inside. He keeps seeing the same hippie girl around town, an underage cutie in tiny cutoff shorts and an even tinier crocheted top, a fringed suede bag swinging around her hips. She’s always hitchhiking, and one day, he offers her a lift. This strange, zonked-out girl (her name is Pussycat, and she’s played by Margaret Qualley), is part of the new generation that’s taking over Rick and Cliff’s world like a pernicious weed. She asks him to take him to Spahn Movie Ranch, a site formerly used in the making of movie and TV westerns. Now it’s a commune headed by charismatic sicko Charles Manson. Cliff doesn’t yet know that, but he remembers the ranch from its earlier days. The old world has merged with a new, more sinister one.

Throughout Once Upon a Time in Hollywood, fiction and fact meet; sometimes they criss-cross and hurtle in opposite directions. But the setting always feels bracingly real: Tarantino’s 1969 Los Angeles is a dreamland of multi-hued bar and restaurant signs—in a lovely sequence, they blink on one by one at twilight, just as actors all around town are leaving their jobs for the day and moving toward that beckoning after-work drink. (The film, every frame of it stunning, was shot by veteran cinematographer and Tarantino regular Robert Richardson.) As the story’s mood turns dark, the recording of “California Dreamin’” you hear on the soundtrack isn’t the Mamas and the Papas’ creamy, sunset-flavored version, but a more foreboding one by José Feliciano, the sound of vultures circling. There are moments in Once Upon a Time in Hollywood that are purely terrifying. The movie’s tone shifts drastically during the finale, a sequence marked by ruthless, cartoonishly orchestrated violence—somehow it doesn’t fit, almost jolting the picture out of whack. But the movie’s final moment sets everything right, gently, a grace note of serenity in the context of an all-too-mad reality.

Pitt and DiCaprio are marvelous together, and though neither are what any of us should call “old,” their faces, once as flawless as airbrushed high-school portraits, have now achieved a more weathered perfection. DiCaprio’s Rick looks mischievously boyish, though you can’t help noticing the tiny crow’s feet marking the skin around his eyes, etched there by dried-up work and dwindling bank accounts—there’s an alluring, Robert Ryan-style weariness about him. And Pitt is superb, striding through the movie with the offhanded confidence of a mountain lion who knows his turf. This is swagger freed from self-consciousness; Cliff was groovy before the word was invented.

Margot Robbie as Sharon Tate in Quentin Tarantino's Once Upon A Time... in Hollywood. Andrew Cooper—ANDREW COOPER

But Once Upon a Time in Hollywood really belongs to one person, a figure who gets less screen time than either of the male leads but who fills the movie with light even so. Margot Robbie plays Sharon Tate, and in the movie’s most stunning sequence—set sometime in February 1969—she comes upon a theater, the Bruin, that’s showing her most recent film, The Wrecking Crew, one of those absurd Matt Helm spy joints starring Dean Martin. She goes up to the box-office booth to buy a ticket—and then it occurs to her that if she explains to the ticket girl that she’s actually in the film, she might be able to get in for free.

It works! She slips on a pair of oversized, owlish eyeglasses and sits down to watch her own image flash on the screen. There’s no vanity or self-congratulation in her expression, only curiosity and an almost mystical kind of fascination, as if she were observing a deer in the forest. She waits to see if the audience laughs at one of her funnier lines—they do. She mimics the martial-arts movies her character executes on-screen, her hands slashing and dipping through the air, her muscles remembering what it was like to learn the routine. Margot Robbie as Sharon Tate is watching, as we are, the real-life Sharon Tate playing a character in a movie. But for us, the two have blended into one person, a young woman, recently married—does she even yet know she’s pregnant?—who has everything to look forward to. In real life, no one could save Sharon Tate. With Once Upon a Time in Hollywood, Tarantino and Robbie restore life to her. The magic spell lasts only a few hours. But no one has ever brought her closer to a happily ever after.

Contact us at letters@time.com.