/* Shared component language for the legal pages (faq, privacy, terms,
   support, 404), built on assets/base.css's tokens
   (--bg/--bg2/--fg/--fg2/--fg3/--hair/--hair-soft/--link/--accent/--shadow/--mono/
   --max/--pad). Ports the old assets/styles.css "legal doc" design language
   (type scale, buttons, the sticky TOC + clause layout, the FAQ search bar, the
   studio ledger/stat/pcols grids) onto the new token set so these pages read as
   part of the same site as the home page and the app pages, instead of the old
   gradient-wordmark system. Structure, content and JS (toc.js, the FAQ filter)
   are unchanged — only the skin. */

:root { --ease: cubic-bezier(0.32, 0.72, 0, 1); }

h4 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

a.lg-link, .body a, .small a, .lede a { color: var(--link); }

/* key-message marker, ported from .hl */
.hl {
  color: var(--link); font-weight: 600;
  background: color-mix(in srgb, var(--link) 14%, transparent);
  margin-inline: -0.24em 0; padding: 0.06em 0.24em 0.1em;
  border-radius: 5px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.hl--mid { margin-inline: -0.24em -0.24em; }

/* ── layout ─────────────────────────────────────────────────────────── */

.band { border-top: 1px solid var(--hair); }
.band--wash { background: color-mix(in srgb, var(--link) 8%, transparent); border-top: 1px solid var(--hair-soft); }
.band--tint { background: var(--bg2); border-top: 1px solid var(--hair-soft); }

.sec { padding-block: clamp(52px, 5.6vw, 84px); }
.sec--tight { padding-block: clamp(40px, 4.2vw, 60px); }
.sec--hero { padding-block: clamp(84px, 11vh, 128px) clamp(22px, 2.4vw, 34px); }

.center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.stack { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; } .gap-18 { gap: 18px; }

/* ── type scale ─────────────────────────────────────────────────────── */

.eyebrow { font-size: 15px; font-weight: 600; letter-spacing: -0.004em; color: var(--link); }
.h1 { font-size: clamp(44px, 7vw, 76px); line-height: 1.04; letter-spacing: -0.04em; }
.brk { color: var(--fg3); font-weight: 400; }
.h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.09; letter-spacing: -0.027em; }
.h3 { font-size: clamp(20px, 2.3vw, 25px); line-height: 1.16; letter-spacing: -0.022em; }
.h4 { font-size: 18px; line-height: 1.25; letter-spacing: -0.018em; }

.lede { font-size: clamp(19px, 2.1vw, 24px); line-height: 1.32; letter-spacing: -0.016em; color: var(--fg2); }
.body { font-size: clamp(16px, 1.2vw, 17px); line-height: 1.55; letter-spacing: -0.01em; color: var(--fg2); }
.small { font-size: 15px; line-height: 1.55; letter-spacing: -0.008em; color: var(--fg2); }
.tiny { font-size: 13px; line-height: 1.5; letter-spacing: -0.004em; color: var(--fg3); }
.num { font-variant-numeric: tabular-nums; }
.measure { max-width: 62ch; }
.measure-s { max-width: 48ch; }
.mono { font-family: var(--mono); }

/* ── buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 24px; border-radius: 999px; border: 0;
  font-family: var(--sans); font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.18s var(--ease), opacity 0.18s var(--ease), background-color 0.18s var(--ease);
}
.btn:hover { opacity: 1; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { filter: brightness(1.04); }
.btn--ghost { background: var(--bg2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--hair); }
.btn--ghost:hover { background: var(--hair-soft); }
.btn--quiet { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--hair); }
.btn--sm { min-height: 40px; padding: 9px 18px; font-size: 15px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.center .cta-row { justify-content: center; }
.arrow-link { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; color: var(--link); }
.arrow-link svg { transition: transform 0.2s var(--ease); }
.arrow-link:hover svg { transform: translateX(3px); }

/* ── stats / ledger / numbered columns ─────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 26px; }
.stat { border-top: 1px solid var(--hair); padding-top: 15px; }
.stat__n { display: block; font-size: clamp(30px, 3vw, 36px); font-weight: 600; letter-spacing: -0.032em; line-height: 1.05; color: var(--fg); }
.stat__l { display: block; margin-top: 6px; font-size: 13.5px; line-height: 1.4; color: var(--fg2); }
.stats__note { margin-top: 22px; max-width: 78ch; font-size: 15px; line-height: 1.55; color: var(--fg2); }

.pcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: clamp(18px, 2.4vw, 34px); }
.pnum { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--link); margin-bottom: 8px; }

.ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); border-top: 1px solid var(--hair-soft); }
.ledger__row { display: flex; align-items: baseline; gap: 18px; padding-block: 18px; border-bottom: 1px solid var(--hair-soft); }
.ledger__n { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--link); }
.ledger__t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ledger__v { font-size: 14.5px; line-height: 1.45; color: var(--fg2); max-width: 46ch; text-wrap: pretty; }

/* a dark full-bleed band, distinct from page.css's rounded .plate card */
.plate { background: #131315; color: #f5f5f7; border-top: 1px solid var(--hair-soft); }
[data-theme="dark"] .plate { background: #1c1c1e; }
.plate .h1, .plate .h2, .plate .h3, .plate .h4 { color: #f5f5f7; }
.plate .lede, .plate .body, .plate .small { color: #a1a1a6; }
.plate .tiny { color: #8e8e93; }
.plate .eyebrow, .plate .pnum { color: #5fd4b4; }
.plate .hl { color: #5fd4b4; background: rgba(95,212,180,.16); font-weight: 500; }
.plate .stat { border-top-color: rgba(255,255,255,0.15); }
.plate .stat__n { color: #f5f5f7; }
.plate .stat__l { color: #a1a1a6; }
.plate .arrow-link { color: #f5f5f7; }
.plate .arrow-link:hover { color: #ffffff; }

/* ── legal-doc layout: a clause column with a sticky table of contents ── */

.legal { display: grid; grid-template-columns: minmax(0, 1fr) 224px; gap: 0 56px; align-items: start; --lg-g: 54px; }
.legal__main { grid-column: 1; order: 1; max-width: 760px; }
.toc { grid-column: 2; order: 2; position: sticky; top: 78px; }
.toc__label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--hair-soft); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg3); cursor: default; background: none; border-top: 0; border-left: 0; border-right: 0; width: 100%; text-align: left; }
.toc__chev { width: 12px; height: 12px; display: none; flex: none; transition: transform 0.2s var(--ease); }
.toc__box { max-height: calc(100vh - 168px); overflow-y: auto; scrollbar-width: thin; padding-block: 8px; }
.toc__g { display: flex; flex-direction: column; }
.toc__i { display: block; padding: 7px 0 7px 12px; border-left: 2px solid transparent; font-size: 13.5px; letter-spacing: -0.008em; color: var(--fg2); transition: color .15s var(--ease), border-color .15s var(--ease); }
.toc__i:hover { color: var(--fg); opacity: 1; }
.toc__i[data-on="true"] { color: var(--link); font-weight: 600; border-left-color: var(--accent); }
.toc__subs { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.28s var(--ease); }
.toc__subs > div { overflow: hidden; min-height: 0; }
.toc__g[data-open="true"] .toc__subs { grid-template-rows: 1fr; }
.toc__i--sub { padding-left: 22px; font-size: 13px; color: var(--fg3); }
.toc__i--sub[data-on="true"] { color: var(--link); }
.toc__sep { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hair-soft); }
@media (prefers-reduced-motion: reduce) { .toc__i, .toc__subs { transition: none; } }
@media (max-width: 860px) {
  .legal { grid-template-columns: minmax(0, 1fr); }
  .legal__main { grid-column: 1; max-width: none; order: 2; }
  .legal { --lg-g: 42px; }
  .toc { position: static; grid-column: 1; order: 1; margin-bottom: 34px; border: 1px solid var(--hair); border-radius: 14px; padding: 4px 18px 6px; }
  .toc__label { padding-block: 14px; border-bottom: 0; cursor: pointer; }
  .toc__chev { display: block; }
  .toc[data-open="true"] .toc__chev { transform: rotate(180deg); }
  .toc__box { max-height: none; border-top: 1px solid var(--hair-soft); }
  .toc:not([data-open="true"]) .toc__box { display: none; }
  .toc__g[data-open] .toc__subs { grid-template-rows: 1fr; }
}
@media print { .nav, .toc, footer, .skip { display: none !important; } .legal { display: block; } .legal__main { max-width: none; } }

.lg-sec { border-top: 1px solid var(--hair); padding-top: 30px; margin-top: 42px; }
.lg-sec:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.lg-h2 { display: grid; grid-template-columns: var(--lg-g) minmax(0, 1fr); gap: 0; font-size: clamp(21px, 2.3vw, 26px); line-height: 1.16; letter-spacing: -0.024em; margin-bottom: 20px; text-wrap: pretty; }
.lg-h2 span { color: var(--fg3); font-weight: 500; letter-spacing: -0.01em; }
.lg-h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.014em; color: var(--fg); margin: 26px 0 12px var(--lg-g); }
.lg-h3:first-child { margin-top: 0; }
.lg-c { display: grid; grid-template-columns: var(--lg-g) minmax(0, 1fr); gap: 0; font-size: 15.5px; line-height: 1.62; letter-spacing: -0.008em; color: var(--fg2); margin-bottom: 13px; text-wrap: pretty; }
.lg-c > span:first-child { color: var(--fg3); font-variant-numeric: tabular-nums; }
.lg-a { color: inherit; text-decoration: none; border-radius: 4px; transition: color 0.15s var(--ease); }
.lg-a:hover { color: var(--link); opacity: 1; }
.lg-a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lg-x { color: var(--fg); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--hair); white-space: nowrap; transition: color 0.15s var(--ease), border-color 0.15s var(--ease); }
.lg-x:hover { color: var(--link); border-bottom-color: var(--accent); opacity: 1; }
.lg-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lg-c strong { color: var(--fg); font-weight: 600; }
.lg-c em { font-style: normal; color: var(--fg2); }
.lg-in { margin: 0 0 13px var(--lg-g); }
.lg-list { list-style: none; margin: 0 0 13px var(--lg-g); padding: 0; display: flex; flex-direction: column; }
.lg-list li { font-size: 15.5px; line-height: 1.6; letter-spacing: -0.008em; color: var(--fg2); padding-block: 11px; border-top: 1px solid var(--hair-soft); text-wrap: pretty; }
.lg-list li:first-child { border-top: 0; padding-top: 0; }
.lg-list b { color: var(--fg); font-weight: 600; }

.lg-sec:target > .lg-h2, .lg-c:target, .lg-h3:target { animation: lg-land 2.4s var(--ease) forwards; }
@keyframes lg-land {
  0%, 42% { background: color-mix(in srgb, var(--link) 14%, transparent); box-shadow: 0 0 0 7px color-mix(in srgb, var(--link) 14%, transparent); }
  100% { background: transparent; box-shadow: 0 0 0 7px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-sec:target > .lg-h2, .lg-c:target, .lg-h3:target { animation: none; background: color-mix(in srgb, var(--link) 14%, transparent); box-shadow: 0 0 0 7px color-mix(in srgb, var(--link) 14%, transparent); }
}

.lg-toast { position: fixed; left: 50%; bottom: 26px; z-index: 60; transform: translate(-50%, 12px); background: var(--fg); color: var(--bg); border-radius: 999px; padding: 9px 18px; font-size: 13px; font-weight: 600; letter-spacing: -0.006em; opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); }
.lg-toast[data-show="true"] { opacity: 1; transform: translate(-50%, 0); }

.lg-table { width: 100%; border-collapse: collapse; font-size: 14.5px; letter-spacing: -0.006em; }
.lg-table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fg2); padding: 0 14px 9px 0; border-bottom: 1px solid var(--hair); }
.lg-table td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--hair-soft); color: var(--fg2); font-variant-numeric: tabular-nums; }
.lg-table td:last-child { color: var(--fg); font-weight: 600; width: 5.5em; }
.lg-in--scroll { overflow-x: auto; }
.lg-table--wide { min-width: 560px; }
.lg-table--wide th, .lg-table--wide td { padding-right: 20px; vertical-align: top; }
.lg-table--wide td { color: var(--fg2); font-variant-numeric: normal; }
.lg-table--wide td:first-child { color: var(--fg); font-weight: 500; }
.lg-table--wide td:last-child { color: var(--fg2); font-weight: 400; width: auto; }

.lg-tbd { font: 500 13px/1 var(--mono); color: var(--fg3); letter-spacing: 0; background: var(--bg2); border: 1px solid var(--hair-soft); border-radius: 5px; padding: 2px 5px; white-space: nowrap; }
@media (max-width: 640px) { .lg-tbd { white-space: normal; } }

.lg-flag { border: 1px solid var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--link) 8%, transparent); padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 34px; }
.lg-flag > p.lg-flag__t { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--link); }
.lg-flag > p:not(.lg-flag__t) { font-size: 15px; line-height: 1.55; letter-spacing: -0.008em; color: var(--fg2); text-wrap: pretty; }

