:root {
  --accent: #468ef9;
  --gold: #7c5cff;
  --on-accent: #000;
  --radius: 14px;
  --max: 1180px;
  --sans: Inter, "Segoe UI", sans-serif;
  --display: Outfit, Inter, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
html[data-theme="dark"], html:not([data-theme]) {
  color-scheme: dark;
  --bg: #000;
  --ink: #fff;
  --muted: rgba(255, 255, 255, 0.58);
  --faint: rgba(255, 255, 255, 0.38);
  --surface: #111;
  --record: #0a0a0a;
  --record-ink: #fff;
  --record-muted: rgba(255, 255, 255, 0.72);
  --record-line: rgba(70, 142, 249, 0.35);
  --line: rgba(255, 255, 255, 0.08);
  --hover: rgba(255, 255, 255, 0.06);
  --note-bg: rgba(70, 142, 249, 0.12);
  --essay: rgba(255, 255, 255, 0.72);
  --scrim: rgba(0, 0, 0, 0.62);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  --lift: 0 12px 30px rgba(0, 0, 0, 0.28);
  --field: #0a0a0a;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #fff;
  --ink: #0a0a0a;
  --muted: rgba(10, 10, 10, 0.62);
  --faint: rgba(10, 10, 10, 0.4);
  --surface: #f6f6f6;
  --record: #0a0a0a;
  --record-ink: #fff;
  --record-muted: rgba(255, 255, 255, 0.78);
  --record-line: rgba(70, 142, 249, 0.35);
  --line: rgba(10, 10, 10, 0.1);
  --hover: rgba(10, 10, 10, 0.04);
  --note-bg: rgba(70, 142, 249, 0.1);
  --essay: rgba(10, 10, 10, 0.72);
  --scrim: rgba(16, 14, 12, 0.28);
  --shadow: 0 10px 40px rgba(16, 14, 12, 0.08);
  --lift: 0 12px 30px rgba(16, 14, 12, 0.06);
  --field: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
.skip { position: absolute; left: 16px; top: -40px; background: var(--record); color: var(--record-ink); padding: 8px 12px; z-index: 40; }
.skip:focus { top: 12px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.wrap { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
main { position: relative; z-index: 1; padding-top: 108px; }

.nav-scrim {
  position: fixed; inset: 0; z-index: 20;
  background: var(--scrim);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
body.nav-open { overflow: hidden; }
.top { position: fixed; z-index: 30; top: 16px; left: 0; right: 0; display: flex; justify-content: center; padding: 0 20px; }
.nav-shell {
  width: min(var(--max), 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.bar-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.bar-links a {
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: 15px;
  padding: 8px 12px; border-radius: 999px;
}
.bar-links a:hover, .bar-links a[aria-current="page"] { color: var(--accent); background: var(--hover); }
.nav-bar { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 18px 0 16px; gap: 8px; }
.brand, .footer-logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -0.04em;
}
.brand img, .footer-logo img { width: 34px; height: 34px; display: block; object-fit: contain; }
.footer-logo img { width: 48px; height: 48px; }
.nav-actions { display: flex; align-items: center; gap: 2px; }
.theme-toggle {
  width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent;
  color: var(--ink); display: grid; place-items: center; cursor: pointer;
}
.theme-toggle:hover { background: var(--hover); }
.theme-toggle svg { width: 18px; height: 18px; }
html[data-theme="dark"] .icon-moon, html:not([data-theme]) .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
.nav-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent; border: 0; padding: 8px; cursor: pointer; color: var(--ink);
}
.nav-bars { position: relative; width: 28px; height: 16px; }
.nav-bars i {
  position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.nav-bars i:first-child { top: 3px; }
.nav-bars i:last-child { bottom: 3px; }
.is-open .nav-bars i:first-child { top: 7px; transform: rotate(45deg); }
.is-open .nav-bars i:last-child { bottom: 7px; transform: rotate(-45deg); }
.nav-words { display: inline-grid; font-family: var(--display); font-size: 16px; }
.nav-words span { grid-area: 1 / 1; transition: transform 0.35s ease, opacity 0.35s ease; }
.nav-words span:last-child { opacity: 0; transform: translateY(80%); }
.is-open .nav-words span:first-child { opacity: 0; transform: translateY(-80%); }
.is-open .nav-words span:last-child { opacity: 1; transform: none; }
.nav-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.is-open .nav-panel { grid-template-rows: 1fr; }
.nav-panel-inner { overflow: hidden; }
.is-open .nav-panel-inner { overflow: auto; max-height: calc(100dvh - 96px); }
.nav-links {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  padding: 8px 22px 22px; border-top: 1px solid var(--line);
}
.nav-group p { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.nav-group a {
  display: block; text-decoration: none; padding: 10px 12px; border-radius: 10px;
  transform: translateY(12px); opacity: 0;
  transition: background 0.2s ease, transform 0.45s ease, opacity 0.45s ease;
}
.is-open .nav-group a { transform: none; opacity: 1; }
.nav-group a:hover { background: var(--hover); transform: translateX(6px); }
.nav-group a[aria-current="page"] strong { color: var(--accent); }
.nav-group strong { display: block; font-family: var(--display); font-weight: 500; letter-spacing: -0.03em; font-size: 17px; }
.nav-group span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

.hero { position: relative; padding: 12px 0 8px; overflow: hidden; }
.hero-dither { position: absolute; top: 0; right: 0; width: min(46vw, 640px); height: 420px; pointer-events: none; }
.hero-inner { position: relative; z-index: 1; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.pill, .badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
}
.pill i, .badge i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.6); animation: live 2.2s ease-out infinite;
}
h1, h2, h3 {
  margin: 0; font-family: var(--display); font-weight: 500; letter-spacing: -0.045em; color: var(--ink); line-height: 1.02;
}
h1 { font-size: clamp(2.6rem, 4.6vw, 4.6rem); max-width: 16ch; }
.accent, .grad { color: var(--accent); }
.lede { color: var(--muted); font-size: 18px; max-width: 42em; margin: 18px 0 0; }
.lede a, .panel a, .essay a { color: var(--accent); }
.eyebrow, .crumbs {
  margin: 0 0 14px; color: var(--accent); letter-spacing: 0.14em; font-size: 12px; text-transform: uppercase; font-weight: 650;
}
.crumbs { color: var(--faint); }
.crumbs a { color: var(--faint); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.page-hero { padding: 8px 0 0; }
.page-hero h1 { font-size: clamp(2.4rem, 4vw, 4rem); }
.section { padding: 28px 0 72px; }
.detail { padding-bottom: 72px; }
.detail h1 { font-size: clamp(1.8rem, 3vw, 2.8rem); max-width: none; word-break: break-word; }

.search { display: flex; gap: 10px; margin-top: 22px; max-width: 760px; }
.search input {
  flex: 1; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
}
.note {
  margin: 14px 0; padding: 14px 16px; border-radius: 12px;
  background: var(--note-bg); box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.28); color: var(--muted);
}
.note.bad { box-shadow: inset 0 0 0 1px rgba(255, 90, 70, 0.5); color: #ffb4a8; }
html[data-theme="light"] .note.bad { color: #8a2a16; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.metric {
  background: var(--surface); border-radius: 18px; padding: 18px 18px 16px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.metric strong {
  display: block; font-family: var(--display); font-size: clamp(22px, 2vw, 32px);
  letter-spacing: -0.04em; font-weight: 500; line-height: 1.05;
}
.metric span { display: block; margin-top: 8px; color: var(--faint); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

.table-wrap, .kv {
  overflow-x: auto; border-radius: 18px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-wrap th { white-space: nowrap; word-break: normal; }
.table-wrap td { overflow-wrap: break-word; word-break: normal; vertical-align: top; }
.table-wrap td .btn { margin: 0 6px 6px 0; }
th {
  text-align: left; color: var(--faint); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 12px; padding: 14px 16px; border-top: 0;
}
td { padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: top; }
td a, .mono, .kv a { color: var(--accent); text-decoration: none; }
td a:hover, .kv a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.pager a { color: var(--accent); text-decoration: none; font-weight: 600; }

.kv { display: grid; grid-template-columns: 200px 1fr; }
.kv .k, .kv .v { padding: 14px 16px; border-top: 1px solid var(--line); }
.kv .k { color: var(--faint); font-size: 13px; }
.kv .k:nth-child(-n+2), .kv .v:nth-child(-n+2) { border-top: 0; }

.stack { display: grid; gap: 14px; }
.panel, .card {
  background: var(--surface); border-radius: 22px; padding: 22px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.panel h2, .panel h3 {
  margin: 0 0 12px; font-size: clamp(1.6rem, 2vw, 2rem); max-width: none;
}
.panel p, .essay p, .essay li { color: var(--essay); }
.essay { max-width: 72ch; }
.essay h2 { margin: 28px 0 10px; font-size: 2rem; max-width: none; }
.essay p { font-size: 17px; line-height: 1.7; margin: 0 0 14px; }
.essay a { color: var(--accent); }
.empty { color: var(--muted); margin: 0 0 12px; }

.form { display: grid; gap: 10px; }
.form label, .form .k { color: var(--faint); font-size: 13px; margin: 0; }
.form input, .form textarea, .form select, .search input {
  width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.search input { width: auto; }
.form textarea { resize: vertical; min-height: 88px; }
[data-wallet-compile-status] { white-space: pre-wrap; }
[data-wallet-compile-status].bad { color: #ffb4a8; }
html[data-theme="light"] [data-wallet-compile-status].bad { color: #8a2a16; }
.form select { appearance: none; }
.actions, .tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; border-radius: 10px; padding: 12px 16px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink);
}
.btn.solid, .tabs .btn[aria-selected="true"], .post-tabs button[aria-selected="true"] {
  border: 0; background: var(--accent); color: var(--on-accent); font-weight: 650;
}
button:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.balance {
  margin: 0; font-family: var(--display); font-size: clamp(36px, 4vw, 52px);
  letter-spacing: -0.045em; font-weight: 500; color: var(--ink);
}
.seed {
  margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--field);
  box-shadow: inset 0 0 0 1px var(--line); color: var(--accent);
  font-family: var(--mono); font-size: 13px; white-space: pre-wrap; word-break: break-all;
}
details.panel summary { cursor: pointer; font-family: var(--display); font-size: 1.4rem; letter-spacing: -0.03em; }
.tx-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.tx-list a { color: var(--accent); text-decoration: none; font-family: var(--mono); font-size: 13px; }

.wallet-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; }
.wallet-side { display: grid; gap: 4px; padding: 14px; position: sticky; top: 108px; }
.wallet-side .k { margin: 12px 0 4px; color: var(--faint); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.wallet-side .k:first-child { margin-top: 0; }
.wallet-side button, .wallet-side .side-link {
  display: block; width: 100%; text-align: left; background: transparent; color: var(--ink);
  border: 0; border-radius: 10px; padding: 10px 12px; font: inherit; cursor: pointer; text-decoration: none;
}
.wallet-side button[aria-selected="true"], .wallet-side .side-link[aria-current="page"] {
  background: var(--hover); color: var(--accent);
}
.wallet-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr); gap: 14px; align-items: start; }
.file-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--field); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer;
}
input[data-wallet-file] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0;
}

.footer { position: relative; z-index: 1; background: var(--accent); color: #1a0f00; padding: 56px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.footer-brand p { max-width: 28ch; margin: 14px 0 0; }
.footer-grid strong, .footer p { margin: 0; }
.footer-grid div:not(.footer-brand) { display: grid; align-content: start; gap: 10px; }
.footer-grid div:not(.footer-brand) p { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 12px; }
.footer a { color: #1a0f00; text-decoration: none; }
.footer-grid div:not(.footer-brand) a { display: inline-block; transition: transform 0.25s ease; }
.footer-grid div:not(.footer-brand) a:hover { transform: translateX(6px); }
.footer-logo span { font-size: 42px; }

@keyframes live { 70%, 100% { box-shadow: 0 0 0 8px rgba(255, 122, 26, 0); } }
@media (prefers-reduced-motion: reduce) {
  .pill i, .badge i, .nav-panel, .nav-shell { animation: none; transition: none; }
}
@media (max-width: 980px) {
  .nav-links, .metrics, .footer-grid, .wallet-grid { grid-template-columns: 1fr 1fr; }
  .hero-dither {
    position: relative;
    width: min(100%, 240px);
    height: 180px;
    margin: 4px 0 12px auto;
    opacity: 1;
  }
}
@media (max-width: 860px) {
  .bar-links { display: none; }
}
.closed-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 24px;
}
.closed-screen img { width: min(280px, 62vw); height: auto; }
.closed-screen h1 {
  margin: 28px 0 0; font-size: clamp(42px, 7vw, 84px); max-width: 12ch;
}
.closed-screen .lede { margin-top: 18px; }

@media (max-width: 760px) {
  main { padding-top: 92px; }
  .metrics, .kv, .wallet-shell, .wallet-grid, .footer-grid, .nav-links { grid-template-columns: 1fr; }
  .wallet-side { position: static; }
  .search { flex-direction: column; }
  h1 { max-width: none; }
}
