/* mandately.dev. Colours come only from tokens.css (generated from design/tokens.json): no colour value is written
   here. Pages are generated from docs/*.md by scripts/build_web.py. */

@font-face { font-family: "Source Serif 4"; src: url("fonts/source-serif-4.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--sans); font-size: 16px;
  line-height: 1.65; }
svg { max-width: 100%; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 10; background: var(--raised); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; }
.skip:focus { top: 12px; }
a { color: var(--pine); text-underline-offset: 3px; }
a:hover { color: var(--pine-hover); }
a:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; border-radius: 2px; }

.in { max-width: 1320px; margin: 0 auto;
  padding-left: max(clamp(16px, 4vw, 40px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(16px, 4vw, 40px), env(safe-area-inset-right, 0px)); }
.top { background: var(--hero); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 20px; padding-block: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; margin-right: auto; color: var(--ink); text-decoration: none; }
.brand .mk { width: 28px; height: 28px; }
.brand .wm { width: auto; height: 19px; }
.brand .dot { fill: var(--dot); }
.brand .tag { font: 600 12px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 5px 9px; margin-left: 4px; }
.bar nav { display: flex; gap: 18px; flex-wrap: wrap; }
.bar nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.bar nav a:hover { color: var(--ink); }

.doc { padding-block: 40px 56px; }
.doc h1 { font: 500 clamp(32px, 5vw, 44px)/1.1 var(--serif); letter-spacing: -.01em; margin: 0 0 18px; text-wrap: balance; }
.doc h2 { font: 500 28px/1.2 var(--serif); margin: 44px 0 12px; text-wrap: balance; }
.doc h3 { font: 500 20px/1.3 var(--serif); margin: 28px 0 8px; }
.doc p, .doc ul, .doc ol { margin: 0 0 14px; max-width: 46rem; }
.doc ul, .doc ol { padding-left: 1.3rem; display: grid; gap: 8px; }
.doc li::marker { color: var(--muted); }
.doc strong { font-weight: 600; }
.doc code { font: 400 .9em/1 var(--mono); background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 2px 5px; overflow-wrap: break-word; }
.doc pre { margin: 0 0 18px; background: var(--band); color: var(--band-ink); border: 1px solid var(--band-line);
  border-radius: var(--radius-md); padding: 16px 18px; overflow-x: auto; }
.doc pre code { background: none; border: 0; padding: 0; font: 400 14px/1.65 var(--mono); color: inherit;
  overflow-wrap: normal; }
.table { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--raised); }
.table table { border-collapse: collapse; width: 100%; font-size: 15px; }
.table th, .table td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table th { font: 600 12px/1.4 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table td code { overflow-wrap: normal; white-space: nowrap; }

.foot { display: flex; flex-wrap: wrap; gap: 18px; padding-block: 24px 40px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted); }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot .legal { margin-left: auto; }

@media (max-width: 480px) {
  .bar { gap: 12px; }
  .bar nav { gap: 14px; }
  .doc h2 { font-size: 24px; }
  .table th, .table td { padding: 8px 10px; }
  .foot .legal { margin-left: 0; }
}

/* Layout: the page with an "On this page" list beside it on wide screens */
.layout { display: block; }
.doc { max-width: 800px; }
.toc, .side { display: none; }
@media (min-width: 1100px) {
  .layout { display: grid; grid-template-columns: minmax(0, 800px) 210px; justify-content: space-between; gap: 48px; }
  .layout > .side { display: none; }
  .toc { display: block; position: sticky; top: 24px; align-self: start; padding-top: 48px; font-size: 14px; }
  .toc p { margin: 0 0 10px; font: 600 12px/1.4 var(--sans); letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); }
  .toc ul { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line); display: grid; gap: 8px; }
  .toc a { color: var(--muted); text-decoration: none; }
  .toc a:hover { color: var(--ink); }
}

/* Inline code that wraps keeps its box on each line */
.doc code { -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* Code blocks with a label (a file path, or Terminal) and a Copy button */
.code { margin: 0 0 18px; background: var(--band); border: 1px solid var(--band-line); border-radius: var(--radius-md);
  overflow: hidden; }
.code figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px;
  padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--band-line); background: var(--band-raised);
  font: 500 12.5px/1.4 var(--mono); color: var(--band-muted); }
