:root {
  color-scheme: dark;
  --paper: #090b07;
  --bg: var(--paper);
  --surface: #12150f;
  --surface-raised: #171b13;
  --ink: #edf2df;
  --muted: #9ba48b;
  --quiet: #626b55;
  --line: rgba(237, 242, 223, 0.15);
  --line-strong: rgba(237, 242, 223, 0.32);
  --accent: #c8d987;
  --accent-deep: #6b9543;
  --accent-warm: #d0b36a;
  --code: #070806;
  --code-text: #edf2df;
  --code-keyword: #d6e891;
  --code-string: #d0b36a;
  --code-number: #9fc46d;
  --code-type: #b9dcd4;
  --code-comment: #737c67;
  --code-property: #e4e8d4;
  --code-call: #c8d987;
  --code-operator: #aab49b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

body.home-page {
  background: var(--paper);
}

.home-stage {
  position: relative;
  width: min(1240px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(34px, 6vw, 76px) clamp(20px, 4vw, 42px) 90px;
}

.brand-system {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: clamp(36px, 7vw, 96px);
  align-items: center;
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(42px, 8vh, 74px);
  font-size: 15px;
  font-weight: 720;
}

.home-brand img {
  width: 28px;
  height: 28px;
}

.home-brand strong {
  border: 1px solid rgba(208, 179, 106, 0.42);
  border-radius: 999px;
  color: var(--accent-warm);
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1;
}

.home-index {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: clamp(42px, 7vh, 70px);
  padding: 13px 0;
  background: rgba(9, 11, 7, 0.92);
  backdrop-filter: blur(18px);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.home-index a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.home-kicker {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(52px, 8vw, 90px);
  line-height: 0.96;
  letter-spacing: 0;
}

.home-lede {
  width: min(720px, 100%);
  margin: 26px 0 0;
  color: #d9deca;
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.48;
}

.brand-mark {
  width: min(470px, 100%);
  justify-self: center;
  overflow: visible;
}

.brand-mark path,
.brand-mark circle {
  vector-effect: non-scaling-stroke;
}

.brand-mark .specimen-lines path {
  fill: none;
  stroke: rgba(237, 242, 223, 0.18);
  stroke-width: 1;
}

.brand-mark .specimen-spine {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  opacity: 0.78;
}

.brand-mark .specimen-echo {
  fill: none;
  stroke: rgba(200, 217, 135, 0.2);
  stroke-width: 1;
  stroke-linecap: round;
}

.brand-mark .specimen-thread {
  fill: none;
  stroke: var(--accent-deep);
  stroke-width: 1.2;
  stroke-linecap: round;
  opacity: 0.55;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: clamp(38px, 6vh, 62px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.track {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 190px;
  border-left: 1px solid var(--line);
  background: transparent;
  padding: 20px 20px 22px 0;
}

.track:first-child {
  border-left: 0;
}

.track + .track {
  padding-left: 20px;
}

.track span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.track strong {
  max-width: 330px;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.08;
}

.track small {
  max-width: 330px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.48;
}

.track:hover strong {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.home-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 46px;
  padding: 13px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.home-source-links,
.source-links {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.home-source-links a,
.source-links a {
  color: inherit;
  text-decoration: none;
}

.home-source-links a:hover,
.home-source-links a:focus-visible,
.source-links a:hover,
.source-links a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-attribution {
  display: grid;
  gap: 10px;
  margin-top: 44px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid rgba(237, 242, 223, 0.08);
  padding: 16px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.home-attribution {
  margin-top: 22px;
}

.site-attribution p {
  max-width: 780px;
  margin: 0;
}

.site-attribution strong {
  color: var(--ink);
  font-weight: 620;
}

.site-attribution nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 12px;
  font-weight: 650;
}

.site-attribution a {
  color: var(--accent);
  text-decoration: none;
}

.site-attribution a:hover,
.site-attribution a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.home-notes {
  width: min(760px, 100%);
  margin-top: 44px;
  padding-bottom: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1480px, 100%);
  min-height: 58px;
  margin: 0 auto;
  padding: 14px clamp(24px, 4vw, 52px) 12px;
  background: rgba(9, 11, 7, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand,
.topnav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
}

.brand-logo {
  width: 26px;
  height: 26px;
}

.brand strong {
  border: 1px solid rgba(208, 179, 106, 0.42);
  border-radius: 999px;
  color: var(--accent-warm);
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1;
}

.topnav {
  gap: 4px;
}

.topnav a {
  padding: 9px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.topnav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: min(240px, 24vw);
}

.search-box span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.search-box input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 0 13px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.search-box input:focus {
  border-color: var(--line-strong);
  outline: 2px solid rgba(243, 239, 230, 0.1);
}

.menu-button {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 9px;
}

.menu-button span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
}

.site-shell {
  display: grid;
  grid-template-columns: minmax(270px, 310px) minmax(0, 1fr);
  gap: clamp(44px, 5vw, 96px);
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 34px clamp(24px, 4vw, 52px) 80px;
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 8px 0 24px;
}

.nav-section + .nav-section {
  margin-top: 18px;
}

.nav-section-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}

.nav-link {
  display: grid;
  gap: 3px;
  padding: 8px 0 8px 12px;
  border-left: 2px solid transparent;
}

.nav-link span {
  font-size: 14px;
  font-weight: 450;
}

.nav-link:hover,
.nav-link.is-active {
  border-left-color: var(--ink);
}

.content {
  min-width: 0;
}

.eyebrow,
.section-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}

.doc {
  width: min(1000px, 100%);
  padding-bottom: 80px;
}

.home-doc {
  margin-top: 38px;
}

.doc-header {
  padding: 12px 0 24px;
  border-bottom: 1px solid var(--line);
}

.doc-header h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
}

.doc-header p:last-child {
  width: min(720px, 100%);
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.markdown-body {
  padding-top: 28px;
  font-size: 16px;
  line-height: 1.78;
}

.markdown-body h1 {
  display: none;
}

.markdown-body h2 {
  margin: 44px 0 12px;
  font-size: 24px;
  line-height: 1.2;
}

.markdown-body h3 {
  margin: 30px 0 8px;
  font-size: 20px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol {
  color: #d5d0c6;
}

.markdown-body a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.markdown-body code {
  border-radius: 4px;
  background: var(--surface);
  padding: 0.16em 0.36em;
  font: 0.92em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.markdown-body pre {
  overflow: auto;
  border-radius: 6px;
  background: var(--code);
  padding: 12px 16px 13px;
  color: var(--code-text);
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  display: block;
  line-height: 1.42;
}

.markdown-body .code-block {
  overflow: hidden;
  border: 1px solid rgba(237, 242, 223, 0.12);
  border-radius: 6px;
  margin: 20px 0;
  background: var(--code);
}

.markdown-body .code-block-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  border-bottom: 1px solid rgba(237, 242, 223, 0.1);
  padding: 4px 8px 4px 12px;
  color: var(--code-comment);
  font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.markdown-body .code-language {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
}

.copy-code-button {
  flex: 0 0 auto;
  border: 1px solid rgba(237, 242, 223, 0.18);
  border-radius: 4px;
  background: rgba(237, 242, 223, 0.04);
  padding: 4px 8px;
  color: var(--code-text);
  font: inherit;
  cursor: pointer;
}

.copy-code-button:hover,
.copy-code-button:focus-visible {
  border-color: rgba(237, 242, 223, 0.34);
  background: rgba(237, 242, 223, 0.08);
}

.copy-code-button[data-state="copied"] {
  border-color: rgba(200, 217, 135, 0.42);
  color: var(--accent);
}

.copy-code-button[data-state="selected"] {
  border-color: rgba(208, 179, 106, 0.42);
  color: var(--accent-warm);
}

.markdown-body .code-block pre {
  margin: 0;
  border-radius: 0;
  border: 0;
}

.markdown-body .install-tabs {
  margin: 18px 0 28px;
  border: 1px solid var(--line);
  background: rgba(18, 21, 15, 0.72);
  overflow: hidden;
}

.markdown-body .tab-list {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 6, 0.36);
}

.markdown-body .tab-button {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  white-space: nowrap;
}

.markdown-body .tab-button[aria-selected="true"] {
  color: var(--ink);
  background: rgba(200, 217, 135, 0.09);
}

.markdown-body .tab-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.markdown-body .tab-panel {
  padding: 16px;
}

.markdown-body .tab-panel[hidden] {
  display: none;
}

.markdown-body .tab-panel h3 {
  margin-top: 0;
  font-size: 1rem;
}

.markdown-body .tab-panel p {
  margin-top: 0;
}

.markdown-body .highlight {
  background: var(--code) !important;
  color: var(--code-text) !important;
}

.markdown-body .highlight .line {
  display: block;
  min-height: 1.42em;
}

.tok-keyword {
  color: var(--code-keyword);
  font-weight: 650;
}

.tok-string {
  color: var(--code-string);
}

.tok-number,
.tok-literal {
  color: var(--code-number);
}

.tok-type {
  color: var(--code-type);
}

.tok-comment {
  color: var(--code-comment);
  font-style: italic;
}

.tok-property {
  color: var(--code-property);
}

.tok-call {
  color: var(--code-call);
}

.tok-punctuation,
.tok-operator {
  color: var(--code-operator);
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.markdown-body th,
.markdown-body td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

.markdown-body blockquote {
  margin: 24px 0;
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--muted);
}

.page-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 54px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.page-nav-link {
  display: grid;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
}

.page-nav-link span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}

.page-nav-link strong {
  font-size: 16px;
  line-height: 1.3;
}

.page-nav-link.is-next {
  text-align: right;
}

.page-nav-link:hover strong,
.page-nav-link:focus-visible strong {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 920px) {
  .topnav {
    display: none;
  }

  .search-box {
    width: min(220px, 38vw);
  }

  .menu-button {
    display: block;
  }

  .site-shell {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 18px 20px 64px;
  }

  .sidebar {
    display: none;
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
  }

  .site-shell.is-open .sidebar {
    display: block;
  }

  .brand-system {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    width: min(360px, 100%);
  }

  .home-index {
    justify-content: flex-start;
  }

  .source-links {
    display: none;
  }

  .track-grid {
    grid-template-columns: 1fr;
    border-bottom: 0;
  }

  .track,
  .track + .track {
    border-left: 0;
    border-bottom: 1px solid var(--line);
    min-height: 0;
    padding: 18px 0;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand strong,
  .search-box {
    display: none;
  }

  .brand-copy h1 {
    font-size: 50px;
  }

  .page-nav {
    grid-template-columns: 1fr;
  }

  .page-nav-link.is-next {
    text-align: left;
  }

}