The clear-eyed kid, wise beyond their years, is an evergreen trope of teen TV. That the wisdom they dole out should be earnest sex advice, however, is decidedly less familiar. An adolescent sex therapist? Now there’s something you don’t see every day.

This is the premise of the Netflix show Sex Education, the creation of British-Australian writer and playwright Laurie Nunn. And it’s a bonkers one, she readily admits. What started out as a joke that kept on giving has spun out into a high-school universe all its own, replete with a stellar cast and a web of compelling coming-of-age stories.

“I realised it was an interesting way to have frank, non-judgmental conversations with a teen audience about sex,” says Nunn, “but always in a light-hearted way.” And it’s likely that those conversations will speak not just to teen viewers but their adults too.

Asa Butterfield plays the 16-year-old sage, Otis. One day he and pink-haired Maeve (Emma Mackey, all black eyeliner and up-yours attitude) chance upon Adam (Connor Swindells), the school bully, having a Viagra-induced nightmare in a disused toilet block. Helpfully, Otis’s mother Jean, played by Gillian Anderson, is an actual no-holds-barred sex therapist, and he manages to talk Adam out of his panic, and his cubicle. Maeve sees a business opportunity. “The students of this school need your help, Otis,” she tells him, “and we need their money.” So they set up a clandestine clinic held in out-of-hours classrooms and on the swim-meet bleachers. She handles the admin, he the clients’ woes.

Stalling for time … Otis (Asa Butterfield) and Adam (Connor Swindells). Photograph: Jon Hall/Netflix

Those woes – the sex story of the week – were one of the most fun parts about writing the show, says Nunn. She came to the series with a few issues she wanted to deal with, and asked the predominantly female writers (“We had a couple of really brilliant, sensitive men in the room as well”) what information they wished they’d had when they were at school, and soon universal themes began to emerge. A sex educator was in the room too, to ensure they kept to the sex-positive, body-positive message Nunn wanted at the core of the show.

One imagines, just as the writers of the legal drama The Good Wife probably had a list of the many ways you might get into trouble, a list here of the many ways you might have trouble getting it on. But, says Nunn, it was never about ticking boxes: the sex issues had to have narrative integrity. “It’s never titillating – it’s always supposed to be awkward and cringeworthy and truthful,” she says.

To that end, directors Ben Taylor and Kate Herron brought in leading film and TV intimacy director Ita O’Brien. They heard her talking on Radio 2 about the Intimacy on Set guidelines she has developed and taught in British drama schools since 2015. “They were really aware that with the sexual content, and such a young cast, they needed to put in place good process, and take care of their actors,” O’Brien says.

Intimacy director Ita O’Brien, who consulted on the series. Photograph: Nicholas Dawkes Photography

Her guidelines draw on those that exist for combat scenes: fight directors are given time, space and a clear process for creating a fight, physical acting that clearly involves risk. Given the difficulties (ones that #MeToo has made only too evident) involved in creating moments of sexual expression, she set about defining what best practice should look like.

More often than not, O’Brien says, when things go badly on set it hasn’t been due to a director abusing their position of power, but ratherthat they have just been embarrassed. “They don’t know how to talk openly, they have no idea how to organise someone – physically – to get what they want,” she says. Actors are frequently left to their own devices, and an actor without a director moves a simulated sex scene out of the professional realm and into the personal – which makes them vulnerable.

O’Brien’s first day on set for Sex Education was to shoot a lesbian scene, in which one of the girls is desperate to please and the other has basically checked out. “I did my research,” O’Brien says. “I found [Kat Harding’s book] The Lesbian Kama Sutra, which was really useful, because it was supposed to be such an energetic scene.” She wanted to make sure that the different moves she offered the actors and the director felt authentic.

This quest for emotional and sexual authenticity might feel at odds with what some have deemed the inauthentic cultural identity of Otis’s world. As has been widely noted, if his and the other actors’ clipped tones, not to mention references to A-levels, minges and Wotsits, make the show and its school decidedly British, the varsity jackets, the corridor lockers and the name of the school – Moordale – are all too clearly not. The reason for this deliberate cultural hybridity is twofold.

First, says Nunn, the heightened premise needed a world elevated to match it. “So even though it was filmed in Wales [Moordale is housed in the former University of South Wales campus in Caerleon], I wouldn’t say it was set in Wales.” And with the Back to the Future colour palette and the clothes shifting between the decades even as the kids send mobile phone messages, the era the story is set in is just as hard to pin down. Nunn likes to think of the Moordale universe as something based on a comic, with people going, “Oh Moordale, where all those teenagers exist.”

Otis and his mum (Gillian Anderson) have a quiet chat. Photograph: Sam Taylor/AP

Second, the all-American teen genre is Nunn and Taylor’s first love, so they knowingly pay homage to it, from the song scene in Ten Things I Hate About You to the A-list clique (Mean Girls) arriving in a convertible together (Twilight). Here, however, Nunn has dug deeper to look for new perspectives.

She points to Otis’s best friend Eric (a breakout performance from Ncuti Gatwa): “At first you think, ‘Oh, I’ve seen this character before’; the gay black best friend, there for comedic effect.” He’s a queer kid obsessed with Hedwig and glitter, from a deeply conservative yet compassionate family, and his journey, as Nunn puts it, is very much equal to that of Otis; it becomes something you don’t see as often in a teen film. Moreover, their friendship, which Nunn sees as a love story between two friends, puts mutual respect and vulnerability between boys front and centre in a way that is equally rare. It’s the thing of which she is proudest.

Sex Education is about as literal a title as it gets, both in describing the magic-realist world of Otis’s therapy sessions and in what viewers can take from them. Rather than turning to Google or watching porn, the students are going to another student for help, and getting some very real answers. As Nunn puts it: “Sometimes you do just need a person to speak to.”