:root {
  color-scheme: light;
  --paper: #f7f8f4;
  --surface: #ffffff;
  --surface-muted: #f0f2ed;
  --ink: #111814;
  --muted: #667068;
  --line: #dce1da;
  --line-strong: #c9d0c8;
  --green: #08785a;
  --green-bright: #86c238;
  --green-soft: #edf5e9;
  --code: #111814;
  --code-ink: #eef8f0;
  --header-height: 64px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d110f;
  --surface: #121815;
  --surface-muted: #19201c;
  --ink: #edf2ed;
  --muted: #a0aaa2;
  --line: #29322d;
  --line-strong: #3a463f;
  --green: #6fca9a;
  --green-bright: #a6dc55;
  --green-soft: #18281f;
  --code: #080b09;
  --code-ink: #eaf5ec;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
}
a {
  color: inherit;
}
button,
input {
  font: inherit;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  transform: translateY(-150%);
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 7px;
}
.skip-link:focus {
  transform: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
}
.site-header__inner {
  max-width: 1500px;
  height: 100%;
  margin: auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 34px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 850;
  position: relative;
}
.brand__mark::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  right: 3px;
  top: 3px;
  background: var(--green-bright);
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}
.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.top-nav a:hover {
  color: var(--ink);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.icon-button,
.language-link {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  cursor: pointer;
}
.icon-button:hover,
.language-link:hover {
  border-color: var(--green);
  color: var(--green);
}
.menu-trigger {
  display: none;
}

.home {
  min-height: 80vh;
}
.home-hero {
  min-height: 250px;
  padding: 72px 24px 48px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(var(--green-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--green-soft) 1px, transparent 1px);
  background-size: 36px 36px;
}
.home-hero > p {
  margin: 0 0 18px;
  color: var(--green);
  font: 700 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .18em;
}
.home-hero h1 {
  max-width: 850px;
  margin: 0 auto;
  font-size: clamp(38px, 5.6vw, 72px);
  line-height: 1.01;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.home-hero > div {
  max-width: 730px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  text-wrap: balance;
}
.route-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-inline: 1px solid var(--line);
}
.route-card {
  min-height: 330px;
  padding: 38px 42px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  transition: background .16s ease;
}
.route-card:nth-child(odd) {
  border-right: 1px solid var(--line);
}
.route-card:hover {
  background: var(--green-soft);
}
.route-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--green);
  font: 750 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .17em;
}
.route-card__top b {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--ink);
  letter-spacing: 0;
  font-size: 12px;
}
.route-card h2 {
  margin: 42px 0 12px;
  font-size: 27px;
  letter-spacing: -.035em;
}
.route-card p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}
.route-card__link {
  margin-top: auto;
  padding-top: 34px;
  color: var(--green);
  font-weight: 750;
  font-size: 14px;
}
.install-strip {
  border-block: 1px solid var(--line);
  background: var(--surface-muted);
  padding: 42px max(24px, calc((100vw - 1070px) / 2));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 50px;
  align-items: center;
}
.install-strip > div {
  overflow: hidden;
  border: 1px solid #28332d;
  border-radius: 12px;
  background: var(--code);
  color: var(--code-ink);
}
.install-strip small {
  display: block;
  padding: 10px 16px;
  border-bottom: 1px solid #28332d;
  color: #859289;
  font: 700 10px/1 ui-monospace, monospace;
  letter-spacing: .15em;
}
.install-strip code {
  display: block;
  padding: 7px 18px;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.install-strip code:first-of-type {
  padding-top: 16px;
}
.install-strip code:last-of-type {
  padding-bottom: 16px;
}
.install-strip code span,
.install-strip code em {
  color: #7dd99e;
  font-style: normal;
}
.install-strip ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
}
.install-strip li::first-letter {
  color: var(--green);
}
.stack-map {
  max-width: 1120px;
  margin: auto;
  padding: 72px 0 92px;
}
.stack-map header {
  padding: 0 24px 28px;
}
.stack-map h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -.04em;
}
.stack-map p {
  max-width: 650px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}
.stack-map > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
}
.stack-map a {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-decoration: none;
  background: var(--surface);
}
.stack-map a:hover {
  background: var(--green-soft);
}
.stack-map code {
  color: var(--muted);
  font-size: 12px;
}

