/* ==========================================================================
   Super Bean Boy — the legal documents
   The privacy policy and the terms, on the same night-sky canvas as the landing
   page but built for READING: one column, a real measure, and nothing that moves.
   Generated pages — see tools/build_legal.py. The deletion instructions and the
   support page are written by hand and wear the same column.
   ========================================================================== */

/* THE NAV IS ALWAYS THERE ON THESE PAGES. On the landing page it hides until the
   reader has scrolled past the hero, which is right when there is a hero to get out
   of the way of. Here the page starts at the text, so a nav that needs scrolling to
   reveal is a page with no way back to the site. */
.legal .nav {
  transform: none;
  visibility: visible;
  transition-delay: 0s;
}
.legal .nav__links { display: flex; }

/* THREE LINKS NOW, ON A ROW THE LANDING PAGE HIDES BELOW 700px AND THESE PAGES CANNOT —
   a legal page with no way to its two neighbours is the thing being avoided. So the row is
   tightened rather than dropped: a smaller gap and no wrap inside a label, which keeps
   "Delete data" on one line down to 320px. */
.legal .nav__links { gap: 0.85rem; font-size: 0.82rem; white-space: nowrap; }
/* And the logo keeps its width while they do. It is `width: auto` off a fixed height, so a
   flex row with no room left shrinks it to nothing rather than to something small — at 390px
   it was already measuring 0px wide before this row grew a third link. */
.legal .nav__brand { flex: 0 0 auto; }
.legal .nav__brand img { min-width: 55px; }
/* AND ON A PHONE THE BUTTON GOES INSTEAD. Logo, three links and "Get the game" need about
   440px, and at 375px the button ran off the right edge half-drawn. The logo already goes
   home and the footer says "Back to the game", so the button is the one to lose. */
.legal .nav > .btn { display: none; }
@media (min-width: 560px) {
  .legal .nav__links { gap: 1.6rem; font-size: 0.92rem; }
  .legal .nav > .btn { display: inline-flex; }
}

.legal__main {
  padding: clamp(6rem, 12vw, 8.5rem) var(--gutter) clamp(4rem, 8vw, 6rem);
}

.legal__doc {
  width: min(100%, 68ch);
  margin-inline: auto;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

/* --- the draft banner ---------------------------------------------------- */

.legal__draft {
  margin: 0 0 2.5rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line-2);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: rgba(255, 209, 102, 0.08);
  color: var(--text);
  font-size: 0.95rem;
}
.legal__draft strong { color: var(--gold); }

/* --- headings ------------------------------------------------------------ */

.legal__doc h1,
.legal__doc h2,
.legal__doc h3 {
  font-family: var(--display);
  color: var(--text);
  line-height: 1.15;
  text-wrap: balance;
}
.legal__doc h1 {
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 600;
  margin: 0 0 0.6rem;
}
/* The version-and-date line the documents open with, which markdown makes an
   ordinary paragraph and which is really a subtitle. */
.legal__doc h1 + p {
  margin: 0 0 2.5rem;
  color: var(--muted-2);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
.legal__doc h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  font-weight: 600;
  margin: 3.2rem 0 1rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
/* BOTH DOCUMENTS PUT A `---` BEFORE EVERY SECTION, and an h2 draws its own rule, so
   the two land on top of each other with a gap between them. The rule belongs to
   whichever arrives first: where the markdown supplies one, the heading gives its up. */
.legal__doc hr + h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.legal__doc h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2.2rem 0 0.7rem;
  color: var(--green);
}

.legal__doc p { margin: 0 0 1.1rem; text-wrap: pretty; }
.legal__doc strong { color: var(--text); font-weight: 600; }

/* --- lists --------------------------------------------------------------- */

.legal__doc ul,
.legal__doc ol { margin: 0 0 1.4rem; padding-left: 1.3rem; }
.legal__doc li { margin-bottom: 0.55rem; }
.legal__doc li::marker { color: var(--green-2); }

/* --- links --------------------------------------------------------------- */

.legal__doc a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(164, 255, 63, 0.4);
  transition: text-decoration-color 0.2s;
}
.legal__doc a:hover { text-decoration-color: var(--green); }

