:root {
  --bg: #f5f8fc;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-soft: #eef4fb;
  --line: rgba(19, 45, 74, 0.08);
  --line-strong: rgba(19, 45, 74, 0.14);
  --text: #102235;
  --muted: #667a91;
  --accent: #0ea5e9;
  --accent-strong: #0284c7;
  --accent-soft: rgba(14, 165, 233, 0.12);
  --success: #10b981;
  --danger: #ef4444;
  --shadow-lg: 0 28px 80px rgba(31, 52, 79, 0.10);
  --shadow-md: 0 16px 42px rgba(31, 52, 79, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.10), transparent 25%),
    radial-gradient(circle at 85% 10%, rgba(56, 189, 248, 0.08), transparent 20%),
    linear-gradient(180deg, #fbfdff 0%, #f3f8fd 52%, #edf3f9 100%);
}

.ambient {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(70px);
  pointer-events: none;
  opacity: .65;
}
.ambient--one {
  width: 360px;
  height: 360px;
  top: 60px;
  left: -120px;
  background: rgba(14, 165, 233, 0.12);
}
.ambient--two {
  width: 320px;
  height: 320px;
  right: -60px;
  top: 180px;
  background: rgba(59, 130, 246, 0.08);
}

.shell {
  width: min(1280px, calc(100vw - 36px));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(245, 248, 252, 0.78);
  border-bottom: 1px solid rgba(16, 34, 53, 0.05);
}
.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 76px;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}
.brand__mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #67e8f9);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.26);
}
.brand__copy {
  display: grid;
  gap: 2px;
}
.brand__copy strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand__copy small {
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 18px;
}
.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.topnav a:hover { color: var(--accent-strong); }

.page {
  display: grid;
  gap: 24px;
  padding: 34px 0 44px;
}

.hero {
  display: grid;
  gap: 20px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.96), rgba(247, 251, 255, 0.84)),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 34%);
  box-shadow: var(--shadow-lg);
}
.eyebrow,
.panel__eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 11px;
  color: var(--accent-strong);
  font-weight: 700;
}
.hero h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}
.lead {
  margin: 14px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.searchbar {
  display: flex;
  gap: 14px;
  align-items: center;
}
.searchbar__field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.searchbar__icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-weight: 800;
}
.searchbar input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}
.searchbar input::placeholder { color: #8ba0b7; }
.searchbar button,
.ghost {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: .18s ease;
}
.searchbar button {
  padding: 16px 22px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 16px 30px rgba(14, 165, 233, 0.22);
}
.searchbar button:hover { transform: translateY(-1px); }

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}
.hero__links a {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  padding: 20px 22px;
}
.metric__label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
}
.metric__value {
  margin-top: 14px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
  letter-spacing: -0.04em;
}
.metric__sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.feature-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
}
.feature-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: -0.03em;
}
.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}
.feature-card code {
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--accent-strong);
}

.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.panel__head h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.ghost {
  padding: 12px 18px;
  border-radius: 14px;
  color: var(--accent-strong);
  background: var(--accent-soft);
}
.ghost:hover { background: rgba(14, 165, 233, 0.18); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.overview-item {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(245, 248, 252, 0.85);
  border: 1px solid rgba(19, 45, 74, 0.06);
}
.overview-item__label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
}
.overview-item__value {
  display: block;
  margin-top: 10px;
  font-size: 18px;
  line-height: 1.45;
  word-break: break-word;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr);
  gap: 20px;
}
.side-stack {
  display: grid;
  gap: 20px;
}

.blocks-list,
.side-list,
.result-view {
  display: grid;
  gap: 12px;
}

.block-row,
.data-card,
.tx-row,
.utxo-row,
.note-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(19, 45, 74, 0.07);
  background: #fff;
}

.block-row {
  padding: 18px;
}
.block-row__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.block-row__meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #35506d;
  font-size: 12px;
  font-weight: 600;
}

.data-card,
.note-card {
  padding: 18px;
}
.note-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.note-card p + p { margin-top: 10px; }

.mono {
  font-family: Consolas, "Courier New", monospace;
}
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.clickable {
  color: var(--accent-strong);
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
}
.clickable:hover { text-decoration: underline; }

.json-shell,
.code-shell {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: #0f1e2d;
  color: #d7e6f6;
  overflow: auto;
}
.json-shell pre,
.code-shell pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.65;
}
.code-shell summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 12px;
}

.tx-grid,
.utxo-grid {
  display: grid;
  gap: 10px;
}
.tx-row,
.utxo-row {
  padding: 16px;
}

.empty-state,
.error-state {
  padding: 36px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  background: linear-gradient(180deg, #ffffff, #f6f9fc);
  border: 1px dashed rgba(19, 45, 74, 0.14);
}
.empty-state h3,
.error-state h3 {
  margin: 0 0 10px;
  font-size: 24px;
  letter-spacing: -0.03em;
}
.empty-state p,
.error-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.error-state h3 { color: var(--danger); }

@media (max-width: 1140px) {
  .metrics,
  .feature-grid,
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .topbar__inner,
  .panel__head,
  .block-row__top,
  .searchbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topnav {
    gap: 12px;
  }

  .metrics,
  .feature-grid,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .panel {
    padding: 20px;
  }

  .searchbar button,
  .ghost {
    width: 100%;
  }
}
