/* Mertcash — white page, black ink outlines, yellow highlights; one light theme by design */
:root {
  --paper: #FFFFFF;
  --card: #FFFFFF;
  --ink: #111111;
  --muted: #555555;
  --line: #111111;
  --mustard: #F5C518;
  --mustard-soft: #FFF4C2;
  --primary: #111111;
  --primary-ink: #FFFFFF;
  --side: #FFFFFF;
  --side-fg: #111111;
  --side-muted: #555555;
  --lemon: #F5C518;
  --link: #111111;
  --shadow: #111111;
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body: "Figtree", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--body); }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--mustard); outline-offset: 2px; border-radius: 6px;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.1; text-wrap: balance; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 65ch; }
code, .mono { font-family: var(--mono); font-size: .9em; }

/* shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-fg); border-right: 2px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 24px 18px;
  display: flex; flex-direction: column; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--side-fg); text-decoration: none; }
.brand img { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--shadow); }
.brand b { font-family: var(--display); font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }
.nav { display: grid; gap: 2px; }
.nav a {
  color: var(--side-fg); text-decoration: none; padding: 9px 12px; border-radius: 10px;
  font-weight: 500; display: flex; align-items: center; gap: 10px; border: 2px solid transparent;
}
.nav a:hover { background: var(--mustard-soft); }
.nav a.active { background: var(--mustard); color: #1C1A16; border-color: var(--ink); box-shadow: 2px 2px 0 var(--shadow); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; display: grid; gap: 10px; font-size: .85rem; color: var(--side-muted); }
.menu-btn { display: none; }

.main { min-width: 0; }
.page { max-width: 1000px; margin: 0 auto; padding-block: 48px 40px; padding-inline: 32px; display: grid; gap: 40px; }

/* type helpers */
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.block > :last-child { margin-bottom: 0; }

/* hero */
.page > *, .hero > * { min-width: 0; }
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 36px; align-items: center; }
.hero .logo {
  width: 200px; height: 200px; border-radius: 50%; border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--shadow); transform: rotate(-4deg); transition: transform .3s ease;
}
.hero .logo:hover { transform: rotate(3deg) scale(1.03); }
.hero h1 mark { background: none; color: inherit; box-shadow: inset 0 -.32em 0 var(--mustard); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1rem var(--body); padding: 11px 20px; border-radius: 12px; cursor: pointer;
  background: var(--primary); color: var(--primary-ink); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--shadow); text-decoration: none; transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.btn.ghost { background: var(--card); color: var(--ink); }
.btn[disabled] { cursor: not-allowed; opacity: .6; transform: none; box-shadow: 3px 3px 0 var(--shadow); }

/* grids & cards */
.grid { display: grid; gap: 18px; }
.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)); }
.card {
  background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 20px;
  box-shadow: 4px 4px 0 var(--shadow); min-width: 0;
}
.card > :last-child { margin-bottom: 0; }
.card.flat { box-shadow: none; }
.card.tint { background: var(--mustard-soft); }
.tag {
  display: inline-block; font-family: var(--mono); font-size: .75rem; font-weight: 600;
  background: var(--mustard); color: #1C1A16; border: 2px solid var(--ink); border-radius: 8px; padding: 1px 8px; margin-bottom: 12px;
}
.stat { display: grid; gap: 2px; }
.stat .l { font-size: .82rem; color: var(--muted); font-weight: 500; }
.stat .n { font-family: var(--display); font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1.5px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { text-align: right; font-weight: 600; }

/* redacted transaction strip */
.txrow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.txrow div { padding: 14px 16px; border-right: 2px solid var(--line); min-width: 0; }
.txrow div:last-child { border-right: 0; }
.txrow .l { display: block; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.txrow .v { font-family: var(--mono); font-size: .92rem; overflow-wrap: anywhere; }
.redact { background: var(--ink); color: transparent; border-radius: 4px; padding: 0 4px; user-select: none; }

/* steps */
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.steps .card { counter-increment: s; }
.steps .card::before {
  content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px;
  border-radius: 50%; border: 2px solid var(--ink); background: var(--lemon); color: #1C1A16; font: 800 1rem var(--display);
}

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1.5px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
td.yes { font-weight: 700; }
td.yes::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--mustard); border: 2px solid var(--ink); margin-right: 7px; vertical-align: 0; }
td.no { color: var(--muted); }
.empty-row td { text-align: center; color: var(--muted); padding: 32px 12px; }

/* forms */
label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
input, select {
  font: 500 1rem var(--body); color: var(--ink); background: var(--paper); width: 100%;
  border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
input:disabled, select:disabled { opacity: .7; }
form.card { display: grid; gap: 14px; }

/* tabs / segmented */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  font: 600 .92rem var(--body); padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: var(--card); color: var(--ink); border: 2px solid var(--line);
}
.seg button.active { background: var(--mustard); color: #1C1A16; border-color: var(--ink); box-shadow: 2px 2px 0 var(--shadow); }

/* bar */
.bar { height: 22px; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; display: flex; background: repeating-linear-gradient(45deg, transparent 0 8px, var(--mustard-soft) 8px 16px); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .88rem; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--ink); margin-right: 6px; vertical-align: -1px; }