/* --- tables, as the site's glass panels ---------------------------------- */

/* Scrollable rather than squeezed: several of these are three and four columns
   wide and a phone is not, and a table that wraps to one word per line is less
   readable than one the reader pushes sideways. */
.legal__doc table {
  width: 100%;
  margin: 0 0 1.8rem;
  border-collapse: collapse;
  font-size: 0.93rem;
  display: block;
  overflow-x: auto;
}
.legal__doc thead th {
  text-align: left;
  color: var(--text);
  font-family: var(--display);
  font-weight: 600;
  white-space: nowrap;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line-2);
}
.legal__doc tbody td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.legal__doc tbody tr:last-child td { border-bottom: 0; }

/* --- quotes and rules ---------------------------------------------------- */

.legal__doc blockquote {
  margin: 0 0 1.6rem;
  padding: 0.9rem 1.2rem;
  border-left: 3px solid var(--line-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  color: var(--muted);
}
.legal__doc blockquote p:last-child { margin-bottom: 0; }

.legal__doc hr {
  margin: 2.6rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.legal__doc code {
  font-size: 0.9em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ice);
}

/* --- the footer on these pages ------------------------------------------- */

.legal footer .footer__brand { text-align: center; }
.legal footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.legal footer a:hover { color: var(--text); }

/* ==========================================================================
   The deletion instructions
   The one page under /legal/ that is WRITTEN rather than generated, because it
   is not a document — it is four screens of the game with a sentence each. Same
   column, same measure; what it adds is a step that carries a picture.
   ========================================================================== */

/* The two routes, offered before the steps: press it yourself, or ask us. Reached through
   .legal__doc so that the document's own list indent above does not out-rank the padding: 0. */
.legal__doc .legal__routes {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 0 0 2.6rem;
  padding: 0;
  list-style: none;
}
.legal__route {
  margin: 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.legal__route h2 {
  margin: 0 0 0.4rem;
  padding: 0;
  border: 0;
  font-size: 1.05rem;
  font-family: var(--display);
  color: var(--green);
}
.legal__route p { margin: 0; font-size: 0.95rem; }
/* An address on its own line, big enough to tap: on the support page it IS the answer,
   not a word in a sentence. Allowed to break anywhere so a 320px card cannot overflow. */
.legal__route .legal__email {
  display: inline-block;
  margin-bottom: 0.45rem;
  font-family: var(--display);
  font-size: clamp(1.05rem, 4.2vw, 1.2rem);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* --- the steps ----------------------------------------------------------- */

.steps { margin: 0 0 2.4rem; padding: 0; list-style: none; counter-reset: step; }

.step {
  display: grid;
  gap: 1.1rem 1.4rem;
  grid-template-columns: 1fr;
  align-items: start;
  margin: 0 0 2rem;
  padding: 0 0 2rem;
  border-bottom: 1px solid var(--line);
}
.step:last-child { border-bottom: 0; padding-bottom: 0; }

/* Two columns as soon as there is room for the shot to sit beside its sentence:
   below that the picture belongs UNDER the words, since a phone reading this is
   the same shape as the phone in the picture. */
@media (min-width: 620px) {
  .step { grid-template-columns: 1fr minmax(0, 260px); }
}

.step__text { min-width: 0; }

.step__text h2 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.6rem;
  padding: 0;
  border-top: 0;
  font-size: 1.2rem;
}
/* The number is the list's own count rather than a character in the heading, so
   a re-ordered page cannot end up with two step threes. */
.step__text h2::before {
  counter-increment: step;
  content: counter(step);
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #0a0d1c;
  font-size: 0.95rem;
  font-weight: 600;
}
.step__text p:last-child { margin-bottom: 0; }

.step__shot {
  margin: 0;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: var(--shadow-sm);
}
.step__shot img { display: block; width: 100%; height: auto; }

/* --- the callout the irreversible step gets ------------------------------ */

.legal__warn {
  margin: 1.2rem 0 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line-2);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius);
  background: rgba(255, 157, 77, 0.08);
  color: var(--text);
  font-size: 0.95rem;
}
.legal__warn strong { color: var(--orange); }
