/* Documentation pages (site/docs/*.html), generated by tools/build_docs.py.
   Sits on top of style.css and glass.css. */

.docs-shell {
  max-width: 1240px; margin: 0 auto; padding: 2.2rem clamp(1rem, 4vw, 2.5rem) 3rem;
  display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 2.5rem; align-items: start;
}
.docs-side {
  position: sticky; top: 5.6rem; max-height: calc(100vh - 7rem); overflow-y: auto;
  display: flex; flex-direction: column; gap: 1.4rem; scrollbar-width: thin; padding-bottom: 1rem;
}
.docs-nav, .docs-toc { display: flex; flex-direction: column; gap: .1rem; }
.docs-nav-label {
  margin: 0 0 .4rem; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-dim);
}
.docs-nav a, .docs-toc a {
  color: var(--ink-soft); text-decoration: none; font-size: .88rem; line-height: 1.35;
  padding: .38rem .7rem; border-radius: 10px; border-left: 2px solid transparent;
  transition: background .2s, color .2s;
}
.docs-nav a:hover, .docs-toc a:hover { background: rgba(255, 255, 255, .07); color: var(--ink); }
html[data-theme="light"] .docs-nav a:hover, html[data-theme="light"] .docs-toc a:hover { background: rgba(20, 28, 70, .07); }
.docs-nav a[aria-current="page"] {
  color: var(--ink); font-weight: 600; background: linear-gradient(110deg, var(--accent-soft), transparent);
  border-left-color: var(--accent);
}
.docs-toc { border-top: 1px solid var(--line-soft); padding-top: 1.2rem; }
.docs-toc a { font-size: .8rem; padding: .28rem .7rem; }
.docs-toc a.toc-l3 { padding-left: 1.5rem; color: var(--ink-dim); }
.docs-toc a.active { color: var(--accent); border-left-color: var(--accent); }

.docs-main { min-width: 0; margin: 0; max-width: none; padding: 0; width: 100%; }
.doc {
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02)), var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--line); border-radius: 24px; box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
  padding: clamp(1.4rem, 4vw, 3rem); font-size: 1rem; line-height: 1.7; overflow-wrap: break-word;
}
html[data-theme="light"] .doc { background: linear-gradient(180deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .55)), var(--glass); }
.doc > :first-child { margin-top: 0; }
.doc h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.1; letter-spacing: -.04em; margin: 0 0 1.2rem; font-weight: 700;
  background: linear-gradient(120deg, var(--ink) 35%, var(--accent) 80%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.doc h2 { font-size: 1.6rem; letter-spacing: -.03em; margin: 2.8rem 0 .8rem; padding-top: 1.6rem; border-top: 1px solid var(--line-soft); line-height: 1.2; }
.doc h3 { font-size: 1.2rem; letter-spacing: -.02em; margin: 2rem 0 .5rem; }
.doc h4 { font-size: 1rem; margin: 1.5rem 0 .4rem; color: var(--ink-soft); }
.doc h2, .doc h3, .doc h4 { scroll-margin-top: 5.5rem; position: relative; }
.doc .headerlink { position: absolute; left: -1.3rem; color: var(--ink-dim); text-decoration: none; opacity: 0; font-family: var(--mono); font-size: .9em; transition: opacity .2s; }
.doc h2:hover .headerlink, .doc h3:hover .headerlink, .doc h4:hover .headerlink, .doc .headerlink:focus { opacity: 1; color: var(--accent); }
.doc p { margin: 0 0 1.05rem; color: var(--ink-soft); }
.doc strong { color: var(--ink); }
.doc li { color: var(--ink-soft); margin: .3rem 0; }
.doc ul, .doc ol { padding-left: 1.4rem; margin: 0 0 1.1rem; }
.doc li::marker { color: var(--accent); }
.doc a { color: var(--accent); text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.doc a:hover { text-decoration-color: var(--accent); }
.doc a.ext::after { content: "\2197"; font-size: .8em; margin-left: .15em; opacity: .7; }
.doc hr { border: 0; height: 1px; margin: 2rem 0; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.doc blockquote {
  margin: 1.2rem 0; padding: .8rem 1.1rem; border-left: 3px solid var(--accent-2); border-radius: 0 14px 14px 0;
  background: rgba(255, 255, 255, .04);
}
.doc blockquote p:last-child { margin-bottom: 0; }
.doc img { max-width: 100%; height: auto; border-radius: 14px; }
.doc pre { position: relative; margin: 1.1rem 0 1.3rem; padding: 1rem 1.1rem; font-size: .82rem; line-height: 1.6; }
.doc pre code { font-family: var(--mono); background: none; border: 0; padding: 0; color: var(--code-ink); white-space: pre; }
.doc :not(pre) > code { font-size: .86em; }
.doc .copy-code {
  position: absolute; top: .55rem; right: .55rem; opacity: 0; font: 600 .7rem var(--mono); cursor: pointer;
  padding: .25rem .55rem; border-radius: 8px; color: var(--code-ink); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
  transition: opacity .2s, background .2s;
}
.doc pre:hover .copy-code, .doc .copy-code:focus-visible { opacity: 1; }
.doc .copy-code:hover { background: var(--accent); color: var(--accent-ink); }

.doc .table-scroll { overflow-x: auto; margin: 1.2rem 0 1.4rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .03); }
.doc table { width: 100%; border-collapse: collapse; font-size: .88rem; line-height: 1.5; }
.doc th, .doc td { text-align: left; padding: .6rem .85rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; font-family: inherit; font-size: inherit; white-space: normal; }
.doc td:nth-child(n), .doc td:first-child { font-family: inherit; white-space: normal; font-size: inherit; }
.doc th { position: static; background: rgba(255, 255, 255, .06); font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-dim); white-space: nowrap; }
html[data-theme="light"] .doc th { background: rgba(20, 28, 70, .06); }
.doc tr:last-child td { border-bottom: 0; }
.doc td code { white-space: pre-wrap; overflow-wrap: anywhere; }

.doc-lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 42rem; }
.doc-cards { margin-top: 1.6rem; }
.doc-cards .card { text-decoration: none; }

.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.6rem; }
.docs-pager a {
  display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.2rem; border-radius: 18px; text-decoration: none; color: var(--ink); font-weight: 600;
  border: 1px solid var(--line); background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 var(--glass-hi); transition: transform .25s, border-color .25s;
}
.docs-pager a:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.docs-pager a span { font: 500 .7rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }
.docs-pager .next { text-align: right; grid-column: 2; }
.docs-pager .prev { grid-column: 1; }
.docs-edit { text-align: center; margin: 1.6rem 0 0; font-size: .82rem; }
.docs-edit a { color: var(--ink-dim); }

@media (max-width: 960px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; padding-top: 1.4rem; }
  .docs-side { position: static; max-height: none; flex-direction: column; }
  .docs-nav { flex-direction: row; flex-wrap: wrap; gap: .4rem; }
  .docs-nav .docs-nav-label { width: 100%; }
  .docs-nav a { border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; background: var(--glass); }
  .docs-nav a[aria-current="page"] { border-color: var(--accent); }
  .docs-toc { display: none; }
  .doc .headerlink { display: none; }
}
@media (max-width: 640px) {
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager .next, .docs-pager .prev { grid-column: 1; text-align: left; }
  .doc { border-radius: 18px; }
}
