Three Marvel interpretations of Kamala Khan surround fan Meevers Desu as Ms. Marvel at the Denver Comic Con. Sean McCabe

A few years ago, a mandate went out in the offices of DC Comics. “I never want to see Supergirl’s panties again,” wrote Matt Idelson, an editor of DC’s Superman series, in an all-company email so epic it made headlines.

The Supergirl shot was a “staple,” G. Willow Wilson told me in a recent phone call. One of the few women writers to make it into the comics big leagues, Wilson likened the panty shot’s iconic status in comics circles to the still of Marilyn Monroe standing on the subway grate. “You look up at her panties. That was a thing that happened all the time.”

Much has changed quickly in one of the most nostalgia-fueled industries there is. Movies adapted from comics — once the domain of teenage boys — are now blockbusters, their characters playing out sociopolitical allegories. The line between niche and mass isn’t so bright, in the multibillion-dollar industry. Witness the scope of Comic Cons, the massive annual conventions for fans and creators in various cities. The o.g. iteration, in San Diego, hit capacity years ago, with 130,000-plus attendees. Anticipation for New York City’s version, set to touch down in the Javits Center next week, has been no less intense; tickets sold out in an hour. Matt Damon will be there (promoting The Great Wall, the most ambitious Sino-Hollywood production yet). So will representatives from HBO, DreamWorks, and Netflix.

Another major player in attendance will be a fictional Pakistani-American teen. Kamala Khan, the inheritor to the title Ms. Marvel, is one of the unlikeliest comic creations of the decade. A sixteen-year-old “morph,” or shape-shifter, Khan reboots a series started in the 1960s, offering a kind of girl counterpoint to Captain Marvel. In 2014, Khan took over for Carol Danvers, the original Ms. Marvel, and has since charmed even those fans who didn’t exactly want her. Seen initially as a corporate bid for diversity, an apologia of sorts from an industry where black and female characters are, more often than not, still written by white men, she has since become a broadly loved star — one spoken of on fan forums and in the Marvel offices as the next Peter Parker, a/k/a Spider-Man. Her fans don’t look any particular way. At San Diego Comic Con in July, they turned out in such a range that the comics site Bleeding Cool produced a photo essay, headlined in part: “Everyone Wants to Cosplay as Ms. Marvel.”

Written by Wilson, and inspired by the stories of Marvel editor Sana Amanat, the new Ms. Marvel is a study in conversion. Not of a religious sort (though Wilson, who is white, converted to Islam in college), but a creative transfiguration: the small to the large, the honest detail into mass appeal. The series is one of Marvel’s most successful, having entered an elite class within months of its debut, when that first issue hit a sixth print, a rare mark achieved by only a few genre classics, like the first issue of Wolverine. Amanat says she and Wilson never dreamed they’d make it to thirty issues, as they did this year. She puts their success down to Khan’s believability. “There’s that quote,” she told me recently, speaking by phone from the Marvel offices. ” ‘You achieve universality through specificity.’ We didn’t have a political agenda to prove to the world that Muslims are like this or not like this. You get to know Kamala Khan through the fact that she really wants to eat a BLT and she would really like to have her first kiss. And then you get to know that yeah, she’s a Muslim. She goes to mosque.”

Khan heads up what you might think of as a new league of naturalistic superheroes. There’s a revamped Black Panther, written for once by a black man, the memoirist and social critic Ta-Nehisi Coates. This spring, Valiant introduced a plus-size superheroine, and last fall DC’s Batgirl attended a transgender wedding. Heroines designed to conform to bedroom-poster ideals have lost the spandex. When Medusa, Queen of the Inhumans, makes it to the big screen in 2019, the rumor is it’ll be in something other than her old outfit: a tight bodice slit to the pelvis, where rests a strategically placed crystal. Batgirl, too, now wears a moto jacket and utility belt, part of a push toward what Wilson calls “more functionality, less butt floss.” The shift in costumes parallels a psychic realignment, as superheroes come to reflect the realities of a new range of audiences. On Netflix, the hardened Jessica Jones, a survivor of sexual violence wary of close connection, carries on an interracial romance with Luke Cage. Cage himself is now bouncing bullets off his chest in his own Netflix series, generating Black Lives Matter thinkpieces.

