The new Ruth Bader Ginsburg biopic “On the Basis of Sex” was born at a funeral.

The year was 2010 — long before the documentary “RBG” had made its way to theaters. Long before the Supreme Court justice, who is known for her sharply worded dissents, had become a meme with the moniker “Notorious” appended to her initials. And long before Kate McKinnon was even hired by SNL, on which her impersonation of Ginsburg as a dancing trash-talker has become a staple of the sketch comedy show.

Daniel Stiepleman, a nephew of Ginsburg’s, recalls sitting at the funeral of Ginsburg’s husband, Marty, listening to the eulogies.

It was there that Stiepleman — at the time a 29-year-old film school graduate, former Peace Corps volunteer and high school English teacher — says he hit upon the idea for his first screenplay, when a eulogist stood to speak about the only case that the couple ever argued together: a seemingly dry 1972 appeals court tax case called Moritz v. Commissioner of Internal Revenue.

“I thought I was going to write the movie that would introduce the country to Ruth Bader Ginsburg,” Stiepleman says. Instead, the country beat him to it.

As it turns out, “Moritz” was no ordinary financial dispute. The petitioner, Charles E. Moritz, had been denied a deduction for expenses incurred in caring for his invalid mother — a denial based on the assumption that women, not men, would be their parents’ caregivers in old age. Through this landmark gender discrimination case, the film burnishes the Ginsburg myth not only by focusing on her fairy-tale marriage, but also by showing how she made, as one character put it, the “opening salvo in a new civil rights war.”

Screenwriter Daniel Stiepleman — Ginsburg’s nephew — and director Mimi Leder. (Matt McClain/The Washington Post)

In an onstage Q&A at the D.C. premiere of “On the Basis of Sex,” Ginsburg recalled how that salvo came to her attention: “Marty came into my room — my little room, he worked in the bigger room,” she remembers. “He said, ‘Ruth, read this.’ And I said, ‘Marty, you know I don’t read tax cases.’ ‘Read this one.’ About 10 minutes later, I walked into his big room and said, ‘Marty, let’s take it.’ ” She realized it could lay the groundwork for future cases questioning discrimination against women.

Marty would handle the tax side, and Ruth would take the gender discrimination side, just as the Ginsburgs divided up the household chores, with Marty often doing the cooking. For Stiepleman, who says he modeled his own marriage on his aunt and uncle’s, the case is a metaphor for the Ginsburgs’ partnership. “It’s the two of them arguing in court what they’d already figured out how to do at home, which was to create real equality,” he says (room size aside).

Stiepleman waited a year to approach his aunt about the rights to her story, out of respect for her grief. But when he described the story he wanted to tell, she responded with a zinger that sounds like one of McKinnon’s famous “Gins-burns”: “Well, if that’s how you want to spend your time.”

Stiepleman firmly believes that there’s still room to say something fresh about a woman as well-known as his aunt. “She’s very private,” he explains, “I mean, I thought I knew her — and I did — but not to the same intimate degree where I felt that I could write her.” That familiarity only came after hours of one-on-one interviews and poring over her academic notes and legal papers.

So who is Kiki, as Ginsburg is called in “On the Basis of Sex,” and what is the film’s ultimate message — as well as its target audience?

Its creators and stars agree that the movie is something of a cinematic Reese’s Peanut Butter Cup. Armie Hammer, 32, who plays Marty, calls attention to the film’s split personality by citing its focus on the Ginsburgs’ “amazing partnership” on one hand and, on the other, its stuffier theme of public policy: “How a government taxes its citizens,” Hammer says with the cadence of the attorney he plays, “is a direct representation of how that government views its people.”

WASHINGTON, DC - DECEMBER 11: Felicity Jones poses for a portrait at the Ritz-Carlton Georgetown, Washington, DC on Tuesday December 11, 2018 in Washington, DC. Jones appears as Ruth Bader Ginsburg in the movie, "On the Basis of Sex". (Matt McClain/The Washington Post)

