The (anti)heroines of Booksmart, Olivia Wilde’s relentlessly charming directorial debut, are bookish indeed. But that doesn’t mean they’re uncomfortable in their skin—at least not completely. Amy (Kaitlyn Dever) and Molly (Beanie Feldstein, the revelation of Lady Bird) are straight-A students joined at the hip against the cool and, therefore, to their minds, idiotic popular kids at school. Their peers, they assume, are too busy partying, playing sports, or spending their parents’ money to study and think of their future. Throughout high school, Amy and Molly have found their distancing contempt for their fellow students justified by their own good grades. In an inversion of Lady Bird’s struggle to make it to the Ivy Leagues, their hard-won admissions to Yale is both proof of success and a signal of missed opportunity. All these years, they never needed anyone else’s validation because, smart as they are, they know that their life will really start only once they get to college and finally meet like-minded people. That’s where they’ll forge bonds with those who think about politics, the environment, and other capital-I issues that a future youngest female Supreme Court Justice like Molly and a humanitarian like Amy, will work to change.

It is to Wilde’s and the actresses’ credit that I felt both sympathy and pity for Amy and Molly’s perfectionism and nerdiness. They think they know exactly what they’re doing and have found their own weird ways of having fun, from silent robot dancing to private joke references to Clint Eastwood’s Sully. But the two girls get a bitter taste of the real word well before stepping onto their university campus. On the last day of high school, they realize what their arrogance had kept hidden from them all along: They’re far from the only kids who got into prestigious schools. Even the most outrageously popular kids have received offers from top-rated colleges (or Google), and although one would be justifiably inclined to imagine some rich parents’ scam behind those admissions, all these laid-back students can claim to have had their kegs and drank them, too. Wilde immerses the nerds in the audience—certainly the nerd in me—within a lawless world where actions actually have no consequences, and having more fun than you should has little consequence; honi soit qui mal y pense. Yet after the initial shock of discovery wears off, this new universe seems to hold hopeful promise: You truly can do both, after all!

Wilde isn’t making a fairy tale of youthful possibility. Amy and Molly decide to make up for their years as good girls by going to a party on graduation night and prove to their friends (and also themselves) that they aren’t dutiful robots. But naturally, there are many obstacles on the path to popularity. The script—penned by a team of female writers who worked on various comedy projects such as the Netflix rom-com Set It Up, Black-ish, and The Spy Who Dumped Me—follows a classical teen movie structure of accidents and escapes that helps make Booksmart accessible to a young audience, but perhaps prevents it from better translating the frightening and exciting unpredictability of a young person’s night out. Every incident seems too unavoidable to be mistaken for a mistake.

The surprises lie not in the diversions, but in the details of their execution. Feldstein and Dever understand what unites but also what differentiates their inseparable characters, giving each girl a distinctive personality that slowly unravels over the course of the film, defining itself against the choices they have to make. Behind the pair’s mutual, judgmental irony exist complex and individual feelings that emerge only in a time of crisis. Molly is more driven and proactive than Amy, but neither would usually confront the fact of their power imbalance weren’t it for this new need to open themselves up to other kids. It is once they reluctantly put themselves in less than comfortable situations—a deserted boat party thrown by Jared (a touching Skyler Gisondo), or an immersive theatre experience—that Amy and Molly’s adventures make Booksmart seem truthful to the existential dilemmas of youth.

Teenhood is the perilous walk on the fine line between confidence and embarrassment—between fake-it-till-you-make-it and who-do-you-think-you-are—which is why it is a challenging if sometimes rewarding topic for filmmakers. While Bo Burnham leaned into the unease of the age so hard as to make Eighth Grade masochistically cathartic, Wilde’s approach is more straightforwardly appealing. It is evident that Molly and Amy have too much bravado to really bomb at the party when they finally arrive (unlike introverted Kayla in Eighth Grade), and Wilde takes great pleasure in praising their brashness with slow-motion photography, countless contemporary pop and hip-hop music cues, and a staccato editing that gives their repartee and facial gymnastics the perfect framing. But these girls’ concern is buried deep beneath all these wisecracks: They might find that having fun is too difficult for them, or disappointing. Perhaps they will suffer from finally letting down their guard.

Sadly, it is at this key juncture, when the two friends finally make themselves vulnerable to others, that Wilde’s crowd-pleasing method falls short: When Amy and Molly have their biggest argument ever in front of all their classmates, the sound of their voices is quickly and startlingly overwhelmed by a tune on the soundtrack, turning this difficult but captivating moment of anxious emotional dumping into just another stop on the way to expected personal growth. As it does with friendship, the director’s universalist impulse also mitigates the impact of Booksmart’s otherwise astonishingly subtle exploration of romantic failure and sexual awakening. Molly and Amy have disturbing crushes like any other kid their age, and Wilde embraces most of the contradictions inherent to attraction (who hasn’t fallen for exactly the wrong person as a 16-year-old?) but shivers at the harshest outcomes that desire can lead to. When Amy has her first sexual experience with a girl—a wonderful thing to see in any movie, let alone in one aimed at teenagers—and things don’t go well, she is still rewarded with a happy resolution. Teen movies needn’t be all doom and gloom (and Molly isn’t as fortunate as her friend) but as much as Booksmart plays with genre tropes, it still seems nervously bound by them.

Perhaps smoothing out the edges of heartbreak isn’t too steep a price to pay for a film so enthusiastic and acute about the willful free fall of teenhood. As portrayed by Wilde, the disappointment that Amy and Molly (and everyone else) discover at that age is exciting precisely because it is so brutal, and also transformative—a multiple-choice test without correct answers. You can’t learn about it in books, but maybe you can figure it out at the movies.