LUBBOCK, Texas—The conservative effort to undermine marriage equality by legalizing anti-gay bigotry under the guise of religious liberty appears to be in peril.

On Monday, a panel of judges for the 5th Circuit U.S. Court of Appeals heard arguments in Barber v. Bryant, a challenge to Mississippi’s HB 1523—easily the most sweeping anti-LGBTQ bill passed since the Supreme Court struck down same-sex marriage bans nationwide in 2015. Passed in response to that ruling less than a year later, the Mississippi law would permit religious individuals, businesses, and government officials to discriminate against LGBTQ people in a broad array of contexts. Shortly before it took effect, a federal judge blocked HB 1523 as an egregious constitutional violation. Mississippi appealed to the 5th Circuit, drawing a panel of three conservative judges. Before Monday’s hearing, it seemed probable that these judges would reverse the district court and let HB 1523 take effect. But after 90 lively minutes of arguments, that outcome is no longer assured. In fact, the court often appeared skeptical of the law’s constitutionality and wary of its malevolent intent.

To grasp what’s at stake in this litigation, consider the unprecedented reach of the Mississippi bill. A typical religious freedom statute protects all beliefs and allows the government to restrict religious exercise when it has a compelling reason to do so. (Mississippi already has such a law.) By contrast, HB 1523 protects just three beliefs and does so absolutely, permitting no exemptions. The law seeks only to safeguard individuals who believe that marriage is “the union of one man and one woman”; that “sexual relations are properly reserved to such a marriage”; and that “an individual’s immutable biological sex” is “objectively determined by anatomy and genetics at time of birth.”

Under HB 1523, anyone who acts upon these beliefs receives total immunity from legal action. Landlords may evict gay and trans renters. Employers may fire LGBTQ workers. Private and state-run adoption agencies can turn away same-sex couples. Clerks and judges can refuse to marry same-sex couples. A doctor can refuse to counsel or treat an LGBTQ patient. And private businesses can refuse to serve LGBTQ people if doing so somehow involves “recognition of” a same-sex marriage. A gay couple who attempts to celebrate their anniversary with a nice dinner in Mississippi can be lawfully ejected from the restaurant. Don’t believe me? Read the bill.

A group of lawyers challenged the law as an effort to favor certain religious people in a manner that burdened adherents to other faiths—and specifically, LGBTQ people. The effort was led by Roberta Kaplan, the attorney who took down the federal same-sex marriage ban; civil rights attorney Rob McDuff; the Mississippi Center for Justice; and the Campaign for Southern Equality. Kaplan and McDuff argued before the court on Monday, facing off against Jonathan Mitchell, who recently argued in favor of rolling back marriage equality at the Texas Supreme Court. Mitchell co-authored a bizarre brief informing the 5th Circuit that gay people don’t deserve rights because they bully Christians and sometimes become straight. But when he kicked off arguments on Monday, Mitchell was levelheaded and focused on landing one knockout jab: The plaintiffs, a group of religious LGBTQ people who fear discrimination because of HB 1523, don’t have standing to fight against it because they aren’t actually harmed by it.

The law of “standing”—who has the right to fight a government action in court—can be dusty and distracting. Not here. Standing cuts to the core of this case because Kaplan is bringing a First Amendment Establishment Clause challenge. Under Supreme Court precedent, a state cannot endorse specific religious beliefs because doing so “sends a message to nonadherents that they are outsiders, not full members of the political community.” Those made “outsiders” by state endorsement of a religion are stigmatized by this “religious message,” and that injury confers standing to sue.

Unfortunately for Kaplan, the judges on Monday’s panel—Jerry E. Smith, Catharina Haynes, Jennifer Walker Elrod—are sticklers on standing. They’re also Republican appointees. So there was a ripple of surprise in the courtroom when Haynes, the most vigorous questioner of the day, threw Mitchell a hardball: What if, instead of singling out LGBTQ people, the Mississippi law protected only those who believe “marriage is a union between one man and one woman of the same race”—would that change the standing analysis?

“No,” Mitchell responded. “The plaintiffs still have to show imminent risk of suffering as well as personal and concrete harm.”

“What particular harm,” Haynes wondered, would suffice to confer standing?

“If the couple is about to get married,” Mitchell explained, “and faces a substantial risk of denial of services.”

Nobody looked happy with a standing theory that lets racist laws stay on the books until a racist uses them to harm black people. The extremely conservative Smith tried to help out Mitchell.

“Suppose Mississippi passed a statute that said, the official religion of this state is Southern Baptist,” he said. Would non-Baptists have standing to sue?

Nope! Mitchell responded. Not unless “some duty carried out” by the government discriminates against non-Baptists. This answer is, to put it lightly, unexpected since the Constitution explicitly bars the government from “respecting an establishment of religion.” But when Smith tried to bail him out, Mitchell doubled down, asserting that only “an action of the state” respecting an establishment of religion would give plaintiffs standings. Simply passing a law doesn’t count.

Then it was Elrod’s turn. What if, she asked Mitchell, the state printed out HB 1523 “on a big board in front of the state capitol.” Would that confer standing?

