/* kadenzi.com: the landing page and the three documents. Kadenzi's own look, as the app and the first version's boards
   have it: brand blue #2557d6 (ink #1c46b3, soft #e7edfb), Instrument Sans and Serif (self-hosted, SIL OFL: fonts/),
   the K mark. Light and dark, from the reader's setting. No script, no outside requests. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/instrument-sans.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --ground: #ffffff;
  --panel: #f4f5f7;
  --line: #e1e4ea;
  --text: #15171c;
  --muted: #5b616e;
  --brand: #2557d6;
  --brand-ink: #1c46b3;
  --brand-soft: #e7edfb;
  --on-brand: #ffffff;
  --link: #1c46b3;
  --link-line: #7390e2;
  --focus: #2557d6;

  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --m: clamp(20px, 4vw, 40px);
  --col: 1120px;
  --fs-display: clamp(40px, 6vw, 66px);
  --fs-heading: clamp(28px, 3.2vw, 36px);
  --fs-statement: clamp(19px, 1.8vw, 22px);
  --fs-text: 17px;
  --fs-small: 14px;
  --r-panel: 20px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0f1115;
    --panel: #181b22;
    --line: #2a2f3a;
    --text: #eceef2;
    --muted: #a6acb8;
    --brand-ink: #a9bff5;
    --brand-soft: #1b2950;
    --link: #a9bff5;
    --link-line: #5f7fd8;
    --focus: #a9bff5;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 var(--fs-text)/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: var(--m); top: -100px; z-index: 2;
  padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--ground); text-decoration: none; font-weight: 500;
}
.skip:focus { top: 12px; }
.sr-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: calc(var(--col) + 2 * var(--m)); margin: 0 auto; padding: 0 var(--m); }

/* the top: the K mark and the three documents, always in view, never behind a menu */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 28px; padding-bottom: 28px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; }
.wordmark img { width: 28px; height: 28px; }
.legal { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-small); }
.legal a { text-decoration: none; transition: color 150ms ease; }
.legal a:hover, .legal a[aria-current="page"] { color: var(--link); }
.legal a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--link-line); }

/* buttons and links in running text */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 22px;
  border-radius: 999px; background: var(--brand); color: var(--on-brand); font-weight: 500; text-decoration: none;
  transition: background-color 150ms ease, transform 120ms var(--ease);
}
.btn:hover { background: #1c46b3; }
.btn:active { transform: scale(0.97); }
.prose a, .doc a, .foot a, .faq a { color: var(--link); text-decoration: underline; text-decoration-color: var(--link-line); text-underline-offset: 3px; }
.prose a:hover, .doc a:hover, .foot a:hover, .faq a:hover { text-decoration-color: currentColor; }
.address { font-weight: 500; }

/* ---------------- the landing page ---------------- */
.hero { padding-top: clamp(48px, 9vw, 120px); padding-bottom: clamp(56px, 9vw, 120px); }
.hero h1 { max-width: 15ch; font: 400 var(--fs-display)/1.02 var(--font-serif); letter-spacing: -0.02em; text-wrap: balance; }
.hero .lede { max-width: 46ch; margin-top: 28px; font-size: var(--fs-statement); line-height: 1.45; }
.hero .act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 36px; }
.hero .act p { color: var(--muted); font-size: var(--fs-small); }

.band { background: var(--panel); }
.sec { padding-top: clamp(56px, 8vw, 104px); padding-bottom: clamp(56px, 8vw, 104px); }
.sec h2 { max-width: 22ch; margin-bottom: 20px; font: 400 var(--fs-heading)/1.12 var(--font-serif); letter-spacing: -0.015em; text-wrap: balance; }
.sec .prose { max-width: 62ch; display: grid; gap: 16px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 40px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { padding: 24px; border-radius: var(--r-panel); background: var(--ground); counter-increment: step; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 16px;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-size: 15px; font-weight: 600;
}
.steps h3 { margin-bottom: 8px; font-size: var(--fs-text); font-weight: 600; }
.steps p { color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 40px 0 0; }
.facts div { padding-top: 16px; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: var(--fs-small); }
.facts dd { margin: 4px 0 0; font-weight: 500; }

.lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 48px; margin-top: 48px; }
.lists h3 { margin-bottom: 12px; font-size: var(--fs-text); font-weight: 600; }
.lists ul { margin: 0; padding: 0; list-style: none; }
.lists li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.lists li span { color: var(--muted); }

