/* ============================================================================
   LEGAL PAGES
   ----------------------------------------------------------------------------
   One readable column in the same token system as the rest of the site. No
   sky, no glass: these are documents, and a document that is hard to read is
   a document nobody reads, which defeats the point of having one.

   Every colour comes from design/tokens.css. There are no literals in here,
   because unlike the hero these pages do not sit on a photograph.
   ========================================================================== */

/* CLOUDSCAPE (phase 10.6). The same sky and the same cloud card as the home
   page, with the document set on one wide reading card: Outfit at 17px on a
   1.7 line, a clear heading rhythm, tables in soft wells. The text itself is
   not edited here or anywhere in this phase; only where it sits. */

html { overflow-x: clip; }
body {
  margin: 0;
  position: relative;
  /* The two decorative clouds overhang the viewport on purpose. Like the home
     page, body clips them: html alone does not shrink the scroll width. */
  overflow-x: hidden;
  min-height: 100dvh;
  background: linear-gradient(to bottom,
    var(--canvas) 0%,
    color-mix(in srgb, var(--sky-top) 8%, var(--canvas)) 62%,
    color-mix(in srgb, var(--sky-top) 14%, var(--canvas)) 100%);
  color: var(--body);
  font: 400 1.0625rem/1.7 var(--font-sans);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

/* Two faint clouds behind the card, the logo's silhouette. Decorative only. */
body::before, body::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: min(560px, 70vw); aspect-ratio: 32 / 24;
  background: color-mix(in srgb, var(--brand) 5%, transparent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 4 32 24'%3E%3Cpath d='M23.5 24H9A4.5 4.5 0 1 1 9.07 15A7 7 0 1 1 22.93 13.03A5.5 5.5 0 1 1 23.5 24Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 4 32 24'%3E%3Cpath d='M23.5 24H9A4.5 4.5 0 1 1 9.07 15A7 7 0 1 1 22.93 13.03A5.5 5.5 0 1 1 23.5 24Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
body::before { top: 120px; right: -8%; }
body::after  { bottom: 8%; left: -10%; }

* { box-sizing: border-box; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding-left: 1.25em; }

/* A class rule that sets `display` beats the user-agent's
   `[hidden] { display: none }`, because a class outranks a bare attribute
   selector. An element toggled with `el.hidden = true` then stays on screen
   with the attribute silently set, which is exactly how the download list
   shipped expanded. One global rule costs nothing and closes the whole class
   of bug. */
[hidden] { display: none !important; }

/* Fail closed. A [data-when] block exists to say something only a particular
   deployment can truthfully say. entity.js decides which, and adds
   .entity-ready when it has. Without scripting nobody decides, and showing every
   variant at once published "Free for one person" and "Free, and finished" and a
   price next to "takes no payments" on the same page. So nothing flag-gated is
   shown until a script has chosen. */
html:not(.entity-ready) [data-when] { display: none !important; }

a { color: var(--brand-text); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--brand-text); outline-offset: 3px; }   /* an outline: a shadow can be overridden, see site.css */
@media (forced-colors: active) { :focus-visible { outline: 3px solid Highlight; outline-offset: 2px; } }

.legal-skip {
  position: absolute; left: var(--s-4); top: -100px; z-index: 30;
  padding: var(--s-3) var(--s-5);
  background: var(--cloud); color: var(--ink);
  border-radius: var(--r-pill); box-shadow: var(--e-3);
  font: var(--t-label); text-decoration: none;
  transition: top var(--d-fast) var(--ease-out);
}
.legal-skip:focus { top: var(--s-4); }

/* The same floating frosted pill as the home page. */
.legal-nav {
  position: sticky; top: var(--s-4); z-index: 20;
  width: calc(100% - 2 * var(--s-4)); max-width: 1180px;
  margin: var(--s-4) auto 0;
  border-radius: var(--r-pill);
  background: var(--glass-bg-2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  border: 1px solid var(--glass-stroke);
  box-shadow: inset 0 1px 0 var(--glass-inner), var(--e-3);
}
@media (prefers-reduced-transparency: reduce) {
  .legal-nav { background: var(--cloud); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.legal-nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--s-3);
  padding: 10px 22px;
}
.legal-nav a { color: var(--body); text-decoration: none; font: var(--t-label); }
.legal-nav a:hover { color: var(--brand-text); }
.legal-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.legal-home { display: inline-flex; align-items: center; gap: 10px; font: var(--t-title-md) !important; letter-spacing: -0.02em; text-transform: lowercase; color: var(--ink) !important; }
.legal-home svg { color: var(--brand); flex: none; width: 26px; height: 26px; }

/* The document: one wide reading card, 72ch of text inside it. */
.legal-wrap {
  max-width: calc(72ch + 2 * clamp(24px, 5vw, 56px));
  margin: var(--s-7) auto var(--s-10);
  padding: clamp(28px, 5vw, 56px);
  width: calc(100% - 2 * var(--s-4));
  border-radius: var(--r-xl);
  background: var(--cloud);
  box-shadow: var(--sunlit), var(--e-3);
}

.legal-title { font: 600 clamp(2rem, 4.4vw, 2.75rem)/1.1 var(--font-sans); letter-spacing: -0.03em; color: var(--ink); }
.legal-stamp {
  margin-top: var(--s-3);
  font: var(--t-caption);
  color: var(--muted);
}

/* The one-paragraph answer, before the detail. Somebody who reads only this
   should still come away with the true version. */
.legal-lede {
  margin-top: var(--s-6);
  padding: var(--s-5) var(--s-6);
  border-radius: var(--r-lg);
  background: var(--brand-50);
  box-shadow: var(--sunlit);
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1.6;
}

.legal-wrap h2 {
  margin-top: var(--s-9);
  font: 600 1.5rem/1.25 var(--font-sans);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.legal-wrap h3 {
  margin-top: var(--s-7);
  font: 600 1.125rem/1.3 var(--font-sans);
  color: var(--ink);
}
.legal-wrap p,
.legal-wrap ul,
.legal-wrap ol { margin-top: var(--s-4); line-height: 1.7; }
.legal-wrap li { margin-top: var(--s-2); }

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font: var(--t-body-sm);
}
.legal-table th,
.legal-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  text-align: left;
  vertical-align: top;
}
.legal-table tr:last-child td { border-bottom: 0; }
.legal-table th { color: var(--ink); font-weight: 600; }
/* Tables sit in a soft well, and scroll inside it rather than the page. */
.legal-table-wrap {
  overflow-x: auto;
  margin-top: var(--s-5);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-lg);
  background: var(--cloud-2);
}

.legal-foot {
  margin-top: var(--s-9);
  padding-top: var(--s-5);
  border-top: 1px solid var(--hairline-soft);
  font: var(--t-caption);
  color: var(--muted);
}
.legal-foot a { color: var(--muted); }

code {
  padding: 1px 5px;
  border-radius: var(--r-sm);
  background: var(--cloud-3);
  font-family: var(--font-mono);
  font-size: 0.875em;
}

@media (max-width: 520px) {
  .legal-lede { padding: var(--s-4) var(--s-5); font-size: 1rem; }
  .legal-wrap h2 { margin-top: var(--s-8); }
}

@media (forced-colors: active) {
  body::before, body::after { display: none; }
  .legal-wrap, .legal-nav, .account-card, .share-card, .legal-table-wrap, .legal-lede,
  .consent-block { border: 1px solid CanvasText; }
  .btn, .segment, .plan-badge, .share-btn, .field { border: 1px solid ButtonText; }
  .segment.is-active { border-width: 2px; }
}
