When Craig Johnson set out to make a teen comedy with “Alex Strangelove,” he naturally felt the obligation to work in one of the staples of the genre — a gross-out gag, though knowing that the director of “The Skeleton Twins” and “Wilson” has always had a distinctive, often outre sense of humor, it could be expected that nothing less than the unexpected would suffice.

“I was really searching for a twist on party hijinks [because] we’ve seen the kid trip out on acid. We’ve seen the kid get too drunk and throw up on his friend, but I thought, where could we go to that we haven’t seen?” says Johnson. “ So I thought, if Alex is this nature nerd, he’s obsessed with weird animals, so I read about psychotropic toads. Then it was just like, ‘Oh okay, here we go — I’m just going to push this as far as it can be pushed.”

Queasiness commences in “Alex Strangelove,” yet it isn’t only a tool for the many laughs Johnson is able to wring from the bad idea of licking a toad, but even more resonant punchlines in how one can feel the nausea and potential euphoria the film’s lead character Alex Truelove (Daniel Doheny) does when coming to terms with his sexuality in the week before prom. While Johnson’s welcome update of the high school sex farce pushes the comedy as far as it can go, there also seems to be something positively revolutionary about how he normalizes the conundrum at its center, in which the popular student council president (and wildlife aficionado) must decide whether to follow his instinct to pursue an attractive, urbane fella named Elliott (Antonio Marziale) he recently met at a party or stay in a relationship with his girlfriend Claire (Madeleine Weinstein), a longtime friend with whom he shares a strong connection but seemingly no sexual chemistry.

The answer may appear obvious from the start of “Alex Strangelove” to everybody but Alex, yet few other things are in Johnson’s brilliantly subversive comedy, which slyly reworks the spectre of prom night that has loomed large over the high school genre since the days of John Hughes and before into a touching story of someone following their own timeline to discover who they are. As the film finds its way into homes everywhere on Netflix, Johnson spoke about how close “Alex Strangelove” is to him, the 10 years it took to get made and embracing certain genre tropes in order to ultimately upend them.

Daniel Doheny and Antonio Marziale in "Alex Strangelove"How did this come about?

This one is certainly my most autobiographical. The spark of it came from struggling with confusing sexual identity issues. I came out incrementally throughout college, [initially] as bisexual and then eventually, later in my mid-twenties, basically I was like, “Okay, wait a second…no, no, you are full gay.” And once I came out, I was able to look back on my journey and think, “Wow, what a rollercoaster. I certainly think I have fallen in love with a couple of women in my life very authentically, but then there was always this pesky sex thing that got in the way,” so I thought, “Man, if you took this journey and condensed it into one kid’s senior year of high school, it could make for a really fun high school sex comedy that I don’t think I’ve seen before, a throwback in some ways to a bit of a John Hughes vibe but with a little bit of a modern Apatow “Superbad” vibe. The script came out just super fast about 10 years ago, and then it’s just been now 10 years of trying to get it made.

Your films typically defy easy genre categorization, but did having the contours of something as sturdy as the high school movie help? Of course, you subvert expectations, anyway.

Absolutely. There was a full embrace of the genre – high school movie – or the subgenre of the high school sex comedy. I knew I was embracing that, but I knew it had to sparkle and be fresh. It couldn’t just feel like a generic knockoff, but I feel honestly the freshness came just in the premise. There’s been numerous [films about] the teenage boy who’s got to lose his virginity by prom night, but if you take that losing your virginity story but then complicate it with “I don’t know if I like boys or girls,” that’s enough of a conflict to support a movie, and then you just have to embrace the hijinks — the partying, the drug trips gone wrong, the awkward sex encounters that are all tropes of a high school movie. It’s certainly the most genre-driven movie I’ve done which actually freed me up a little bit to take more flights of fancy and to snap crackle and pop a little more.

There seems to be a paradox when it comes to making teen comedies in that if you’re authentic, you typically would fall into an “R” rating while a great deal of your intended audience is “PG-13.” Did making the film with Netflix where ratings aren’t a consideration alleviate that pressure?

I knew it was always going to be a hard R before Netflix even was in the picture. In fact, there were some studios that we talked to that said, “Hey, could you try to do it as a PG-13? We’d be more likely to finance it.” And I took a look at the script and I thought, “No, it’s about love and sex and you can’t talk about sex authentically if you’re constrained by PG-13 rating,” so I always knew that it wouldn’t be worth it to make the movie any other way. We were doing it this way or we’re not doing it.

Daniel Doheny and Madeleine Weinstein in "Alex Strangelove"Over the 10 years you were setting this up and since when you came out yourself, the social dynamics around coming out in high school seem to have changed considerably. Was that something you had to keep tabs on?

