/* Pinchu docs — loaded only by docs/*.html, on top of base.css.
   Same desk and smoked glass as the site. The reading signature: the clip is clamped on the
   contents rail at the section you are reading, the way it sits on the tier rail in Mint. */
html { scroll-behavior: smooth; }
.calm, .calm body { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.top-tools .here {
  font: 600 13px/1 var(--body); color: var(--acc-ink); background: var(--text);
  border-radius: var(--r-sm); padding: 0 12px; min-height: 34px; display: inline-flex; align-items: center;
}

/* ---------- shell ---------- */
.docs { max-width: 1240px; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 32px; align-items: start; }
.toc { position: sticky; top: calc(var(--head-h) + 24px); max-height: calc(100vh - var(--head-h) - 48px); overflow: auto; padding: 4px 4px 12px 0; }
.toc-doc { font: 600 12px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin: 0 0 12px 34px; }
.toc-rail { position: relative; }
.toc-rail::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); border-radius: 2px; }
.toc-read { position: absolute; left: 13px; top: 6px; width: 2px; height: 0; background: var(--steel); border-radius: 2px; transition: height .35s var(--ease); }
.toc-clip { position: absolute; left: 1px; top: 0; width: 26px; transform: translateY(-50%); transition: top .35s var(--ease); pointer-events: none; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a {
  display: block; padding: 7px 8px 7px 34px; border-radius: 6px; text-decoration: none;
  font-size: 14px; line-height: 1.35; color: var(--text-2); transition: color .2s, background .2s;
}
.toc a:hover { color: var(--text); background: rgba(236,236,230,.05); }
.toc a[aria-current="true"] { color: var(--text); font-weight: 600; }
.toc a .n { font: 500 12px var(--mono); color: var(--text-3); margin-right: 6px; }
.toc a[aria-current="true"] .n { color: var(--acc); }

/* ---------- the reading sheet ---------- */
.sheet { padding: clamp(20px, 3.4vw, 48px) clamp(18px, 4vw, 56px) clamp(28px, 4vw, 56px); min-width: 0; }
.doc-switch { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.28); width: fit-content; margin-bottom: 28px; }
.doc-switch a { padding: 8px 14px; border-radius: 7px; text-decoration: none; font: 600 14px/1.2 var(--display); color: var(--text-2); }
.doc-switch a:hover { color: var(--text); background: rgba(236,236,230,.06); }
.doc-switch a[aria-current="page"] { background: var(--text); color: var(--acc-ink); }

.doc-head { max-width: 72ch; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.doc-head h1 { font-size: clamp(32px, 4.2vw, 52px); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.doc-meta span { font: 600 12px/1 var(--mono); color: var(--text-2); padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 6px; }
.doc-meta span.draft { border-style: dashed; }
.doc-head .lede { font-size: clamp(16px, 1.4vw, 18px); color: var(--text-2); margin-top: 16px; }

.prose { max-width: 72ch; }
.prose section { padding-top: 36px; }
.prose h2 { font-size: clamp(22px, 2.2vw, 28px); margin-bottom: 14px; display: flex; gap: 12px; align-items: baseline; }
.prose h2 .n { font: 600 15px var(--mono); color: var(--text-3); flex: none; }
.prose h3 { font-size: 18px; margin: 26px 0 10px; }
.prose p, .prose li { color: var(--text-2); line-height: 1.7; }
.prose p + p, .prose p + ul, .prose ul + p, .prose p + ol, .prose ol + p { margin-top: 12px; }
.prose b, .prose strong { color: var(--text); }
.prose ul:not([class]), .prose ol:not([class]) { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.prose h3 + ul:not([class]), .prose h3 + ol:not([class]), .register ul { margin-top: 0; }
.prose ol:not([class]) .st { margin-left: 6px; vertical-align: 1px; }
.prose code { color: var(--text); background: rgba(236,236,230,.07); padding: 1px 5px; border-radius: 4px; }
.prose .formula { font: 500 14px/1.9 var(--mono); color: var(--text); padding: 12px 14px; margin: 14px 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(0,0,0,.35); overflow-x: auto; }
.prose [lang="zh"] { line-height: 1.85; }

/* callouts: what is fact vs. proposal, no coloured side bars */
.note { margin: 16px 0; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); background: rgba(0,0,0,.35); font-size: 14px; color: var(--text-2); }
.note b:first-child { color: var(--text); }

/* tables scroll inside their own box on small screens */
.tbl { margin: 16px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(0,0,0,.25); }
.tbl table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 520px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child > * { border-bottom: 0; }
.tbl thead th { font-size: 12px; font-weight: 600; color: var(--text-3); background: rgba(14,14,13,.6); }
.tbl td { color: var(--text-2); }
.tbl td.num, .tbl th.num { font-family: var(--mono); text-align: right; white-space: nowrap; color: var(--text); }
.tbl tbody th { font-weight: 600; color: var(--text); }

/* status tags: three states, told apart by line style and text, not colour alone */
.st { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--mono); padding: 5px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line-2); color: var(--text-2); }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.st-design::before { border: 1.5px solid var(--text-3); }
.st-live { color: var(--text); border-color: rgba(236,236,230,.45); }
.st-live::before { background: var(--text); }
.st-none { border-style: dashed; color: var(--text-3); }
.st-none::before { background: transparent; border: 1.5px dashed var(--text-3); }
.st-open { border-color: rgba(255,154,138,.4); color: var(--bad); }
.st-open::before { border: 1.5px solid var(--bad); }

