/* The docs pages and the facts page, on site.css's tokens in both palettes. */

/* ----------------------------------------------------------------- layout - */

.docs {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 64px;
  padding-top: 56px;
  padding-bottom: 120px;
}

.doc {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  max-width: 74ch;
}

.docs-nav {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  font-size: 14px;
}

.docs-nav-group + .docs-nav-group {
  margin-top: 22px;
}

.docs-nav-head {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}

.docs-nav li + li {
  margin-top: 2px;
}

.docs-nav a {
  display: block;
  padding: 5px 10px;
  border-left: 2px solid var(--line-2);
  color: var(--dim);
}

.docs-nav a:hover {
  color: var(--text);
  border-left-color: var(--fil-line);
}

.docs-nav a[aria-current='page'] {
  color: var(--text);
  border-left-color: var(--fil);
  background: var(--fil-wash);
}

/* ------------------------------------------------------------------- head - */

.doc-head {
  margin-bottom: 36px;
}

.doc-crumb {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-crumb span {
  color: var(--faint);
}

.doc h1,
.facts h1 {
  font-size: clamp(40px, 6.4vw, 68px);
  line-height: 1;
  margin-top: 14px;
}

.doc-head .dated,
.facts .section-head .dated {
  margin-top: 14px;
}

.doc-alt {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 14px;
  color: var(--mute);
}

.doc-jump {
  display: none;
}

/* ------------------------------------------------------------------- body - */

.doc-body {
  max-width: none;
  font-size: 16px;
  color: var(--dim);
}

.doc-body > * + * {
  margin-top: 16px;
}

.doc-body h2 {
  font-size: clamp(28px, 3.6vw, 38px);
  line-height: 1.1;
  color: var(--text);
  margin-top: 52px;
}

.doc-body h3 {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-top: 32px;
}

.doc-body h2 + *,
.doc-body h3 + * {
  margin-top: 12px;
}

.doc-body ul,
.doc-body ol {
  padding-left: 1.4em;
}

.doc-body ul {
  list-style: disc;
}

.doc-body ol {
  list-style: decimal;
}

.doc-body li + li {
  margin-top: 8px;
}

.doc-body li::marker {
  color: var(--faint);
}

.doc-body a {
  text-decoration: underline;
  text-decoration-color: var(--fil-line);
  text-underline-offset: 3px;
}

.doc-body a:hover {
  text-decoration-color: currentColor;
}

.doc-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--track);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.doc-body pre {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r-panel);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}

.doc-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  overflow-wrap: normal;
}

.doc-body blockquote {
  border-left: 2px solid var(--fil-line);
  padding-left: 16px;
  color: var(--mute);
}

.doc-body hr {
  border: 0;
  border-top: 1px solid var(--line-2);
  margin: 40px 0;
}

.doc-body .doc-table {
  margin-top: 20px;
}

.doc-body .tbl td {
  font-size: 14px;
}

.doc-body .tbl td:first-child {
  font-family: var(--font-ui);
  font-size: 14px;
  min-width: 12ch;
}

/* ------------------------------------------------------------ copy boxes - */

.doc-box {
  position: relative;
  border: 1px solid var(--line-3);
  border-radius: var(--r-card);
  background: var(--panel);
  overflow: hidden;
}

.doc-prompt {
  border-color: var(--fil-line);
  background: linear-gradient(var(--fil-wash), var(--fil-wash)), var(--panel);
}

.doc-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 0 16px;
}

.doc-box-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fil);
}

.doc-body .doc-box-text {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 15px;
}

.doc-copybox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.doc-copybox .doc-box-text {
  flex: 1;
  min-width: 0;
}

.doc-copybox .doc-copy {
  margin: 10px 12px 10px 0;
}

.doc-copy {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fil-ink);
  background: var(--fil);
  border: 0;
  border-radius: var(--r-ctrl);
  padding: 7px 14px;
  cursor: pointer;
  transition: background var(--t);
}

.doc-copy:hover {
  background: var(--fil-lit);
}

.doc-copy[hidden] {
  display: none;
}

.doc-copy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.doc-copy-scratch {
  position: fixed;
  top: 0;
  left: -9999px;
  opacity: 0;
}

/* ------------------------------------------------------------------ pager - */

.doc-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 64px;
}

.doc-pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-panel);
  background: var(--panel);
  color: var(--text);
}

.doc-pager a:hover {
  border-color: var(--fil-line);
}

.doc-pager-next {
  grid-column: 2;
  text-align: right;
}

.doc-pager-dir {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ------------------------------------------------------------------- foot - */

.doc-foot {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--dim);
}

.doc-foot p + p {
  margin-top: 8px;
}

.doc-ai {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--faint);
}

/* ------------------------------------------------------------------ facts - */

.facts .doc-body {
  max-width: 80ch;
}

/* ----------------------------------------------------------------- mobile - */

@media (max-width: 920px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    padding-top: 36px;
    padding-bottom: 80px;
  }

  .doc {
    grid-column: 1;
  }

  .docs-nav {
    grid-column: 1;
    grid-row: 2;
    position: static;
    max-height: none;
    overflow: visible;
    padding-top: 28px;
    border-top: 1px solid var(--line);
  }

  .doc-jump {
    display: inline;
  }
}

@media (max-width: 620px) {
  .doc-pager {
    grid-template-columns: 1fr;
  }

  .doc-pager-next {
    grid-column: 1;
  }

  .doc-body pre {
    font-size: 13px;
  }
}
