/* WorldPlane docs: the site's tokens and nav (site.css), with a sidebar, prose, code and API reference blocks. */
.docs-page {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(91, 140, 255, 0.1), transparent 65%),
    radial-gradient(700px 500px at -10% 10%, rgba(154, 123, 255, 0.07), transparent 60%),
    var(--bg);
}
.nav-docs-current {
  border-color: rgba(190, 205, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
}
.docs {
  padding: 68px 0 0;
}
.docs-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  max-width: calc(1240px + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Sidebar */
.docs-side {
  position: sticky;
  top: 68px;
  align-self: start;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
  padding: 36px 4px 40px 0;
  scrollbar-width: thin;
}
.docs-side-title {
  margin: 0 0 10px;
  color: var(--ink-3);
  font: 600 12px/1 var(--body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.docs-side ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.docs-side > ul > li + li {
  margin-top: 2px;
}
.docs-side a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.35;
  text-decoration: none;
}
.docs-side a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}
.docs-side a[aria-current='page'] {
  color: var(--ink);
  font-weight: 600;
  background: rgba(127, 176, 255, 0.1);
}
.docs-side .docs-sub {
  margin: 4px 0 8px 10px;
  padding-left: 10px;
  border-left: 1px solid var(--line-2);
}
.docs-side .docs-sub a {
  padding: 4px 8px;
  font-size: 13.5px;
  color: var(--ink-3);
}
.docs-side .docs-sub a:hover,
.docs-side .docs-sub a.active {
  color: var(--ink);
}
.docs-side-extra {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.docs-menu-toggle {
  display: none;
}

/* Content */
.doc {
  min-width: 0;
  max-width: 860px;
  padding: 40px 0 96px;
}
.doc > h1 {
  margin-top: 14px;
  font-size: clamp(34px, 4.6vw, 50px);
  letter-spacing: -0.04em;
}
.doc .doc-lede {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.6;
}
.doc h2 {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: clamp(24px, 2.6vw, 30px);
  letter-spacing: -0.03em;
}
.doc h3 {
  margin-top: 40px;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.doc h4 {
  margin: 28px 0 0;
  font: 600 15px/1.3 var(--body);
  color: var(--ink);
}
.doc h2,
.doc h3,
.doc h4 {
  position: relative;
  scroll-margin-top: 84px;
}
.doc .anchor {
  margin-left: 0.35em;
  color: var(--ink-3);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.doc h2:hover .anchor,
.doc h3:hover .anchor,
.doc h4:hover .anchor,
.doc .anchor:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .doc .anchor {
    opacity: 0.5;
  }
}
.doc p,
.doc li,
.doc dd {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.7;
}
.doc p {
  margin-top: 14px;
}
.doc ul,
.doc ol {
  margin: 12px 0 0;
  padding-left: 22px;
}
.doc li + li {
  margin-top: 6px;
}
.doc li > ul,
.doc li > ol {
  margin-top: 6px;
}
.doc a {
  color: #a9c1ff;
  text-underline-offset: 2px;
}
.doc strong,
.doc b {
  color: var(--ink);
}
.doc :not(pre) > code {
  white-space: normal;
  overflow-wrap: anywhere;
  color: #dbe4ff;
}
.doc hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Callouts */
.callout {
  margin-top: 20px;
  padding: 14px 18px;
  border: 1px solid var(--line-2);
  border-left: 3px solid #7fb0ff;
  border-radius: 12px;
  background: rgba(91, 140, 255, 0.06);
}
.callout p:first-child {
  margin-top: 0;
}
.callout-warn {
  border-left-color: var(--s4);
  background: rgba(255, 190, 85, 0.06);
}

/* Steps */
.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0 !important;
}
.steps > li {
  position: relative;
  padding-left: 44px;
  counter-increment: step;
}
.steps > li + li {
  margin-top: 18px;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(127, 176, 255, 0.1);
  color: var(--ink);
  font: 600 13px/1 var(--body);
}

/* Cards (overview links) */
.doc-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.doc-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  color: inherit !important;
  text-decoration: none;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.doc-card:hover {
  border-color: rgba(190, 205, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
}
.doc-card strong {
  display: block;
  font: 600 16px/1.3 var(--display);
}
.doc-card span {
  display: block;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.5;
}

/* Tables */
.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.doc th,
.doc td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  line-height: 1.55;
}
.doc th {
  color: var(--ink);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.doc tr:last-child td {
  border-bottom: 0;
}
.doc td:first-child {
  min-width: 120px;
}

/* Code */
.code {
  position: relative;
  margin-top: 16px;
}
.doc pre {
  margin: 16px 0 0;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #090c15;
  font: 400 13.5px/1.6 var(--mono);
  color: #dfe6f5;
  tab-size: 2;
}
.code > pre {
  margin-top: 0;
  padding-right: 76px;
}
.doc pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  white-space: pre;
  color: inherit;
}
.doc pre .c {
  color: var(--ink-3);
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(20, 26, 40, 0.9);
  color: var(--ink-2);
  font: 500 12.5px/1 var(--body);
  cursor: pointer;
}
.copy-btn:hover {
  color: var(--ink);
  border-color: rgba(190, 205, 255, 0.4);
}
.copy-btn.copied {
  color: var(--good);
}

/* API reference */
.ep {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 14px;
}
.ep code {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink) !important;
}
.verb {
  display: inline-block;
  min-width: 58px;
  padding: 3px 8px;
  border-radius: 6px;
  font: 600 12px/1.4 var(--mono);
  text-align: center;
  letter-spacing: 0.04em;
}
.verb-get {
  background: rgba(47, 214, 168, 0.14);
  color: #6ff0c8;
}
.verb-post {
  background: rgba(91, 140, 255, 0.16);
  color: #9ab8ff;
}
.verb-put {
  background: rgba(255, 190, 85, 0.14);
  color: #ffd38a;
}
.verb-patch {
  background: rgba(154, 123, 255, 0.16);
  color: #c4b2ff;
}
.verb-delete {
  background: rgba(255, 95, 168, 0.14);
  color: #ff9cc9;
}
.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 16px;
  margin: 14px 0 0;
}
.facts dt {
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.7;
}
.facts dd {
  margin: 0;
  font-size: 15px !important;
}
.status-list {
  list-style: none;
  padding-left: 0 !important;
}
.status-list li {
  font-size: 15px !important;
}
.status-list code:first-child {
  display: inline-block;
  min-width: 40px;
  text-align: center;
}
.api-index {
  columns: 2;
  column-gap: 32px;
  list-style: none;
  padding-left: 0 !important;
}
.api-index li {
  break-inside: avoid;
  font-size: 14px !important;
}
.api-index .verb {
  min-width: 52px;
  margin-right: 6px;
  font-size: 11px;
}
.req {
  color: var(--s4);
  font-size: 12px;
  font-weight: 600;
}
.opt {
  color: var(--ink-3);
  font-size: 12px;
}

/* Footer on docs pages sits under the grid. */
.docs + .footer {
  margin-top: 0;
}

/* Tablet and phone: the sidebar folds behind a button. */
@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .docs-side {
    position: static;
    max-height: none;
    padding: 20px 0 0;
  }
  .docs-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    font: 500 14px/1 var(--body);
    cursor: pointer;
  }
  .docs-menu-toggle::after {
    content: '';
    width: 7px;
    height: 7px;
    margin-left: 2px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s;
  }
  .docs-menu-toggle[aria-expanded='true']::after {
    transform: translateY(2px) rotate(-135deg);
  }
  .js .docs-side-nav {
    display: none;
  }
  .js .docs-side.open .docs-side-nav {
    display: block;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
  }
  .doc {
    padding-top: 20px;
  }
}
@media (max-width: 620px) {
  .doc-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .api-index {
    columns: 1;
  }
  .facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .facts dd + dt {
    margin-top: 8px;
  }
  .doc pre {
    font-size: 12.5px;
    padding: 14px;
  }
  .code > pre {
    padding-top: 44px;
    padding-right: 14px;
  }
}
