Midnight in Paris. (A real one.)

It’s May 1922. There’s a dazzling soiree going on at the Hotel Majestic: Picasso is there, and so is Stravinsky. Serge Diaghilev, head of the Ballets Russes, is the ringleader at this after-party for the premiere of “Le Renard” (“The Fox”), for which Stravinsky wrote the score.

James Joyce shambles in, drunk. Marcel Proust shows up a bit later, looking exquisite. Meeting face to face for the first time, the two notorious rivals sit next to each other for a meal tailored to Russian appetites.

What did they talk about? Did Proust say to Joyce, “Ah, monsieur, when I bite into this smetana and black bread, a memory reveals itself. . .”? And did Joyce reply, “Black beer, did you say? Who’s hiding the Guinness?”

It was a historic gathering. The guest of honor was European Modernism, surrounded by the greatest rule-breakers of the day. And the celebration wasn’t just about a ballet opening — it was about Paris as a cultural capital, with the Ballets Russes as its hub.

Someone once described Paris in the 1920s as Europe meeting the world over a gin-fizz. Yes, but the fizz began bubbling more than a decade before, when Diaghilev’s band of Russian dancers, choreographers, painters and musicians first landed in Paris. Diaghilev, a man of no artistic talent but brimming with charm, taste and the ability to raise money, swept into his orbit the greatest Modernists in the city — that is to say, some of the greatest artists on the planet.

Diaghilev even turned ballet into modern art, as the National Gallery of Art exhibit “Diaghilev and the Ballets Russes,” which runs May 12 through Sept. 2, makes clear.

Before the Ballets Russes, ballet was seen as frivolous and decadent, swamped by long-winded spectacle and bad music. But Diaghilev looked at ballet and saw a gold mine. First, however, he had to get it out of Russia, where it was stagnating as political turmoil dried up the coffers of St. Petersburg’s Imperial Ballet (now the Mariinsky), where Diaghilev found most of his dancers.

He also had to rethink the form.

“I wonder if it would be possible to create new, short ballets?” Diaghilev mused. Of course it was possible. He made it so, and found a way to pack choreography, music and design into a tighter, more powerful experience.

Finally, Diaghilev had to move aside the women.

Most theatrical dance at the time was exceedingly feminine. Think of the leg shows. The Folies Bergere in Paris, where Josephine Baker would land, had its own ballet troupe. Throughout the grand European ballet companies, the ballerina was in her glory, and the great works were named for her: “Giselle,” “The Sleeping Beauty,” “Coppelia.”

Into this pastel-tinted world marched the Ballets Russes, with its hot colors, new music — and men. Electrifying, beautiful, sexy men: Vaslav Nijinsky, Leonid Massine, Serge Lifar, Anton Dolin, Adolph Bolm.

Male-centric stories ruled the day: “Petrushka,” about a male puppet; “L’Apres-midi d’un Faune” (“Afternoon of a Faun”), about a god of the forest, part beast, part man. The title characters in “Apollo” and “The Prodigal Son,” by the young George Balanchine, remain defining roles for male dancers to this day.

“Le Spectre de la Rose,” in which a woman returns from a ball, falls asleep and dreams that the spirit of her floral souvenir jumps into her bedroom, was a sensation because of Nijinsky’s “grace and brutality,” as writer-filmmaker Jean Cocteau (and a Ballets Russes librettist) put it. The dancer astounded with his great leaps and great delicacy in a costume covered in silk rose petals, a yin and yang of male and female.

One of the first hits of the Ballets Russes in 1909 was Michel Fokine’s “Polovetsian Dances From Prince Igor,” excerpted from the opera by Russian composer Alexander Borodin, with its corps of dangerously virile men. Audiences are said to have been so charged up by that raw male energy that they ripped off the theater’s orchestra rail.

With that rail went the ballerina, figuratively speaking. Suddenly, she was eclipsed. Anna Pavlova, Tamara Karsavina, Ida Rubinstein and other women danced to great acclaim with the Ballets Russes, but what excited audiences most — the innovation that was destined to continue, spinning on through history to us — was the dancing man.

The feminized ballet world, with its roots in the 19th century and centered on the female body and the female dancer, “becomes disparaged by this new ballet,” says Lynn Garafola, dance history professor at Barnard College and author of “Diaghilev’s Ballets Russes.” Pavlova soon left to run her own troupe. Fokine put Karsavina in pants in “The Firebird” and rigidly confined her movements.

