/* ==========================================================================
   Documentation page
   Same tokens and canvas as the landing page, laid out as a reading view:
   a sticky table of contents on the left, one long column on the right.
   ========================================================================== */

.docs-body {
  background: var(--white);
}

/* Header ------------------------------------------------------------------- */

.docs-head {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4rem;
  padding-inline: var(--gutter);
  border-bottom: 1px solid var(--ink-100);
  background: color-mix(in srgb, var(--white) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.docs-head__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.docs-head__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 600;
}

.docs-head__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.docs-head__nav a {
  display: none;
  padding: 0.45rem 0.75rem;
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: var(--small);
  transition: color var(--fast) var(--ease-out), background-color var(--fast) var(--ease-out);
}

.docs-head__nav a:hover {
  color: var(--text-1);
  background: var(--ink-050);
}

@media (min-width: 640px) {
  .docs-head__nav a { display: inline-flex; }
}

.docs-head__cta {
  display: inline-flex !important;
  background: var(--black) !important;
  color: var(--white) !important;
  font-weight: 500;
}

.docs-head__cta:hover {
  background: var(--ink-700) !important;
  color: var(--white) !important;
}

/* Shell -------------------------------------------------------------------- */

.docs-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: 2.5rem var(--gutter) 4rem;
}

@media (min-width: 960px) {
  .docs-shell {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 3.5rem;
    padding-top: 3.5rem;
  }
}

/* Sidebar ------------------------------------------------------------------ */

.docs-side {
  position: relative;
  align-self: start;
  padding: 1.25rem;
  border-radius: 40px 12px;
  background: var(--ink-100);
}

@media (min-width: 960px) {
  .docs-side {
    position: sticky;
    top: 5.5rem;
    max-height: calc(100vh - 7.5rem);
    overflow-y: auto;
  }
}

.docs-side__label {
  cursor: pointer;
  list-style: none;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--tiny);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-3);
}

.docs-side__label::-webkit-details-marker {
  display: none;
}

/* A caret while it behaves as a disclosure, gone once it is a sidebar. */
.docs-side__label::after {
  content: "";
  float: right;
  width: 6px;
  height: 6px;
  margin-top: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--fast) var(--ease-out);
}

.docs-side[open] > .docs-side__label::after {
  transform: rotate(-135deg);
  margin-top: 5px;
}

@media (min-width: 960px) {
  .docs-side__label {
    cursor: default;
  }

  .docs-side__label::after {
    display: none;
  }
}

.docs-side__list {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
}

.docs-side__list a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  color: var(--text-2);
  font-size: var(--small);
  line-height: 1.35;
  transition: color var(--fast) var(--ease-out), background-color var(--fast) var(--ease-out);
}

.docs-side__list a:hover {
  color: var(--text-1);
  background: var(--white);
}

.docs-side__list a.is-current {
  color: var(--text-1);
  background: var(--white);
  font-weight: 500;
}

/* Reading column ----------------------------------------------------------- */

.docs-main {
  min-width: 0;
  max-width: 46rem;
}

.docs-intro {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--ink-100);
}

.docs-intro .display-2 {
  margin-top: 0.75rem;
}

.docs-intro .lede {
  margin-top: 1rem;
}

.doc {
  padding-top: 3.5rem;
  scroll-margin-top: 5.5rem;
}

.doc__title {
  font-family: var(--font-display);
  font-size: var(--h2);
  font-weight: 300;
  letter-spacing: var(--track-h2);
  line-height: var(--leading-display);
  margin-bottom: 1.25rem;
}

.doc h2,
.doc h3,
.doc h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--text-1);
}

/* Inside a document these are sub headings, not the document title. */
.doc h2:not(.doc__title) {
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.doc h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-size: 1.0625rem;
}

.doc h4 {
  margin-top: 1.25rem;
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
}

.doc p {
  margin-top: 0.875rem;
  color: var(--text-2);
  font-size: var(--body);
  line-height: 1.62;
}

.doc strong {
  color: var(--text-1);
  font-weight: 500;
}

.doc a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent-strong) 35%, transparent);
}

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

.doc code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--ink-100);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.doc-list {
  margin-top: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.4375rem;
}

.doc-list li {
  position: relative;
  padding-left: 1.125rem;
  color: var(--text-2);
  font-size: var(--body);
  line-height: 1.55;
}

.doc-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6875rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-300);
}

.doc-list--num {
  counter-reset: item;
}

.doc-list--num li {
  padding-left: 1.75rem;
  counter-increment: item;
}

.doc-list--num li::before {
  content: counter(item) ".";
  top: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-400);
}

/* Code and the data model tree --------------------------------------------- */

.doc-pre {
  margin: 1.25rem 0 0;
  padding: 1.25rem;
  overflow-x: auto;
  border-radius: 20px 8px;
  background: var(--ink-600);
  color: #e7ebef;
}

.doc-pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre;
}

/* Tables ------------------------------------------------------------------- */

.doc-table {
  margin-top: 1.25rem;
  overflow-x: auto;
  border-radius: 20px 8px;
  background: var(--ink-100);
}

.doc-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--small);
}

.doc-table th,
.doc-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
}

.doc-table th {
  font-family: var(--font-mono);
  font-size: var(--tiny);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-3);
}

.doc-table tbody tr {
  border-top: 1px solid color-mix(in srgb, var(--ink-300) 45%, transparent);
}

.doc-table td {
  color: var(--text-2);
  line-height: 1.5;
}

.doc-table td:first-child {
  color: var(--text-1);
}

/* Pipeline flow ------------------------------------------------------------ */

.doc-flow {
  margin-top: 1.25rem;
  padding: 1.5rem;
  border-radius: 40px 12px;
  background: var(--ink-100);
}

.doc-flow__list {
  counter-reset: flow;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.doc-flow__step {
  position: relative;
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--text-1);
  font-size: var(--small);
  counter-increment: flow;
}

.doc-flow__step::before {
  content: counter(flow);
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.625rem;
}

.doc-flow__note {
  margin-top: 1rem !important;
  font-family: var(--font-mono);
  font-size: var(--tiny) !important;
  letter-spacing: 0.02em;
  color: var(--text-3) !important;
}

/* Footer ------------------------------------------------------------------- */

.docs-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: var(--container);
  margin-inline: auto;
  padding: 1.75rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--ink-100);
  color: var(--text-3);
  font-size: var(--small);
}

.docs-foot a:hover {
  color: var(--text-1);
}
