People tend to regard history as a stream of progress that only flows one way. The LGBTQ rights movement has experienced great success over the past 35 years passing laws and fighting court cases to make discrimination against LGBTQ people illegal. The crown jewels of these achievements are marriage equality, state and local nondiscrimination laws, and the legal interpretation of Title VII of the 1964 Civil Rights Act to protect transgender people on the basis of sex.

In the next five years, all of that is probably going away, and there won’t be a path to reclaim that progress for at least a generation, if not two or three.

Late last month, something happened that escaped the notice of most of the progressive press. The conservative plan to end the LGBTQ rights movement as we know it snapped into clear focus. It’s not a short term plan, but one that will take place inexorably over the next five to ten years. The scary part is that it is not just feasible, but also highly likely to succeed, and there’s very little the movement can do to prevent its own demise.

Related: Will the Supreme Court reexamine the Civil Rights Act?

Their long term strategy for the Supreme Court is to do two things. First is to interpret Obergefell v. Hodges as narrowly as possible, such that the decision only guarantees the right to get your name on a license and a death certificate. The second is to lay the groundwork for the Religious Freedom Restoration Act of 1993 (RFRA) to nullify almost all legislation, case law, policies, and regulations protecting LGBTQ people. Once this is accomplished, the protections for transgender people under the 1964 Civil Rights Act will almost inevitably fall, along with protections for women and other minorities.

To achieve both, all they have to do is keep planting the seeds in dissents to court opinions, and wait for Kennedy and/or Ginsburg to retire. Kennedy is already dropping big hints that he will retire after the next session of the Supreme Court. Once Kennedy retires, he is almost certain to be replaced by someone with a legal philosophy nearly identical to Justice Gorsuch, given The Heritage Foundation and The Federalist Society are the source of the list the Trump Administration is using to pick Supreme Court justices.

So what does the legal path to the LGBTQ civil rights armageddon look like? Here’s what’s probably in store for us.

The Gorsuch Era Begins

On June 26th, the Supreme Court issued a per curiam decision in the case of Pavan v. Smith, in which the state of Arkansas was argued that two sets of married lesbian parents could not be on the birth certificate of their children. In both cases, the children were conceived by anonymous sperm donations. A heterosexual married couple who conceived in the same way would legally be allowed to have both their names on the birth certificates, and thus differential treatment was clearly happening.

The Supreme Court of reversed and remanded the Arkansas state Supreme Court ruling, finding that, “Arkansas may not, consistent with Obergefell, deny married same-sex couples that recognition.” Gorsuch, Alito, and Thomas dissented, arguing that Obergefell isn’t settled law, and only applies to the issuance of marriage certificates, and death certificates. While Justice Roberts did not join the dissent, it is unknown if he supported the decision either (since individual justices do not have to sign onto a per curiam decision).

What this tells us is that we have at least 3, if not 4, Supreme Court Justices ready to roll back marriage equality by allowing states to reduce the legal rights of same sex partners to a relatively worthless piece of paper that does not have to be honored for any legal purpose except death certificates. This exact same argument was successfully also used on June 29th in the case of Pidgeon v. Turner.

In this case, a conservative pastor in Houston argued that since Texas state law still forbids recognition of same sex marriage (it was never repealed, only overturned), it was illegal to for city government to offer city employees in same sex marriages the same benefits as heterosexual employees. The Texas Supreme Court instead accepted, 9 to 0, the argument that since Obergefell didn’t say anything specifically about employee benefits.

This tells us that we can expect Obergefell to be continually challenged until eventually they get one or two more votes at SCOTUS, whereupon they will issue an opinion that states can interpret Obergefell narrowly. If Chief Justice Roberts balks at such a blatant attack on stare decisis, all conservatives have to do is wait for Breyer or Ginsburg to also step down or die before the end of the first four years Trump Administration. Given Justice Ginsburg is 84 years old, and Breyer is 78, the odds that at least one of them leaves the bench before the end of 2020 is high.

Even more dangerous than this attempt to tear down Obergefell in the same piecemeal way they are tearing down Roe v. Wade, is how they are opening up the aperture to use RFRA as a legal justification to ignore civil rights laws. In previous years, the Supreme Court did not have the votes to take up cases (grant writ of certiorari, or cert) involving vendors refusing to serve LGBTQ people in states where LGBTQ people are legislatively protected from such discrimination. These cases usually involved a first amendment claim that the government was forcing them to express themselves in a way that violated their religious beliefs. For example, in 2014 the Supreme Court declined to hear the case of Elane Photography v. Willock, in which a New Mexico photographer for hire refused to take pictures at a same-sex wedding.

That all changed after the death of Justice Scalia, and the addition of Justice Gorsuch. This is why SCOTUS now took up the case of Masterpiece Cakeshop, Ltd. v. Colorado Civil Rights Commission, which is basically the same as Elane Photography, but with cakes.

Civil rights experts are relatively confident that a first amendment claim can be beat back with the current composition of the court. Justices Alito, Thomas, and Gorsuch all seem primed to carve out a giant religious exemption to civil rights laws. Chief Justice Roberts hasn’t been supportive of overturning civil rights laws in the past (Elane) on the basis of first amendment claims in the past. Justice Kennedy voted with the majority in Obergefell, Hobby Lobby, and Little Sisters of the Poor. Even if Kennedy decides against Masterpiece Cake shop, however, you can be sure that a Trump appointee to the Supreme Court will treat the outcome as narrowly as possible (e.g. “Masterpiece Cakeshop was about freedom of speech. This new case involves a RFRA claim. Totally different.”)

Gorsuch has a history of interpreting RFRA extremely broadly, to the point that in Gorsuch’s opinion even signing a piece of paper opting out of the ACA’s provisions on birth control was an unconstitutional burden on the free exercise of religion. While Chief Justice Roberts hasn’t been supportive of first amendment claims, he did vote with the majority in Hobby Lobby and Little Sisters of the Poor Home for the Aged v. Burwell. He also dissented in Obergefell, and has expressed the view in that case that the LGBTQ lobby is so powerful that they do not need government protections from discrimination.