/*
  The pages around the landing page: the legal pages, the invite and shared-memory pages, credits and 404.
  They are documents, not screens, so they leave the section-per-screen box of main > section alone and
  set their own reading layout on the same tokens, type and buttons.
*/
body { background: var(--bg); }
main.legal, main.doc { padding-top: calc(var(--nav) + var(--s-8)); padding-bottom: var(--s-9); }

/* ---------- legal ---------- */
.legal__head { max-width: 46rem; padding-bottom: var(--s-8); border-bottom: 1px solid var(--line); margin-bottom: var(--s-8); }
.legal__kicker { color: var(--muted); }
.legal__head h1 { font-size: clamp(40px, 3.4vw + 20px, 72px); line-height: 1.04; letter-spacing: var(--display-tracking-xl); margin-top: var(--s-3); }
.legal__lede { margin-top: var(--s-4); color: var(--muted); font-size: var(--t-lead); }
.legal__grid { align-items: start; }
.legal__toc { font-size: var(--t-small); }
.legal__toc .t-label { color: var(--muted); margin-bottom: var(--s-3); }
.legal__toc ol, .legal__toc ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.legal__toc a { display: block; padding: 6px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; }
.legal__toc a:hover { color: var(--action); }
.legal__also { margin-top: var(--s-7); }
.legal__body { font-size: 17px; line-height: 1.7; max-width: 44rem; }
.legal__body > * + * { margin-top: var(--s-4); }
.legal__body h2 { font-size: clamp(24px, 1vw + 18px, 32px); line-height: 1.2; margin-top: var(--s-8); padding-top: var(--s-2); scroll-margin-top: calc(var(--nav) + var(--s-5)); }
.legal__body h2:first-child { margin-top: 0; }
.legal__body h3 { font-family: var(--font-text); font-size: 18px; font-weight: 500; margin-top: var(--s-6); letter-spacing: 0; }
.legal__body ul, .legal__body ol { padding-left: 1.2em; display: grid; gap: var(--s-2); }
.legal__body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--action); text-underline-offset: 3px; }
.legal__body .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-5) var(--s-6); }
.legal__body .table-wrap { overflow-x: auto; }
.legal__body table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 15px; line-height: 1.5; }
.legal__body th, .legal__body td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal__body th { font-size: 13px; font-weight: 500; color: var(--muted); }
/* a value the client or the lawyer still has to give: marked so it cannot ship unnoticed */
.fill { background: #f3d58a; color: #3a2a06; padding: .08em .45em; border-radius: 4px; font-weight: 500; font-size: .92em; white-space: nowrap; }
@media (max-width: 1023px) {
  .legal__toc { grid-column: 1 / -1; margin-bottom: var(--s-7); padding: var(--s-5); background: var(--surface); border-radius: var(--r-md); }
  .legal__toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-5); }
  .legal__toc .legal__also, .legal__toc ul { display: none; }
  .legal__body { grid-column: 1 / -1; }
}
@media (max-width: 639px) { .legal__toc ol { grid-template-columns: minmax(0, 1fr); } .legal__body { font-size: 16px; } }

/* the footer on a document page: the links and the legal row, one band */
.page-foot { padding-block: var(--s-9) var(--s-7); }
.page-foot .footer__col h2 { font-family: var(--font-text); font-size: var(--t-label); font-weight: 500; color: var(--muted); letter-spacing: 0; margin-bottom: var(--s-4); }
.page-foot .footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.page-foot .footer__col a { color: var(--ink); text-decoration: none; }
.page-foot .footer__legal { margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--line); font-size: var(--t-small); color: var(--muted); }
.page-foot .footer__legal a { color: inherit; }

/* ---------- invite, shared memory, credits, 404: one card in the middle of the paper ---------- */
.page-link { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; background-color: var(--bg);
  background-image: linear-gradient(rgb(36 26 15 / .04) 1px, transparent 1px), linear-gradient(90deg, rgb(36 26 15 / .04) 1px, transparent 1px);
  background-size: 28px 28px; }
