* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0d0f0e;
  --panel: #131615;
  --panel-2: #171b19;
  --text: #e4e1da;
  --muted: #9b978e;
  --dim: #69655d;
  --rule: #232720;
  --rule-strong: #30352c;
  --link: #8ec5ff;
  --link-hover: #d9eeff;
  --accent: #f7931a;
  --accent-soft: #2b2114;
  --green: #83c88a;
  --blue: #8fb8ff;
  --red: #d9937c;
  --card-radius: 6px;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Mono", Menlo, "JetBrains Mono", "Fira Code", Consolas, monospace;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(142, 197, 255, 0.35);
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

img {
  max-width: 100%;
  display: block;
}

.nav-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 15, 14, 0.96);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-brand-group {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: max-content;
}

.nav-brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.nav-brand-bitcoin {
  color: var(--accent);
}

.nav-by {
  color: var(--dim);
  font-size: 12px;
}

.nav-by a {
  color: var(--muted);
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 16px;
  margin-left: auto;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.nav-links a:hover {
  color: var(--text);
}

.search-wrap {
  position: relative;
  flex: 0 1 290px;
  max-width: 290px;
  margin-left: auto;
}

#site-search {
  width: 100%;
  min-height: 30px;
  background: var(--panel);
  border: 1px solid var(--rule-strong);
  color: var(--text);
  padding: 5px 10px 5px 27px;
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
  outline: none;
}

#site-search:focus {
  background: #0f1110;
  border-color: #46513f;
}

#site-search::placeholder {
  color: var(--dim);
}

.search-wrap::before {
  content: "search";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  overflow: hidden;
  color: transparent;
  border: 1px solid var(--dim);
  border-radius: 50%;
}

.search-wrap::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 19px;
  width: 6px;
  height: 1px;
  background: var(--dim);
  transform: rotate(45deg);
}

#site-search-results {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: min(430px, 70vh);
  overflow: auto;
  background: #0f1110;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}

.search-hit {
  display: block;
  padding: 9px 11px;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.search-hit:last-child {
  border-bottom: 0;
}

.search-hit.active,
.search-hit:hover {
  background: var(--panel-2);
}

.search-hit-title {
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 2px;
}

.search-hit-snippet,
.search-empty {
  color: var(--muted);
  font-size: 12px;
}

.search-hit mark {
  color: var(--text);
  background: var(--accent-soft);
  padding: 0 2px;
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 48px;
  }
}

.rail {
  display: none;
}

@media (min-width: 900px) {
  .rail {
    display: block;
    position: sticky;
    top: 48px;
    align-self: start;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 24px 8px 36px 0;
  }
}

.rail h3 {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 18px 0 6px;
}

.rail h3:first-child {
  margin-top: 0;
}

.rail ul {
  list-style: none;
}

.rail li a {
  display: block;
  padding: 3px 0;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}

.rail li a:hover,
.rail li a.active {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.32);
}

.rail .b {
  margin-left: 4px;
  color: var(--dim);
  font-size: 10px;
}

.rail .b::before { content: "["; }
.rail .b::after { content: "]"; }
.rail .b.path { color: var(--green); }
.rail .b.term { color: var(--blue); }
.rail .b.risk { color: var(--red); }

.col {
  min-width: 0;
  max-width: 790px;
  padding: 24px 0 60px;
}

.page-hero {
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--rule-strong);
  margin-bottom: 18px;
}

.page-hero img {
  width: min(560px, 100%);
  height: auto;
}

.hero-grid {
  display: grid;
  gap: 18px;
  align-items: start;
}

@media (min-width: 720px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  }
}

.hero-copy h1,
.guide-header h1,
.term-header h1,
.index-header h1 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.hero-copy p,
.guide-subtitle,
.term-definition,
.index-header p,
.lede {
  color: var(--muted);
  font-size: 13.5px;
  max-width: 650px;
}

.hero-media {
  border: 1px solid var(--rule-strong);
  border-radius: var(--card-radius);
  overflow: hidden;
  background: var(--panel);
}

.hero-media img {
  width: 100%;
  aspect-ratio: 2.2 / 1;
  object-fit: contain;
  background: #050605;
}

.hero-media figcaption {
  color: var(--muted);
  font-size: 11px;
  padding: 8px 10px;
  border-top: 1px solid var(--rule);
}

.principles {
  display: grid;
  gap: 8px;
  padding: 14px 0 4px;
  margin: 18px 0 24px;
}

.principles p {
  color: var(--muted);
  font-size: 13px;
}

.principles strong {
  color: var(--text);
}

.quick-guide {
  display: grid;
  gap: 8px;
  margin: 0 0 28px;
  padding: 14px 16px;
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--card-radius);
  background: var(--panel);
}

.quick-guide .tag {
  color: var(--accent);
  font-weight: 700;
}

