/* ============================================================
   Beyul Explorer — layout & components
   Motion language = "the veil": blur → clarity, no bounce.
   letter-spacing: 0 (brand constraint), except mono labels.
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--beyul-cyan); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--beyul-cyan-hover); }
button { font-family: inherit; cursor: pointer; }

/* Ambient veil background */
#veil-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 540px at 78% -8%, var(--cyan-12), transparent 60%),
    radial-gradient(700px 500px at 8% 8%, color-mix(in srgb, var(--beyul-cyan) 7%, transparent), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 60%);
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--bg-1) 86%, transparent);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 50;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { filter: drop-shadow(0 0 8px var(--beyul-cyan-glow)); }
.brand-text { font-weight: 700; font-size: 16px; color: var(--text); display: flex; align-items: baseline; gap: 7px; }
.brand-sub { font-size: 10px; letter-spacing: .22em; color: var(--text-mute); font-weight: 600; }

.search { flex: 1 1 320px; display: flex; min-width: 220px; position: relative; }
.search input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); border-radius: var(--radius); padding: 10px 44px 10px 14px;
  font-family: var(--font-mono); font-size: 13px; outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.search input::placeholder { color: var(--text-mute); font-family: var(--font-sans); }
.search input:focus { border-color: var(--cyan-dim); box-shadow: 0 0 0 3px var(--cyan-12); }
.search button {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 30px; border: none; border-radius: var(--radius-sm);
  background: var(--cyan-12); color: var(--beyul-cyan); font-size: 16px;
}
.search button:hover { background: var(--cyan-20); }

.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a {
  color: var(--text-dim); padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 14px; transition: background .15s var(--ease), color .15s var(--ease);
}
.topnav a:hover { background: var(--panel); color: var(--text); }
.topnav a.active { color: var(--beyul-cyan); background: var(--cyan-12); }

.topbar-tools { display: flex; align-items: center; gap: 8px; }
.ghost-btn {
  background: transparent; border: 1px solid var(--line); color: var(--text-dim);
  border-radius: var(--radius-sm); padding: 6px 10px; font-size: 12px; font-weight: 600;
}
.ghost-btn:hover { border-color: var(--cyan-dim); color: var(--text); }
.conn-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-family: var(--font-mono);
}
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.conn-pill.live .conn-dot { background: var(--beyul-cyan); box-shadow: 0 0 8px var(--beyul-cyan); }
.conn-pill.offline .conn-dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* ---------- Status banner ---------- */
.status-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px clamp(16px, 4vw, 40px);
  background: var(--warn-12);
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 24%, transparent);
  font-size: 12.5px;
}
.sb-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: 4px; padding: 2px 7px; }
.sb-line { color: var(--text-dim); }
.sb-more { margin-left: auto; color: var(--warn); font-weight: 600; }
.sb-more:hover { color: var(--warn); filter: brightness(1.15); }

