/* Docs page. A night band on top, then paper for reading. Body text is darker than --muted for long reads. */

.page-docs { background: var(--page); }
.page-docs { --read: #333333; }

.docs-top { position: relative; isolation: isolate; overflow: hidden; padding-bottom: 96px; background: var(--night); color: #fff; }
.docs-hero { display: grid; justify-items: center; max-width: 800px; padding-top: 52px; text-align: center; }
.docs-hero .kicker { color: var(--night-soft); }
.docs-hero h1 { margin-top: 18px; font-size: clamp(44px, 6.6vw, 84px); }
.docs-hero .lede { max-width: 580px; margin-top: 24px; }
.docs-hero .text-link { margin-top: 28px; color: #fff; }

.docs { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 64px; align-items: start; padding-top: 56px; }

/* Index */
.toc { position: sticky; top: 24px; min-width: 0; }
.toc ol { list-style: none; margin: 14px 0 0; padding: 0; }
.toc a {
  display: block; padding: 7px 12px; border-left: 2px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.toc a:hover { color: var(--ink); }
.toc a[aria-current] { border-left-color: var(--ink); color: var(--ink); font-weight: 500; }

.docs-body { min-width: 0; max-width: 800px; }

.callout {
  display: flex; gap: 14px; padding: 20px 22px;
  border: 1px solid var(--line-strong); border-radius: 18px; background: #fff;
  font-size: 15px; color: var(--read);
}
.callout .i { flex: none; margin-top: 3px; }
.callout p + p { margin-top: 10px; }
.callout b { color: var(--ink); }

/* Follow the note */
.guide { margin-top: 40px; padding: 32px; border-radius: 26px; background: var(--ink); color: #fff; scroll-margin-top: 20px; }
.guide-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.guide-head .kicker { color: var(--night-muted); }
.pill-dark { padding: 5px 10px; border: 1px solid var(--night-line); border-radius: 999px; font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--night-soft); }
.guide h2 { margin-top: 14px; font-size: clamp(36px, 4.6vw, 56px); }
.guide-lede { margin-top: 12px; color: var(--night-soft); }

.guide-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 28px; }
.guide-tabs button {
  display: grid; gap: 4px; padding: 12px 14px; text-align: left;
  border: 1px solid var(--night-line); border-radius: 14px; background: none; color: var(--night-soft);
  font-weight: 500; font-size: 14px; cursor: pointer;
}
.guide-tabs button span { font: 500 11px/1 var(--mono); color: var(--night-muted); }
.guide-tabs button:hover { border-color: rgba(255, 255, 255, .4); }
.guide-tabs button[aria-selected="true"] { background: #fff; border-color: #fff; color: var(--ink); }
.guide-tabs button[aria-selected="true"] span { color: var(--muted); }

.guide-stage {
  position: relative; margin-top: 14px; padding: 76px 0 20px;
  border: 1px solid var(--night-line); border-radius: 20px; background: rgba(255, 255, 255, .02);
}
.stage-nodes { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); }
.stage-node { display: grid; justify-items: center; gap: 6px; padding: 0 6px; text-align: center; }
.stage-node b { margin-top: 6px; font-size: 14px; font-weight: 600; }
.stage-node small { font-size: 12px; color: var(--night-muted); }
.node-icon {
  display: grid; place-items: center; width: 56px; height: 56px;
  border: 1px solid var(--night-line); border-radius: 16px; background: #0f0f0f; color: #fff;
  transition: background-color .4s, color .4s, border-color .4s;
}
.node-icon svg { width: 24px; height: 24px; }
.node-zk { font: 600 15px/1 var(--mono); }
.stage-node.is-reached .node-icon { border-color: rgba(255, 255, 255, .55); }
.stage-node.is-active .node-icon { background: #fff; border-color: #fff; color: var(--ink); }
.stage-line {
  position: absolute; top: 104px; left: 12.5%; right: 12.5%; height: 1px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .3) 0 4px, transparent 4px 9px);
}
.stage-line::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--step) / 3 * 100%);
  background: #fff; transition: width .6s cubic-bezier(.65, 0, .35, 1);
}
.stage-note {
  position: absolute; top: 22px; left: 0; width: 25%; z-index: 2;
  display: flex; justify-content: center;
  transform: translateX(calc(var(--step) * 100%));
  transition: transform .6s cubic-bezier(.65, 0, .35, 1);
}
.stage-note .tile { width: 36px; height: 36px; box-shadow: 0 0 0 6px var(--ink); }
.stage-caption { margin-top: 22px; text-align: center; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--night-muted); }