.code figcaption span { overflow-wrap: anywhere; }
.code.shell figcaption span { font-family: var(--sans); font-weight: 600; letter-spacing: .02em; }
.doc .code pre { margin: 0; border: 0; border-radius: 0; }
.code.output { background: var(--raised); border-color: var(--line); }
.code.output figcaption { background: var(--surface); border-color: var(--line); color: var(--muted);
  font-family: var(--sans); font-weight: 600; letter-spacing: .02em; }
.doc .code.output pre { background: var(--raised); color: var(--ink); }
.doc .code.output pre code { white-space: pre-wrap; overflow-wrap: anywhere; }   /* output reads as text: it wraps */
.copy { flex: none; font: 500 12px/1 var(--sans); color: var(--band-ink); background: transparent;
  border: 1px solid var(--band-line); border-radius: var(--radius-pill); padding: 6px 11px; cursor: pointer; }
.copy:hover { border-color: var(--band-muted); }
.copy:focus-visible { outline: 2px solid var(--band-key); outline-offset: 2px; }

/* Steps (::: steps / ::: step): numbered down a line, code at full width */
.steps { counter-reset: step; margin: 8px 0 30px; }
.step { position: relative; counter-increment: step; padding: 0 0 28px 52px; }
.step::before { content: ""; position: absolute; left: 16px; top: 40px; bottom: 8px; width: 1px; background: var(--line); }
.steps > .step:last-child::before { display: none; }
.steps > .step:last-child { padding-bottom: 0; }
.doc .step > h3 { margin: 4px 0 8px; font: 500 21px/1.3 var(--serif); }
.step > h3::before { content: counter(step); position: absolute; left: 0; top: 0; width: 33px; height: 33px;
  border-radius: 50%; background: var(--pine); color: var(--on-pine); display: grid; place-items: center;
  font: 600 14px/1 var(--sans); }
.doc .step > p { margin: 0 0 12px; }
.step > :last-child { margin-bottom: 0; }

/* Folded detail (::: more) */
details.more { margin: 4px 0 16px; max-width: 46rem; }
details.more > summary { cursor: pointer; list-style: none; color: var(--pine); font-weight: 500; font-size: 15px;
  display: inline-flex; gap: 8px; align-items: baseline; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; font: 500 16px/1 var(--mono); width: 12px; }
details.more[open] > summary::before { content: "\2212"; }
details.more > summary:hover { color: var(--pine-hover); }
details.more > summary:focus-visible { outline: 2px solid var(--pine); outline-offset: 3px; border-radius: 2px; }
.doc details.more > :not(summary) { margin-top: 10px; }
.doc details.more > :last-child { margin-bottom: 4px; }

/* Notes (::: note) */
.note { margin: 0 0 18px; max-width: 46rem; padding: 12px 16px; background: var(--raised);
  border: 1px solid var(--line); border-left: 3px solid var(--pine); border-radius: var(--radius-sm); }
.doc .note p { margin: 0; }
.doc .note p + p { margin-top: 8px; }

/* The messages table (::: says) */
.says .table td:first-child { width: 42%; font: 500 13.5px/1.5 var(--mono); color: var(--ink); }
.says .table td:first-child::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px;
  border-radius: 50%; background: var(--pine); vertical-align: 1px; }
@media (max-width: 640px) {
  .step { padding-left: 46px; }
  .step > .code, .step > pre { position: relative; z-index: 1; margin-left: -46px; }   /* full width, over the line */
  .code figcaption { font-size: 11.5px; }
  .says .table thead { display: none; }
  .says .table table, .says .table tbody, .says .table tr, .says .table td { display: block; width: auto; }
  .says .table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .says .table tr:last-child { border-bottom: 0; }
  .says .table td { padding: 0; border: 0; }
  .says .table td:first-child { width: auto; margin-bottom: 4px; }
}

/* The docs' side menu, on screens wide enough for three columns; below that the header links reach every section */
@media (min-width: 1240px) {
  .layout { grid-template-columns: 200px minmax(0, 760px) 200px; gap: 40px; justify-content: space-between; }
  .layout > .side { display: block; position: sticky; top: 24px; align-self: start; padding-top: 48px; font-size: 14px; }
  .side p { margin: 0 0 8px; font: 600 12px/1.4 var(--sans); letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); }
  .side ul { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 2px; }
  .side a { display: block; padding: 5px 10px; border-left: 2px solid transparent; color: var(--muted);
    text-decoration: none; }
  .side a:hover { color: var(--ink); }
  .side a[aria-current="page"] { color: var(--ink); font-weight: 600; border-left-color: var(--pine); }
  .layout:not(:has(> .toc)) { grid-template-columns: 200px minmax(0, 760px); justify-content: start; gap: 56px; }
}
