The idea for “Elf” began as an ode to New York during the holidays.

David Berenbaum, the screenwriter behind the Christmas classic, had just moved to Los Angeles and missed the East Coast. Nostalgia for the city inspired what he calls a “left-of-center” family comedy about a human who was raised by elves in the North Pole.

“It hits hardest at Christmastime when it’s 105 degrees out here,” Berenbaum said. “It was very comforting to write a Christmas movie when you miss the snow, and there’s a heatwave outside.”

Anyone who has ever switched on the TV from Thanksgiving to New Year’s, a period of time in which “Elf” is on perpetual rotation, knows that the New Line comedy went on to become a massive box office hit before cementing its place as a perennial holiday film. And while Buddy, the doe-eyed optimistic Santa helper played unforgettably by Will Ferrell, remains ageless on screen, the reality is that it has been 15 years since “Elf” first enchanted audiences. In honor of that anniversary, Variety spoke with some of the key people behind the film.

On paper, “Elf” might not have worked. Ferrell was fresh off a stint playing everyone from a dim-witted George W. Bush to a supercilious Alex Trebek on “Saturday Night Live,” but he wasn’t a proven film draw, having only had a few supporting turns in the likes of “Old School.” But after Jim Carrey turned down the Buddy role, the producers opted to take a chance on the up-and-coming comic. His task was to ground the story of a man raised by elves who journeys to New York in search of his biological father (James Caan).

“I loved the idea of someone who didn’t fit in, who set out to find his place in the world,” Berenbaum said.

Michael Ginsberg/New Line Prods.

Mary Steenburgen, who plays Buddy’s stepmom, says there was an “inherent risk” in a movie centering on a grown man who thinks he’s an elf. The cast agrees that the wacky comedy worked for one reason, and one reason only: Ferrell.

“This was Will’s movie. He just has such a sweetness and innocence to him,” said Zooey Deschanel, who plays Buddy’s eventual love interest. “He’s able to always go to that place of innocence that allows a character like this to really come to life.”

Bob Newhart, the legendary comedian known to “Elf” enthusiasts as Papa Elf, notes that Ferrell’s role was a tough one to pull off. It’s his idealistic and child-like commitment that sells the performance.

“Will could have just come off as a stupid guy who doesn’t realize he’s a lot bigger than anyone else,” Newhart said. “There was a lot of danger in the fact that if the audience didn’t go along with Will’s persona, it could have been a big flop.”

The other major role went to Deschanel, a relative newcomer who had turned heads in the 2003 indie drama “All the Real Girls” and had first hit the scene playing Patrick Fugit’s older sister in 2000’s “Almost Famous.” Her performance as Jovie, the department store employee who struggles to get into the Yuletide frame of mind, was her big break. Deschanel and Ferrell have a sweet chemistry on screen, but they almost didn’t get a chance to work with each other. The actress wasn’t the first choice for the role.

“I went in as a backup,” she says of her audition. “The person they cast couldn’t do it. A lot of the parts I got early in my career, I was filling in for someone else who had dropped out last minute.”

There was a downside to working on “Elf.” Deschanel wasn’t keen on her pixie fashion. The natural brunette donned golden blonde locks for the film — a look she disliked, but one that she’s partly to blame for putting in the producers’ heads. Despite her best efforts to convince them otherwise, it was her initial reading that convinced producers she needed a bleached hairdo.

“What is funny is I had dyed my hair for a screen test for a movie that never happened,” she said. “I had a meeting for ‘Elf’ while I was blonde, and I asked them if I could dye my hair back to brown. They said ‘No, we want you to look the way you did in your audition.'”

There wasn’t as much improvising as in a traditional Ferrell comedy (though Berenbaum says Ferrell thought of the line Buddy shouts at the fake Santa at the mall, “You sit on a throne of lies!”), but that doesn’t mean it made it any easier for the crew to keep it together on set.

“You went to work every day, and your biggest challenges was getting through a scene without breaking it,” Steenburgen recalls. “It’s part of the beautiful, weird edge that you walk on when you work with Will that you can’t stop yourself from laughing at him.”

Another obstacle was making the 6-foot-3 Buddy look disproportionately larger than the elves in Santa’s workshop. Director Jon Favreau insisted on using real actors, which meant he had to get someone with the creative chops to make Newhart and others look dwarf-like without the aid of CGI. Instead, he used forced perspective to create an optical illusion and make it appear like Ferrell towered over everyone else in the room. For Newhart, that entailed shooting all of his scenes standing a few feet behind Ferrell to give the impression that his character was half the size of Buddy’s.

“As an actor, it’s tough because you don’t have the eye contact. He’s looking one way, I’m looking the other,” Newhart said. “It is difficult when you’re not playing to the other actor’s face and his reaction.”

Michael Ginsberg/New Line Prods.

That proved rather challenging when shooting a scene early on in the movie where Buddy sits on Papa Elf’s lap as the father-figure breaks the news that Buddy is, in fact, a human. Newhart appears a fraction of Ferrell’s size, but only because it wasn’t actually Newhart sitting in the chair.

“There’s a small kid between me and Will that he was sitting on,” Newhart explained. The crew made a box for Ferrell to sit on so he wouldn’t crush the young actor’s legs, though Newhart joked he still doesn’t know how the little kid survived the weight of Ferrell.

To this day, all that moviemaking magic has confused even the biggest “Elf” aficionados.

“When fans find out I’m taller than 3 feet and 2 inches, they feel cheated,” Newhart laughed. “They don’t understand how I’m 5 foot 7. They’re going, ‘That’s not Papa Elf. He’s too tall to be Papa Elf.'”

Alan Markfield/New Line Prods./K

There are a few perks that come with filming a holiday classic. It’s common knowledge that elves stick to the four main food groups: candy, candy canes, candy corns, and syrup. That meant noshing on sugar-coated pasta — lots of it.

“There are worse things in the world to eat than that, but we had been doing it for hours,” Steenburgen says of the scene where Buddy sits around the dining room table with the Hobbs family. “I was just thinking, ‘How the hell am I going to get through this movie? I just need to laugh so hard right now.’ It was almost impossible not to do.”

And no holiday movie set in New York would be complete without a visit to Central Park. Deschanel and Steenburgen recall the brutal winter as they filmed the grand finale, which finds Buddy and crew gathering a crowd to raise enough Christmas spirit to power Santa’s sleigh.

“We just did that scene over and over,” Steenburgen said. “I remember it being bitterly cold, and it was 3 in the morning. I was tired, but I had the feeling I was in a scene that would stand the test of time.”