/* ── Public shell ──────────────────────────────────────────────────────────── */
/* The frame round every public page outside the app (legal/LegalPage.jsx's
   PublicShell: Terms/Privacy/Cookies, 404, board, changelog, sign-on, reset) and
   the static /about/ /learn/ /faq/ /contact/ pages (tools/build-learn.mjs copies
   this sheet and legal-table-footer.css next to them, with the token and taskbar
   sheets, so anything here must work without the app's other sheets).
   It is the landing page's own sky: the same radial gradient on the themed
   --landing-* ramp, the same fixed taskbar (hero-topbar.css), so it follows the
   theme exactly as the landing does. The starfield is the app's SpaceBackground
   canvas, a child of .legal-page (the static pages mount it via
   src/learnBackdrop.jsx), drawn over this gradient and under main/footer. */
.legal-page {
  min-height: 100dvh;
  /* Clears the fixed taskbar (60px; 52px on a phone). */
  padding-top: 60px;
  background: radial-gradient(ellipse at 50% 0%, var(--landing-bg-1) 0%, var(--landing-bg-2) 55%, var(--landing-bg-3) 100%);
  background-attachment: fixed;
  color: var(--legal-text);
  font-family: inherit;
  display: flex;
  flex-direction: column;
}

/* On the static pages, links between them swap only nav/main/footer (learnBackdrop.jsx)
   and the starfield keeps running; the new main fades in. Into or out of the SPA it is
   still a full document load with a new random canvas, so that crossfades and the
   stars fade in rather than blink and pop (both ends opt in: shell.css copies this). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .legal-page .space-bg { animation: legal-fade-in .6s ease-out both; }
  .legal-main { animation: legal-fade-in .25s ease-out both; }
}
@keyframes legal-fade-in { from { opacity: 0; } }

/* Above the fixed canvas; the taskbar already is (fixed, z-index 20). Whatever
   <main> a page brings takes the free height, so the footer sits at the bottom. */
.legal-page > main, .legal-footer { position: relative; z-index: 1; }
.legal-page > main { flex: 1; }

/* The one way into the app from the shell: a pill in the accent fill at the head
   of the taskbar row, so it reads as the action and the satellites as places.
   Its height is the row's shared --chrome-h. A phone's row has no room for it;
   the logo still goes home. */
.legal-nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: var(--chrome-h, 40px);
  padding: 0 18px;
  border-radius: 999px;
  background: var(--legal-primary);
  color: var(--legal-on-primary);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
@media (hover: hover) {
  .legal-nav-cta:hover { background: var(--legal-primary-2); }
}
.legal-nav-cta:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
@media (max-width: 600px) {
  .legal-nav-cta { display: none; }
}

.legal-main {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.legal-header {
  margin-bottom: 48px;
  border-bottom: 1px solid rgba(var(--legal-border-rgb),0.1);
  padding-bottom: 32px;
}

.legal-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--legal-heading);
  margin: 0 0 10px;
}

.legal-updated {
  font-size: 0.9rem;
  color: var(--legal-muted);
  margin: 0;
}

/* Shown only on a non-English policy: a translated copy is a convenience, and the
   English text is the binding one. Quiet, but above the body so it is read first. */
.legal-translation-notice {
  font-size: 0.95rem;
  color: var(--legal-muted);
  border-left: 2px solid var(--legal-heading-2);
  padding: 8px 0 8px 12px;
  margin: 0 0 28px;
}

.legal-body section {
  margin-bottom: 40px;
}

.legal-body h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--legal-heading-2);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(var(--legal-border-rgb),0.08);
}

.legal-body h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--legal-accent-lighter);
  margin: 20px 0 6px;
}

.legal-body p {
  line-height: 1.75;
  color: var(--legal-text-2);
  margin: 0 0 12px;
  font-size: 0.925rem;
}

.legal-body ul {
  margin: 0 0 12px 20px;
  padding: 0;
}

.legal-body li {
  line-height: 1.75;
  color: var(--legal-text-2);
  font-size: 0.925rem;
  margin-bottom: 6px;
}

.legal-body a {
  color: var(--legal-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (hover: hover) {
  .legal-body a:hover { color: var(--legal-accent-light); }
}

/* 10.2 - legal@galaxyglot.com was marked up as <strong>, not as a link at all, in
   five places across Terms/Privacy/Cookies. It's now a real mailto anchor and
   picks up .legal-body a above; the extra weight keeps it as prominent as the
   <strong> it replaced. */
.legal-body a[href^="mailto:"] { font-weight: 600; }

/* 10.3 - "Terms" on /legal/terms looked identical to "Privacy" and "Cookies", so
   the links gave no sense of place. aria-current is set by NavLink (SPA) or by
   build-learn (static pages). */
.legal-footer a[aria-current="page"] {
  color: var(--legal-heading);
  font-weight: 600;
}


.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 16px 0;
}

.legal-table th {
  text-align: left;
  padding: 10px 12px;
  background: rgba(var(--legal-primary-rgb),0.1);
  color: var(--legal-accent-lighter);
  font-weight: 600;
  border-bottom: 1px solid rgba(var(--legal-border-rgb),0.15);
}

.legal-table td {
  padding: 10px 12px;
  color: var(--legal-text-2);
  border-bottom: 1px solid rgba(var(--legal-border-rgb),0.08);
  vertical-align: top;
}

.legal-table tr:last-child td { border-bottom: none; }

.legal-table code {
  background: rgba(var(--legal-primary-rgb),0.12);
  color: var(--legal-accent-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.legal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  border-top: 1px solid rgba(var(--legal-border-rgb),0.08);
  font-size: 0.9rem;
  color: var(--legal-muted-2);
  flex-wrap: wrap;
  /* Pinned to the bottom like the taskbar is to the top, same frosted glass. */
  position: sticky;
  bottom: 0;
  background: color-mix(in srgb, var(--legal-bg) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10;
}

.legal-footer a {
  color: var(--legal-muted);
  text-decoration: none;
  transition: color 0.15s;
}
@media (hover: hover) {
  .legal-footer a:hover { color: var(--legal-accent-light); }
}

.legal-footer-sep { color: var(--legal-muted-3); }

@media (max-width: 600px) {
  .legal-footer { padding: 12px 16px; gap: 4px 10px; font-size: 0.8rem; }
  .legal-title { font-size: 1.6rem; }
  .legal-table { font-size: 0.85rem; }
  .legal-table th, .legal-table td { padding: 8px; }
}

