:root {
  --paper: #ffffff;
  --paper-soft: #f6f8fb;
  --paper-blue: #eef5f7;
  --ink: #17212b;
  --ink-soft: #4f5e6e;
  --ink-muted: #6b7785;
  --line: #d8e0e8;
  --line-strong: #aab8c6;
  --graphite: #2b2f36;
  --gold: #7a5a0a;
  --gold-soft: #f5ecd0;
  --blue: #2d5f7b;
  --teal: #21736b;
  --green: #23754d;
  --red: #9a4439;
  --shadow: 0 18px 44px rgba(23, 33, 43, 0.08);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

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

img,
svg {
  max-width: 100%;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 20;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 12px;
  border-radius: var(--radius);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(159, 122, 26, 0.55);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
  font-weight: 700;
}

.brand img {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}

.brand span {
  display: block;
  font-size: 15px;
}

.brand small {
  display: block;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 500;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 18px;
  color: var(--ink-soft);
  font-size: 14px;
}

.nav-links a:hover,
.doc-section a:hover,
.sidebar a:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-actions .button {
  min-height: 38px;
  padding: 8px 10px;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover {
  border-color: var(--blue);
  background: var(--paper-blue);
}

.button-primary {
  border-color: var(--graphite);
  background: var(--graphite);
  color: var(--paper);
}

.button-primary:hover {
  background: #1f242a;
  color: var(--paper);
}

.button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.page {
  padding: 34px 18px 42px;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}

.shell {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.shell-inner {
  display: grid;
  gap: 24px;
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 108px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 16px;
}

.sidebar-title {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.sidebar-sub,
.sidebar-footer {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.45;
}

.sidebar-section-label {
  margin: 16px 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
}

.nav-link {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 9px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.nav-link .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.nav-link.active {
  background: var(--paper-blue);
  color: var(--ink);
}

.nav-link.active .dot {
  background: var(--blue);
}

.sidebar-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.docs-main {
  min-width: 0;
  display: grid;
  gap: 26px;
}

.docs-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(238, 245, 247, 0.85) 0%, rgba(255, 255, 255, 1) 78%),
    var(--paper);
  box-shadow: var(--shadow);
  padding: 28px;
  scroll-margin-top: 90px;
}

.docs-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.docs-kicker::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(35, 117, 77, 0.12);
}

.docs-title,
.doc-section h1,
.doc-section h2,
.doc-section h3,
.doc-section p {
  margin-top: 0;
}

.docs-title {
  max-width: 820px;
  margin-bottom: 12px;
  font-size: 42px;
  line-height: 1.08;
  font-weight: 800;
}

.docs-subtitle {
  max-width: 760px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 18px;
}

.docs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.tag,
.rpc-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 750;
}

.tag--accent {
  border-color: rgba(159, 122, 26, 0.34);
  background: var(--gold-soft);
  color: var(--gold);
}

.doc-section {
  overflow-x: auto;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 90px;
}

.doc-section h2 {
  margin-bottom: 14px;
  font-size: 28px;
  line-height: 1.16;
}

.doc-section h3 {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.25;
}

.doc-section p,
.doc-section li {
  color: var(--ink-soft);
  font-size: 15px;
}

.doc-section ul,
.doc-section ol {
  padding-left: 22px;
}

.code-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.code-list code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  padding: 5px 7px;
  color: var(--ink);
  font-size: 12px;
}

.cards,
.data-grid,
.artifact-list,
.summary-grid {
  display: grid;
  gap: 14px;
}

.cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.data-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.artifact-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-card,
.metric,
.artifact-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 18px;
}

.mini-card {
  display: block;
  color: var(--ink-soft);
  font-size: 14px;
}

.mini-card:hover {
  border-color: var(--blue);
  background: var(--paper-blue);
  text-decoration: none;
}

.mini-card-title,
.metric-label,
.artifact-label {
  margin-bottom: 8px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-value {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.12;
  font-weight: 800;
  word-break: break-word;
}

.metric-note,
.artifact-card p {
  margin-bottom: 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.artifact-card {
  display: grid;
  gap: 12px;
}

.artifact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.note {
  margin: 16px 0 0;
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #fffaf0;
  color: var(--ink-soft);
  padding: 16px;
}

.callout-warning {
  border-left-color: var(--gold);
}

code {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfcfd;
  color: var(--ink);
  padding: 2px 5px;
  font-size: 0.92em;
}

pre,
.code-block {
  overflow: auto;
  border: 1px solid #263544;
  border-radius: var(--radius);
  background: #111922;
  color: #e9f1f7;
  padding: 16px;
  font-size: 13px;
  line-height: 1.55;
}

pre code,
.code-block code {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  white-space: pre;
}

.rpc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  margin: 12px 0 0;
  font-size: 13px;
}

.rpc-table th,
.rpc-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.rpc-table th {
  color: var(--ink);
  font-weight: 800;
}

.rpc-table td {
  color: var(--ink-soft);
}

.sha-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.sha-row {
  display: grid;
  grid-template-columns: minmax(190px, 0.38fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 12px;
}

.sha-row code {
  word-break: break-all;
}

.docs-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-muted);
  font-size: 13px;
}

.footer {
  padding: 30px 18px;
  background: var(--graphite);
  color: #f4f6f8;
}

.footer-grid {
  width: min(100%, var(--max));
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.footer-brand img {
  width: 32px;
  height: 32px;
}

.footer p,
.footer small {
  color: #cbd3dc;
}

@media (max-width: 1020px) {
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: relative;
    top: 0;
    max-height: none;
    box-shadow: none;
  }

  .cards,
  .data-grid,
  .artifact-list,
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 719px) {
  .nav {
    align-items: center;
    flex-wrap: wrap;
  }

  .brand small {
    display: none;
  }

  .nav-actions {
    flex: 1 0 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .nav-actions .button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 7px 10px;
  }

  .docs-title {
    font-size: 36px;
  }

  .docs-subtitle {
    font-size: 16px;
  }

  .docs-hero {
    padding: 22px;
  }

  .cards,
  .data-grid,
  .artifact-list,
  .summary-grid,
  .sha-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
