/*
 * Terms, Privacy, Billing and refunds, and Acceptable use. On top of flow.css, so they share getting started's
 * tokens, Geist, top bar and light and dark switch.
 *
 * Karl, 16 Nov 2026 (second pass): centred, clean and slick, just the policy on its page, a tad more colour. So no
 * tabs, contents list, summary card or numbers: one centred column. The header is centred over a soft glow in the
 * site's four spectrum colours, the only colour on the page, and the text reads left-aligned inside the column.
 */

/* The glow is wider than the column, so the page clips it rather than scrolling sideways on a phone. */
.legal-page {
  overflow-x: clip;
}

.legal-main {
  position: relative;
  flex: 1;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 0 var(--gutter) 112px;
}

/* The header: title, one line, the date, and a short spectrum line under it. */
.legal-head {
  position: relative;
  isolation: isolate;
  padding: clamp(56px, 12vh, 120px) 0 clamp(48px, 8vh, 80px);
  text-align: center;
}

/* The glow behind the title: the four spectrum colours, soft and blurred, fading out before the text starts. */
.legal-head::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  top: -4%;
  width: min(960px, 100vw);
  height: 420px;
  transform: translateX(-50%);
  background:
    radial-gradient(40% 60% at 26% 52%, color-mix(in oklab, var(--pink) 100%, transparent) 0%, color-mix(in oklab, var(--pink) 45%, transparent) 30%, color-mix(in oklab, var(--pink) 12%, transparent) 55%, color-mix(in oklab, var(--pink) 0%, transparent) 80%),
    radial-gradient(36% 56% at 43% 38%, color-mix(in oklab, var(--yellow) 100%, transparent) 0%, color-mix(in oklab, var(--yellow) 45%, transparent) 30%, color-mix(in oklab, var(--yellow) 12%, transparent) 55%, color-mix(in oklab, var(--yellow) 0%, transparent) 80%),
    radial-gradient(36% 60% at 60% 60%, color-mix(in oklab, var(--mint) 100%, transparent) 0%, color-mix(in oklab, var(--mint) 45%, transparent) 30%, color-mix(in oklab, var(--mint) 12%, transparent) 55%, color-mix(in oklab, var(--mint) 0%, transparent) 80%),
    radial-gradient(40% 60% at 76% 44%, color-mix(in oklab, var(--blue) 100%, transparent) 0%, color-mix(in oklab, var(--blue) 45%, transparent) 30%, color-mix(in oklab, var(--blue) 12%, transparent) 55%, color-mix(in oklab, var(--blue) 0%, transparent) 80%);
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
  opacity: 0.22;
  pointer-events: none;
}

:root[data-theme='light'] .legal-head::before {
  opacity: 0.24;
}

.legal-head h1 {
  margin: 0;
  font-size: clamp(38px, 6.4vw, 60px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}

.legal-lead {
  max-width: 520px;
  margin: 20px auto 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: balance;
}

.legal-date {
  margin: 28px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.legal-date::after {
  content: '';
  display: block;
  width: 56px;
  height: 2px;
  margin: 18px auto 0;
  border-radius: 2px;
  background: var(--spectrum-line);
}

/* The text. */
.legal-body {
  max-width: 640px;
  margin: 0 auto;
  font-size: 16.5px;
  line-height: 1.72;
}

.legal-body section {
  scroll-margin-top: 24px;
}

.legal-body section + section {
  margin-top: 52px;
}

.legal-body h2 {
  margin: 0 0 14px;
  font-size: 21px;
  font-weight: 620;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.legal-body p {
  margin: 0 0 16px;
  text-wrap: pretty;
}

.legal-body ul {
  margin: 0 0 16px;
  padding-left: 20px;
  list-style: disc;
}

.legal-body li {
  margin: 0 0 8px;
  padding-left: 4px;
}

.legal-body li::marker {
  color: var(--muted);
}

.legal-body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s linear;
}

.legal-body a:hover {
  text-decoration-color: var(--underline-strong);
}

.legal-body strong {
  font-weight: 620;
}

/* Who gets what, as rows rather than a wide table, so it reads on a phone too. */
.legal-rows {
  margin: 8px 0 20px;
  padding: 0;
}

.legal-rows div {
  display: grid;
  grid-template-columns: minmax(0, 168px) minmax(0, 1fr);
  gap: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.legal-rows div:last-child {
  border-bottom: 1px solid var(--line);
}

.legal-rows dt {
  font-weight: 600;
  line-height: 1.55;
}

.legal-rows dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 599px) {
  .legal-rows div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.legal-body .legal-end {
  margin: 72px 0 0;
  text-align: center;
  color: var(--muted);
}

/* The other policies and how to reach us, centred under the page. */
.legal-foot {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 32px var(--gutter) 44px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.legal-foot ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-foot a {
  color: var(--muted);
  transition: color 0.2s linear;
}

.legal-foot a:hover,
.legal-foot a[aria-current='page'] {
  color: var(--ink);
}

.legal-body a:focus-visible,
.legal-foot a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 699px) {
  .legal-body {
    font-size: 16px;
  }

  .legal-body section + section {
    margin-top: 44px;
  }

  .legal-body h2 {
    font-size: 19px;
  }
}