/* status register: three columns read left to right as the path to launch */
.register { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.register > div { padding: 16px; border-left: 1px solid var(--line); background: rgba(0,0,0,.22); }
.register > div:first-child { border-left: 0; }
.register h3 { margin: 10px 0 10px; font-size: 17px; }
.register ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }

/* contract registry rows */
.reg { list-style: none; margin: 16px 0; padding: 0; display: grid; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(0,0,0,.25); }
.reg li { display: grid; grid-template-columns: minmax(0, 15ch) minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.reg li:last-child { border-bottom: 0; }
.reg .who { font-weight: 600; color: var(--text); font-size: 14px; }
.reg .what { grid-column: 2 / -1; font-size: 13px; color: var(--text-3); }
.reg .val { min-width: 0; }
.reg code { font-size: 13px; color: var(--text); }
.reg .addr-none { font: 13px var(--mono); color: var(--text-3); }
.reg .copy { min-height: 32px; padding: 0 10px; font-size: 12px; }

/* references: title on one line, the full URL on its own line */
.refs { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 0; counter-reset: ref; }
.refs li { counter-increment: ref; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.refs li::before { content: "[" counter(ref) "]"; font: 500 13px var(--mono); color: var(--text-3); grid-row: span 3; padding-top: 2px; }
.refs .t { color: var(--text); font-weight: 600; font-size: 15px; }
.refs .u, .ref-url .u { font: 13px/1.5 var(--mono); word-break: break-all; color: var(--text-2); }
.ref-url { margin-top: 4px; }
.prelaunch[data-state="open"] { border-style: solid; border-color: var(--acc); color: var(--acc); }
.prelaunch[data-state="paused"], .prelaunch[data-state="hold"] { border-style: solid; color: var(--text); }
@media (max-width: 900px) { .top-tools .prelaunch[data-live="chip"] { display: inline-block; font-size: 10px; padding: 6px; } }
.refs .why { font-size: 13px; color: var(--text-3); }
sup.r { font: 500 11px var(--mono); }
sup.r a { color: var(--text-3); text-decoration: none; padding: 0 1px; }
sup.r a:hover { color: var(--acc); }

/* FAQ / glossary */
.faq { display: grid; gap: 0; margin-top: 12px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 52px; padding: 10px 2px; font-weight: 600; color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--steel); border-bottom: 2px solid var(--steel); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq details > div { padding: 0 2px 16px; display: grid; gap: 10px; }
.gloss { margin: 12px 0 0; display: grid; border-top: 1px solid var(--line); }
.gloss div { display: grid; grid-template-columns: minmax(0, 16ch) minmax(0, 1fr); gap: 4px 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.gloss dt { font-weight: 600; color: var(--text); }
.gloss dd { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.6; }

/* doc map on the docs home */
.map { list-style: none; margin: 16px 0 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.map a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 18px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.map a:hover { background: rgba(236,236,230,.04); }
.map b { font: 700 20px/1.2 var(--display); color: var(--text); }
.map span { grid-column: 1; color: var(--text-2); font-size: 15px; }
.map i { grid-row: 1 / span 2; grid-column: 2; width: 10px; height: 10px; border-top: 2px solid var(--steel); border-right: 2px solid var(--steel); transform: rotate(45deg); transition: transform .2s var(--ease); }
.map a:hover i { transform: translateX(3px) rotate(45deg); }

.doc-end { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; font-size: 14px; }
.doc-end a { color: var(--text); }

.foot nav { flex-wrap: wrap; }

/* mobile contents: a disclosure above the sheet */
.toc-m { display: none; }

@media (max-width: 960px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .toc { display: none; }
  .toc-m { display: block; padding: 0; }
  .toc-m summary { cursor: pointer; min-height: 48px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
  .toc-m summary small { font: 500 12px var(--mono); color: var(--text-3); margin-left: 8px; font-weight: 400; }
  .toc-m ol { list-style: none; margin: 0; padding: 0 8px 10px; display: grid; }
  .toc-m a { display: block; padding: 10px 8px; text-decoration: none; color: var(--text-2); border-top: 1px solid var(--line); font-size: 15px; }
  .register { grid-template-columns: minmax(0, 1fr); }
  .register > div { border-left: 0; border-top: 1px solid var(--line); }
  .register > div:first-child { border-top: 0; }
  .reg li { grid-template-columns: minmax(0, 1fr) auto; }
  .reg .what { grid-column: 1 / -1; grid-row: 2; }
  .reg .val { grid-column: 1 / -1; }
  .gloss div { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .top-tools .here { display: none; }
}
@media (max-width: 560px) {
  .sheet { border-radius: 10px; }
  .doc-switch { width: 100%; }
  .doc-switch a { flex: 1; text-align: center; padding: 8px 6px; }
}
