:root {
  --bg: #12110e;
  --ink: #ece6d5;
  --ink-soft: #c8c0a8;
  --muted: #9a917c;
  --line: rgba(236, 230, 213, 0.12);
  --paper: #1c1a15;
  --surface: rgba(28, 26, 21, 0.85);
  --gold: #e2b657;
  --teal: #2bb3a3;
  --in: #7dcea0;
  --out: #e07a5f;
  --danger: #d45d4a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: "Outfit", "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.mesh {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(1000px 520px at 10% -12%, #2a2418, transparent 55%),
    radial-gradient(800px 480px at 90% 10%, rgba(43, 179, 163, 0.12), transparent 50%),
    var(--bg);
}

.grid {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(236, 230, 213, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 230, 213, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 15%, transparent 70%);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scan {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 0;
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.brand-glyph {
  width: 9px;
  height: 9px;
  background: var(--gold);
  transform: rotate(45deg);
  display: inline-block;
}

.brand-word {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.08em;
}

.brand-en {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
}

.brand-en:empty,
.brand-hero em:empty {
  display: none;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-nav {
  display: flex;
  gap: 16px;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.top-nav a:hover {
  color: var(--gold);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}

.lang-btn {
  height: 30px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.lang-btn.active {
  background: var(--gold);
  color: #1a1408;
  font-weight: 600;
}

.hero {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(40px, 8vh, 72px) 0 8px;
  animation: rise 0.55s ease both;
}

.brand-hero {
  margin: 0 0 12px;
  font-size: clamp(36px, 7vw, 56px);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}

.brand-hero em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.48em;
  letter-spacing: 0.28em;
  color: var(--gold);
  vertical-align: 0.3em;
  margin-left: 0.12em;
}

.hero h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.lede {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 48ch;
}

.search {
  display: flex;
  gap: 8px;
  margin: 20px 0 10px;
}

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
}

.search-field:focus-within {
  outline: 1px solid var(--gold);
}

.search-lock {
  width: 12px;
  height: 14px;
  border: 1.5px solid var(--gold);
  border-radius: 2px;
  position: relative;
  flex-shrink: 0;
  opacity: 0.85;
}

.search-lock::before {
  content: "";
  position: absolute;
  left: 1.5px;
  top: -6px;
  width: 5px;
  height: 6px;
  border: 1.5px solid var(--gold);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

.search input {
  flex: 1;
  height: 100%;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  min-width: 0;
}

.search input::placeholder {
  color: var(--muted);
  font-family: var(--font);
}

.search button,
.subscribe-form button {
  height: 44px;
  min-width: 96px;
  padding: 0 18px;
  border: 0;
  background: var(--gold);
  color: #1a1408;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.search button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.search button.is-loading {
  background-image: linear-gradient(110deg, var(--gold) 0%, #f0d48a 45%, var(--gold) 80%);
  background-size: 200% 100%;
  animation: scan 1.1s linear infinite;
}

.chain-line {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.status {
  width: min(760px, calc(100% - 32px));
  margin: 8px auto;
  min-height: 1.2em;
  color: var(--muted);
  font-size: 13px;
}

.status.error { color: var(--danger); }
.status.ok { color: var(--teal); }

.portfolio,
.sheet,
.tabs {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto 12px;
}

.portfolio {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  animation: rise 0.4s ease both;
}

.port-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.port-head b {
  color: var(--gold);
  font-size: 20px;
  font-family: var(--mono);
}

.port-chains,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tabs { margin-top: 0; }

.port-chains button,
.tabs button {
  height: 28px;
  padding: 0 10px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: 600 12px / 1 var(--font);
  cursor: pointer;
}

.port-chains button.has,
.tabs button.active {
  border-color: rgba(226, 182, 87, 0.55);
  color: var(--gold);
}

.tabs button.active {
  background: var(--gold);
  color: #1a1408;
  border-color: var(--gold);
}

.port-chains button.empty {
  color: var(--muted);
}

.sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px 12px;
  animation: rise 0.45s ease both;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.pill {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.sheet-actions {
  display: flex;
  gap: 8px;
}

#copy-btn,
#watch-btn {
  height: 28px;
  min-width: 76px;
  padding: 0 10px;
  border: 1px solid rgba(226, 182, 87, 0.45);
  background: transparent;
  color: var(--gold);
  font: 500 12px / 1 var(--font);
  cursor: pointer;
}

#watch-btn.accent,
#copy-btn.copied {
  color: var(--in);
  border-color: rgba(125, 206, 160, 0.45);
}

.report {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.report col.lab { width: 96px; }

.report th,
.report td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: left;
  line-height: 1.35;
}

.report th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.report td { font-size: 13px; }

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
  word-break: break-all;
}

.time,
.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  white-space: nowrap;
}

.num b { font-weight: 650; }
.gold b { color: var(--gold); font-size: 16px; }
.out b { color: var(--out); }
.in b { color: var(--in); }

.range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.range .to { color: var(--muted); font-size: 12px; }

.assets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.asset {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 12.5px;
}

.asset .sym { color: var(--ink); font-weight: 650; }
.asset .amt { color: var(--muted); }
.asset .usd { color: var(--gold); }

.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.panel h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.panel-note {
  margin: 4px 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.tx-list,
.peer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tx-list li,
.peer-list li {
  display: grid;
  gap: 4px 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.tx-list li {
  grid-template-columns: 52px 1fr auto;
}

.tx-dir {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.tx-dir.in { color: var(--in); }
.tx-dir.out { color: var(--out); }

.tx-peer {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

.tx-time {
  font-size: 11px;
  color: var(--muted);
}

.tx-amt {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.tx-amt.in { color: var(--in); }
.tx-amt.out { color: var(--out); }

.peer-list li {
  grid-template-columns: 1fr auto;
}

.peer-addr {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

.peer-stats {
  font-size: 11px;
  color: var(--muted);
}

.peer-vol {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
}

.pillars {
  width: min(920px, calc(100% - 32px));
  margin: 36px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 520px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.pillar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}

.pillar-list li {
  padding: 20px 16px 20px 0;
  border-bottom: 1px solid var(--line);
}

.pillar-list li:not(:last-child) {
  border-right: 1px solid var(--line);
  margin-right: 12px;
  padding-right: 16px;
}

.pillar-index {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 10px;
}

.pillar-list h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.pillar-list p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.subscribe {
  width: min(920px, calc(100% - 32px));
  margin: 36px auto 48px;
  padding-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: end;
  border-top: 1px solid var(--line);
}

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.subscribe-copy h2 {
  margin: 8px 0 0;
  font-size: 24px;
  max-width: 14ch;
}

.subscribe-copy p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.subscribe-form {
  display: grid;
  gap: 8px;
}

.subscribe-form input {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
}

.subscribe-form input:focus {
  outline: 1px solid var(--gold);
}

.subscribe-form input::placeholder {
  font-family: var(--font);
  color: var(--muted);
}

.subscribe-form button { width: 100%; }

.form-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.form-note.ok { color: var(--in); }
.form-note.error { color: var(--danger); }

.site-foot {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-foot .brand-word { color: var(--ink); font-size: 13px; }

@media (max-width: 860px) {
  .pillar-list { grid-template-columns: 1fr 1fr; }
  .pillar-list li:not(:last-child) {
    border-right: 0;
    margin-right: 0;
    padding-right: 0;
  }
  .split,
  .subscribe { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .top-right { width: 100%; justify-content: space-between; }
  .top-nav { display: none; }
  .search { flex-direction: column; }
  .search button { width: 100%; }
  .pillar-list { grid-template-columns: 1fr; }
  .report col.lab { width: 78px; }
  .tx-list li { grid-template-columns: 48px 1fr; }
  .tx-amt { grid-column: 2; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