/* ---------- Layout ---------- */
.view { max-width: var(--maxw); margin: 0 auto; padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 40px) 64px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.2; margin: 0 0 6px; }
.page-head .sub { color: var(--text-mute); font-size: 14px; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; color: var(--beyul-cyan); text-transform: uppercase; margin: 0 0 10px; }
.section-title { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; margin: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 36px 0 14px; }
.section-head a { font-size: 13px; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 16px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-2 { grid-template-columns: 1.4fr 1fr; }
.grid-2-eq { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .grid-2, .grid-2-eq { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 18px 20px;
}
.card.pad-lg { padding: 22px 24px; }
.stat .stat-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; color: var(--text-mute); text-transform: uppercase; }
.stat .stat-value { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 500; margin-top: 6px; line-height: 1.1; color: var(--text); }
.stat .stat-value.cyan { color: var(--beyul-cyan); }
.stat .stat-foot { font-size: 12px; color: var(--text-mute); margin-top: 4px; }

/* ---------- Tables ---------- */
.tbl-wrap { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-mute); font-weight: 600;
  padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
table.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); color: var(--text-dim); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: color-mix(in srgb, var(--beyul-cyan) 4%, transparent); }
.mono { font-family: var(--font-mono); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.t-strong { color: var(--text); }
.hash { font-family: var(--font-mono); font-size: 12.5px; }
.muted { color: var(--text-mute); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--text-dim); background: var(--bg-2); white-space: nowrap;
}
.chip.cyan { color: var(--beyul-cyan); border-color: var(--cyan-dim); background: var(--cyan-12); }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-12); }
.chip.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-12); }
.chip.veil { color: var(--text-mute); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Veil (sheltered) treatment ---------- */
.veil-val {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.veil-blur {
  font-family: var(--font-mono); color: var(--text-mute);
  filter: blur(4.5px); user-select: none; letter-spacing: .05em;
  opacity: .8;
}
.veil-lock {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 11px; color: var(--text-mute); font-family: var(--font-mono);
  border: 1px dashed var(--line); border-radius: 999px; padding: 2px 9px;
}
.veil-lock svg { width: 11px; height: 11px; }
tr.shielded-row td { background: color-mix(in srgb, var(--beyul-cyan) 3%, transparent); }

/* ---------- Detail rows ---------- */
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.kv > .k, .kv > .v { background: var(--panel); padding: 12px 16px; }
.kv > .k { color: var(--text-mute); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; }
.kv > .v { color: var(--text); word-break: break-all; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } .kv > .k { padding-bottom: 0; } }

/* ---------- Buttons / inputs (forms) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: none; border-radius: var(--radius); padding: 11px 18px; font-size: 14px; font-weight: 600;
  background: var(--beyul-grad-cta); color: #042018; transition: filter .15s var(--ease), transform .12s var(--ease);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text-dim); }
.btn.ghost:hover { border-color: var(--cyan-dim); color: var(--text); filter: none; }
.field { display: block; margin-bottom: 14px; }
.field label { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--text-mute); text-transform: uppercase; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 12px; font-family: var(--font-mono); font-size: 13px; outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field input:focus, .field textarea:focus { border-color: var(--cyan-dim); box-shadow: 0 0 0 3px var(--cyan-12); }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }

/* ---------- Notes / callouts ---------- */
.note { border-left: 2px solid var(--cyan-dim); background: var(--cyan-12); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; color: var(--text-dim); }
.note.warn { border-color: var(--warn); background: var(--warn-12); }
.note strong { color: var(--text); }
.note + .note { margin-top: 10px; }

/* ---------- Reveal animation (the veil lifting) ---------- */
@keyframes unveil { from { opacity: 0; transform: translateY(6px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.unveil { animation: unveil .5s var(--ease) both; }
.unveil-2 { animation: unveil .5s var(--ease) .06s both; }
.unveil-3 { animation: unveil .5s var(--ease) .12s both; }
@media (prefers-reduced-motion: reduce) { .unveil, .unveil-2, .unveil-3 { animation: none; } }

/* ---------- Misc ---------- */
.empty { text-align: center; color: var(--text-mute); padding: 48px 16px; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--beyul-cyan); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.copy-btn { background: transparent; border: none; color: var(--text-mute); font-size: 12px; padding: 2px 6px; border-radius: 4px; }
.copy-btn:hover { color: var(--beyul-cyan); background: var(--cyan-12); }
.crumbs { font-size: 12px; color: var(--text-mute); margin-bottom: 14px; font-family: var(--font-mono); }
.crumbs a { color: var(--text-dim); }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-mute); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.tag-deposit, .tag-withdraw, .tag-transfer, .tag-send, .tag-stake { white-space: nowrap; }
.tag-deposit { color: var(--warn); }
.tag-withdraw { color: var(--warn); }
.tag-transfer { color: var(--beyul-cyan); }
.tag-send { color: var(--text-dim); }
.tag-stake { color: var(--text-dim); }
hr.div { border: none; border-top: 1px solid var(--line-soft); margin: 28px 0; }
