/* ──────────────────────────────────────────────
   Ledgera – Services v2
   Light editorial · white bg / black text · documentation-style
   ────────────────────────────────────────────── */

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }

:root {
  --bg:           #ffffff;
  --bg-2:         #fafafa;
  --bg-3:         #f4f4f5;
  --surface:      #fbfbfb;
  --line:         #e8e8e8;
  --line-strong:  #d4d4d4;
  --ink:          #0f0f10;
  --ink-2:        #1f1f22;
  --text-muted:   #5a5a5d;
  --text-fade:    #909094;
  --text-vfade:   #c5c5c8;
  --code-bg:      #f7f7f8;
  --code-bg-2:    #f0f0f1;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.66;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: var(--ink); color: var(--bg); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg-3); }
::-webkit-scrollbar-thumb { background: var(--ink-2); border: 2px solid var(--bg-3); }
::-webkit-scrollbar-thumb:hover { background: var(--ink); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 clamp(24px, 4vw, 56px); }
.wrap-wide { max-width: 1240px; margin: 0 auto; padding: 0 clamp(24px, 4vw, 56px); }

/* ── Top bar ── */
.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.top-ext { display: flex; gap: 24px; align-items: center; }
.top-ext .ext {
  font-family: "Inter", sans-serif;
  font-size: 12.5px;
  color: var(--text-fade);
  transition: color .2s ease;
}
.top-ext .ext:hover { color: var(--ink); }
.top .net-strip-inner {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0 14px;
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.top .net-strip-inner::-webkit-scrollbar { display: none; }
.top .net-strip-inner .lbl {
  font-family: "Space Grotesk", monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-fade);
  margin-right: 6px;
  flex-shrink: 0;
}
.top .net-tab.active {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.top .net-tab.active .kind { color: var(--bg); opacity: 0.7; }
@media (max-width: 720px) {
  .top-ext { display: none; }
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
}
.brand img {
  height: 34px; width: 34px;
  object-fit: contain;
  background: var(--ink);
  padding: 3px;
  border-radius: 6px;
}
.brand .name {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.top-nav { display: flex; gap: 26px; align-items: center; }
.top-nav a {
  font-family: "Inter", sans-serif;
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color .2s ease;
}
.top-nav a:hover { color: var(--ink); }
.top-nav a.active { color: var(--ink); font-weight: 700; }
.top-nav .ext { font-size: 12.5px; color: var(--text-fade); }
@media (max-width: 720px) {
  .top-nav { gap: 14px; }
  .top-nav a:not(.ext-keep) { display: none; }
}

/* ── Page hero (sits above network strip) ── */
.page-hero {
  padding: 64px 0 40px;
}
.page-hero .meta-top { margin-bottom: 18px; }

/* ── Network strip (sticky, anchor nav) ── */
.net-strip {
  position: sticky; top: 68px;
  z-index: 40;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  margin-bottom: 24px;
}
.net-strip-inner {
  display: flex; align-items: center; gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.net-strip-inner::-webkit-scrollbar { display: none; }
.net-strip .lbl {
  font-family: "Space Grotesk", monospace;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-fade);
  margin-right: 8px;
  flex-shrink: 0;
}
.net-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.net-tab:hover {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.net-tab img { width: 18px; height: 18px; object-fit: contain; }
.net-tab .kind {
  font-family: "Space Grotesk", monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--text-fade);
  margin-left: 2px;
}
.net-tab:hover .kind { color: var(--bg); opacity: 0.7; }

/* ── Chain block (one per network on the page) ── */
.chain-block {
  scroll-margin-top: 130px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.chain-block:nth-child(even) { background: var(--bg-2); }
.chain-head {
  padding: 56px 0 28px;
  border-bottom: 1px solid var(--line);
}
.chain-banner {
  display: flex; align-items: center; gap: 24px;
}
.chain-banner .chain-logo {
  width: 64px; height: 64px;
  object-fit: contain;
  background: var(--bg);
  padding: 6px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.chain-banner .meta-top { margin-bottom: 12px; }
.chain-banner .chain-meta {
  font-family: "Space Grotesk", monospace;
  font-size: 12.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.chain-banner .chain-meta code {
  font-size: 0.95em;
  padding: 1px 6px;
}
h2.chain-title {
  font-family: "Manrope", sans-serif;
  font-weight: 900;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* h3 inside chain-block now plays the role h2 did before */
h3.step-title {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: clamp(1.3rem, 2vw, 1.55rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  scroll-margin-top: 130px;
}
h3.step-title .n {
  font-family: "Space Grotesk", monospace;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--text-fade);
  min-width: 32px;
}
h3.step-title .opt {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-fade);
  margin-left: 4px;
}
h4.substep-title {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.005em;
  color: var(--ink-2);
  margin-top: 22px;
  margin-bottom: 6px;
}
h4.substep-title .opt {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text-fade);
}

/* Useful commands compact groups */
.cmdlist .group {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.cmdlist .group:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.cmdlist .h-group {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 10px;
}

/* ── Hero ── */
.hero {
  padding: clamp(56px, 8vw, 110px) 0 50px;
  border-bottom: 1px solid var(--line);
}
.hero .meta-top {
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 22px;
}
.hero .badge {
  font-family: "Space Grotesk", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--bg);
  padding: 5px 10px;
}
.hero .badge.outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.hero .chain-id {
  font-family: "Space Grotesk", monospace;
  font-size: 13px;
  color: var(--text-muted);
}
.hero .alt-link {
  font-family: "Space Grotesk", monospace;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color .2s ease, border-color .2s ease;
}
.hero .alt-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

h1.display {
  font-family: "Manrope", sans-serif;
  font-weight: 900;
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.lead {
  font-weight: 400;
  color: var(--text-muted);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.7;
  max-width: 66ch;
  margin-top: 24px;
}

.last-updated {
  margin-top: 22px;
  font-family: "Space Grotesk", monospace;
  font-size: 12px;
  color: var(--text-fade);
  letter-spacing: 0.06em;
}
.last-updated b { color: var(--ink); font-weight: 700; }

/* ── Resources bar ── */
.resources {
  margin-top: 36px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.resources a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  transition: background .2s ease, border-color .2s ease;
}
.resources a:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.resources a .ic {
  font-family: "Space Grotesk", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-fade);
}
.resources a:hover .ic { color: var(--bg); }

/* ── Quick facts strip ── */
.facts-strip {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.facts-strip .cell {
  padding: 18px 22px;
  border-right: 1px solid var(--line);
}
.facts-strip .cell:last-child { border-right: none; }
.facts-strip .l {
  font-family: "Space Grotesk", monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-fade);
}
.facts-strip .v {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
  margin-top: 8px;
  word-break: break-all;
}
@media (max-width: 720px) {
  .facts-strip { grid-template-columns: 1fr 1fr; }
  .facts-strip .cell:nth-child(2n) { border-right: none; }
  .facts-strip .cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ── Step (numbered H2 section) ── */
.step {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.step:last-child { border-bottom: none; }
h2.step-title { scroll-margin-top: 80px; }
h2.step-title {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: clamp(1.7rem, 2.8vw, 2.1rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
h2.step-title .n {
  font-family: "Space Grotesk", monospace;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.20em;
  color: var(--text-fade);
  min-width: 36px;
}
h3.substep-title {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.005em;
  color: var(--ink-2);
  margin-top: 28px;
  margin-bottom: 8px;
}
.step p,
.step .body p {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 8px 0;
  max-width: 72ch;
}

/* ── Code block ── */
.pre-wrap {
  position: relative;
  margin: 16px 0;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  padding: 18px 22px;
  margin: 0;
  font-family: "JetBrains Mono", "Space Grotesk", monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink);
  overflow-x: auto;
  tab-size: 2;
}
pre .c { color: var(--text-fade); font-style: italic; }
pre .k { color: var(--ink); font-weight: 700; }
code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9em;
  background: var(--code-bg-2);
  padding: 2px 7px;
  border: 1px solid var(--line);
  color: var(--ink);
}

button.pre-copy {
  position: absolute;
  top: 10px; right: 10px;
  font-family: "Space Grotesk", monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  padding: 6px 11px;
  z-index: 4;
  transition: background .2s, color .2s, border-color .2s;
}
button.pre-copy:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
button.pre-copy.done {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ── Callout (Note / Important) ── */
.callout {
  margin: 18px 0;
  padding: 14px 18px 14px 20px;
  background: var(--bg-2);
  border-left: 3px solid var(--ink-2);
  display: flex; gap: 14px;
  align-items: flex-start;
}
.callout .tag {
  font-family: "Space Grotesk", monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 3px 7px;
  background: var(--bg);
  border: 1px solid var(--ink);
  white-space: nowrap;
  margin-top: 1px;
}
.callout .body {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.callout.note .tag { color: var(--text-muted); border-color: var(--text-muted); }
.callout.note { border-left-color: var(--text-muted); }

/* ── Endpoint table (rows) ── */
.ep-list {
  border: 1px solid var(--line);
  margin-top: 18px;
}
.ep-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  transition: background .2s ease;
}
.ep-row:last-child { border-bottom: none; }
.ep-row:hover { background: var(--bg-2); }
.ep-row .l {
  font-family: "Space Grotesk", monospace;
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}
.ep-row .u {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
}
.ep-row .cp {
  font-family: "Space Grotesk", monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  padding: 6px 11px;
  user-select: none;
  transition: background .2s, color .2s, border-color .2s;
}
.ep-row .cp:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
@media (max-width: 720px) {
  .ep-row { grid-template-columns: 1fr; gap: 8px; padding: 14px 18px; }
  .ep-row .cp { justify-self: start; }
}

/* ── Switcher (mainnet/testnet) ── */
.switcher {
  display: inline-flex;
  border: 1px solid var(--ink);
  margin-top: 28px;
}
.switcher a {
  padding: 9px 18px;
  font-family: "Space Grotesk", monospace;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  border-right: 1px solid var(--ink);
  transition: background .2s, color .2s;
}
.switcher a:last-child { border-right: none; }
.switcher a.active {
  background: var(--ink);
  color: var(--bg);
}

/* ── Useful commands grouping ── */
.cmdlist .group {
  margin-top: 42px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.cmdlist .group:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.cmdlist .h-group {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 12px;
}
.cmdlist h4.sub {
  font-family: "Space Grotesk", monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 22px 0 6px;
}

/* ── Landing network grid ── */
.net-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin-top: 40px;
}
.net-card {
  display: block;
  padding: 32px 30px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  transition: background .25s ease;
  position: relative;
}
.net-card:hover { background: var(--bg-2); }
.net-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.net-card:hover::after { transform: scaleX(1); }
.net-card .row {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 22px;
}
.net-card img {
  width: 38px; height: 38px;
  object-fit: contain;
  background: var(--bg);
  padding: 3px;
  border: 1px solid var(--line);
}
.net-card .name {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.net-card .nets {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 16px;
}
.net-card .pill {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "Space Grotesk", monospace;
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}
.net-card .pill .d {
  width: 8px; height: 8px;
  background: var(--ink);
  border-radius: 50%;
}
.net-card .pill.testnet .d { background: var(--text-fade); }
.net-card .enter {
  margin-top: 24px;
  font-family: "Space Grotesk", monospace;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink);
  display: flex; justify-content: space-between; align-items: center;
}

/* ── Section divider with label ── */
.divider {
  display: flex; align-items: center; gap: 18px;
  margin: 56px 0 14px;
}
.divider::before, .divider::after {
  content: ""; flex: 1;
  height: 1px;
  background: var(--line);
}
.divider .lbl {
  font-family: "Space Grotesk", monospace;
  font-size: 11px;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-fade);
}

/* ── Footer (minimal one-line) ── */
.foot {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  margin-top: 60px;
  background: var(--bg-2);
}
.foot-minimal .copyr {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Legacy multi-column styles (no longer used but kept for future) */
.foot-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 900px) {
  .foot-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .foot-brand { grid-column: 1 / -1; }
}
.foot-brand {
  max-width: 320px;
}
.foot-brand .row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.foot-brand img {
  height: 32px; width: 32px;
  background: var(--ink);
  padding: 3px;
  border-radius: 6px;
}
.foot-brand .nm {
  font-family: "Manrope", sans-serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-transform: uppercase;
}
.foot-brand .tag {
  font-family: "Inter", sans-serif;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

.foot-col h5 {
  font-family: "Space Grotesk", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}
.foot-col ul {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 8px;
}
.foot-col li a {
  font-family: "Inter", sans-serif;
  font-size: 13.5px;
  color: var(--text-muted);
  transition: color .2s ease;
}
.foot-col li a:hover { color: var(--ink); }

.foot-bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px; flex-wrap: wrap;
}
.foot-bottom .copyr {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--text-muted);
}
.foot-bottom .build {
  font-family: "Space Grotesk", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-fade);
}
.foot-bottom .build b { color: var(--ink); font-weight: 700; }