That characters would have to diversify to survive was clear to everyone in the industry. For a brief period in the 1960s and ’70s, comic books started to reveal a more expansive, if sometimes caricatured, vision of what it means to be a hero. The Black Panther and Luke Cage were a nod to the civil rights movement. Miss America was joined by Ms. Marvel, thanks very much. But as the books moved out of newsstands and into specialty shops, their fan base constricted to a white, male audience. The industry gave these readers what it thought they wanted — “boob window” is an actual industry term for a costume cutout showing cleavage — and alienated outsiders. “Over time, we started to appeal to the same, dwindling fans,” Jason Aaron, the writer of Thor, told the data journalism site fivethirtyeight.com two years ago, for a story on diversity. Now anyone can download a Marvel release. Twitter powers a fan base with no clear allegiances except to story and character, and changing audience demographics mean that diversity is good business.

Those shifts don’t necessarily tally with what’s happening on payroll. Creators in what Wilson calls “a handshake business” are still overwhelmingly male and white. “The audience is driving the shift in character demographics more than the slight increases in more representative creator ranks are,” agrees Tim Hanley, a statistician who tracks the comic world. “Thor and Wolverine are women now, but they’re both written by men. There’s a black Captain America and a black Spider-Man — who coexists with the original Peter Parker — and a black female Iron Man, but they’re written by white men; all of the artists are white as well, though Spider-Man is occasionally drawn by a woman. Even with the recent massive influx of women writing female characters — and only female characters; few women write men or team books — men still write female characters in at least equal numbers.”

This helps explain the success of characters fleshed out by writers who might know their stories intimately. Those characters are good. They’re specific. And they’re special, insomuch as they’re still rare. They also make Marvel look hipper than perhaps it is. White men writing female and p.o.c. characters isn’t a great look in 2016, and Marvel has suffered from the prevalence of it, drawing backlash online. Writers from the margins — black writers, women, trans writers, immigrant kids — are also precisely the types one would think would be prized in the industry. Comics have always been for the outsiders, the freaks, the kids who can’t find anyone to sit with in the cafeteria. Amanat cites X-Men as the gateway drug that got her hooked.

“What I loved about them was that they were really this band of misfits who completely were disconnected from society and everyone blamed them for a lot of things going wrong. And there was a certain camp [of mutants] who hated everyone, and a camp who rose up above that and decided to take their ‘vulnerabilities’ and make them into strengths. That was very captivating to me. And honestly,” she adds, “it was probably one of the most diverse casts on television at the time.”

Khan is tempted by a BLT. Courtesy Marvel

The disconnect — between diversity on the page and the lack thereof in writers’ rooms — is a startling one. The page contains infinitudes. “Our special-effects budget is unlimited,” Amanat joked last year to Coates, in a talk available on YouTube. “It’s a pen and paper.” A comic hero can be green and muscly, or brown and gawky. You can’t use that old Hollywood excuse, that stars of color simply don’t exist; they can be drawn.

But these characters can also front, deceptively, for a monochrome industry. Wilson blames “a certain amount of gatekeeping” for sustaining this status quo. “Any time you get a new creator or writer or artist, there’s this question of, well, how are they qualified, especially if this person is female or a person of color. The fact is, there is not such a thing as being qualified to write comics. A lot of the best comic writers don’t have high school degrees. Now we have Ta-Nehisi Coates, and Roxane Gay [the writer, also black, tapped to write World of Wakanda as a companion to Black Panther]. If you look at their qualifications — he’s a MacArthur ‘genius.’ Gay is a bestselling author, teaching at the college level. Margaret Atwood is another public intellectual [who’s been recruited]. If you’re a white dude, you can just write comics because you’re good at it, but if you’re a person of color or a woman, you have to be a MacArthur genius or have a Ph.D. or speak three languages.”

Wilson herself is a former journalist once based in Egypt; like Khan, she was raised in New Jersey. Only Wilson was white, in a nonreligious household. She converted to Islam in college, on a path of self-reckoning that wouldn’t be out of place in a comic book, drawn to the mysticism of full faith in what can’t be known. “Once you discover that the world rewards reckless faith, no lesser world is worth contemplating,” she wrote in a memoir about her conversion, The Butterfly Mosque. Islam she describes as a map to the true and unseen universe, the “dark planes that stretch beyond the earth in every direction, full of stars and dust.”