.docs-layout {
  max-width: 1500px;
  min-height: calc(100vh - var(--header-height));
  margin: auto;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 230px;
}
.sidebar {
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 18px 16px 40px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}
.sidebar__search {
  margin-bottom: 22px;
}
.sidebar__search button {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
}
.sidebar__search kbd {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-muted);
  font-size: 10px;
}
.sidebar-section {
  margin: 0 0 26px;
}
.sidebar-section h2 {
  margin: 0 8px 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
}
.sidebar-section ul {
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
  list-style: none;
}
.sidebar-section a {
  display: block;
  padding: 7px 11px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
}
.sidebar-section a:hover {
  color: var(--ink);
}
.sidebar-section a[aria-current="page"] {
  border-left-color: var(--green);
  border-radius: 0 7px 7px 0;
  color: var(--green);
  background: color-mix(in srgb, var(--green-soft) 80%, var(--surface));
}
.doc-main {
  min-width: 0;
  padding: 0 46px 80px;
  background: var(--surface);
}
.doc-article {
  max-width: 820px;
  margin: auto;
}
.doc-breadcrumbs {
  padding: 34px 0 20px;
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.doc-breadcrumbs a {
  text-decoration: none;
}
.doc-header {
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}
.doc-header h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.doc-header > p {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}
.doc-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}
.doc-actions a {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
}
.doc-actions a:hover {
  border-color: var(--green);
  color: var(--green);
}
.markdown-body {
  padding-top: 28px;
  font-size: 16px;
  line-height: 1.8;
}
.markdown-body h2 {
  margin: 56px 0 16px;
  padding-top: 4px;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -.035em;
}
.markdown-body h3 {
  margin: 36px 0 12px;
  font-size: 21px;
  line-height: 1.35;
}
.markdown-body p {
  margin: 15px 0;
}
.markdown-body a {
  color: var(--green);
  text-underline-offset: 3px;
}
.markdown-body ul,
.markdown-body ol {
  padding-left: 24px;
}
.markdown-body li {
  margin: 5px 0;
}
.markdown-body :not(pre) > code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--ink);
  font: .86em/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.markdown-body pre {
  position: relative;
  overflow: auto;
  margin: 20px 0;
  padding: 20px 52px 20px 20px;
  border: 1px solid #28332d;
  border-radius: 12px;
  background: var(--code);
  color: var(--code-ink);
  font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  tab-size: 2;
}
.markdown-body pre code {
  font: inherit;
}
.copy-code {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 7px;
  border: 1px solid #39483f;
  border-radius: 6px;
  color: #a9b7ad;
  background: #1d2621;
  cursor: pointer;
  font-size: 10px;
}
.table-scroll {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.markdown-body th,
.markdown-body td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.markdown-body th {
  background: var(--surface-muted);
  white-space: nowrap;
}
.markdown-body tr:last-child td {
  border-bottom: 0;
}
.markdown-body blockquote {
  margin: 24px 0;
  padding: 2px 18px;
  border-left: 3px solid var(--green);
  color: var(--muted);
}
.callout {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--green);
  border-radius: 10px;
  background: var(--green-soft);
}
.callout--warn {
  border-left-color: #c98516;
  background: color-mix(in srgb, #c98516 8%, var(--surface));
}
.callout__title {
  font-weight: 780;
}
.callout__content > :first-child {
  margin-top: 8px;
}
.callout__content > :last-child {
  margin-bottom: 0;
}
.doc-cards {
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.doc-card {
  position: relative;
  min-height: 126px;
  padding: 20px 45px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink) !important;
  text-decoration: none;
  background: var(--surface);
}
.doc-card:hover {
  border-color: var(--green);
  background: var(--green-soft);
}
.doc-card__title {
  font-weight: 760;
}
.doc-card__description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.doc-card__arrow {
  position: absolute;
  right: 18px;
  top: 18px;
  color: var(--green);
}
.install-tabs {
  margin: 24px 0;
  display: grid;
  gap: 10px;
}
.install-tab {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.install-tab__label {
  margin: 0 !important;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  font-size: 13px !important;
}
.install-tab pre {
  margin: 0;
  border: 0;
  border-radius: 0;
}
.checklist {
  margin: 24px 0;
  padding: 0 !important;
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  list-style: none;
  background: var(--line);
}
.checklist li {
  margin: 0;
  padding: 12px 15px;
  display: flex;
  gap: 10px;
  background: var(--surface);
}
.checklist li span {
  color: var(--green);
  font-weight: 800;
}
.toc {
  height: fit-content;
  max-height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 40px 20px;
  border-left: 1px solid var(--line);
}
.toc h2 {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.toc a {
  display: block;
  padding: 6px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.45;
}
.toc a:hover {
  color: var(--green);
}
.toc__nested {
  padding-left: 12px !important;
}
.doc-footer {
  margin-top: 76px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.pagination {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pagination a {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
}
.pagination a:last-child {
  text-align: right;
}
.pagination a:hover {
  border-color: var(--green);
}
.pagination small {
  color: var(--muted);
}
.site-footer {
  min-height: 90px;
  padding: 25px max(24px, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
  font-size: 12px;
}
.site-footer a {
  text-underline-offset: 3px;
}
.search-dialog {
  width: min(680px, calc(100vw - 30px));
  max-height: min(680px, calc(100vh - 50px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 90px #0004;
}
.search-dialog::backdrop {
  background: #0b120d99;
  backdrop-filter: blur(3px);
}
.search-dialog__bar {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.search-dialog__bar input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}
.search-dialog__bar button {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-muted);
  cursor: pointer;
  font-size: 11px;
}
.search-results {
  max-height: 560px;
  overflow-y: auto;
  padding: 10px;
}
.search-results > p {
  padding: 14px;
  color: var(--muted);
}
.search-results a {
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 8px;
  text-decoration: none;
}
.search-results a:hover {
  background: var(--green-soft);
}
.search-results span {
  color: var(--muted);
  font-size: 13px;
}
.not-found {
  min-height: 70vh;
  padding: 120px 24px;
  text-align: center;
}
.not-found > p {
  color: var(--green);
  font: 800 13px ui-monospace, monospace;
  letter-spacing: .2em;
}
.not-found h1 {
  font-size: clamp(36px, 6vw, 70px);
  letter-spacing: -.05em;
}
.not-found a {
  color: var(--green);
  font-weight: 750;
}

@media (max-width: 1100px) {
  .docs-layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
  .stack-map {
    padding-inline: 24px;
  }
}

@media (max-width: 800px) {
  :root {
    --header-height: 56px;
  }
  .site-header__inner {
    padding: 0 16px;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .top-nav {
    position: fixed;
    inset: var(--header-height) 0 auto;
    padding: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .top-nav a {
    padding: 12px;
  }
  .menu-open .top-nav {
    display: flex;
  }
  .menu-trigger {
    display: grid;
  }
  .language-link,
  .theme-trigger {
    display: none;
  }
  .home-hero {
    padding: 62px 24px 42px;
  }
  .home-hero h1 {
    font-size: 42px;
  }
  .route-grid {
    grid-template-columns: 1fr;
    border-inline: 0;
  }
  .route-card {
    min-height: 310px;
    padding: 32px 28px;
    border-right: 0 !important;
  }
  .install-strip {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .stack-map > div {
    grid-template-columns: 1fr 1fr;
  }
  .docs-layout {
    display: block;
  }
  .sidebar {
    position: fixed;
    z-index: 40;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    width: min(310px, 88vw);
    height: auto;
    transform: translateX(-105%);
    box-shadow: 20px 0 60px #0003;
    transition: transform .18s ease;
  }
  .menu-open .sidebar {
    transform: translateX(0);
  }
  .doc-main {
    padding: 0 24px 60px;
  }
  .doc-breadcrumbs {
    padding-top: 24px;
  }
  .doc-header h1 {
    font-size: 36px;
  }
  .doc-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .brand {
    font-size: 15px;
  }
  .home-hero h1 {
    font-size: 36px;
  }
  .home-hero > div {
    font-size: 16px;
  }
  .route-card h2 {
    font-size: 25px;
  }
  .stack-map > div {
    grid-template-columns: 1fr;
  }
  .install-strip {
    padding-inline: 18px;
  }
  .install-strip code {
    font-size: 11px;
    overflow-x: auto;
  }
  .doc-main {
    padding-inline: 18px;
  }
  .doc-header h1 {
    font-size: 32px;
  }
  .doc-header > p {
    font-size: 16px;
  }
  .pagination {
    grid-template-columns: 1fr;
  }
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Friend links page */
.links-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}
.links-hero {
  margin-bottom: 40px;
}
.links-hero > p {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 8px;
}
.links-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 40px);
}
.links-hero > div {
  color: var(--muted);
  max-width: 640px;
}
.links-hero a {
  color: var(--green);
}
.friend-group {
  margin-bottom: 48px;
}
.friend-group h2 {
  font-size: 20px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.friend-group h2 small {
  color: var(--muted);
  font-weight: 400;
  margin-left: 8px;
}
.friend-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.friend-link > a {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  height: 100%;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.friend-link > a:hover {
  border-color: var(--green);
}
.friend-link--degraded > a {
  opacity: 0.72;
}
.friend-link__logo {
  flex: none;
  border-radius: 8px;
  background: var(--surface-muted);
}
.friend-link__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.friend-link__name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.friend-link__dr,
.friend-link__status {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  white-space: nowrap;
}
.friend-link__status {
  background: var(--surface-muted);
  color: var(--muted);
}
.friend-link__meta {
  font-size: 12px;
  color: var(--muted);
}
.friend-link__desc {
  font-size: 13px;
  line-height: 1.55;
}
