/* docs page */

.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; max-width: 1240px; margin: 0 auto; padding: 0 24px; }

.side { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; overflow-x: hidden; padding: 32px 10px; margin-left: -10px; }
.side h4 { margin: 18px 0 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.side h4:first-child { margin-top: 0; }
.side a { display: block; text-decoration: none; color: var(--text-2); padding: 5px 10px; margin: 0 -10px; border-radius: 7px; font-size: 13.5px; }
.side a:hover { color: var(--text); background: var(--bg-subtle); }
.side a.active { color: var(--text); background: var(--bg-subtle); font-weight: 550; }

.doc { padding: 40px 0 24px; min-width: 0; max-width: 760px; }
.doc-hero { padding-bottom: 28px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.doc-logo { display: block; width: 72px; height: 72px; margin-bottom: 18px; border-radius: 18px; box-shadow: var(--shadow-lg); }
.doc-hero h1 { font-size: 40px; line-height: 1.1; letter-spacing: -.035em; font-weight: 720; margin: 10px 0 12px; }
.doc-hero p.lead { font-size: 17px; line-height: 1.6; color: var(--text-2); margin: 0 0 20px; }
.doc-hero .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 9px 16px; border-radius: 10px; font-weight: 580; font-size: 14px; border: 1px solid var(--border-strong); background: var(--surface); }
.btn:hover { border-color: var(--text-3); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { opacity: .9; }
.btn svg { width: 15px; height: 15px; }

.doc section { padding-top: 36px; scroll-margin-top: 68px; }
.doc h2 { font-size: 24px; letter-spacing: -.025em; font-weight: 680; margin: 0 0 10px; }
.doc h3 { font-size: 16px; letter-spacing: -.01em; font-weight: 640; margin: 26px 0 8px; }
.doc p, .doc li { font-size: 15px; line-height: 1.7; color: var(--text-2); }
.doc p { margin: 0 0 14px; }
.doc ul, .doc ol { padding-left: 20px; margin: 0 0 14px; }
.doc li { margin-bottom: 4px; }
.doc strong { color: var(--text); font-weight: 600; }
.doc a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.doc :not(pre) > code { font-family: var(--mono); font-size: .86em; background: var(--bg-subtle); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; color: var(--text); }

pre {
  position: relative; margin: 0 0 18px; padding: 16px 18px; border-radius: 12px; overflow-x: auto;
  background: var(--bg-subtle); border: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--text);
}
pre .c { color: var(--text-3); }
pre .k { color: var(--accent-ink); }
pre .s { color: var(--good); }
.code-label { font-size: 12px; font-family: var(--mono); color: var(--text-3); margin: 0 0 6px; }
.copy {
  position: absolute; top: 8px; right: 8px; font-size: 11.5px; padding: 3px 9px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); opacity: 0; transition: opacity .15s;
}
pre:hover .copy, .copy:focus-visible { opacity: 1; }

.callout { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-radius: 12px; margin: 0 0 18px; border: 1px solid var(--border); background: var(--surface-2); }
.callout svg { width: 18px; height: 18px; margin-top: 3px; color: var(--text-2); }
.callout p { margin: 0; font-size: 14px; }
.callout.warn { background: var(--warn-soft); border-color: transparent; }
.callout.warn svg { color: var(--warn); }
.callout.tip { background: var(--accent-soft); border-color: transparent; }
.callout.tip svg { color: var(--accent-ink); }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 6px 0 8px; }
.feature { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface); }
.feature .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; margin-bottom: 10px; }
.feature .ic svg { width: 15px; height: 15px; }
.feature b { display: block; font-weight: 620; font-size: 14px; color: var(--text); }
.feature span { font-size: 13.5px; color: var(--text-2); line-height: 1.55; display: block; margin-top: 2px; }

.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td { color: var(--text-2); }
td code { white-space: nowrap; }
.yes { color: var(--good); font-weight: 600; }
.no { color: var(--text-3); }

.tier { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tier.t0 { background: var(--good-soft); color: var(--good); }
.tier.t1 { background: var(--accent-soft); color: var(--accent-ink); }
.tier.t2 { background: color-mix(in srgb, var(--eitr) 14%, transparent); color: var(--eitr); }

.diagram { border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin: 4px 0 18px; background: var(--surface-2); }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram text { font-family: var(--font); }

.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps > li { counter-increment: step; position: relative; padding-left: 40px; margin-bottom: 18px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 650; display: grid; place-items: center;
}
.steps > li > strong { display: block; margin-bottom: 4px; }

details { border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; margin-bottom: 8px; background: var(--surface); }
summary { cursor: pointer; padding: 13px 0; font-weight: 580; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--text-3); font-weight: 400; font-size: 18px; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { margin-top: 0; }

.roadmap { list-style: none; padding: 0 !important; }
.roadmap li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); margin: 0; }
.roadmap li:last-child { border-bottom: 0; }
.roadmap .badge { min-width: 78px; justify-content: center; }

@media (max-width: 820px) {
  .docs { grid-template-columns: 1fr; gap: 0; padding: 0 16px; }
  .side { position: static; max-height: none; padding: 16px 0 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .side h4 { display: none; }
  .side a { flex: none; margin: 0; border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
  .doc { padding-top: 24px; }
  .doc-hero h1 { font-size: 32px; }
  .features { grid-template-columns: 1fr; }
}

/* architecture diagram */
.d-group { fill: none; stroke: var(--border-strong); stroke-dasharray: 4 4; }
.d-box { fill: var(--surface); stroke: var(--border-strong); }
.d-key { fill: var(--accent-soft); stroke: var(--accent); }
.d-dark { fill: var(--text); }
.d-title { fill: var(--text); font-size: 13px; font-weight: 600; }
.d-title-inv { fill: var(--bg); font-size: 13px; font-weight: 600; }
.d-sub { fill: var(--text-3); font-size: 11.5px; }
.d-sub-inv { fill: var(--bg); opacity: .7; font-size: 11.5px; }
.d-label { fill: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.d-line { fill: none; stroke: var(--text-3); stroke-width: 1.5; }
.d-line.dash { stroke-dasharray: 4 4; }
.d-head { fill: var(--text-3); }
