@import url("theme.css");

/* Long-form pages: the microtask guide, the privacy policy and the terms.
 *
 * Same editorial dark system as the landing page, tuned for reading rather
 * than for converting. The article is set on the page canvas at a real
 * reading measure instead of inside a bordered, blurred card, which was the
 * single most dated thing about these pages. Type is larger and leading is
 * looser than on the landing page, because this is text somebody actually
 * has to get through.
 */

html {
  scroll-snap-type: none !important;
  scroll-padding-top: 7rem;
}

body.legal-body {
  background: var(--paper);
}

/* One soft wash, matching the landing page, fixed so it does not scroll with
   the text and cannot cost a repaint on a long document. */
body.legal-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    46rem 30rem at 84% -6%,
    rgb(var(--accent-rgb) / 0.09),
    transparent 62%
  );
}

.legal-app {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.legal-app .bar {
  width: 100%;
  padding-inline: max(1.5rem, calc((100vw - 78rem) / 2));
  top: 0;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.legal-brand img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.legal-kind {
  margin-left: 1rem;
  color: var(--ink-faint);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.legal-app .theme {
  margin-left: auto;
}

.legal-main {
  width: min(78rem, 100% - 3rem);
  margin-inline: auto;
  padding-block: clamp(3rem, 8vh, 6rem) clamp(4rem, 10vh, 7rem);
}

/* The article column. Not a card: no border, no fill, no blur. */
.legal-card {
  width: min(42rem, 100%);
}

.legal-card > h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1rem + 5.6vw, 4.25rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.042em;
  color: var(--ink);
  text-wrap: balance;
}

.legal-card h2 {
  margin: clamp(3rem, 7vh, 4.5rem) 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 1rem + 2.2vw, 2.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.legal-card h3 {
  margin: 2.25rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.legal-card p,
.legal-card li {
  font-size: 1.0625rem;
  line-height: 1.68;
  color: var(--ink-dim);
}

.legal-card p {
  margin: 1.15rem 0;
}

.legal-card ul,
.legal-card ol {
  margin: 1.15rem 0;
  padding-left: 1.3rem;
}

.legal-card li + li {
  margin-top: 0.65rem;
}

.legal-card strong,
.legal-card b {
  color: var(--ink);
  font-weight: 600;
}

.legal-card a {
  color: var(--accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.legal-card a:hover {
  text-decoration-thickness: 2px;
}

/* The standfirst under the headline. Larger than body, dimmer than the
   headline, and the one place the article gets a wider measure. */
.legal-card .lede {
  max-width: none;
  margin: 1.75rem 0 0;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-dim);
}

.legal-card .meta {
  margin: 0 0 1.5rem;
  color: var(--ink-faint);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.legal-card .meta a {
  color: inherit;
  text-decoration: none;
}

.legal-card .meta a:hover {
  color: var(--ink);
}

/* Trailing byline sits below the article, so it drops the caps treatment. */
.legal-card > .meta:last-child {
  margin: 3.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/* Pull-quote style callout. A tinted block with a single accent rule, rather
   than a bordered box with a rounded corner on one side only. */
.legal-card .callout {
  margin: clamp(2rem, 5vh, 2.75rem) 0;
  padding: 1.4rem 1.6rem;
  border-left: 2px solid var(--accent);
  background: var(--accent-wash);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
}

.legal-card .callout strong {
  color: var(--ink);
}

/* Tables as data, not as boxes. Hairline rows only. */
.legal-card table {
  width: 100%;
  margin: 1.75rem 0 2.25rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  color: var(--ink-dim);
}

.legal-card th,
.legal-card td {
  padding: 0.9rem 1rem 0.9rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.legal-card th {
  color: var(--ink-faint);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom-color: var(--line-strong);
}

.legal-card td:first-child {
  color: var(--ink);
  font-weight: 500;
}

.legal-card code {
  padding: 0.12rem 0.4rem;
  border-radius: 0.3rem;
  background: var(--paper-raise);
  color: var(--ink);
  font-size: 0.9em;
}

/* ============================================ the guide layout and its toc ==== */

@media (min-width: 66rem) {
  .guide {
    display: grid;
    grid-template-columns: minmax(0, 42rem) minmax(0, 1fr);
    gap: clamp(3rem, 6vw, 6rem);
    align-items: start;
  }

  .toc {
    position: sticky;
    top: 7rem;
    order: 2;
  }
}

/* Below the split, the contents list would sit above the headline and push
   the article down the screen. The document's own headings are the navigation
   at that width. */
@media (max-width: 65.99rem) {
  .toc {
    display: none;
  }
}

.toc h2 {
  margin: 0 0 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.toc ol {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.2s ease;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  margin-right: 0.7rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--line-strong);
}

.toc a:hover {
  color: var(--ink);
}

/* ===================================================== the closing action ==== */

.legal-cta {
  margin-top: clamp(3.5rem, 8vh, 5rem);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  border-radius: var(--r-panel);
  background: var(--paper-raise);
}

.legal-cta h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 1rem + 1.8vw, 2.25rem);
}

.legal-cta p {
  margin: 0 0 1.5rem;
  max-width: 46ch;
}

.legal-cta-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* `.legal-card a` is more specific than `.btn`, so without these the button
   label inherits the link colour and a mint button gets mint text on it. */
.legal-card .legal-cta a.btn,
.legal-card .legal-cta a.ghost {
  display: inline-block;
  text-decoration: none;
}

.legal-card .legal-cta a.btn {
  color: var(--on-accent);
}

.legal-card .legal-cta a.ghost {
  color: var(--ink);
}

/* ================================================================ footer ==== */

.legal-footer {
  width: min(78rem, 100% - 3rem);
  margin-inline: auto;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--ink-faint);
  font-size: 0.875rem;
}

.legal-footer a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-footer a:hover {
  color: var(--ink);
}

/* =========================================================== small screens ==== */

@media (max-width: 42rem) {
  .legal-kind {
    display: none;
  }

  /* Stacked rows rather than a scrolling table. The first row is the header,
     and its labels are re-attached to each cell below. */
  .legal-card table,
  .legal-card tbody,
  .legal-card tr,
  .legal-card td {
    display: block;
    width: 100%;
  }

  .legal-card tr:first-child {
    display: none;
  }

  .legal-card tr {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
  }

  .legal-card td {
    padding: 0.2rem 0;
    border: 0;
  }

  .legal-card td:first-child {
    font-size: 1.0625rem;
    font-weight: 600;
  }

  .legal-card td:nth-child(2)::before,
  .legal-card td:nth-child(3)::before {
    display: block;
    margin-top: 0.6rem;
    color: var(--ink-faint);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .legal-card td:nth-child(2)::before {
    content: "Details";
  }

  .legal-card td:nth-child(3)::before {
    content: "Location";
  }
}
