Since its debut in 1999, Lemony Snicket’s A Series of Unfortunate Events has stood out for being a children’s series that didn’t believe in happy endings. The popular books followed three young siblings whose parents die in a fire and who are placed in the care of one hapless or unsavory guardian after another, all the while being hunted by an evil distant relative hungry for their enormous fortune. Page after page proved verbose, fatalistic, dark—and utterly engrossing, thanks in part to the series’s enigmatic narrator, its macabre sensibility, and its wonky literariness. But more than anything it always seemed to assume the best of its young readers, believing they possessed the emotional and intellectual maturity to enjoy such a tale.

A decade after the 13th and final book was released, the series is set to find a new audience, and re-engage an older one, when a TV adaptation from Netflix premieres Friday. After a (rather bad) 2004 movie version starring Jim Carrey, many book fans greeted news of the show with skepticism. Luckily, the unfortunate story of the Baudelaire orphans seems to have finally gotten a worthy adaptation. Netflix’s A Series of Unfortunate Events makes an impressive effort to stay true to the spirit and idiosyncrasies of the books without being overly reverential. (It helps that the series’s real author, Daniel Handler, is an executive producer and the show’s writer.) The result is a show that’s likely to appeal to both adults and children with its layers of mystery, a weird sense of humor, and hyper-self-awareness—as long as viewers can accept the misery that lies ahead.

The show revolves around the three kind and clever Baudelaire orphans and the vast, complicated mystery they begin to unearth about their parents. There’s 14-year-old Violet, an avid inventor (played by Malina Wiessman); 12-year-old Klaus, a voracious bookworm (Louis Hynes); and their baby sister Sunny, who’s a whiz at biting stuff (Presley Smith). And then there’s the cruel and calculating Count Olaf (played by Neil Patrick Harris)—the Baudelaire’s first guardian whose sole interest is stealing their wealth, with the help of his coterie of henchmen.

The first season of the show spans the first four books of the series with each episode roughly 45 minutes long, a pacing that allows the characters and storylines room to breathe. (The entire season was provided to critics.) Crucial to the narrative is the fictional Lemony Snicket himself. As played by an understated Patrick Warburton, Snicket is the omnipresent narrator he is in the books: interrupting the story so often the “fourth wall” feels more like a door, wandering into the frame mid-scene to define words or offer commentary, and repeatedly urging viewers to spend their time in some other, more pleasant way. Warburton’s affect-less, almost bored delivery won’t jibe with everyone, but it does help to balance out the more fantastical elements of the show.

Much of the Baudelaires’ time is spent trying to out-maneuver Count Olaf using their unique skills, whether it’s decoding cryptic letters or inventing life-saving tools. A running theme is the sheer incompetence of the adults and authority figures around the siblings—and the way institutions meant to protect them, such as schools and the legal system, end up spectacularly failing them. Sometimes, the misfortunes that befall the children feel so sadistic as to strain believability; without spoiling, various subplots involve leeches, gruesome workplace accidents, hurricanes, snake bites, and chores. To its credit, the show doesn’t downplay the darkness that’s at the core of A Series of Unfortunate Events. But the director Barry Sonnenfeld (The Addams Family, the Men in Black trilogy) introduces levity elsewhere.

One of the great delights of Netflix’s A Series of Unfortunate Events is the world-building, aided by stunning production design that translates the books to screen while adding new flourishes. It was never clear exactly when or where the story of the books takes place: The series is riddled with playful anachronisms, from the characters’ old-fashioned outfits to steampunk technology, and mixes real geographical references (Arizona, Peru, Winnipeg) with invented ones (Lake Lachrymose). The show similarly has fun fleshing out the Baudelaires’ world. It modernizes the story a bit with the internet and smartphones, while tossing in a new set of amusing cultural references (Sonic Youth, Haruki Murakami, Uber). As Violet, Klaus, and Sunny bounce from place to place, viewers catch glimpses of this peculiar universe: a country road that reeks of horseradish, a lake that experiences hurricanes, a menagerie of outlandish reptiles.

The rest of the show’s levity comes from the cast, who bring to life a script that lurches between bizarre and mundane. While the 2004-movie version of Count Olaf felt like exactly what it was—Jim Carrey being very Jim Carrey-ish but in prosthetics and heavy makeup—Harris’s take on the villain is more faithful. The difficulty of portraying Olaf lies in capturing the inherent ridiculousness of his character along with how frightening he is. Harris succeeds unevenly, but fills in the gaps with physical comedy, hilarious deadpanning, and scene-stealing theatricality. The actors who play the older Baudelaires, Wiessman and Hynes, are terrific and instantly likable, ably holding their own against more experienced actors.

As for the supporting cast: Joan Cusack, Aasif Mandvi, K. Todd Freeman, Alfre Woodard, and Rhys Darby all deliver near-perfect performances as some of the hapless adults who try to look after the Baudelaires. (Mandvi, Freeman, and Woodard play characters who, in both the film and the books, were portrayed as white.) There are also a couple of surprise characters who were mentioned but never actually showed up in the books—just one of the many ways the show builds beyond the original material.

While the medium doesn’t always work to the story’s benefit—the theme song sounds a lot like a Panic! at the Disco b-side imploring viewers to “Look away, look away,” and some of the digital effects fall horribly flat—Netflix’s decision to adapt A Series of Unfortunate Events into a TV show seems, in many ways, inevitable. The books check all the streaming service’s boxes for an original series: a beloved franchise (Gilmore Girls, Full House) that never got its proper due (Arrested Development) and fits the binge-watch model. As a weird and expansive series, it’s also tonally and thematically akin to the likes of Stranger Things, The OA, and Jessica Jones, though a bit wackier. As could be expected for a show with a metafictional bent, there are some winking (and slightly groan-inducing) references to the glories of longform, commercial-free TV peppered throughout.

All of which is to say that A Series of Unfortunate Events could end up being one of Netflix’s more exciting adaptations. Handler has said the next season will be 10 episodes long and stretch through book nine (The Carnivorous Carnival), which means the third season should be the last. The series (mild spoiler) becomes increasingly philosophical and grim as it progresses, even more so than J.K. Rowling’s Harry Potter books. It’ll be fascinating to see whether Netflix will have the wisdom to shed some of the whimsy and darken its tone accordingly in the coming years. The first season, at least, is a more than promising start—compelling even if, by the eighth episode, viewers have come to accept that the story of the Baudelaires won’t have a storybook ending.