When “You’re the Worst” premiered on FX last year, it offered a dark, comedic twist on the meet cute.

Jimmy (Chris Geere) and Gretchen (Aya Cash) had more of a meet despicable. Here were two relationship-opposed people, of sometimes questionable character, who found themselves falling for each other. By the end of the first season, the pair warily met their inevitable fate when Gretchen moved in with Jimmy after a series of unfortunate events that culminated in her apartment burning down.

It was expected that Season 2, which wrapped up Wednesday night, would focus on Jimmy and Gretchen’s issues with co-habitation, but the show threw viewers for a loop when it was revealed that Gretchen was suffering from clinical depression. While still funny, “You’re the Worst” veered into even darker territory as Gretchen struggled with a perpetual sadness she couldn’t explain to her narcissistic boyfriend.

“I always want to throw our audience off a little bit,” creator and showrunner Stephen Falk said in a phone interview with The Post last month. Falk said that Gretchen’s depression wasn’t always known, but developed in early Season 2 meetings with the show’s writers. 

It wasn’t something that we felt like we had to do to explain her bad behavior,” Falk said, well aware of some of the criticism behind the storyline. “It was just a complication that seemed to fit.”

While some fans have been skeptical of the unexpected plot, the show has also been praised for portraying clinical depression with authenticity.

The last few minutes of the season’s fourth episode are the first real indication that something is wrong with Gretchen — she’s shown sneaking out of the house in the middle of the night and driving away. In a later episode, Jimmy follows her and discovers that she’s crying alone in her car.

In episode seven, after a day of day-drinking and hurling insults at her friends, Gretchen tells Jimmy what’s been going on with her in the most Gretchen way possible:

“Okay, so here’s an interesting thing that you don’t know about me: I am clinically depressed. It’s been going on my whole life so I’m actually really good at handling it. It strikes me whenever and I have no idea why, but it’s fine. I’m sorry I never told you — slipped my mind! And who knows? With the right attitude this could be a really fun adventure for everyone. So the only thing I need from you is to not make a big deal of it and be okay with how I am and the fact that you can’t fix me.”

On a conference call last month, Geere said the cast referred to Gretchen’s depression as the show’s fifth character — rounding out an ensemble that includes Gretchen’s dependent BFF Lindsay (Kether Donohue) and Jimmy’s roommate, Edgar (Desmin Borges), a veteran who suffers from PTSD.

“The whole depression storyline has been hard for all of us because we’re trying to stay true to the characters,” Geere said, noting that “for a very intelligent guy, [Jimmy] is quite limited emotionally.”

In a phone interview, Cash said that the development, though unexpected, didn’t surprise her. “If you look at who Gretchen is and the way she deals with the world… her drinking and drug use and the sort of self-medication aspect of things, it makes a lot of sense.”

As the season progressed, Gretchen’s depression changed the tone of “You’re the Worst,” in some cases causing it to feel like a different show altogether. In fact, if you’d just casually tuned in to episode nine, it may have looked like another show altogether.

The episode, “LCD Soundsystem,” opens with guest stars Tara Summers and Justin Kirk, as a couple with whom Gretchen becomes fascinated in the throes of her illness. It’s more than five minutes before you see anyone from the show’s cast, and it’s Gretchen, peering through the couple’s window while smoking a cigarette.

“It was like I was guest-starring on my own show, which was fascinating,” Cash said. “I love that they did that. What an amazing risk to take as writers. I really loved sort of the weird fever dream.”

Falk knows it was a polarizing episode, calling the negative reactions “voracious,” but he said the response was overwhelmingly positive. This glowing Reddit thread discussing the episode certainly supports that interpretation.

“Everything we do in the show is a fine balance, it’s always walking a line,” said Falk, who was an executive producer on Showtime’s “Weeds.” “I think the most interesting television does that. If you’re pleasing everyone at all times, you’re doing something wrong.”

Even before Gretchen’s depression was revealed, “You’re the Worst” dealt deftly with serious topics while it garnered laughs with irreverent humor. “When you’re writing a comedy, there’s this idea that everything has to be funny. And I kind of reject that,” Falk told The Post earlier this year, in an interview about how the show has approached Edgar’s PTSD.

This season’s penultimate episode saw Gretchen’s depression at its worst — she’s basically rendered unable to communicate aside from a few texts — but it ultimately set us up for a resolution of sorts, as a previously clueless Jimmy finally figured out a way to support Gretchen, even if he doesn’t fully understand what she’s going through.

In Wednesday’s finale, Gretchen finally looks like herself again. When Jimmy asks how she’s feeling, she responds: “Human, a little human.”

When Jimmy suggests that she tries switching her medication the next time she feels her depression coming on, Gretchen drops the bomb: She’s not on medication. “S–t, no, I don’t want to lose my edge!” she says. It’s a flabbergasting declaration, considering how adamant she was about Jimmy not being able to “fix” her. But it also feels like Gretchen’s back!

By the end of the episode, after taking care of Jimmy, hungover from the notorious trash juice at Vernon and Becca’s gender-reveal party, Gretchen changes her tune a bit. “I’m gonna talk to someone about it, a doctor someone, maybe see about some medication,” she says casually. “It’s always just been me, you know? Now it’s not anymore.”

A sweet moment afterward underscores how much Gretchen and Jimmy have grown over the course of their unlikely relationship during the second season. “You know, after I cleaned the fries off your face and put you to bed, you said something to me that was pretty dark,” Gretchen tells Jimmy. Afraid of what he might have said, Jimmy replies, “Don’t tell me.”

“Okay, I won’t,” she says. “I love you, too.”