Sure, I would rewrite the movie consistently over the 10 years and most of the rewrites were to reflect where high schoolers were, especially over the last three years or so. There’s just been this sea change in terms of openness. High school kids have gotten so much more open-minded and progressive, especially when it comes to embracing sexual experimentation and different multiple sexualities in high school. And it actually ended up helping the movie. The most recent rewrite I did was one that really made Alex’s school very open and progressive — there were queer kids, bi kids, trans kids. That wasn’t the issue for him. [The question for Alex was no longer] I can’t come out because I’d be the only gay kid. It’s like I can be whatever I want. It’s 2018. I can date him, I can date her, I can date multiple people. But that doesn’t make it any easier. In some ways, it makes it more overwhelming — I’m now paralyzed by choice. So what am I really into? I’ve got a girlfriend. I love her. But yet I’m attracted to this guy and it’s okay to date this guy, so what do I do? What am I really into? The conflict is internal, but strong enough to drive the movie.

How did you find your cast?

You hire incredible casting directors. We have two. David Rubin in New York and Richard Hicks in L.A. and we just cast a net over the entire United States and Canada. We saw hundreds and hundreds and hundreds of kids and it was the most daunting but the most exciting casting process I’ve ever gone through because we knew our three leads were going to be fresh faces. I’d never experienced that in a movie before, so we would whittle it down to maybe a few contenders for the three lead roles and then did a little bit of chemistry reads and mixing and matching, like this Alex and this Claire and this Alex and that Elliott, just see who vibed, and then we ended up with these three fabulous, young fresh faces. This movie was just a joy to make partially because of their energy, vitality and spirit. They’re all in their early twenties, and I felt like a cool brother to them. We all felt like we were at summer camp on this one. There’s always challenges in a movie, but out of the four movies I’ve done this was the one that felt the least like work. Making this movie was unfettered joy.

That also comes across visually. It seems like you’re able to be really playful with the color palette – were purple and pink as much of a touchstone as I perceived it to be?

We knew that we wanted something that was poppy and candy-colored and embraced youth and energy, so that meant that [it had to be] colorful. I always wanted little splashes of pink to remind people that we’re dealing in a world that embraces queer identity, but the purple bit just coalesced around prom and felt like a bouquet of warm flowers and felt right for the end of the movie.

It just seemed like you had some fun with that plaid shirt Alex wears at the start of the film where pink and blue overlap into purple, perhaps as a nod to his dilemma.

That may have been modeled on my fashion when I was a when I was a high school kid. [laughs] And Alex is very much my surrogate. He’s the character that’s the most directly based on me. Even though it’s the most genre-driven movie I’ve done, it’s in some ways the most personal and I don’t know what that says about me when my story would make a good sex comedy. I embrace it.

Daniel Doheny and Madeleine Weinstein in "Alex Strangelove"Like your previous films, there’s also some pretty killer needle drops – are there certain songs you’ll actually have as a centerpiece in your head as you’re writing?

Yeah, a lot I do. Music is so critical to me. I always tell my producers to put twice as much into the music budget as you think it should be because I’m going to hit you with serious cues and I really do dig my feet in with a lot of them. One of those critical cues for me is that Dusty Springfield song, “No Easy Way Down” that plays when Alex and Elliott are in the car [in one of their first serious conversations]. I’ve been wanting to put that song into a movie forever in a seduction scene [because] it’s the sexiest song I’ve ever heard, and also Dusty is a queer icon, so I felt like Elliott would embrace her. That was the one that you were going to have to rip from my cold dead hands, and luckily we got it in. But I managed to put in so many songs that I had wanted as first choices — obviously, the B-52s [song that] Elliott dances to, and then there’s a St. Lucia tune that plays at the prom and even in the opening credits we hear a little bit from a song called “Kelly” from When Saints Go Machine that was written into the script as the opening credits song. I’m thrilled when anyone brings up the music because it’s so important to me.

You also do something clever at the end, including a bunch of real-life coming out videos. How did that coda come about?

That notion of the videos was in the very very first draft that I wrote 10 years ago, which was a real early phase of the coming-out YouTube video. Kids would post these online and then other kids would watch them and be inspired by them, and that was just a moving thing that inspired me, so that was always the end of the movie. We debated whether it made sense in the edit, [asking ourselves] do we need it? And we felt that we did. We felt that it gave some social context to the whole movie and that it really couched Alex’s story as just one of hundreds of thousands of stories of kids who are going through something similar when they’re young. We just found that it had impact, so we embraced it.

“Alex Strangelove” is now streaming on Netflix.