.faq { display: grid; gap: 0; max-width: 72ch; margin: 32px 0 0; }
.faq dt { padding-top: 20px; border-top: 1px solid var(--line); font-weight: 600; }
.faq dd { margin: 6px 0 20px; color: var(--muted); }
.faq dd a { color: var(--link); }

.close { padding-top: clamp(56px, 8vw, 104px); padding-bottom: clamp(56px, 8vw, 104px); }
.close p { max-width: 40ch; font-size: var(--fs-statement); line-height: 1.45; }
.close .act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }

/* ---------------- the documents ---------------- */
.doc-wrap { display: grid; grid-template-columns: 240px minmax(0, 700px); justify-content: space-between; align-items: start; gap: 48px; }
.doc-wrap > aside { order: -1; min-width: 0; align-self: stretch; }
.doc { min-width: 0; padding: 32px 0 120px; }
.doc h1 { font: 400 var(--fs-display)/1.05 var(--font-serif); letter-spacing: -0.02em; }
.doc .dated { margin-top: 14px; color: var(--muted); font-size: var(--fs-small); }
.doc .intro { margin-top: 28px; font-size: var(--fs-statement); line-height: 1.45; }
.doc section { padding-top: 56px; }
.doc h2 { margin-bottom: 16px; font: 400 var(--fs-heading)/1.15 var(--font-serif); letter-spacing: -0.01em; }
.doc h3 { margin: 28px 0 8px; font-size: var(--fs-text); font-weight: 600; }
.doc p, .doc ul, .doc ol { margin: 0 0 16px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: 8px; }
.doc li::marker { color: var(--muted); }
.doc .num { counter-reset: s; list-style: none; padding: 0; }
.doc .num > li { position: relative; padding-left: 40px; margin-bottom: 14px; counter-increment: s; }
.doc .num > li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-ink); font-size: 14px; line-height: 26px; text-align: center; font-weight: 600;
}
.doc .ui { font-weight: 500; }
.doc code { font: 0.92em ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; }

/* tables read as rows on a phone: each cell under its column's name */
.doc table { width: 100%; margin: 8px 0 24px; border-collapse: separate; border-spacing: 0; line-height: 1.5; font-size: 16px; }
.doc th { padding: 10px 12px; text-align: left; vertical-align: bottom; font-weight: 500; color: var(--muted); background: var(--panel); }
.doc th:first-child { border-radius: 10px 0 0 10px; }
.doc th:last-child { border-radius: 0 10px 10px 0; }
.doc td { padding: 12px; vertical-align: top; }
.doc td:first-child { font-weight: 500; }
.doc tr + tr td { border-top: 1px solid var(--line); }

.toc { position: sticky; top: 24px; margin-top: 32px; padding: 22px; border-radius: var(--r-panel); background: var(--panel); }
.toc h2 { margin-bottom: 10px; font-size: var(--fs-text); font-weight: 600; }
.toc ol { display: grid; gap: 8px; margin: 0; padding-left: 20px; font-size: var(--fs-small); line-height: 20px; }
.toc li::marker { color: var(--muted); }
.toc a { text-decoration: none; }
.toc a:hover { color: var(--link); }

/* ---------------- the foot: who runs Kadenzi, and the three documents again ---------------- */
.foot { padding-top: 32px; padding-bottom: 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); line-height: 22px; }
.foot .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.foot .legal a { color: var(--text); text-decoration: none; }
.foot .legal a:hover { color: var(--link); }
.foot .who { margin-top: 12px; }
.band + .foot, .close + .foot { border-top: 0; }

/* the 404 */
.lost { padding-top: 64px; padding-bottom: 120px; }
.lost h1 { font: 400 var(--fs-display)/1.05 var(--font-serif); letter-spacing: -0.02em; }
.lost p { margin-top: 20px; max-width: 48ch; }

@media (max-width: 900px) {
  .doc-wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; order: -1; margin-top: 8px; }
  .steps, .facts { grid-template-columns: minmax(0, 1fr); }
  .lists { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .doc table, .doc thead, .doc tbody, .doc tr, .doc td { display: block; }
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .doc tr { padding: 12px 0; }
  .doc tr + tr { border-top: 1px solid var(--line); }
  .doc tr + tr td { border-top: 0; }
  .doc td { padding: 2px 0; }
  .doc td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: var(--fs-small); font-weight: 500; }
  .doc td:first-child[data-label]::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
