/* blog: listing + article pages (loads after site.css) */
.post-wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* shared ambient header — reuses .hero-bg / .orb / .grid from site.css, bleeding full width */
.blog-head, .article-head { position: relative; isolation: isolate; }
.blog-head .hero-bg, .article-head .hero-bg {
  left: 50%; right: auto; width: 100vw; transform: translateX(-50%); top: -68px; bottom: -80px;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
.article-head .o1 { width: 520px; height: 520px; right: -60px; top: -200px; }
.article-head .o2 { width: 420px; height: 420px; right: auto; left: -120px; top: 40px; }
.blog-head > .wrap > *, .article-head > :not(.hero-bg) { animation: rise 1s var(--ease) both; }
.blog-head > .wrap > :nth-child(2), .article-head > :nth-child(3) { animation-delay: .07s; }
.blog-head > .wrap > :nth-child(3), .article-head > :nth-child(4) { animation-delay: .14s; }
.article-head > :nth-child(5) { animation-delay: .21s; }
.article-head > :nth-child(6) { animation-delay: .28s; }

/* listing */
.blog-head { padding: 120px 0 64px; }
.blog-head h1 { font-size: clamp(56px, 9vw, 104px); font-weight: 700; letter-spacing: -.05em; line-height: .98; }
.blog-head p { font: 500 clamp(19px, 2.2vw, 24px)/1.4 var(--font-display); color: var(--ink-soft); margin: 20px 0 0; letter-spacing: -.02em; max-width: 32em; }
.post-grid { list-style: none; margin: 0 0 120px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.post-tile {
  display: flex; flex-direction: column; height: 100%; padding: 14px 14px 28px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 26px; position: relative; overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s;
}
.post-tile:hover { text-decoration: none; transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.post-tile > :not(.cover) { margin-left: 14px; margin-right: 14px; }
.post-tile h2 { font-size: clamp(22px, 2.4vw, 27px); letter-spacing: -.03em; line-height: 1.15; margin-top: 10px; margin-bottom: 10px; transition: color .2s; }
.post-tile:hover h2 { color: var(--accent); }
.post-tile p { color: var(--ink-soft); font-size: 16px; margin-bottom: 18px; }
.post-tile .tags { margin-bottom: 4px; }
.post-tile .more { color: var(--accent); font-weight: 500; font-size: 15px; margin-top: auto; padding-top: 20px; display: inline-flex; align-items: center; gap: 8px; }
.post-tile .more i { transition: transform .25s var(--ease); }
.post-tile:hover .more i { transform: translateX(4px); }
.post-meta { font-size: 14px; color: var(--ink-faint); display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 22px; }
.post-meta time { color: var(--ink-soft); font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 820px) { .post-grid { grid-template-columns: 1fr; } .blog-head { padding: 96px 0 48px; } }

/* post covers (listing tiles + "keep reading") */
.cover { position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 18px; color: #fff; isolation: isolate; }
.post-tile .cover { aspect-ratio: 16 / 8; transition: transform .6s var(--ease); }
.post-tile:hover .cover { transform: scale(1.015); }
.cover-migrate { background: radial-gradient(120% 140% at 0% 0%, #2997ff 0%, #4b47d6 45%, #1c1a5e 100%); }
.cover-btc { background: radial-gradient(120% 140% at 100% 0%, #ffb340 0%, #f7931a 40%, #7a3a00 100%); }
.cover::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 28px 28px; }
.cover-art { width: 82%; height: auto; overflow: visible; }
.cover-art .ln { fill: none; stroke: rgba(255,255,255,.45); stroke-width: 2; }
.cover-art .nd { fill: rgba(255,255,255,.12); stroke: rgba(255,255,255,.55); stroke-width: 1.5; }
.cover-art .nd.hl { fill: rgba(255,255,255,.3); stroke: #fff; }
.cover-art .dotp { fill: #fff; filter: drop-shadow(0 0 6px #fff); }
.cover-art .dotp.dim { opacity: .55; }
.cover-btc > .fa { font-size: 72px; position: relative; filter: drop-shadow(0 10px 24px rgba(0,0,0,.3)); transition: transform .6s var(--ease); }
.post-tile:hover .cover-btc > .fa { transform: rotate(-10deg) scale(1.06); }
.hashes { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 14px; overflow: hidden; z-index: -1; }
.hashes span { font: 500 15px ui-monospace, "SF Mono", Menlo, monospace; color: rgba(255,255,255,.2); white-space: nowrap; animation: hashflow 18s linear infinite; }
.hashes span:nth-child(2) { animation-duration: 24s; animation-direction: reverse; }
.hashes span:nth-child(3) { animation-duration: 21s; }
@keyframes hashflow { from { transform: translateX(-30%); } to { transform: translateX(10%); } }

/* article header */
.article-head { padding: 88px 0 44px; }
.crumb { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--ink-soft); transition: color .2s, border-color .2s; }
.crumb:hover { text-decoration: none; color: var(--ink); border-color: var(--line-strong); }
.crumb i { font-size: 12px; transition: transform .2s var(--ease); }
.crumb:hover i { transform: translateX(-3px); }
.article-head h1 { font-size: clamp(38px, 6vw, 62px); font-weight: 700; letter-spacing: -.045em; line-height: 1.03; margin: 22px 0 20px; }
.dek { font: 500 clamp(19px, 2.3vw, 23px)/1.42 var(--font-display); color: var(--ink-soft); letter-spacing: -.02em; margin: 0 0 28px; }
.byline { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-faint); padding-top: 22px; border-top: 1px solid var(--line); }
.byline b { color: var(--ink); font-weight: 600; display: block; font-size: 15px; }
.byline .brand-mark { width: 40px; height: 40px; border-radius: 11px; font-size: 13px; flex: none; background: var(--grad); color: #fff; }
.tags.inline { margin-top: 18px; }

/* floating "On this page" — wide screens only */
.toc { display: none; }
@media (min-width: 1300px) {
  .toc {
    display: block; position: fixed; top: 120px; left: calc(50% + 392px); width: 220px; z-index: 5;
    opacity: 0; transform: translateX(-8px); pointer-events: none; transition: opacity .4s, transform .4s var(--ease);
  }
  .toc.show { opacity: 1; transform: none; pointer-events: auto; }
}
.toc p { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; font-size: 13.5px; line-height: 1.35; color: var(--ink-faint); transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.active { color: var(--ink); border-left-color: var(--accent); font-weight: 500; }

/* prose */
.prose { font-size: 18px; line-height: 1.72; letter-spacing: -.014em; padding-bottom: 40px; }
.prose > * { margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose p { color: var(--ink); }
.prose a:not(.anchor) { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; transition: text-decoration-color .2s; }
.prose a:not(.anchor):hover { text-decoration-color: var(--accent); }
.prose h2 { font-size: 31px; letter-spacing: -.032em; margin-top: 2.3em; line-height: 1.15; position: relative; scroll-margin-top: 96px; }
.prose h3 { font-size: 21px; letter-spacing: -.02em; margin-top: 1.8em; }
.anchor { margin-left: 10px; color: var(--ink-faint); font-weight: 500; opacity: 0; transition: opacity .2s, color .2s; }
.prose h2:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--accent); text-decoration: none; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 0; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 600; }
.prose code { font: 500 .86em ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--line); padding: .1em .4em; border-radius: 6px; }

/* code blocks (wrapped in .code by post.js) */
.code { border-radius: 16px; overflow: hidden; background: #1d1d1f; border: 1px solid #2c2c30; box-shadow: var(--shadow-sm); }
.code-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.03); }
.code-dots { display: flex; gap: 6px; }
.code-dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.code-dots i:nth-child(2) { background: #febc2e; }
.code-dots i:nth-child(3) { background: #28c840; }
.code-lang { font-size: 12px; font-weight: 500; color: #8e8e93; }
.code-copy { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--font); color: #a1a1a6; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: 5px 10px; cursor: pointer; transition: color .2s, background .2s; }
.code-copy:hover { color: #fff; background: rgba(255,255,255,.12); }
.prose pre { margin: 0; background: transparent; color: #f5f5f7; padding: 18px 22px 20px; overflow-x: auto; font: 13.5px/1.65 ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace; letter-spacing: 0; }
:root[data-theme="dark"] .code { background: #111113; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .code { background: #111113; } }
.prose pre code { background: none; border: 0; padding: 0; font: inherit; color: inherit; }
.prose pre .c { color: #8e8e93; }
.prose pre .k { color: #6bb8ff; }
.prose pre .v { color: #ffd479; }
.code-cap { font-size: 14px; color: var(--ink-faint); margin-top: .7em !important; }

/* callouts */
.tldr { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; overflow: hidden; box-shadow: var(--shadow-sm); }
.tldr::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.tldr h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 12px; font-family: var(--font); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; }
.tldr ul { margin: 0; }
.callout { position: relative; font: 600 clamp(20px, 2.4vw, 24px)/1.4 var(--font-display); letter-spacing: -.022em; color: var(--ink) !important; padding: 28px 0 28px 30px; margin-top: 1.6em !important; margin-bottom: .4em !important; }
.callout::before { content: ""; position: absolute; left: 0; top: 28px; bottom: 28px; width: 4px; border-radius: 4px; background: var(--grad); }

/* figures */
figure { margin: 2em 0 0; }
.diagram { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram .box { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.5; }
.diagram .box.hl { fill: var(--accent-soft); stroke: var(--accent); }
.diagram .t { fill: var(--ink); font: 600 15px var(--font); }
.diagram .s { fill: var(--ink-faint); font: 400 12.5px var(--font); }
.diagram .lbl { fill: var(--ink-soft); font: 500 12.5px var(--font); }
.diagram .line { stroke: var(--ink-faint); stroke-width: 1.6; fill: none; }
.diagram .line.live { stroke: var(--accent); stroke-width: 2; }
.diagram .line.dash { stroke-dasharray: 6 5; animation: flow 1.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -11; } }
.diagram .arrow { fill: var(--ink-faint); }
.diagram .arrow.live { fill: var(--accent); }
figcaption { font-size: 14px; color: var(--ink-faint); margin-top: 12px; text-align: center; }

.phases { list-style: none; padding: 0 !important; counter-reset: phase; display: grid; gap: 12px; }
.phases li { counter-increment: phase; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 18px 66px; position: relative; margin: 0 !important; transition: border-color .3s, transform .3s var(--ease); }
.phases li:hover { border-color: var(--line-strong); transform: translateX(4px); }
.phases li::before { content: counter(phase); position: absolute; left: 20px; top: 18px; width: 30px; height: 30px; border-radius: 10px; background: var(--grad); color: #fff; font: 600 14px/30px var(--font); text-align: center; }
.phases b { display: block; font-weight: 600; }
.phases span { color: var(--ink-soft); font-size: 16px; }

/* traffic ramp: bars grow when revealed */
.ramp { display: flex; gap: 6px; align-items: flex-end; height: 130px; padding: 22px 0 0; }
.ramp div { flex: 1; background: var(--grad); border-radius: 8px 8px 2px 2px; position: relative; min-width: 0; transform-origin: bottom; transform: scaleY(0); transition: transform .9s var(--ease); }
.ramp div:nth-child(2) { transition-delay: .08s; } .ramp div:nth-child(3) { transition-delay: .16s; } .ramp div:nth-child(4) { transition-delay: .24s; }
.ramp div:nth-child(5) { transition-delay: .32s; } .ramp div:nth-child(6) { transition-delay: .4s; } .ramp div:nth-child(7) { transition-delay: .48s; }
.reveal.in .ramp div, figure:not(.reveal) .ramp div { transform: none; }
.ramp div span { position: absolute; top: -22px; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.ramp-cap { display: flex; gap: 6px; font-size: 12px; color: var(--ink-faint); text-align: center; margin-top: 8px; }
.ramp-cap span { flex: 1; min-width: 0; }

/* masked order receipt */
.receipt { max-width: 440px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; font-size: 15px; box-shadow: var(--shadow); position: relative; }
.receipt::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(90deg, #ffb340, #f7931a); }
.receipt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 14px; border-bottom: 1px dashed var(--line-strong); font-size: 13px; color: var(--ink-faint); }
.receipt-logo { font: 700 15px var(--font-display); letter-spacing: .12em; color: var(--ink); }
.receipt dl { margin: 14px 0 0; display: grid; gap: 6px; }
.receipt dl div { display: flex; justify-content: space-between; gap: 12px; }
.receipt dt { color: var(--ink-faint); }
.receipt dd { margin: 0; display: flex; align-items: center; gap: 8px; }
.receipt .dots { letter-spacing: .1em; color: var(--ink-faint); }
.receipt ul { list-style: none; padding: 14px 0 0 !important; margin: 14px 0 0; border-top: 1px dashed var(--line-strong); display: grid; gap: 8px; }
.receipt li { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 !important; }
.receipt li span:last-child { color: var(--ink-faint); }
.receipt-total { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-strong); font-weight: 600; }
.redact { display: inline-block; width: 56px; height: 14px; border-radius: 4px; background: repeating-linear-gradient(135deg, var(--ink-faint) 0 4px, var(--line-strong) 4px 8px); opacity: .55; }
.redact.wide { width: 84px; }

/* end of article */
.author-card { display: flex; gap: 18px; align-items: center; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 32px 0 20px; }
.author-card .brand-mark { width: 54px; height: 54px; border-radius: 15px; font-size: 17px; flex: none; background: var(--grad); color: #fff; }
.author-card p { margin: 4px 0 0; color: var(--ink-soft); font-size: 15px; }
.author-card b { font-size: 17px; }
.next-post { display: flex; align-items: center; gap: 20px; padding: 12px 24px 12px 12px; margin: 0 0 112px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s; }
.next-post:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.next-post .cover { width: 112px; height: 84px; flex: none; font-size: 30px; border-radius: 14px; }
.next-post .cover > .fa { font-size: 30px; }
.next-body { display: grid; gap: 2px; min-width: 0; }
.next-body .meta { margin: 0; }
.next-body b { font: 600 18px/1.3 var(--font-display); letter-spacing: -.02em; transition: color .2s; }
.next-post:hover b { color: var(--accent); }
.next-arrow { margin-left: auto; color: var(--accent); transition: transform .25s var(--ease); flex: none; }
.next-post:hover .next-arrow { transform: translateX(4px); }

@media (max-width: 600px) {
  .prose { font-size: 17px; }
  .code { margin-left: -24px; margin-right: -24px; border-radius: 0; border-left: 0; border-right: 0; }
  .prose pre { font-size: 12.5px; }
  .author-card { flex-direction: column; align-items: flex-start; }
  .diagram { overflow-x: auto; padding: 14px; }
  .diagram svg { min-width: 560px; }
  .next-post { padding: 12px 16px 12px 12px; gap: 14px; }
  .next-post .cover { width: 72px; height: 72px; font-size: 24px; }
  .next-body b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .ramp div { transform: none; }
}
