Nick Robinson and Katherine Langford in Love, Simon.

Nick Robinson delivers a breakthrough performance as the title character in Love, Simon, a sweet throwback high-school comedy about a gay teen who—thanks to email and social networking—may need to come out sooner than expected.

The film leans towards the formulaic, with a lot of similarities to the works of John Hughes (The Breakfast Club), thanks to some typical characters and a synth-heavy soundtrack. While the Hughes and Clueless comparisons are part of its charms, the film does feel a bit generic at times—but by the time the movie plays out, the formulaic plot mechanics are mostly forgivable, because, well, this movie is pretty damned adorable. Based on the Becky Albertalli novel Simon vs. the Homo Sapiens Agenda (which would’ve been a much better movie title), the screenplay by Elizabeth Berger and Isaac Aptaker has enough original and sincere notes to earn smiles and tears.

Simon finds out that somebody at his high school is gay and closeted, thanks to a social-media post. Because he’s in the same predicament, Simon creates a Gmail account, contacts the student and begins a pen-pal relationship. Over the course of the emails, Simon falls in love (or, well, the high-school version of love) with the anonymous student, and is constantly scanning his classmates for clues to his identity.

Those classmates include best-friend Leah (Katherine Langford), who may or may not have a crush on Simon; new girl in school Abby (Alexandra Shipp), the apple of buddy Nick’s (Jorge Lendeborg Jr.) eye; and Martin (Logan Miller), the resident class clown/annoying guy. All of these characters are enjoyable, with the exception of that of Miller, who plays the “annoying guy” role so well that he becomes genuinely, unappealingly annoying.

Director Greg Berlanti balances Simon’s school life with a heartwarming, beautifully depicted family life. Jennifer Garner, an underrated actress, is awesome as The. Best. Mom. Ever., while Josh Duhamel is equally terrific as Simon’s goofy, trying-to-be-cool dad. Talitha Bateman rounds out the family as the little sister who wants to be a cook.

Jack Antonoff is the executive musical producer on the film, so that means a bunch of songs by his band Bleachers appear on the soundtrack. The generally chirpy, happy momentum of the Bleachers tracks serves the film well, along with well-placed songs from Whitney Houston, The Jackson 5 and The 1975. Credit Antonoff for coming up with a nice cinematic playlist, John Hughes-style.

Robinson gives us a seemingly real kid with Simon. He’s heavily reliant on emails and social media when it comes to expressing himself—a modern reality. When the screenplay takes his character into unfortunate territory (there’s a silly emotional-blackmail subplot), Robinson survives the wrong turns with a consistently warm and funny performance. He’s somebody you root for from the moment he walks onscreen, even when the script isn’t up to par. His work here should take his career to the next level.

There’s a moment in this film when two high school kids tell each other that they love one another. They aren’t romantically involved, and they never will be, but they love each other in a way with which many high school students, past and present, can relate. I’m betting a few more kids will be telling their buddies that they love them like this after seeing Love, Simon.

Love, Simon is playing at theaters across the valley.