The first-time director ventures into the most terrifying place on Earth — middle school — with an intensely personal and poignant tale of a not-always-so-typical teenager.

When Bo Burnham was a few years into his career as a stand-up comic, he started to suffer from panic attacks onstage. Not just ordinary, garden-variety stage fright, but dizzying, tunnel-vision, breath-gasping, palm-drenching meltdowns. So the 28-year-old comedian decided to make an autobiographical film about his struggle with anxiety. And to play his onscreen alter ego, he chose … a 13-year-old girl.

"It just felt right to me," he explains. "I thought, 'Uh-oh, am I going to make a movie about a 13-year-old girl?' But it wasn't really a choice. If you want to be stuck in your own head worrying about your image and how the world perceives you, you either have to be a 25-year-old male comedian or any 13-year-old girl, you know?"

Eighth Grade is a uncomfortably visceral portrait of what it's like to grow up in the age of anxiety — and the age of social media — through the eyes of an awkward teen named Kayla, played by Elsie Fisher, a 15-year-old actress with a handful of TV and film credits, most notably the Despicable Me franchise. The character frequently uploads videos of herself to her YouTube vlog, where she gives advice as though she's confident enough to help other kids through bouts of unease. But underneath, she's a typical teenage wreck. In one scene, she locks herself in a bathroom at a pool party to change into her swimsuit and collapses into a full-blown panic attack. Says Burnham, "That was me in the dressing room before going out onstage."

Burnham burst onto the scene as an early YouTuber in 2006, when, at age 16, he began uploading videos of himself singing original pun-filled ditties that quickly went viral. His quirky little songs — like "My Whole Family (Thinks I'm Gay)" — caught the attention of talent agents and Comedy Central executives and next thing he knew, he was selling out shows, signing record deals, doing bit parts in movies like 2009's Funny People and headlining Netflix stand-up specials. But as his profile rose, so did his anxiety levels. And that's why, in 2014, he started writing his script, a deeply personal story about his own long-term relationship with panic and social fear.

"I wanted to write about my anxiety because it was a thing in my life that I was coming to grips with," he explains. "So I sat down and just tried to buckshot a bunch of scenes with a bunch of different characters, not knowing what it was going to be. And over that process, I stumbled on the voice of this kid and her dad. [I wrote a] scene of them driving to the mall and her not wanting him to look weird when they were driving and him not knowing what she meant by that, and it was just immediately very alive to me. It felt more real than everything else I was writing."

Burnham weaved parts of himself into Kayla, but the real inspiration for the character were the vulnerable young YouTubers he spent hours studying — kids pouring their hearts out to the world in videos with only 12 views. "They're living incredibly complex interior lives that are reflective of what it means to be alive in this moment," he says. They were asking the same questions he was: Who am I? How does the world see me? Am I a fraud? Burnham found himself relating more to the girls. "The boys talked about video games and the girls talked about their souls." Much of the teen slang in Eighth Grade — even the countless "ums" and "uhs" he peppered throughout the script — came verbatim from YouTube vlogs.

He tried shopping the script around Hollywood in 2014, but "it's not the easiest sell," he admits. A24 was interested, but it was only a distributor at the time, and Burnham needed production financing. With no serious backers, he threw himself back into stand-up, periodically returning to the script to update it with ever more contemporary references (swapping Facebook for Snapchat, for instance). Once his third Netflix special, Make Happy, came out in 2016 to overwhelmingly positive reviews, Burnham felt he had enough momentum to get Eighth Grade off the ground. A draft found its way to Scott Rudin and his producing partner Eli Bush (who made the 2017 coming-of-age Oscar contender Lady Bird). "It was so vivid and alive and original," says Bush. "The immediacy of it made us feel like we needed to start shooting tomorrow."