.lg-meta { display: grid; gap: 0; margin-bottom: 38px; }
.lg-meta div { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 0 16px; padding-block: 12px; border-top: 1px solid var(--hair-soft); font-size: 15px; line-height: 1.5; letter-spacing: -0.008em; color: var(--fg2); text-wrap: pretty; }
.lg-meta dt { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg3); padding-top: 2px; }
.lg-meta dd { margin: 0; }
@media (max-width: 560px) {
  .legal { --lg-g: 42px; }
  .lg-meta div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
}

/* ── the FAQ search bar and grouped questions ──────────────────────── */

.faqbar { position: sticky; top: 52px; z-index: 40; background: var(--nav); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); border-bottom: 1px solid var(--hair-soft); }
.faqbar__in { display: flex; align-items: center; gap: 16px; padding-block: 10px; }
.faqbar__n { font-family: var(--mono); font-size: 12px; letter-spacing: -0.01em; color: var(--fg3); white-space: nowrap; }
.faqfield { position: relative; flex: 1; display: flex; align-items: center; min-width: 0; }
.faqfield > svg { position: absolute; left: 15px; width: 15px; height: 15px; color: var(--fg3); pointer-events: none; }
.faqfield input { width: 100%; height: 42px; padding: 0 40px; border-radius: 10px; border: 1px solid var(--hair); background: var(--bg2); color: var(--fg); font-size: 15px; letter-spacing: -0.008em; }
.faqfield input::-webkit-search-decoration, .faqfield input::-webkit-search-cancel-button { -webkit-appearance: none; }
.faqfield input::placeholder { color: var(--fg3); }
.faqfield input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 14%, transparent); }
.faqfield__x { position: absolute; right: 10px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: none; color: var(--fg3); display: grid; place-items: center; cursor: pointer; }
.faqfield__x:hover { color: var(--fg); background: var(--hair-soft); }
.faqfield__x[hidden] { display: none; }
.faqfield__x svg { width: 14px; height: 14px; }
.faq .toc { top: 128px; }
.faq .toc__box { max-height: calc(100vh - 216px); }

.faq-g { margin-bottom: 46px; scroll-margin-top: 130px; }
.faq-g[hidden] { display: none; }
.faq-g__h { font-size: clamp(21px, 2.3vw, 26px); line-height: 1.16; letter-spacing: -0.024em; margin-bottom: 8px; }
.faq-q { padding-block: 20px; border-bottom: 1px solid var(--hair-soft); }
.faq-q[hidden] { display: none; }
.faq-q__q { font-size: 17px; font-weight: 600; letter-spacing: -0.018em; color: var(--fg); margin-bottom: 7px; }
.faq-q__a { font-size: 15.5px; line-height: 1.62; letter-spacing: -0.008em; color: var(--fg2); max-width: 66ch; }
.faq-end { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--hair); }
@media (max-width: 640px) {
  .faqbar__n { display: none; }
  .faqfield input { font-size: 16px; }
}