.link-top { padding: var(--s-5) 0; }
.link-top .nav__logo { font-size: 20px; }
.link-main { display: grid; align-content: start; justify-items: center; padding: var(--s-6) var(--gut) var(--s-8); }
.link-card { width: min(100%, 40rem); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: clamp(28px, 4vw, 48px);
  box-shadow: 0 1px 0 rgb(36 26 15 / .04), 0 30px 60px -36px rgb(36 26 15 / .4); }
.link-card + .link-card { margin-top: var(--s-5); }
.link-card .t-label { color: var(--muted); }
.link-card h1 { font-size: clamp(32px, 2.4vw + 18px, 48px); line-height: 1.08; letter-spacing: var(--display-tracking-xl); margin-top: var(--s-3); }
.link-card h1 em { font-style: italic; color: var(--accent); }
.link-card h2 { font-size: clamp(24px, 1vw + 18px, 30px); line-height: 1.15; }
.link-card > p { margin-top: var(--s-4); color: var(--muted); font-size: var(--t-lead); line-height: 1.5; }
.link-card .stores { margin-top: var(--s-6); }
.link-steps { list-style: none; counter-reset: s; padding: 0; margin: var(--s-6) 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.link-steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: var(--s-3); padding: var(--s-4) 0; border-bottom: 1px solid var(--line); font-size: var(--t-body); }
.link-steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.have-app { margin-top: var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); align-items: center; }
.have-app p { margin: 0; color: var(--muted); font-size: var(--t-small); }
.link-foot { padding: var(--s-6) 0 var(--s-7); text-align: center; font-size: var(--t-small); color: var(--muted); }
.link-foot a { color: var(--ink); }
.link-loading { display: flex; align-items: center; gap: var(--s-3); color: var(--muted); padding: var(--s-6) 0; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--action); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* store buttons: the real Apple and Google Play marks; "coming soon" until the store links exist */
.stores { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.store { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 20px 8px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); text-decoration: none;
  transition: transform .18s var(--ease, ease), box-shadow .18s var(--ease, ease); }
.store:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgb(36 26 15 / .6); }
.store img { width: 24px; height: 28px; object-fit: contain; }
.store img[data-ink] { filter: invert(1); }
.store span { display: grid; line-height: 1.15; }
.store small { font-size: 11.5px; opacity: .8; }
.store strong { font-weight: 500; font-size: 17px; }
.store[aria-disabled="true"] { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); cursor: default; }
.store[aria-disabled="true"]:hover { transform: none; box-shadow: none; }
.store[aria-disabled="true"] img[data-ink] { filter: none; }
.stores.emphasis-android .store-android, .stores.emphasis-ios .store-ios { order: -1; }

/* a shared memory */
.byline { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-5); }
.byline .avatar { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 500; }
.byline-name { font-weight: 500; }
.byline-date { color: var(--muted); font-size: var(--t-small); }
.media { margin-top: var(--s-6); border-radius: 18px; overflow: hidden; background: #1d150d; }
.media img, .media video { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
.media audio { display: block; width: 100%; background: var(--bg); }
.media--audio { background: none; }
.section-label { margin-top: var(--s-6); font-size: var(--t-label); font-weight: 500; color: var(--muted); }
.prose { margin-top: var(--s-2); font-size: var(--t-body); line-height: 1.7; white-space: pre-wrap; color: var(--ink); }
.prose.muted { color: var(--muted); }
.notice { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-radius: 12px; background: #f3e1d9; color: #6b2a1f; font-size: var(--t-small); }
.hidden { display: none !important; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

/* credits and 404 */
.credit-list { list-style: none; padding: 0; margin: var(--s-6) 0 0; border-top: 1px solid var(--line); }
.credit-list li { padding: var(--s-4) 0; border-bottom: 1px solid var(--line); font-size: var(--t-small); line-height: 1.6; color: var(--muted); }
.credit-list li b { color: var(--ink); font-weight: 500; }
.credit-list a { color: var(--ink); }