Burnham insisted on directing the film himself — "I was thinking, 'If this is going to get made, it'll be with me directing because the only people that know the material better than me are actual 13-year-olds, and they aren't allowed to direct yet,' " he says. He had eight months before the summer shoot to put himself through a crash-course in filmmaking, watching three movies a day and reading stacks of books about directing (like Sidney Lumet's Making Movies).

"Bo was very clear he wanted to make this movie while he was young enough to be in touch with these feelings and not make it with any nostalgia or irony," says Josh Hamilton, 49, who plays Kayla's dad. "He came of age at such an ironic time in terms of comedy and culture. But with this movie, he's made a choice to do the opposite and not be afraid to be completely sincere."

With the entire film centered on Kayla, Burnham couldn't think about production until he found his 13-year-old star. After scouring the internet for young female actors, he sent veteran casting director Allison Jones (who'd worked on The Office and Veep) six potentials. At the top of the list was Fisher, whom Burnham found when he came across her in a random YouTube video in which she discusses brownies with a 10-year-old girl on a red carpet. "It was a very strange interview, and she was navigating the complexities of it in a very open way," he says. "We saw a hundred kids, but Elsie was the second person in the room, and I was rooting for her the whole time." Still, he made her test six times to be sure she could handle a role that involved more than talking about recipes.

It was, in some pretty obvious ways, typecasting. Fisher took the part just a few weeks before she herself was graduating from middle school, as Kayla is about to do in the film. "It really did feel like an extended year of eighth grade," she says. Before landing the part, Fisher had grown a bit discouraged with acting because so many of the teen roles she found herself auditioning for were disingenuous. But Eighth Grade seemed different. "I really appreciated that this script was genuine," she says. "I've got acne, and it gave me room to have that — it didn't make it a plot detail, it was never commented upon. I just kind of had it. I feel like if you're a teen in a movie and you have acne, they either slather you in makeup or it's specifically for a nerdy character and made a big deal. It doesn't need to be that way."

Fisher, who lives in Thousand Oaks, California, had been to the East Coast only once before Eighth Grade started its summer 2017 shoot in the upstate New York suburb Suffern. Burnham, who grew up outside Boston, knew he wanted a rugged, New England-y location. "Summer is so loaded in places where it snows," he explains. "The thought of being in a bathing suit in a place where you were in a winter coat four months earlier is much more intense than summer where it's warm all the time. I wanted it to feel like a beaten, weathered place where the sun was finally coming out." In addition to mostly naturalistic interior shoots in Kayla's bedroom, they filmed at the mall and at Suffern Middle School, which agreed to leave the kids' real artwork up on the walls, and Burnham cast a handful of real students and teachers — including Suffern's band instructor.

Once the 27-day shoot began — on a budget of about $2 million — the vibe on the set was more like Bill Murray's Meatballs than Catherine Hardwicke's Thirteen. "It felt like summer camp," says Burnham, "and we were camp counselors just trying to make sure kids didn't drown in the pool." Contributing to the laid-back atmosphere was the fact that Fisher is a minor, so the production had to be restricted to nine-hour workdays (her dad and younger brother were on location, too). "We wanted to do the Cassavetes way of production," says Burnham, referring to the late director who was known for his family-style sets. Burnham and some of the crew lived in a large house together, and every Sunday, they'd cook up a big dinner for the cast while Fisher and her brother played Mario Kart. On weekends, they'd go-kart at a nearby track. "It was like a dream," says Burnham of the experience. "I know that, like, it'll never be as good as this again."

Burnham flew to London late in the editing process to work with British composer Anna Meredith on the electronic score. "My elevator pitch was, 'What if Trent Reznor was a 13-year-old girl?' " he jokes. He and his editor, Jennifer Lilly, didn't finish the film until three days before its Sundance premiere. The screening was a moment he'd agonized over for some time. "I was terrified," he admits. "I felt so out of depth and intimidated by the film world."

As it often is, his anxiety was unnecessary. Eighth Grade got rave reviews, with critics lauding its "humorous and nuanced approach" and "tender take on teen angst." The film has earned a rare 99 percent rating on Rotten Tomatoes and $13.5 million domestically since its wide release in August, more than six times its budget. On Nov. 16, it also nabbed four Independent Spirit Award nominations, including best feature and best female lead.

One thing it hasn't done, however, is cure Burnham of his anxiety. "I think it will always be there to some degree," he says. "But I didn't set out to fix my anxiety. I set out to describe it."