Bronislava Nijinska, sister of Nijinsky, and a noteworthy Ballets Russes choreographer as well as a dancer, straddled the sexual divide, uneasily. Among other works, she created “Le Renard,” the ballet that sparked the Proust-Joyce encounter. In it, she danced as a male fox. Also in 1922, the year of that big party at the Hotel Majestic, she strapped down her breasts to dance Nijinsky’s role in “Afternoon of a Faun.”

Nijinska wanted in on the cutting edge. She would have seen how the power and athleticism of the male roles matched the hard lines of other modern arts. This was the direction that modernism was taking — away from the soft, florid shapes of Art Nouveau and toward the primitive (think of Picasso’s 1907 painting “Les Demoiselles d’Avignon,” with its African masks), the blocky (cubism) and the dissonant. Consider Stravinsky’s “The Rite of Spring,” or “the riot of spring,” really, because its May 1913 Ballets Russes premiere was met with revolt.

The masculine character of the Ballets Russes didn’t stop with the dancers. Diaghilev also turned his star dancers into star choreographers. Nijinsky and Massine were groomed to produce new repertory. Fokine, whose pioneering reforms were crucial to the company’s early success — he insisted on excellence in music and overall design — grew so jealous that he left.

This new ballet company also drew an enthusiastic male audience of intellectuals and cultural sophisticates. Significantly, a good part of this audience was gay. (It’s not for nothing that Proust, reclusive and ailing, made the effort to attend the “Renard” after-party.) With Diaghilev, an acknowledged homosexual, as its leader; his lovers — Nijinsky, Massine, Lifar — as its stars; and the frank eroticism of so many of its works (“Scheherazade” was one big orgy; “Afternoon of a Faun” was a living wet dream), the Ballets Russes was an oasis for gay men.

“It gave them a cultural center that could not be articulated openly,” Garafola says. “It was a safe haven for gay men during a period of intense persecution.” At the Ballets Russes, “you could be gay, people knew you were gay, and it didn’t affect you. You were welcomed in the audience.”

Remember, this was at a time when homosexuality was a crime in London. When the curtains parted on a Ballets Russes production, they offered a view of Never-Never Land; a world of sensory pleasures that was gay, yes, and fundamentally human. The vulnerable but irrepressible human spirit, as seen in “Petrushka”; the effort to unlock the mysteries of fertility in “The Rite of Spring”; the pleasures of the body in “Scheherazade” — the Ballets Russes dissected the fullness of human experience as no theater had done before.

And now — what lives on? Are the costumes, paintings and backcloths in “Diaghilev and the Ballets Russes” all that remain of this tremendous force in modern art — and modern mores? We still have the music. We have some of the choreography. And countless newer versions, too — there is no end to the reimagined “Firebirds” and “Rites of Spring.” But what of the less tangible legacy?

The male dancer escalated in importance — as Rudolf Nureyev, Mikhail Baryshnikov and those around them made clear. But more than that, the masculinity introduced by the Ballets Russes, and the desire to whip up excitement with it, has stayed with us, too. The male body, its muscularity, strength and athleticism, became a persistent idea in modern ballet. Think of Balanchine’s further creations: “The Four Temperaments,” “Agon.” As modernism in other arts took on hard edges and lean lines, so has ballet.

Today, we don’t have Diaghilev-style painter-collaborators to anchor our visual field with bold costumes and backcloths. It is the dancers’ fast pace, bursts of action and punchy energy that keep our attention. In those aspects of current ballet live the echoes of the Ballets Russes, adapted for women as well as men.

The artistic energy, the phenomenon of a ballet company as a creative center of gravity that could lead Stravinsky, Picasso, Proust and Joyce to dine together — that is gone. But what of the sensuality, the warmth, the lusciousness, the body beautiful — have those qualities lasted? They began to fade even during Diaghilev’s reign. The mysterious Nijinsky qualities, those he brought to the role of the Rose and the Faun — human, inhuman and the divine wrapped together — as you walk through the National Gallery’s exhibit, you will see them represented less and less in the costumes and designs for later ballets. Heat is hard to kindle, and even trickier to hold.