Yes! Mitchell replied. So long as an individual had “direct and personal contact” by “personally confronting the billboard,” he or she could have standing to sue. But, he noted, that plaintiff “would still lose on the merits.”

Why, though? Mitchell wouldn’t quite say. Throughout the afternoon, he continually diverted discussion of HB 1523’s constitutionality back to a debate about standing. Haynes put a stop to his evasions with one sharp question. She couldn’t understand, she told Mitchell, “this idea that this is not discriminating against people, that it’s just protecting religious beliefs.” Then she pitched a hypothetical: Imagine a same-sex couple applies for a marriage license, and the clerk “goes running down the hall” yelling “really loudly, ‘Oh, oh, oh, I’m recused!’ ” (For effect, Haynes raised her voice and waved her arms in the air, almost getting a grin out of the sour-faced Smith.)

“It’s not clear to me,” Haynes said, “why that isn’t state-sponsored discrimination.”

Mitchell insisted that such behavior wasn’t permitted under the statute which, Haynes pointed out, is patently false. She then threw out another hypothetical: A same-sex couple signs a contract for wedding-related goods, and the seller refuses to recognize the contract after receiving payment. HB 1523, she noted, “expressly allows the state to bless that nonrecognition.”

“ ‘Bless’ is an overstatement,” Mitchell stuttered. A skeptical Haynes sat back with a quizzical expression, looking unconvinced. Mitchell sat down and Kaplan approached the lectern with a look of grave concern.

“I’m not here to talk in general about religious freedom laws,” Kaplan declared. In other states, “thoughtful people on both sides” had crafted “neutral religious accommodation laws” that comport with the constitution. But HB 1523 “is completely inconsistent with our nation’s history. It begins with an endorsement of three specific religious beliefs” and “says to certain people in Mississippi, you are outsiders, you are not part of this community.” The law violates the chief command of the Establishment Clause by “promoting religious beliefs.”

Elrod, who was engaged and fair-minded throughout arguments despite her obvious sympathy for religious accommodation laws, pounced. She noted that in addition to shielding “religious beliefs,” HB 1523 insulates “moral convictions.” Doesn’t that give the law a secular purpose?

Absolutely not. “There are zero people saying they’re promoting” HB 1523 for “secular policy reasons,” Kaplan said. For Mississippi to pretend otherwise would be a “sham.” Haynes looked perturbed. Is there no way, she asked, for the government to protect anti-gay individuals’ freedom of “conscience” without violating the Constitution?

Of course there is, Kaplan responds—so long as it is done neutrally.

“The Supreme Court,” she reminded Haynes, “has said neutrality is the underlying principle of the Establishment Clause.” Nobody thinks Mississippi can’t protect religious freedom. What it can’t do is protect specific religious beliefs by giving special rights to adherents of a particular creed.

Elrod and Smith nudged Kaplan back to the standing issue. Why, they wondered, should the court render a decision if nobody has been “injured” by the law yet?

“It’s not fair,” Kaplan said, “to say to a gay couple, close your eyes, cross your fingers, and hope” public discrimination “doesn’t happen to you.” Then, to drive home the threat HB 1523 poses to LGBTQ people, Kaplan related the story of a lesbian whose 7-year-old daughter attended public school in Mississippi.

“The teacher asked each child, ‘Who are your parents, and are they married?’ ” Kaplan recounted. When the daughter said she had two moms, the teacher said, “No, they aren’t married.” She then polled the other students in the class, asking them whether these moms could really be married since they’re both women. The parents complained and the teacher was re-assigned. But under HB 1523, the school could take no action against the teacher.

“I implore you,” Kaplan said, “do not put 7-year-old children at risk of that indignity.” Already, two lesbian plaintiffs in the case have fled Mississippi for fear that something similar could happen to their children. HB 1523 creates a “stigmatic injury,” Kaplan said, which confers standing under the Establishment Clause. The court should recognize the galling stigma at stake here and strike down the law, she concluded.

Hanging over Monday’s arguments was the knowledge that this case goes far beyond HB 1523. Congressional Republicans have proposed a federal version of HB 1523, called the First Amendment Defense Act, that Donald Trump has vowed to sign. It would apply nationwide. Trump’s leaked religious freedom executive order, not yet signed but still a threat, is also an HB 1523 copycat. If the courts block this bill, they may stymie the national effort to favor anti-LGBTQ religious beliefs over all others. If the courts let HB 1523 take effect, they’ll create terrible precedent, and civil rights advocates will have a much harder time fighting its future iterations.

Here in Lubbock, then, we may have gotten a taste of the battle to come—an early skirmish between those who support religious freedom regardless of faith and those who demand extra rights for anti-LGBTQ believers. Smith, a polite but rigid traditionalist, seems poised to side with Mississippi on standing grounds. Haynes, a thoughtful and practical moderate, looks ready to block the whole law. Elrod is the wild card. She is a fair-minded but deeply conservative judge, and her vote may well tip the balance of this case. Her questions on Monday hinted at discomfort with Mississippi’s bigoted experiment. If she follows her instincts to a progressive outcome, she could help forestall the burgeoning movement to enshrine anti-LGBTQ religious favoritism in the law.