@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  --bg: #06070b;
  --bg-2: #0a0c12;
  --surface: #0f1219;
  --surface-2: #161a23;
  --surface-3: #1d2230;
  --text: #f3f5f9;
  --muted: #98a2b3;
  --faint: #667085;
  --line: #222838;
  --line-2: #2d3548;
  --mint: #22e5c7;
  --violet: #8b6cff;
  --pink: #f06bd0;
  --brand: #3fe9d0;
  --grad: linear-gradient(100deg, #22e5c7 0%, #6ea8ff 45%, #8b6cff 75%, #f06bd0 100%);
  --grad-soft: linear-gradient(135deg, rgba(34, 229, 199, .14), rgba(139, 108, 255, .14));
  --ok: #3ddc84;
  --ok-soft: rgba(61, 220, 132, .12);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, .1);
  --bad: #ff6b6b;
  --radius: 16px;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Space Grotesk", Inter, -apple-system, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); overflow-x: hidden; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(139, 108, 255, .45); }
code, pre { font-family: var(--mono); font-size: .86em; }
code { background: var(--surface-2); padding: .12em .4em; border-radius: 6px; border: 1px solid var(--line); }
pre { background: #0b0e15; padding: 16px 18px; border-radius: 12px; overflow-x: auto; line-height: 1.55; border: 1px solid var(--line); color: #d7def0; }
pre code { background: none; padding: 0; border: 0; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -.02em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------- header ---------------- */
header.site { position: sticky; top: 0; z-index: 50; background: rgba(6, 7, 11, .72); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid rgba(255, 255, 255, .06); }
header.site .wrap { display: flex; align-items: center; gap: 18px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font: 700 20px var(--display); color: var(--text); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo svg { width: 30px; height: 30px; }
nav.main { display: flex; gap: 2px; margin-left: auto; align-items: center; }
nav.main a { color: var(--muted); padding: 8px 12px; border-radius: 999px; font-size: 14.5px; font-weight: 500; }
nav.main a:hover, nav.main a.active { color: var(--text); background: rgba(255, 255, 255, .06); text-decoration: none; }
nav.main a.cta { background: var(--text); color: #07080c; margin-left: 8px; font-weight: 600; padding: 8px 16px; }
nav.main a.cta:hover { background: #fff; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: 999px; padding: 7px 14px; font: 500 14px var(--sans); cursor: pointer; }
@media (max-width: 980px) {
  .menu-btn { display: block; }
  nav.main { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--bg-2); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 12px 16px 18px; }
  nav.main.open { display: flex; }
  nav.main a.cta { margin: 8px 0 0; text-align: center; }
}

/* ---------------- sections ---------------- */
.hero { padding: 88px 0 56px; position: relative; }
.hero h1 { font-size: clamp(40px, 7vw, 92px); line-height: .98; margin: 0 0 24px; letter-spacing: -.045em; font-weight: 700; }
.hero p.lead { font-size: clamp(17px, 1.6vw, 21px); color: var(--muted); max-width: 640px; margin: 0 0 34px; line-height: 1.55; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 18px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); font-size: 13.5px; color: var(--muted); margin-bottom: 26px; }
.pill b { background: var(--grad); color: #07080c; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
section { padding: 64px 0; }
section h2 { font-size: clamp(30px, 4vw, 52px); line-height: 1.04; margin: 0 0 14px; letter-spacing: -.035em; }
section .sub { color: var(--muted); margin: 0 0 36px; max-width: 700px; font-size: 18px; }
.kicker { font: 600 13px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font: 600 15px var(--sans); border: 1px solid var(--line-2); color: var(--text); background: rgba(255, 255, 255, .03); cursor: pointer; transition: transform .15s, background .15s, border-color .15s; }
.btn:hover { text-decoration: none; border-color: #4a5570; background: rgba(255, 255, 255, .07); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--grad); border: 0; color: #07080c; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.white { background: var(--text); color: #07080c; border-color: var(--text); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 8px 14px; font-size: 14px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { position: relative; background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--line-2); }
.card h3 { margin: 0 0 8px; font-size: 21px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.card .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--grad-soft); border: 1px solid rgba(139, 108, 255, .3); color: var(--brand); display: grid; place-items: center; margin-bottom: 18px; }
.card .icon svg { width: 22px; height: 22px; }
.card.glow::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; pointer-events: none; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; margin-top: 14px; }
.tag.live { background: var(--ok-soft); color: var(--ok); }
.tag.soon { background: var(--warn-soft); color: var(--warn); }
.note { background: var(--warn-soft); border: 1px solid rgba(255, 181, 71, .25); color: var(--text); border-radius: 12px; padding: 14px 18px; font-size: 15px; }
.note b { color: var(--warn); }
.note.ok { background: var(--ok-soft); border-color: rgba(61, 220, 132, .25); }
.note.ok b { color: var(--ok); }
.note.bad { background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .3); }
.note.bad b { color: var(--bad); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.num { font-variant-numeric: tabular-nums; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps > li { counter-increment: s; position: relative; padding: 20px 22px 20px 72px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.steps > li::before { content: counter(s); position: absolute; left: 20px; top: 19px; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #07080c; font: 700 15px var(--display); display: grid; place-items: center; }
.steps h4 { margin: 0 0 6px; font-size: 18px; }
.steps p { margin: 0 0 10px; color: var(--muted); font-size: 15.5px; }

/* ---------------- footer ---------------- */
footer.site { border-top: 1px solid var(--line); padding: 56px 0 40px; color: var(--muted); font-size: 14.5px; margin-top: 56px; background: var(--bg-2); }
footer.site .cols { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; }
@media (max-width: 860px) { footer.site .cols { grid-template-columns: 1fr 1fr; } }
footer.site h5 { color: var(--text); font: 600 14px var(--sans); margin: 0 0 12px; }
footer.site ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--text); }
footer.site .legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------------- home ---------------- */
.hero-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: 40px; align-items: center; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; } .orb { max-width: 360px; margin: 0 auto; } }
.bg-glow { position: absolute; inset: -120px 0 auto 0; height: 700px; background: radial-gradient(600px 380px at 75% 30%, rgba(139, 108, 255, .22), transparent 70%), radial-gradient(520px 340px at 20% 20%, rgba(34, 229, 199, .14), transparent 70%); pointer-events: none; z-index: -1; }
.grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at 60% 30%, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 60% 30%, #000 20%, transparent 70%); pointer-events: none; z-index: -1; }
.orb svg { width: 100%; height: auto; display: block; }
.orb .dash { animation: dash 6s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -40; } }
@media (prefers-reduced-motion: reduce) { .orb .dash { animation: none; } .orb .traveler { display: none; } }
.orb .spin { transform-origin: 200px 200px; animation: spin 26s linear infinite; }
.orb .spin2 { transform-origin: 200px 200px; animation: spin 40s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .orb .spin, .orb .spin2 { animation: none; } }
.statband { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.statband > div { padding: 24px 26px; border-right: 1px solid var(--line); }
.statband > div:last-child { border-right: 0; }
.statband .big { font: 700 clamp(28px, 3.4vw, 44px) var(--display); letter-spacing: -.03em; line-height: 1.1; }
.statband .lbl { color: var(--muted); font-size: 14px; margin-top: 4px; }
.statband .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; box-shadow: 0 0 0 4px var(--ok-soft); vertical-align: middle; }
@media (max-width: 760px) { .statband { grid-template-columns: 1fr 1fr; } .statband > div:nth-child(2) { border-right: 0; } .statband > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.feature-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.feature-list li { display: flex; gap: 12px; color: var(--muted); }
.feature-list li::before { content: ""; flex: 0 0 20px; height: 20px; margin-top: 3px; border-radius: 50%; background: var(--grad); -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.5 14.2L4.3 10l1.4-1.4 2.8 2.8 5.8-5.8 1.4 1.4-7.2 7.2z"/></svg>') center/contain no-repeat; mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.5 14.2L4.3 10l1.4-1.4 2.8 2.8 5.8-5.8 1.4 1.4-7.2 7.2z"/></svg>') center/contain no-repeat; }
.feature-list b { color: var(--text); }
.bigstat { font: 700 clamp(56px, 10vw, 140px) var(--display); letter-spacing: -.05em; line-height: .95; }
.cta-panel { border-radius: 24px; padding: clamp(32px, 6vw, 64px); background: radial-gradient(500px 260px at 90% 0%, rgba(139, 108, 255, .35), transparent 70%), radial-gradient(500px 260px at 0% 100%, rgba(34, 229, 199, .25), transparent 70%), var(--surface); border: 1px solid var(--line-2); }
.cta-panel h2 { margin-bottom: 12px; }
.card .num-big { font: 700 44px var(--display); letter-spacing: -.03em; line-height: 1; margin-bottom: 10px; }

/* ---------------- explorer / wallet ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.stat .k { font-size: 12.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font: 700 24px var(--display); font-variant-numeric: tabular-nums; margin-top: 2px; overflow-wrap: anywhere; letter-spacing: -.02em; }
.stat .v.small { font: 600 16px var(--sans); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); margin-right: 6px; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { background: var(--bad); }
.mono { font-family: var(--mono); font-size: 13.5px; }
.trunc { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
input[type=text], input[type=password], input[type=number] { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #0b0e15; color: var(--text); font: 15px var(--sans); outline: none; }
input.mono-in { font: 14px var(--mono); }
input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 108, 255, .2); }
label.f { display: block; font-size: 13.5px; color: var(--muted); margin: 14px 0 6px; font-weight: 500; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > input { flex: 1 1 320px; }
#acct-out pre { max-height: 420px; }

/* ---------------- paper ---------------- */
.paper { font-family: var(--serif); font-size: 18px; line-height: 1.7; color: #e3e7ef; }
.paper h1 { font-family: var(--serif); font-size: 36px; line-height: 1.2; text-align: center; margin: 56px 0 12px; letter-spacing: -.01em; }
.paper .authors { text-align: center; color: var(--muted); font-family: var(--sans); font-size: 15px; margin-bottom: 32px; }
.paper .abstract { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 26px; margin: 0 0 16px; }
.paper .abstract h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .1em; font-family: var(--sans); margin: 0 0 8px; }
.paper .keywords { font-size: 15px; color: var(--muted); margin-bottom: 30px; }
.paper h2 { font-family: var(--serif); font-size: 25px; margin: 40px 0 10px; letter-spacing: 0; line-height: 1.3; }
.paper h3 { font-family: var(--serif); font-size: 20px; margin: 24px 0 6px; font-style: italic; font-weight: 600; letter-spacing: 0; }
.paper .eq { text-align: center; font-style: italic; margin: 16px 0; overflow-x: auto; }
.paper .eq span.n { float: right; font-style: normal; color: var(--muted); }
.paper table { font-family: var(--sans); font-size: 14.5px; }
.paper .caption { font-family: var(--sans); font-size: 13.5px; color: var(--muted); margin: 8px 0 24px; }
.paper .def { border-left: 3px solid var(--violet); padding: 4px 0 4px 16px; margin: 14px 0; }
.paper ol.refs { font-size: 15px; padding-left: 26px; }
.toc { font-family: var(--sans); font-size: 14.5px; columns: 2; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 22px 16px 40px; }
@media (max-width: 640px) { .toc { columns: 1; } }
svg.diagram { width: 100%; height: auto; }
svg.diagram text { font-family: var(--sans); fill: var(--text); }
svg.diagram .box { fill: var(--surface); stroke: var(--line-2); }
svg.diagram .box.accent { fill: #151a2b; stroke: var(--violet); }
svg.diagram .arrow { stroke: var(--faint); fill: none; stroke-width: 1.5; }
svg.diagram .muted { fill: var(--muted); }

/* ---------------- learn (bitcoin.org-style) ---------------- */
.toc-side { position: sticky; top: 90px; align-self: start; display: grid; gap: 4px; font-size: 14.5px; }
.toc-side a { color: var(--muted); padding: 6px 12px; border-radius: 8px; border-left: 2px solid var(--line); }
.toc-side a:hover { color: var(--text); text-decoration: none; background: rgba(255, 255, 255, .04); }
.learn { display: grid; grid-template-columns: 220px 1fr; gap: 48px; }
@media (max-width: 900px) { .learn { grid-template-columns: 1fr; } .toc-side { position: static; } }
.know { display: grid; gap: 14px; }
.know .card h3 { font-size: 18px; }