The complicated codes of religion are a natural fit with the world of comics in which Wilson now works. Heroes, too, are bound by codes. Hidden histories and dogmatic restrictions are woven deep into the fabric of comics (remember Superman?). The scriptural precepts held dear in Islam aren’t out of place in a world governed by alternate rules: submission to belief in the unseen, and visible action based on, or demanded by, these beliefs. The hijab, likewise, is a rather uncanny costuming tool, at once conferring anonymity and a kind of empowerment. Perhaps inevitably, a veil defines one of the best-known comic offerings out of the Muslim world: Burka Avenger, the wildly successful, literacy-focused Pakistani heroine.

German cosplayer Gina Kühn Johanna Klemm

When it came time to conceptualize Khan, Wilson felt free of the “editorial mandate” usually dictated by dudes at the top. Creating a new character enabled the freedom for “discussions that could only really have happened when the two primary story drivers on the book were two Muslim women,” Wilson says.

One was whether to put their Jersey City girl in a hijab. Wilson wears one; Amanat does not. And though the garment would have offered an easy hack for anonymity, they saw that choice as the enemy of the specific. In Pakistani-American communities, the hijab functions more ceremonially than in other communities of the Muslim diaspora, such as the Somalis of Seattle, where Wilson lives. Amanat and Wilson didn’t want a pan-Islamic hero, or a “perfect little Muslim girl,” but a girl true to her story, who “would wear hijab [only] when it was culturally appropriate, in the mosque,” Wilson says.

She and Amanat wanted Khan’s parents to read as real too, not the kind who “want to marry you off at sixteen, to your cousin or whatever.” Neither did they want “to go to the total opposite direction and ignore…the joyful chaos of family.” So Khan spars with her parents as much as your average teenage girl. If she’s representative of any group, it’s fans. Khan is herself a writer. She writes fan fiction, primarily about her hero — Carol Danvers.

The girl crush leads to one of the series’ most effective riffs on old comic clichés. Khan’s power is that she’s a morph, able to alter her body in any way she pleases. It’s a power ripe for the exploration of feminism: of what it would mean to a woman to be able to change her appearance at will. Khan uses this power, naturally, to transform into Ms. Marvel herself — taking on a blonde, willowy, Danvers-copy of a body. It’s the classic comic-book version of Khan herself.

In her new Danvers mode, she is able to question “the ideal that’s classically been at the heart of superhero-dom,” Wilson says, “without tearing down a character like Carol Danvers.” Khan’s personal hero embodies the standard “a lot of girls grew up with,” Wilson says. “She’s the tall, voluptuous Baywatch blonde, whereas a lot of readers, myself included, are never going to be that.” By switching into that body, Khan asks “in a very literal way: If you could just turn yourself into that ideal, would you still be the most effective version of yourself?”

In Khan’s case, not really. The scene could be thought of as a classic example of “unfridging,” or updating female characters while honoring the world in which they exist. Coined by the writer Gail Simone, the term refers to the truism that female comic characters were once featured mostly as excuses to indulge in extreme distress and violence — their bodies hacked up and kept in fridges. Khan tries on the body of Danvers, the kind her very character would have been forced into in a different time, and it feels off. “I always thought if I had amazing hair, if I could pull off great boots, if I could fly…that would make me feel strong, that would make me happy,” she says, touching her new golden locks. “But the hair gets in my face, the boots pinch…and this leotard is giving me an epic wedgie.”

The idea that a Pakistani-American girl could be an everywoman in the vein of big-business heroes of the past came from Amanat. The best superhero stories are about specialness dealt with in secret, and Amanat’s versions of those tales are now famous in the offices of Marvel Entertainment. They had to do with her actual childhood, though, like the time she went to prom dateless (she wasn’t allowed) in a well-tied bolt of cloth from Manhattan’s garment district. No New Jersey mall dresses fit the house rules — “not short and not sleeveless.” Nor could she play sports like everyone else, she told me, recalling “lacrosse in the heat with tights underneath my shorts. Fasting and running track, in the month of Ramadan.”

