Congratulations, potty mouths: On Monday, the Supreme Court struck down a federal law barring the registration of “immoral or scandalous” trademarks as an infringement of the First Amendment. No longer can government bureaucrats reject your trademark application because they deem it subjectively offensive. This was an outcome surely required by the Constitution, but buried within the court’s decision in Iancu v. Brunetti is a concession that could allow Congress to impose new, narrower limitations on naughty trademarks. And one layer beneath the ruling is a possible tea leaf for the coming decision on partisan gerrymandering. It’s a lot to pack into a case that started with the word FUCT.

That’s the name Erik Brunetti gave to his clothing line, hoping to convey the “revolutionary” and “proudly subversive” nature of his designs. (He claims it stands for FRIENDS U CAN’T TRUST.) But the United States Patent and Trademark Office refused to register FUCT, citing the federal bar on “immoral or scandalous” trademarks. Brunetti filed a lawsuit against the PTO, alleging that the statute constitutes viewpoint discrimination in violation of his free speech rights.

Iancu v. Brunetti was a pretty easy case in light of SCOTUS’ decision in 2017’s Matal v. Tam. There, the court struck down a similar ban on trademarks that could “disparage” any “persons, living or dead.” The justices unanimously agreed that a bar on “disparaging” trademarks constituted viewpoint discrimination, a cardinal sin under the First Amendment. It is a bedrock constitutional principle that the government cannot restrict speech on the basis of ideas it expresses. And by empowering the PTO to reject trademarks that “disparage” some person or group, the court held, the statute ran afoul of this rule.

As Justice Elena Kagan wrote for the majority in Monday’s ruling, Matal requires the statute in Brunetti to fall, too. It is simply impossible to determine which trademarks are “immoral or scandalous” without evaluating the ideas they express. And only those trademarks that express ideas favored by the government receive registration. According to the standard dictionary definition, Kagan wrote, speech is “immoral” when it is “wicked” or “morally evil.” So the law “permits registration of marks that champion society’s sense of rectitude and morality, but not marks that denigrate those concepts.” Similarly, speech is “scandalous” when it is “shocking to the sense of truth, decency, or propriety.” So the law “allows registration of marks when their messages accord with, but not when their messages defy, society’s sense of decency or propriety.”

“Put the pair of overlapping terms together,” Kagan explained, and the statute “distinguishes between two opposed sets of ideas: those aligned with conventional moral standards and those hostile to them; those inducing societal nods of approval and those provoking offense and condemnation.” And trademarks that clash conventional morality are denied “valuable benefits.” But under the First Amendment, the government retains no power to disfavor speech that conveys ideas it dislikes. Thus, the ban must fall.

To prove her point, Kagan demonstrated how, exactly, the “immoral or scandalous” prohibition works in practice. The PTO denied a trademark to a pain relief medicine called “YOU CAN’T SPELL HEALTHCARE WITHOUT THC,” but registered “SAY NO TO DRUGS—REALITY IS THE BEST TRIP IN LIFE.” (Promoting marijuana is “scandalous”; opposing it is righteous.) It rejected the trademark BONG HITS 4 JESUS because “Christians would be morally outraged by a statement that connects Jesus Christ with illegal drug use,” but registered “JESUS DIED FOR YOU.” And the PTO turned away a “BABY AL QAEDA” trademark because it is “shocking to the sense of decency,” but registered the “WAR ON TERROR MEMORIAL.” (No reasonable person can defend al-Qaida, of course, but more than a few have contested the decency of the war on terror.)

Every justice agreed that Congress cannot ban “immoral” trademarks.

These samples illustrate the law’s preference for trademarks that express “rectitude and morality,” which suffice to prove viewpoint discrimination. But Kagan could’ve also given examples of the PTO’s weirdly inconsistent application of the “immoral or scandalous” ban. For instance, the PTO approved the trademarks “Party With Sluts” and “Wondrous Vulva Puppet” while rejecting “Bubby Trap” and “Pussywear.” It approved “Cumbrella” and rejected “Cum Together.” Somehow, “Anal Fantasy Collection” got approved but “A-Hole Patrol” was refused. And the PTO registered “Grammar Nazi” but not “Coffee Nazi” and “Surf Nazi,” suggesting some idiosyncratic hierarchy of Third Reich metaphors. The disparate treatment of these trademarks reveals a key danger of viewpoint discrimination: It gives government officials broad power to impose arbitrary and eccentric limitations on free expression.

Every justice agreed that Congress cannot ban “immoral” trademarks. But Chief Justice John Roberts, as well as Justices Stephen Breyer and Sonia Sotomayor, wrote that the court should have upheld the ban on “scandalous” trademarks by narrowing it. This provision would pass constitutional muster, they wrote, if it were read to apply exclusively to vulgar “modes of expression.” As Sotomayor noted, “[e]veryone can think of a small number of words” that would “plainly qualify”—basically, George Carlin’s seven dirty words, plus the N-word. These words can be denied a trademark, she wrote, not because of the ideas they express but because they are mere “lewd words” that “cause a visceral reaction.”

Justice Samuel Alito agreed that Congress could ban the registration of “vulgar terms that play no real part in the expression of ideas,” but declined to rewrite the statute to give it that meaning. Notably, Kagan didn’t contest the notion that government can ban a select set of highly offensive words; she wrote only that the current law does no such thing, instead encompassing a huge amount of offensive speech. The opinions in Brunetti therefore leave Congress the option of passing a narrowly tailored law that bans the registration of “vulgar” trademarks. If it does, the PTO could reject trademarks like FUCT, leaving Brunetti back where he started.

There is one final wrinkle in this case. Kagan’s opinion vigorously reaffirms the principle that the government cannot discriminate against expression on the basis of viewpoint, even when that expression isn’t exactly valuable. Nobody argues that the PTO’s refusal to register FUCT posed an acute danger to self-governance, even though nearly everyone agrees it deserves First Amendment scrutiny. Two other cases pending before the court, however, do involve government retaliation against political expression that lies at the heart of the First Amendment. The constitutional challenges to partisan gerrymandering in North Carolina and Maryland assert that a state infringes on free speech when it dilutes citizens’ votes because of their support for a certain political party. Government discrimination against voters on the basis of political expression would seem to be a graver threat to democracy than discrimination against filthy trademarks.

The court did not hand down its gerrymandering decisions on Monday, so we will have to wait a few more days to learn if a majority takes these First Amendment issues seriously. If the court does permit unconstrained partisan gerrymandering, its ruling will be far more damaging to free expression than any trademark law Congress might cook up.