.guide-panel { margin-top: 14px; padding: 24px; border-radius: 20px; background: #fff; color: var(--ink); }
.panel-status { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.pill-light { display: inline-flex; padding: 5px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; }
.guide-panel h3 { margin: 8px 0 10px; font-size: 30px; letter-spacing: -.035em; }
.guide-panel > p:not(.kicker) { color: var(--read); font-size: 16px; }
.more { margin-top: 14px; }
.more summary { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; cursor: pointer; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary .i { width: 14px; height: 14px; transition: transform .2s; }
.more[open] summary .i { transform: rotate(45deg); }
.more p { margin-top: 10px; color: var(--read); font-size: 15px; }
.artifact {
  display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: 14px;
}
.artifact code { font: 500 13px var(--mono); }
.guide-controls { display: flex; gap: 10px; margin-top: 20px; }
.round {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer;
}
.round:hover:not(:disabled) { border-color: var(--ink); }
.round:disabled { opacity: .3; cursor: not-allowed; }
.round-ink { background: var(--ink); border-color: var(--ink); color: #fff; }

/* After the guide */
.remember { margin-top: 28px; padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.remember h3 { margin-top: 12px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.035em; }
.remember p:not(.kicker) { max-width: 640px; margin-top: 14px; color: var(--read); }
.concepts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.concept { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.concept h3 { margin: 10px 0 8px; font: 600 20px/1.2 var(--display); letter-spacing: -.02em; }
.concept p:not(.kicker) { font-size: 14.5px; color: var(--read); }

.explorer { margin-top: 28px; padding: 28px; border-radius: 22px; background: var(--soft); }
.explorer-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 14px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.explorer-tabs button { padding: 9px 14px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.explorer-tabs button:hover { color: var(--ink); }
.explorer-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.explorer-panel { margin-top: 20px; }
.explorer-panel h3 { font-size: 26px; letter-spacing: -.03em; }
.explorer-panel > p { margin-top: 8px; color: var(--read); }
.explorer-rows { margin: 18px 0 0; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.explorer-rows div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; }
.explorer-rows div + div { border-top: 1px solid var(--line); }
.explorer-rows dt { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.explorer-rows dd { margin: 0; text-align: right; font-size: 14px; }
.explorer .fine { margin-top: 14px; }

/* Reading sections */
.doc-section { padding-top: 76px; scroll-margin-top: 16px; }
.doc-section > .kicker + h2 { margin-top: 12px; }
.doc-section h2 { font-size: clamp(30px, 3.6vw, 42px); letter-spacing: -.04em; line-height: 1.02; }
.doc-section h3 { margin-top: 36px; font: 600 21px/1.25 var(--display); letter-spacing: -.02em; }
.doc-section p { max-width: 690px; margin-top: 14px; color: var(--read); font-size: 16px; line-height: 1.7; }
.doc-section h2 + p { margin-top: 18px; }
.doc-section p code { padding: 1px 6px; border-radius: 5px; background: #ececec; font: 500 13.5px var(--mono); }
.doc-section p a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.table-wrap { overflow-x: auto; margin-top: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.table-wrap table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
.table-wrap th {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); background: var(--page);
  font: 500 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.table-wrap td { padding: 14px 16px; vertical-align: top; border-bottom: 1px solid var(--line); color: var(--read); line-height: 1.55; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap td:first-child { color: var(--ink); font-weight: 500; }
.st { display: inline-flex; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.st-on { background: var(--ink); color: #fff; }
.st-demo { border: 1px solid var(--ink); color: var(--ink); }
.st-off { border: 1px dashed #9a9a9a; color: var(--muted); }

.arch {
  list-style: none; margin: 24px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line); border-radius: 18px; background: #fff;
}
.arch li { position: relative; display: grid; align-content: start; gap: 8px; padding: 20px; }
.arch li + li { border-left: 1px solid var(--line); }
.arch li b { font: 600 18px/1.2 var(--display); letter-spacing: -.02em; margin-bottom: 4px; }
.arch li span:not(.kicker) { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--page); font-size: 13.5px; color: var(--read); }
.arch li:not(:last-child)::after {
  content: "→"; position: absolute; right: -11px; top: 50%; z-index: 1; transform: translateY(-50%);
  display: grid; place-items: center; width: 22px; height: 22px;
  border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 12px;
}

.code {
  overflow-x: auto; margin: 22px 0 0; padding: 18px 20px; border-radius: 16px;
  background: var(--ink); color: #ececec; font: 400 13px/1.75 var(--mono); white-space: pre;
}
.code-label { display: block; margin-bottom: 8px; color: #8d8d8d; }

.doc-section blockquote {
  margin: 20px 0 0; padding: 18px 22px; border-left: 3px solid var(--ink); border-radius: 0 14px 14px 0; background: #fff;
  font: 500 19px/1.45 var(--display); letter-spacing: -.01em;
}

.defs { display: grid; gap: 10px; margin: 22px 0 0; }
.defs div { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.defs dt { font-weight: 600; font-size: 15px; }
.defs dd { margin: 0; font-size: 15px; color: var(--read); }

.checks { list-style: none; display: grid; gap: 10px; margin: 22px 0 0; padding: 0; }
.checks li {
  position: relative; padding: 14px 16px 14px 48px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; font-size: 15px; color: var(--read);
}
.checks li::before {
  content: ""; position: absolute; left: 16px; top: 16px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.checks b { color: var(--ink); }
.checks.compact li { padding: 11px 14px 11px 44px; font-size: 14px; }
.checks.compact li::before { top: 12px; left: 14px; }
.note { padding: 14px 16px; border-left: 3px solid var(--ink); background: #fff; font-size: 14.5px !important; }

.endpoints { display: grid; gap: 10px; margin-top: 22px; }
.endpoints > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.endpoints > div > code { display: block; font: 500 13px/1.6 var(--mono); word-break: break-all; }
.endpoints > div > code b { display: inline-block; margin-right: 8px; padding: 2px 7px; border-radius: 5px; background: var(--ink); color: #fff; font-size: 11px; }
.endpoints p { margin-top: 8px !important; font-size: 14.5px !important; }

.steps-list { list-style: none; margin: 18px 0 0; padding: 0; counter-reset: s; max-width: 690px; }
.steps-list li { position: relative; padding: 13px 0 13px 46px; border-bottom: 1px solid var(--line); color: var(--read); counter-increment: s; }
.steps-list li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 15px; font: 500 12px/1.4 var(--mono); color: var(--muted); }

.roadmap { list-style: none; margin: 22px 0 0; padding: 0; }
.roadmap li { position: relative; display: grid; grid-template-columns: 190px 1fr; gap: 16px; padding: 14px 0 14px 30px; border-bottom: 1px solid var(--line); }
.roadmap li::before { content: ""; position: absolute; left: 4px; top: 20px; width: 10px; height: 10px; border: 1.5px solid var(--ink); border-radius: 50%; background: #fff; }
.roadmap li.is-now::before { background: var(--ink); }
.roadmap b { font-size: 15px; font-weight: 600; }
.roadmap span { font-size: 15px; color: var(--read); }

.docs-end {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px;
  margin-top: 76px; padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: #fff;
}
.page-docs .foot { margin-top: 64px; }

@media (max-width: 960px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 32px; }
  .toc { position: static; }
  .toc ol { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  .toc li { flex: none; }
  .toc a { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; white-space: nowrap; }
  .toc a[aria-current] { border-color: var(--ink); }
  .guide { margin-top: 28px; }
}

@media (max-width: 640px) {
  .docs-top { padding-bottom: 64px; }
  .docs-hero { padding-top: 32px; }
  .guide { padding: 20px; border-radius: 22px; }
  .guide-tabs { gap: 6px; }
  .guide-tabs button { padding: 10px 8px; font-size: 12.5px; border-radius: 12px; }
  .guide-stage { padding-top: 64px; }
  .stage-node small { display: none; }
  .stage-node b { font-size: 11.5px; }
  .node-icon { width: 44px; height: 44px; border-radius: 13px; }
  .node-icon svg { width: 20px; height: 20px; }
  .stage-line { top: 86px; }
  .stage-note { top: 16px; }
  .stage-note .tile { width: 30px; height: 30px; border-radius: 9px; }
  .guide-panel { padding: 20px; }
  .guide-panel h3 { font-size: 26px; }
  .remember, .explorer { padding: 20px; }
  .concepts { grid-template-columns: 1fr; }
  .explorer-rows div { flex-direction: column; align-items: flex-start; gap: 4px; }
  .explorer-rows dd { text-align: left; color: var(--read); }
  .arch { grid-template-columns: 1fr; }
  .arch li + li { border-left: 0; border-top: 1px solid var(--line); }
  .arch li:not(:last-child)::after { right: auto; left: 50%; top: auto; bottom: -11px; transform: translateX(-50%) rotate(90deg); }
  .defs div, .roadmap li { grid-template-columns: 1fr; gap: 4px; }
  .doc-section { padding-top: 60px; }
  .docs-end { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .stage-note, .stage-line::after, .node-icon, .more summary .i { transition: none; }
}