The possibilities presented by those negotiations were immediately clear. “When I was pitching [Khan],” says Amanat, “Joe Quesada [Marvel’s chief creative officer] was like, ‘Sana, this is our Spider-Man story. This is Peter Parker, except brown.’ ” Amanat sees the lineage as a narrative one. “[Spider-Man] was about a young teenager struggling to fit in, and the obligations that come with trying to be an adult and find yourself. The connection you have and respect you feel toward your family. That’s really Peter Parker. His struggles are the balance between his superhero life and his home life, and the guilt he feels about his uncle. [Khan’s] are about her identity struggles. Her trying to find herself. They’re told through different perspectives, but it’s two very similar kind of arcs.”

Writer G. Willow Wilson Amber French

Wilson nearly didn’t take the job when Amanat called her to offer it. She was sure she’d get an intolerable amount of backlash. “I was like, ‘You’re going to have to hire an intern to open all the hate mail,’ ” she jokes. She was going off the reaction her faith typically brings: “I couldn’t write an issue of Superman — having nothing to do with Islam or politics — without a certain corner of the internet saying it was an affront to American values by even being on that book. Because I’m Muslim, that it was creeping Shariah.”

That’s not how things went. Young people brought about the atmosphere in which Kamala Khan could be born, and they’ve defended her right to life since she was, in 2014. “The sewers of the internet are a wide and amazing place,” Wilson says, but in this case, not much grumbling has emerged, even from them. “We could have published this series ten years ago, word for word, panel for panel, and it would have been shuttered in a few issues.” She credits her fan base for a passionate defense. “Everyone loves to dump on millennials. ‘They’re going to bring about the apocalypse,’ or whatever. But in my anecdotal experience, it’s the youngsters that have really embraced Kamala from the outset. I thought I was going to have to fight all these battles that readers fight on my behalf — Twitter beefs and backlash.”

If it’s the minority writer’s dream to get members of the majority to care, Khan’s done that for her creators. Fans treat her like a fully realized person, one whose ethnicity is just part of the deal. “She doesn’t seem like the type to enjoy violence or hurting people,” wrote one, in a forum riff on how the new Ms. Marvel’s first fight might go down. The conversation made no mention of Islam, or culture, but only of Khan’s temperament.

Even on Reddit, the infamous warren of internet back alleys that can feel guided by an ethos of adolescent male aggression, Kamala hasn’t faced much criticism. In one thread, titled “America needs a Kamala Khan (Ms. Marvel) movie,” fans debate the odds of Khan’s making it to the big screen. This is really the big question in comic-land. New characters are effectively interns before they become entry-level workers — in an animated series, perhaps, a leap Khan recently made (she’s in the Avengers cartoon). To get to the career high of being in a movie takes time.

Marvel editor Sana Amanat Judith Stephens

By the point Kamala Khan makes it to the screen, it’s possible that what was so new about the character will seem quaint. Comics that were truly groundbreaking when they were conceived can feel like too little, too late when the broader public finally becomes aware of them — as in the case of Black Panther, the first black superhero, who is only now making it to the movies. Of course, what’s old often turns new again. There’s an argument to be made that Black Panther has regained resonance today, in a time of awareness of police shootings, and the Black Lives Matter movement.

Khan, too, has multifaceted resonance. Yona Harvey, a poet tapped by Coates to write World of Wakanda with Gay, told me she mourns that Khan wasn’t out during her daughter’s comics phase. She mentioned to me a blonde character, described in the books as the “queen of concern.” An acquaintance of Khan’s, the girl is a pro at backhanded friendship. “Her niceness is a kind of way of being mean,” Harvey says. She describes one scene in particular: “Kamala is hanging out with her friend, and everything is fine, cool. In comes this tornado of a blonde girl, and she’s like, ‘Kamala, you can’t come out, right?’ She’s focusing on her [Muslim] traditions and family. But her way of so-called connecting and compassion and concern is really abrasive.” Harvey calls her “nice nasty.”

Any girl of color might relate to the faux concern of the girls on top, asserting their place in the junior-high hierarchy. Harvey says her daughter, now seventeen, feels the pangs of nice-nastiness “all the time.” Wilson sees the fact of being able to tell those realities as extraordinary, no matter whether it ever goes to screen. “I’ve been in this industry for decades, since I was twenty,” she says. “This is the fastest I’ve seen the needle move in terms of representation, in terms of willingness to talk about political issues, than I’ve ever seen in my life.”

Behind the Voice Art: Ms. Marvel.

Correction: The new Miss Marvel has had thirty issues, not eleven, as an earlier version of this story said.