/* search */
.search { display: flex; gap: 10px; }
.search input { font-family: var(--mono); font-size: .92rem; }
.result { margin-top: 12px; font-size: .95rem; }

/* feed */
.post { display: grid; gap: 6px; }
.post + .post { margin-top: 18px; }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: .88rem; color: var(--muted); }
.post-meta img { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink); }
.post-meta b { color: var(--ink); }
.badge { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 9px; border-radius: 999px; border: 2px solid var(--ink); background: var(--lemon); color: #1C1A16; }
.badge.gray { background: var(--card); color: var(--ink); border-color: var(--line); }
.post h3 { margin: 4px 0 0; }
.post p { margin: 0; }

/* docs */
.docs { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 36px; align-items: start; }
.toc { position: sticky; top: 24px; display: grid; gap: 2px; font-size: .92rem; }
.toc a { color: var(--muted); text-decoration: none; padding: 5px 10px; border-left: 3px solid transparent; }
.toc a.active { color: var(--ink); border-left-color: var(--mustard); font-weight: 600; }
.docs article { display: grid; gap: 34px; min-width: 0; }
.docs section { scroll-margin-top: 24px; min-width: 0; }
details { border: 2px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--card); }
details + details { margin-top: 10px; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; }
pre { font-family: var(--mono); font-size: .85rem; background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; margin: 0 0 1em; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 12px; font-weight: 600; z-index: 50;
}

.foot { font-size: .82rem; color: var(--muted); border-top: 2px dashed var(--line); padding-top: 18px; margin: 0; max-width: none; }

/* responsive */
@media (max-width: 960px) {
  .g4, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .toc a { border: 2px solid var(--line); border-radius: 999px; padding: 3px 10px; }
  .toc a.active { border-color: var(--ink); background: var(--mustard); color: #1C1A16; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: sticky; top: 0; height: auto; z-index: 20; flex-direction: row; flex-wrap: wrap; align-items: center;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; border-right: 0; border-bottom: 2px solid var(--line); gap: 12px;
  }
  .brand img { width: 38px; height: 38px; }
  .menu-btn {
    display: inline-flex; margin-left: auto; font: 600 .9rem var(--body); padding: 7px 14px; border-radius: 10px;
    background: var(--mustard); color: #1C1A16; border: 2px solid var(--ink); cursor: pointer;
  }
  .nav, .side-foot { display: none; width: 100%; }
  .side.open .nav, .side.open .side-foot { display: grid; }
  .page { padding-inline: 16px; padding-block: 28px 32px; gap: 32px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .hero .logo { width: 132px; height: 132px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .txrow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .txrow div:nth-child(2) { border-right: 0; }
  .txrow div:nth-child(-n+2) { border-bottom: 2px solid var(--line); }
}
@media (max-width: 480px) {
  .g4, .steps { grid-template-columns: minmax(0, 1fr); }
  .search { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* wallet */
.wallet { position: relative; }
.wallet-btn {
  display: inline-flex; align-items: center; gap: 8px; width: 100%; justify-content: center;
  font: 700 .92rem var(--body); padding: 9px 14px; border-radius: 12px; cursor: pointer;
  background: var(--mustard); color: #1C1A16; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--shadow);
}
.wallet-btn.on { background: var(--card); color: var(--ink); font-family: var(--mono); font-weight: 600; }
.wallet-btn.on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3C9A4A; }
.wallet-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 220px;
  background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: 4px 4px 0 var(--shadow); padding: 8px; display: grid; gap: 4px;
}
.wallet-menu button, .wallet-menu a {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  font: 600 .92rem var(--body); color: var(--ink); background: none; border: 0; border-radius: 9px;
  padding: 9px 10px; cursor: pointer; text-decoration: none; text-align: left;
}
.wallet-menu button:hover, .wallet-menu a:hover { background: var(--mustard-soft); }
.wallet-menu small { font-weight: 500; color: var(--muted); font-size: .78rem; }
.wallet-menu p { margin: 4px 10px 6px; font-size: .78rem; color: var(--muted); }
@media (max-width: 820px) {
  .wallet { margin-left: auto; }
  .wallet-btn { width: auto; padding: 7px 12px; font-size: .85rem; }
  .menu-btn { margin-left: 0; }
  .wallet-menu { left: auto; right: 0; }
  .side { overflow: visible; }
}
@media (max-width: 420px) {
  .wl-x { display: none; }
}

/* X link, pinned bottom left */
.x-btn {
  position: fixed; left: calc(16px + env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  background: var(--ink); color: #FFFFFF; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--mustard);
  font: 700 .95rem var(--body); text-decoration: none; transition: transform .12s, box-shadow .12s;
}
.x-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--mustard); }
.x-btn svg { width: 16px; height: 16px; fill: currentColor; }
.side-foot { padding-bottom: 56px; }
.page { padding-bottom: 88px; }
.wallet-btn:not(.on) { gap: 0; }
