/* Writ — the documentation reader (/docs). Signed-out or signed-in, it is
   never the application shell: no topbar, no desk, no sheet. It shares
   tokens.css with every app page (same palette, same type scale, same
   --meaning/--wording/--blocked semantics) and adds only what a long-form
   reading surface needs: a page frame, a section nav, and article prose.

   Content over chrome. The article is the product here; the frame around it
   stays out of the way. */

body.docs {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: var(--t-md)/1.55 var(--ui);
  letter-spacing: var(--ui-tracking);
}

.docs a { color: inherit; }
.docs :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r1); }

.docs-wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }

/* ------------------------------------------------------------------ nav */

.docs-nav-top {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.docs-nav-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 54px;
}
.docs-brand {
  display: inline-flex; align-items: center; gap: 9px;
  font: 600 15px/1 var(--ui); text-decoration: none; color: var(--ink);
}
.docs-brand .logo { display: block; color: var(--ink); }
.docs-brand .logo-overlap { fill: var(--meaning); }
.docs-nav-top nav { display: flex; align-items: center; gap: 20px; font-size: var(--t-sm); }
.docs-nav-top nav a { color: var(--ink-2); text-decoration: none; }
.docs-nav-top nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------------------ layout */

.docs-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 56px;
  /* Vertical only. This element is `class="docs-wrap docs-body"`, and a
     shorthand `padding` here replaces all four sides — including the
     `0 28px` that `.docs-wrap` sets twenty lines above, at the same
     specificity but earlier in the file. That silently zeroed the page's
     horizontal margin everywhere; it was invisible above 1080px, where
     `max-width` plus `margin: 0 auto` happens to supply the gap instead, and
     obvious at 375px where the text sat flush against both screen edges. */
  padding-block: 44px 88px;
  align-items: start;
}
@media (max-width: 760px) {
  .docs-body {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-block: 28px 64px;
  }
  .docs-body .docs-side {
    position: static;
    top: auto;
    display: flex;
    gap: 6px;
    padding-bottom: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .docs-body .docs-side-label { display: none; }
  .docs-body .docs-side a {
    flex: none;
    min-height: 40px;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    white-space: nowrap;
  }
  .docs-body .docs-side a[aria-current="page"] {
    border-left-color: var(--line);
    background: var(--sunken);
  }
}

@media (max-width: 480px) {
  .docs-wrap { padding-inline: 20px; }
}

.docs-side {
  position: sticky; top: 28px;
  display: grid; gap: 2px;
}
.docs-side-label {
  font: 600 11px/1.4 var(--ui); text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-3); margin: 0 0 8px;
}
.docs-side a {
  display: block; padding: 6px 0; font-size: var(--t-sm); color: var(--ink-2);
  text-decoration: none; border-left: 2px solid transparent; padding-left: 10px;
  margin-left: -11px;
}
.docs-side a:hover { color: var(--ink); }
.docs-side a[aria-current="page"] {
  color: var(--ink); font-weight: 600; border-left-color: var(--meaning);
}

.docs-main { min-width: 0; max-width: 720px; }

/* ------------------------------------------------------------------ article */

.docs-kicker {
  font: 500 12px/1.3 var(--ui); text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); margin: 0 0 10px;
}
.docs-main h1 {
  font: 600 30px/1.25 var(--prose); margin: 0 0 14px; color: var(--ink);
}
.docs-lede {
  font: 400 17px/1.55 var(--prose); color: var(--ink-2); margin: 0 0 36px;
  max-width: 62ch;
}
.docs-main h2 {
  font: 600 21px/1.3 var(--prose); margin: 44px 0 12px; color: var(--ink);
  padding-top: 8px; border-top: 1px solid var(--line-2);
}
.docs-main h2:first-of-type { border-top: none; padding-top: 0; }
.docs-main h3 {
  font: 600 16px/1.3 var(--ui); margin: 26px 0 10px; color: var(--ink);
}
.docs-main p { margin: 0 0 14px; max-width: 68ch; color: var(--ink); }
.docs-main p.muted, .docs-main li.muted { color: var(--ink-2); }
.docs-main ul, .docs-main ol {
  margin: 0 0 16px; padding-left: 22px; max-width: 68ch; display: grid; gap: 6px;
}
.docs-main li { color: var(--ink); }
.docs-main strong { font-weight: 600; }
.docs-main code {
  font-family: var(--mono); font-size: .9em; background: var(--sunken);
  padding: .1em .35em; border-radius: var(--r1);
}
.docs-main pre.code {
  font: 400 12.5px/1.6 var(--mono);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--surface);
  overflow-x: auto;
  white-space: pre;
  margin: 0 0 20px;
}
.docs-main pre.code code { background: none; padding: 0; }
.docs-main blockquote {
  margin: 0 0 16px; padding: 2px 0 2px 16px; border-left: 2px solid var(--line);
  color: var(--ink-2); font-style: italic;
}
.docs-main a { text-decoration: underline; text-underline-offset: 2px; }
.docs-main a:hover { color: var(--focus); }

.docs-table-wrap { overflow-x: auto; margin: 0 0 20px; }
.docs-main table { border-collapse: collapse; font-size: var(--t-sm); min-width: 100%; }
.docs-main th, .docs-main td {
  text-align: left; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--line-2);
  vertical-align: top;
}
.docs-main th { color: var(--ink-3); font-weight: 600; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .03em; }

/* A step in the getting-started walkthrough: numbered, verified. */
.docs-steps { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 22px; counter-reset: step; }
.docs-steps > li { position: relative; padding-left: 40px; max-width: 68ch; }
.docs-steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink-2);
  font: 600 12px/24px var(--ui); text-align: center;
}
.docs-steps h3 { margin: 0 0 4px; }
.docs-steps p { margin: 0 0 6px; }

/* Status words, marginal-mark idiom (docs/UI-BRIEF vocabulary), reused for
   the honesty page — never a pill inside prose, a short glyph before the word. */
.docs-status { font: 500 var(--t-sm)/1.4 var(--ui); white-space: nowrap; }
.docs-status::before { content: "\2758"; margin-right: 5px; }
.docs-status-works { color: var(--wording); }
.docs-status-partial { color: var(--meaning); }
.docs-status-missing { color: var(--blocked); }

.docs-callout {
  border: 1px solid var(--line); border-radius: var(--r3);
  background: var(--surface); padding: 14px 18px; margin: 0 0 20px;
  max-width: 68ch; font-size: var(--t-md);
}
.docs-callout p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ footer */

.docs-footer { border-top: 1px solid var(--line); }
.docs-footer .docs-wrap {
  padding-top: 24px; padding-bottom: 24px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; font-size: var(--t-sm); color: var(--ink-2);
}
.docs-footer nav { display: flex; gap: 18px; }
.docs-footer a { color: inherit; text-decoration: none; }
.docs-footer a:hover { text-decoration: underline; text-underline-offset: 2px; }
