/* One stylesheet, no script: the pages must read well with everything else switched off. */
:root {
  --ink: #16202b;
  --soft: #52606d;
  --line: #d9e0e7;
  --surface: #f5f7fa;
  --accent: #2f5bea;
  --accent-ink: #ffffff;
  --notice: #fff4d6;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font:
    1rem / 1.6 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
}

a {
  color: var(--accent);
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
}

.site-header,
.site-footer,
main {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.25rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--ink);
  text-decoration: none;
}

.site-header nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.site-header nav a:not(.button) {
  color: var(--ink);
  text-decoration: none;
}

.site-header nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.button {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

main {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

main.prose {
  max-width: 50rem;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.4rem;
  margin: 2.5rem 0 0.75rem;
}

h3 {
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.lead {
  font-size: 1.2rem;
  color: var(--soft);
  max-width: 44rem;
}

.hint,
.updated {
  color: var(--soft);
  font-size: 0.9rem;
}

.hero {
  padding: 2rem 0 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cards {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}

.cards li,
.plan {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.25rem;
  background: var(--surface);
}

.cards p {
  margin: 0;
  color: var(--soft);
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
  align-items: start;
}

.plan h2 {
  margin-top: 0;
}

.price {
  font-size: 1.35rem;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

caption {
  text-align: left;
  color: var(--soft);
  padding-bottom: 0.35rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.6rem;
  border-top: 1px solid var(--line);
}

.plan td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.notice {
  background: var(--notice);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.contacts dt {
  font-weight: 600;
  margin-top: 1rem;
}

.contacts dd {
  margin: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.9rem;
}

/* Documentation: the navigation beside the article, code and wide tables that never break the page. */
main.docs {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.docs-nav {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  font-size: 0.92rem;
}

.docs-nav ul,
.toc ul {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.docs-nav li,
.toc li {
  margin: 0.2rem 0;
}

.docs-nav a {
  color: var(--ink);
  text-decoration: none;
}

nav.docs-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

.docs-nav-title {
  margin: 1rem 0 0.35rem;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--soft);
}

.doc {
  max-width: 52rem;
  min-width: 0;
}

.doc h2 {
  scroll-margin-top: 1rem;
}

.doc h3,
.doc h4 {
  margin-top: 1.75rem;
  scroll-margin-top: 1rem;
}

.toc {
  border-left: 3px solid var(--line);
  padding-left: 1rem;
  margin: 0 0 2rem;
  font-size: 0.92rem;
}

.toc .docs-nav-title {
  margin-top: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface);
  border-radius: 0.25rem;
  padding: 0.1em 0.3em;
  overflow-wrap: anywhere;
}

pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  line-height: 1.45;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  overflow-wrap: normal;
}

blockquote {
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

.table-wrap table {
  margin: 0;
}

td > p:first-child {
  margin-top: 0;
}

td > p:last-child {
  margin-bottom: 0;
}

.operation {
  border-top: 1px solid var(--line);
  padding-top: 0.25rem;
}

.method {
  display: inline-block;
  min-width: 4.2rem;
  padding: 0.1rem 0.45rem;
  border-radius: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
  vertical-align: 0.1em;
}

.method-get {
  background: #1f7a4d;
}

.method-post {
  background: #2f5bea;
}

.method-put,
.method-patch {
  background: #9a5b00;
}

.method-delete {
  background: #b42318;
}

@media (max-width: 40rem) {
  /* The pricing tables stack; the documentation's wide tables scroll in their .table-wrap instead. */
  .plan table,
  .plan thead,
  .plan tbody,
  .plan tr,
  .plan th,
  .plan td {
    display: block;
  }

  .plan thead {
    position: absolute;
    left: -999px;
  }

  .plan tr {
    border-top: 1px solid var(--line);
    padding: 0.5rem 0;
  }

  .plan th,
  .plan td {
    border: 0;
    padding: 0.15rem 0;
    text-align: left;
  }

  main.docs {
    grid-template-columns: 1fr;
  }

  .docs-nav {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--line);
  }
}
