“Dope” hooks you fast and strong.

The coy, over-the-top Sundance hit from writer-director Rick Famuyiwa about a couple of geeks who get entangled in gangster culture is a fresh and slightly rebellious take on the series of escalating events story.

Our hero, Malcolm (Shameik Moore), is introduced in his senior year of high school. His existence is curated to a stylist’s perfection. He and his friends Jib (“The Grand Budapest Hotel’s” lobby boy Tony Revolori) and Diggy (Kiersey Clemons) like 1990s hip hop culture, play in a three-person punk band, get good grades and stay out of trouble.

They live in the Darby-Dixon neighborhood of the gritty Los Angeles suburb of Inglewood, or, “the bottoms.” To survive, they try to do their own thing and avoid the bad eggs. Jib at one point wishes idly that Waze was capable of identifying bike routes home with no gang activity. Their proximity to danger is more of a nuisance than anything else — at least at the beginning.

The label and aesthetic obsessed Malcolm wants to go to Harvard and he doesn’t want to rely on clichés, or doing what’s expected to get there. We’re talking about his personal essay only here — Malcolm did do expected things like, you know, study. He doesn’t, however, want to use his hard knocks upbringing and single parent household to inform his narrative. He’d rather write about Ice Cube’s Good Day.

If it all sounds kind of light, it is at first. But it’s hard to get a grasp on the tone, which transitions rather violently across the nearly two-hour runtime. One moment, everything is self-referential and glib and sunny; the next, people are actually getting mowed down with gunfire.

It’s one of “Dope’s” quirks that works only in the strong first half — a near real time portrait of a kid stepping out of his comfort zone and getting into some actual trouble.

This section picks up when the charismatic dealer Dom (A$AP Rocky) injects himself into Malcolm’s life. Dom makes him play telephone to invite a pretty, serious girl (Zoë Kravitz) to his birthday party at a club. She says she’ll only go if Malcolm goes, too. He does, of course. What high school male could resist?

After a bit of fun and normal will-they-won’t-they high school drama, the club gets raided. In the chaos, Dom hides his drugs and a gun in Malcolm’s backpack. These aren’t discovered until the next morning at school, after Dom’s been arrested and Malcolm has done the unthinkable: set off the metal detector.

In the vein of Martin Scorsese’s “After Hours” or Jonathan Demme’s “Something Wild,” the teens are thrust into a wild world of dealers, thugs, crooks and liars, as they try to figure out how to get rid of the drugs and stay alive.

Malcolm talks a lot about not doing what’s expected of him — in this case, it means what’s expected of kids from a neighborhood like his. The odd thing is that, at this point, what’s expected of him is exactly what allows him to break bad rather easily. He uses the chemistry lab to sort drugs. The computer lab is for the sales. And the security guard lets him pass every time his drug-sniffing mutt starts getting antsy and the metal detector goes off.

“Dope” is intoxicatingly cinematic, whether illustrating the vibrancy of the best dance party you’ve ever been to, or hitting an unexpected narrative pause to transition into a dreamy, music-video like interlude.

And yet, enjoyable performances aside, the film goes on far too long and the energy and vibrancy of the first half dwindles as it transitions into a drug dealing caper. Don’t expect big ideas or even satirical commentary here either. “Dope” is just a fantastical, slight, and occasionally fun, hip hop-scored romp.