The fate of LGBTQ equality in the American workplace may lie in Justice Neil Gorsuch’s hands.

During Tuesday’s oral arguments in a trio of cases involving transgender and gay rights, Gorsuch was the only conservative justice who seemed genuinely open to the possibility that federal law shields LGBTQ employees from discrimination. He was the only conservative justice who engaged in good faith with the argument that discrimination against gay, bisexual, and transgender workers always takes sex into account. Yet Gorsuch appeared to be concerned about the potential “massive social upheaval” of a ruling that recognizes federal protections for LGBTQ workers. The outcome of Tuesday’s cases may depend upon his ability to set aside political concerns and interpret the law as written.

Those cases revolve around Title VII of the Civil Rights Act of 1964, which bars employment discrimination “because of sex.” The plaintiffs here—two gay men and one transgender woman—argue that it is impossible to discriminate on the basis of sexual orientation and gender identity without taking sex into account. If they are correct, then Title VII imposes a federal ban on LGBTQ employment discrimination. Currently, only 22 states protect gay and bisexual employees, and 21 states protect trans employees. An inclusive interpretation of Title VII would provide a federal backstop for the half of the country that lives in a state with no legal safeguards for LGBTQ employees.

Pam Karlan, arguing for the gay plaintiffs, made a powerful claim that sexual orientation discrimination always turns on sex. “When an employer fires a male employee for dating men,” she began, “but does not fire female employees who date men, he violates Title VII. The employer has … discriminated against the man because he treats that man worse than women who want to do the same thing.” The man’s sex played an inherent role in his termination.

Karlan’s argument is rooted in textualism, the theory that a statute’s words should be interpreted according to their plain meaning whenever possible, without resorting to legislative history. Textualism is a vital tool for the plaintiffs here because everyone agrees that when Congress passed Title VII in 1964, it was not thinking about LGBTQ people. In theory, that fact should not matter for a textualist; what matters are the words because of sex. And as Karlan explained: Imagine two employees “tell you they married their partner Bill last weekend. When you fire the male employee who married Bill, and you give the female employee who married Bill a couple of days off so she can celebrate the joyous event, that’s discrimination ‘because of sex.’ ”

David Cole, who represented the transgender plaintiff, Aimee Stephens, made a similar argument. When Stephens’ employer fired her for transitioning, Cole said, it “fired her for contravening a sex-specific expectation that applies only to people assigned male sex at birth—namely, that they live and identify as a man for their entire lives.” It also fired her for “changing her sex.” And that is sex discrimination “in the same way that firing someone for changing their religion would be religious discrimination.”

Justice Samuel Alito spent much of the morning harping on the fact that Congress did not foresee these results in 1964. He asked why the court should be “deciding a major policy question that was not in Congress’ mind in 1964.” And he accused Karlan of “trying to change the meaning of what Congress understood ‘sex’ to mean” when it passed Title VII. Chief Justice John Roberts, meanwhile, fixated on trans bathroom use and fretted about exemptions for religious organizations. Both Alito and Roberts were more focused on congressional intent and the consequences of LGBTQ equality than the text of Title VII. Justice Clarence Thomas was silent as usual, and Justice Brett Kavanaugh said virtually nothing.

Not even the attorney tasked with excluding gay people from Title VII could fully divorce sex from sexual orientation.

Gorsuch, however, appeared to understand that these cases are a test of his consistency as a self-identified textualist. And he grappled, ambivalently, with the meaning of the statute throughout the morning. In one remarkable exchange with Jeffrey Harris, who argued for the employers, Gorsuch pointed out that Title VII doesn’t require sex to be the sole factor in discrimination; it can be a mere motivating factor, one among several. “Isn’t sex also in play here?” he asked Harris. “In what linguistic formulation would one say that sex, biological gender, has nothing to do” with anti-gay discrimination? “Wouldn’t the employer maybe say, ‘It’s because this person was a man who liked other men’? And isn’t that first part sex?”

Incredibly, Harris briefly conceded Gorsuch’s point. If discrimination “is based on animus against gay men or lesbian women,” Harris responded, then sex “may well be a motivating factor.” Not even the attorney tasked with excluding gay people from Title VII could fully divorce sex from sexual orientation.

Later, Gorsuch pressed Cole on how courts should balance textual interpretation with real-world consequences. “When a case is really, really close on the textual evidence,” the justice asked, should a judge “take into consideration the massive social upheaval that would be entailed” if the court ruled for LGBTQ equality? And what about “the possibility that Congress didn’t think about it”? The question, Gorsuch told Cole, “is a matter of the judicial role and modesty in interpreting statutes that are old.” Under these circumstances, should a judge favor an interpretation that strains the text but aligns more closely with what Congress envisioned?

It is unclear why Gorsuch anticipates that nationwide equality would bring “massive social upheaval” when nearly half the states already banned LGBTQ discrimination without provoking any notable disturbance. Regardless, there is no “massive social upheaval” exception to textualism; if anything, judges should be especially faithful to textualism when the stakes are high to ensure a neutral decision untainted by outside pressures. If Gorsuch abandons his textualist instincts in these cases, he will essentially concede that he prioritizes a conservative result over the integrity of his methodology.

All four of the more liberal justices did their best to push Gorsuch in the right direction. Justice Ruth Bader Ginsburg noted that Title VII “was meant to strike out the entire spectrum of sex stereotyping,” noting that courts have long read the law to prohibit sexist demands that men and women comport with traditional gender roles. Justice Elena Kagan flexed her textualist cred, explaining that “the lodestar of this court’s statutory interpretation has been the text of a statute, not the legislative history. … We look to laws. We don’t look to predictions. We don’t look to desires. We don’t look to wishes.” Justices Sonia Sotomayor and Stephen Breyer reminded Solicitor General Noel Francisco—who argued against LGBTQ rights on behalf of the Trump administration—that the Civil Rights Act was intended to halt discrimination against unpopular groups.

“We can’t deny that homosexuals are being fired merely for being who they are,” Sotomayor told Francisco. “They may have power in some regions, but they are still being beaten, they are still being ostracized from certain things. At what point does a court say, Congress spoke about this—the original Congress who wrote this statute told us what they meant. They used clear words. And regardless of what others may have thought over time, it’s very clear that what’s happening fits those words.”

Gorsuch is a conservative justice appointed by an anti-LGBTQ president and confirmed by mostly anti-LGBTQ senators. He surely feels substantial pressure to rule against LGBTQ rights. But he also seems to comprehend that when an employer discriminates against a gay, bisexual, or transgender worker, sex simply cannot be removed from the equation.

The Supreme Court’s conservatives may well issue a 5–4 decision excluding LGBTQ people from Title VII, claiming judicial humility and insisting that Congress must settle the dispute. Or Gorsuch, who is obviously more comfortable with gays than trans people—could split the baby, concluding that the textualist argument is stronger for sexual orientation than gender identity. But true consistency requires Gorsuch to cast a fifth vote for full equality.