/* Quiet sidebar, one accent from the logo, readable type. */
:root {
  --gold: #e4a73d;
  --ink: #141414;
  --muted: #6b6b6b;
  --line: #ececec;
  --paper: #ffffff;
  --bg: #fafafa;
  --soft: #f4f4f4;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 10px; text-wrap: balance; }
h1 { font-size: clamp(34px, 4.5vw, 48px); }
h2 { font-size: 22px; margin-top: 4px; }
h3 { font-size: 15px; letter-spacing: -0.015em; }
p { margin: 0 0 12px; max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 1.5; }
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.lead { font-size: 18px; line-height: 1.5; color: #333; max-width: 42ch; }

.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 28px; }
.hero img { width: 88px; height: 88px; border-radius: 18px; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
  background: var(--paper); color: var(--ink);
  padding: 22px 14px;
  border-right: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  font-weight: 600; font-size: 16px; letter-spacing: -0.03em;
  padding: 0 8px;
}
.brand img { width: 36px; height: 36px; border-radius: 8px; flex: none; }
.brand small { display: block; font-weight: 400; font-size: 12px; letter-spacing: 0; color: var(--muted); margin-top: 1px; }
.menu { display: grid; gap: 2px; }
.menu a {
  display: flex; align-items: center;
  text-decoration: none; color: #3a3a3a;
  font-size: 14px; font-weight: 500;
  padding: 8px 10px;
  border-radius: 8px;
}
.menu a:hover { background: var(--soft); color: var(--ink); }
.menu a.active { background: var(--ink); color: var(--paper); }
.menu a:focus-visible, .xbtn:focus-visible, .btn:focus-visible, .wallet-btn:focus-visible, .wallet-option:focus-visible, .wallet-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.side-foot { margin-top: auto; display: grid; gap: 8px; padding: 0 4px; }
.wallet-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  font: inherit; font-size: 14px; font-weight: 500; line-height: 1.2; padding: 10px 12px; cursor: pointer;
  color: var(--paper); background: var(--ink); border: 0; border-radius: 8px;
}
.wallet-btn:disabled { opacity: .6; cursor: wait; }
.wallet-btn.connected { background: var(--soft); color: var(--ink); }
.wallet-btn .dot { width: 7px; height: 7px; border-radius: 50%; background: #1f9d55; flex: none; }
.wallet-modal {
  position: fixed; inset: 0; z-index: 40; background: rgba(20, 20, 20, .4);
  display: grid; place-items: center; padding: 16px;
}
.wallet-modal[hidden] { display: none; }
.wallet-panel {
  width: min(400px, 100%); background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(20, 20, 20, .16);
  padding: 20px; display: grid; gap: 14px; max-height: min(80vh, 640px); overflow: auto;
}
.wallet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wallet-head h2 { margin: 0; font-size: 18px; }
.wallet-close {
  font: inherit; font-size: 13px; font-weight: 500; background: transparent;
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); padding: 6px 10px; cursor: pointer;
}
.wallet-close:hover { background: var(--soft); }
.wallet-list { display: grid; gap: 8px; }
.wallet-option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  font: inherit; font-size: 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); padding: 10px 12px; cursor: pointer;
}
.wallet-option:hover { border-color: #ccc; background: var(--bg); }
.wallet-option img, .wallet-mark { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.wallet-mark { display: grid; place-items: center; background: var(--gold); color: var(--ink); font-weight: 600; font-size: 14px; }
.wallet-addr {
  font-size: 13px; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin: 0; font-variant-numeric: tabular-nums;
}
.wallet-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wallet-error, .wallet-note { margin: 0; }
.wallet-error { color: #9a3412; }
.xbtn {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  text-decoration: none; color: var(--muted); background: transparent;
  font-size: 13px; font-weight: 500; padding: 8px 10px; border-radius: 8px;
}
.xbtn:hover { background: var(--soft); color: var(--ink); }
.xbtn svg { width: 14px; height: 14px; fill: currentColor; }
.status { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); display: block; }

.main { padding: 56px 56px 72px; }
.page { max-width: 820px; display: grid; gap: 40px; }
.block { display: grid; gap: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 16px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 14px; font-weight: 500; text-decoration: none;
  color: var(--paper); background: var(--ink); border: 1px solid var(--ink);
  border-radius: 8px; padding: 10px 14px; cursor: pointer;
}
.btn:hover { background: #2a2a2a; }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: #e0e0e0; }
.btn.ghost:hover { background: var(--soft); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }

.stat { font-variant-numeric: tabular-nums; }
.stat .n { font-size: 28px; font-weight: 600; letter-spacing: -0.04em; display: block; margin: 6px 0 2px; }
.stat .l { color: var(--muted); font-size: 13px; }

.badge { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: var(--gold); color: #3a2a08; }
.badge.gray { background: var(--soft); color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-weight: 400; }
thead th { font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.empty-row td { text-align: center; color: var(--muted); padding: 28px 12px; }

label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
input, select {
  font: inherit; font-size: 15px; font-weight: 400; color: var(--ink);
  background: var(--paper); border: 1px solid #e0e0e0; border-radius: 8px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent; }
input:disabled, select:disabled { background: var(--bg); color: var(--muted); }

details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
details p { padding-bottom: 6px; }

.post { padding: 22px 0; border-bottom: 1px solid var(--line); }
.post:first-child { padding-top: 0; }
.post h3 { font-size: 17px; }
.post a { font-weight: 500; text-underline-offset: 3px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.post-meta img { width: 22px; height: 22px; border-radius: 5px; }
.post-meta b { color: var(--ink); font-weight: 600; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  font: inherit; font-size: 13px; font-weight: 500; padding: 7px 12px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); cursor: pointer;
}
.seg button:hover { color: var(--ink); border-color: #ddd; }
.seg button.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.docs { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc { position: sticky; top: 24px; display: grid; gap: 2px; font-size: 13px; }
.toc a { text-decoration: none; color: var(--muted); padding: 4px 0; }
.toc a:hover, .toc a.active { color: var(--ink); }
.docs section { scroll-margin-top: 24px; padding-bottom: 8px; }
.docs section a { font-weight: 500; text-underline-offset: 3px; }

.foot { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 16px; max-width: none; }

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    border-right: 0; border-bottom: 1px solid var(--line);
    position: sticky; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 10px; padding: 12px 14px; z-index: 5;
  }
  .brand small { display: none; }
  .menu {
    order: 3; flex-basis: 100%; min-width: 0; max-width: 100%;
    display: flex; overflow-x: auto; gap: 4px; padding-bottom: 2px;
  }
  .menu a { white-space: nowrap; padding: 7px 10px; }
  .side-foot { margin: 0 0 0 auto; display: flex; align-items: center; gap: 4px; }
  .wallet-btn { width: auto; padding: 8px 12px; }
  .status { display: none; }
  .xbtn { padding: 8px; }
  .xbtn span { display: none; }
  .main { padding: 28px 16px 56px; }
  .g2, .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs { grid-template-columns: 1fr; }
  .toc { display: none; }
}
@media (max-width: 480px) {
  .hero { grid-template-columns: 1fr; gap: 16px; }
  .hero img { width: 64px; height: 64px; border-radius: 14px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  h1 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