.quick-guide h2 {
  color: var(--text);
  font-size: 16px;
}

.quick-guide p {
  color: var(--muted);
  font-size: 13.5px;
}

.quick-guide a {
  width: fit-content;
  color: var(--link);
  font-weight: 700;
}

.block {
  margin-bottom: 32px;
}

.block > h2,
.toc h2 {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-top: 14px;
  border-top: 1px solid var(--rule-strong);
  margin-bottom: 8px;
}

.flat {
  list-style: none;
}

.flat li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 4px 0;
  font-size: 13.5px;
}

.flat li > a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.flat li > a:hover {
  color: #fff;
  text-decoration: underline;
}

.flat .desc {
  color: var(--muted);
}

.tag {
  color: var(--dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.tag.start { color: var(--green); }
.tag.money { color: var(--blue); }
.tag.security { color: var(--accent); }

@media (max-width: 680px) {
  .nav-inner {
    flex-wrap: wrap;
  }

  .nav-by,
  .nav-links {
    display: none;
  }

  .search-wrap {
    flex-basis: 100%;
    max-width: none;
    margin-left: 0;
  }

  .flat li {
    grid-template-columns: 1fr auto;
    row-gap: 0;
  }

  .flat .desc {
    grid-column: 1 / -1;
    padding-left: 12px;
  }
}

.guide-header,
.term-header,
.index-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule-strong);
  margin-bottom: 18px;
}

.badge {
  display: inline-block;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 8px 6px 0 0;
}

.toc {
  background: var(--panel);
  border: 1px solid var(--rule-strong);
  border-radius: var(--card-radius);
  padding: 12px 14px;
  margin-bottom: 22px;
}

.toc h2 {
  border-top: 0;
  padding-top: 0;
}

.term-list {
  border-top: 1px solid var(--rule-strong);
  padding-top: 20px;
  margin: 0 0 28px;
}

.term-list h2 {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.toc ol {
  list-style: none;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
  padding: 2px 0;
  color: var(--muted);
}

.toc li::before {
  content: counter(toc, decimal-leading-zero) "  ";
  color: var(--dim);
}

.toc a {
  color: var(--text);
  text-decoration: none;
}

.guide-section {
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}

.guide-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.guide-section h2 {
  color: var(--text);
  font-size: 16px;
  margin-bottom: 10px;
}

.guide-section h3 {
  color: var(--text);
  font-size: 13px;
  margin: 18px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.guide-section p,
.guide-section li,
.term-content p,
.term-content li,
.security-callout p {
  color: var(--muted);
  font-size: 13.5px;
}

.guide-section p,
.term-content p {
  margin-bottom: 10px;
}

.guide-section ul,
.guide-section ol,
.term-content ul,
.term-content ol {
  margin: 0 0 14px 18px;
}

.guide-section strong,
.term-content strong {
  color: var(--text);
}

code {
  font-family: inherit;
  background: #101210;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  color: var(--text);
  padding: 1px 5px;
}

pre {
  overflow-x: auto;
  background: #101210;
  border: 1px solid var(--rule-strong);
  border-radius: var(--card-radius);
  padding: 12px 14px;
  margin: 10px 0 16px;
}

pre code {
  padding: 0;
  border: 0;
  background: transparent;
}

.callout,
.security-callout {
  border-left: 3px solid var(--accent);
  background: var(--panel);
  padding: 12px 14px;
  margin: 16px 0;
  border-radius: 0 var(--card-radius) var(--card-radius) 0;
}

.callout strong,
.security-callout h2 {
  color: var(--text);
}

.guide-nav,
.term-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--rule-strong);
}

.guide-nav-next,
.term-nav-next {
  margin-left: auto;
}

.term-category-badge {
  display: inline-block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.term-content h2 {
  color: var(--text);
  font-size: 16px;
  margin: 22px 0 10px;
}

.term-content h3 {
  color: var(--text);
  font-size: 13px;
  margin: 18px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.related-terms {
  margin-top: 22px;
}

.related-terms h2 {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.related-grid,
.term-grid {
  display: grid;
  gap: 8px;
}

@media (min-width: 680px) {
  .related-grid,
  .term-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.term-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--rule-strong);
  border-radius: var(--card-radius);
  padding: 11px 12px;
  text-decoration: none;
}

.term-card:hover {
  background: var(--panel-2);
}

.term-card h3 {
  color: var(--text);
  font-size: 13px;
  margin-bottom: 3px;
}

.term-card p {
  color: var(--muted);
  font-size: 12.5px;
}

.alpha {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 16px 0 24px;
}

.alpha a,
.alpha span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  text-decoration: none;
  font-size: 12px;
}

.alpha span {
  color: var(--dim);
}

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 40px;
  padding: 16px 20px;
  color: var(--dim);
  text-align: center;
  font-size: 12px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}