Felicity Jones, 35, who plays Ginsburg, says “On the Basis of Sex” hews closely to the formulaic structure of a sports movie. She says her character’s climactic speech before the appeals court judges — at five minutes and 32 seconds, one of the longest speeches ever delivered by a woman in American film — is equivalent to the “last-quarter game-winning touchdown.” She later compares the character of RBG to the crusading martyr Joan of Arc — while also describing her as a chrysalis of sorts: “It answers the question: ‘How does someone grow into the Ruth Bader Ginsburg that we all know — or think we know — at 85?’­ ” Jones says. “How does she come to find the confidence in her own words?”

Director Mimi Leder, 66, agrees with that last assessment, noting that the film, which covers a span of 20 years, is bookended by images of two very different Ginsburgs: one, a first-year student at Harvard Law School — a naive young woman in a “swaying, cornflower-blue dress,” one of only nine female students in 1956 — and the second, a more confident fighter, clad in a deep ultramarine power suit. The color of the dress, as Leder explains, is a symbol of the “ocean” Ginsburg had to cross to get to where she is today. “On the Basis of Sex,” Leder says, is, in essence, not a story of being but of “becoming.”

“I’ll tell you what ‘On the Basis of Sex’ is about,” Stiepleman says. “Ruth obviously changed the country, but she did it by convincing people to agree with her, instead of destroying the people who disagreed with her.”

Wait a minute — so now this a Trump movie?

“No, no, no,” say Leder and Stiepleman, almost in unison. Ginsburg, 85, is a hero to progressives, many of whom are anxious over her recent health scares. But when the film was focus-grouped in Orange County — an area south of Los Angeles that is neither red nor blue, but deep purple — self-identifying conservatives were just as likely to rate the movie favorably as liberals, the creators explain. More than anything, Stiepleman says, “On the Basis of Sex” is “a joyous, grab-your-kids-and-a-bucket-of-popcorn Christmas movie.”

Jones, left, and Hammer met with Ginsburg before filming. (Matt McClain/The Washington Post)

(Matt McClain/The Washington Post)

The film’s climax — a rebuttal to the arguments of the Internal Revenue Service’s lawyers — is a stirring tour de force by Jones, who has Ginsburg’s vocal mannerisms down pat: a neutral, almost trans-Atlantic accent when calm, but with a touch of Ginsburg’s native Brooklyn creeping in, along with the character’s rising passions.

But as inspirational as that speech may be in the film, it never actually took place. “I had an amazing rebuttal,” Ginsburg confessed to the audience at the National Archives premiere. “But there was no rebuttal.”

“I made it all up,” admits Stiepleman, who adds that Ginsburg’s oral argument may have been “the easiest thing to write in the whole film. I think it was one draft.”

It was easy, he says, because he had access to his aunt’s lecture notes from Rutgers Law School, where she taught while working on the case. Litigation, like teaching — and filmmaking — is just another form of storytelling, he says.

And that’s in part why an argument is not an attack, Stiepleman says. “To argue with someone is to show respect for their ideas,” he says. “If their ideas are good enough, they’re worth arguing about.” That’s a lesson he learned firsthand, by watching his aunt Ruth argue — respectfully — with her daughter Jane, a rivalry he weaves into the film.

Jones says of the film: “It answers the question: ‘How does someone grow into the Ruth Bader Ginsburg that we all know — or think we know — at 85?’­ ” (Jonathan Wenk/Focus Features/AP)

Stiepleman says he was a “hippie-dippy” teacher and that he used to invite students to grade him. His favorite response came from a pupil who once gave his teacher a D. It was attached to this note: “Sorry Mr. Stiepleman. This is my favorite class, but let’s face it, it’s not like you really teach us anything; all we do is think about a bunch of stuff that we never thought about before.” That comment, Stiepleman says, was “the best compliment I’ve ever gotten in my life.”

The screenwriter remembered that kid’s words when he was writing “On the Basis of Sex” — and when he thinks about filmmaking. “I see my job as to help people think about things that maybe they hadn’t thought about before,” he says. “That’s also what Ruth Bader Ginsburg’s job is. And that’s how you end up with a movie like this.”

On the Basis of Sex (PG-13, 120 minutes). At area theaters.