/* =====================================================================
   AERE Network — Block Explorer stylesheet (explorer.aere.network)
   V10 CLEAR SKY edition. Aligned 1:1 with /dapp.css design tokens:
   same CSS variables, Fraunces display serif, Geist UI, Geist Mono for
   hashes/numbers, light sky gradient, glass card surfaces.

   Self-contained: explorer pages load ONLY this file + explorer-lib.js
   (no dapp-shell.js — the explorer ships its own lean header/footer so
   block/tx/address pages stay focused on data, not marketing chrome).

   Locked design 2026-06-13. Companion to /blocks.html (AERE Live Blocks).
   ===================================================================== */

:root {
  color-scheme: light;
  --ink:          #0a1628;
  --ink-2:        #1a2942;
  --ink-soft:     rgba(10, 22, 40, 0.72);
  --ink-faint:    rgba(10, 22, 40, 0.55);
  --line:         rgba(10, 22, 40, 0.10);
  --line-strong:  rgba(10, 22, 40, 0.18);

  --sky-50:       #f4f9ff;
  --sky-100:      #e8f1fb;
  --sky-200:      #d1e3f5;
  --sky-300:      #a8c8e8;
  --sky-400:      #6ea4d4;
  --sky-500:      #3d7fb8;
  --sky-600:      #1f5a8f;

  --warm:         #fef5e8;
  --accent-grad:  linear-gradient(120deg, #3d7fb8 0%, #8a6fb8 50%, #c89868 100%);

  --ok:           #1a7048;
  --ok-bg:        rgba(76, 180, 140, 0.18);
  --ok-bd:        rgba(76, 180, 140, 0.5);
  --bad:          #8e2a2a;
  --bad-bg:       rgba(220, 100, 100, 0.18);
  --bad-bd:       rgba(220, 100, 100, 0.5);
  --pend:         #a86b18;
  --pend-bg:      rgba(255, 180, 80, 0.20);
  --pend-bd:      rgba(255, 180, 80, 0.55);
}

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,200;0,9..144,300;0,9..144,400;0,9..144,500;1,9..144,300;1,9..144,400&family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@300;400;500;600&display=swap');

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 60% 40% at 70% 20%, rgba(255, 217, 168, 0.20) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(168, 200, 232, 0.30) 0%, transparent 70%),
    linear-gradient(180deg, var(--sky-100) 0%, var(--sky-50) 22%, #ffffff 55%, #fefcf8 85%, var(--warm) 100%);
  background-attachment: fixed;
  color: var(--ink);
}

a { color: var(--sky-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================== LAYOUT ============================== */
.exp-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 60px;
}
@media (max-width: 640px) {
  .exp-main { padding: 18px 14px 44px; }
}

/* ============================== HEADER / NAV ============================== */
.exp-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 24px rgba(31, 90, 143, 0.06);
}
.exp-header .bar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.exp-header .brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.exp-header .brand:hover { text-decoration: none; }
.exp-header .brand img { height: 34px; width: auto; display: block; transition: transform 200ms; }
.exp-header .brand:hover img { transform: scale(1.05); }
.exp-header .brand .wm {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.exp-header .brand .wm b {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.exp-header .brand .wm span {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--sky-600);
  margin-top: 3px;
}

.exp-header .search {
  flex: 1 1 320px;
  min-width: 200px;
  position: relative;
  order: 3;
  width: 100%;
}
.exp-header .search input {
  width: 100%;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  padding: 11px 16px 11px 40px;
  border-radius: 12px;
  color: var(--ink);
  outline: 0;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.exp-header .search input:focus {
  border-color: var(--sky-500);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(61, 127, 184, 0.14);
}
.exp-header .search input::placeholder { color: var(--ink-faint); }
.exp-header .search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: var(--ink-faint);
  pointer-events: none;
}

.exp-header .links {
  display: flex;
  align-items: center;
  gap: 4px;
  order: 2;
  flex-shrink: 0;
}
.exp-header .links a {
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-2);
  padding: 8px 15px;
  border-radius: 999px;
  text-decoration: none;
  transition: all 200ms;
}
.exp-header .links a:hover { color: var(--sky-600); background: rgba(168, 200, 232, 0.18); text-decoration: none; }
.exp-header .links a.active { color: var(--sky-600); background: rgba(168, 200, 232, 0.22); }

@media (min-width: 861px) {
  .exp-header .search { order: 2; flex: 1 1 280px; width: auto; max-width: 480px; }
  .exp-header .links { order: 3; }
}
@media (max-width: 860px) {
  .exp-header .bar { padding: 12px 16px; gap: 12px; }
  .exp-header .search { flex-basis: 100%; }
}

/* ============================== PAGE HEAD ============================== */
.exp-pagehead { margin: 26px 0 22px; }
.exp-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--sky-600);
  margin-bottom: 14px;
}
.exp-kicker .dot, .pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--sky-500);
  border-radius: 50%;
  animation: aere-sky-pulse 2s infinite;
}
@keyframes aere-sky-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(61, 127, 184, 0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(61, 127, 184, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 127, 184, 0); }
}
h1.exp-h1 {
  font-family: 'Fraunces', serif;
  font-weight: 200;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.0;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0 0 0.5rem;
}
h1.exp-h1 em, .accent {
  font-style: italic;
  font-family: 'Fraunces', serif;
  font-weight: 300;
  background-image: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.exp-sub {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(1.0rem, 1.6vw, 1.2rem);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
  max-width: 720px;
}
.exp-sub code, .exp-mini-code {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.82em;
  background: rgba(168, 200, 232, 0.18);
  border: 1px solid rgba(168, 200, 232, 0.4);
  padding: 1px 7px;
  border-radius: 6px;
  color: var(--sky-600);
}

/* ============================== CARDS ============================== */
.card {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(31, 90, 143, 0.10),
              inset 0 1px 0 rgba(255, 255, 255, 0.95);
  overflow: hidden;
}
.card.pad { padding: 24px; }
.card + .card { margin-top: 18px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.card-head .more {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sky-600);
}

/* Key/value rows for detail pages */
.kv {
  display: grid;
  grid-template-columns: 220px 1fr;
  row-gap: 0;
  column-gap: 24px;
}
.kv > .k, .kv > .v {
  padding: 13px 0;
  border-bottom: 1px solid rgba(10, 22, 40, 0.06);
}
.kv > .k {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
}
.kv > .v {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
  word-break: break-all;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.kv > .v a { color: var(--sky-600); }
.kv > .k:last-of-type, .kv > .v:last-of-type { border-bottom: 0; }
@media (max-width: 640px) {
  .kv { grid-template-columns: 1fr; }
  .kv > .k { padding-bottom: 2px; border-bottom: 0; }
  .kv > .v { padding-top: 2px; }
}

/* ============================== STAT GRID ============================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 12px 36px rgba(31, 90, 143, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.stat-label {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sky-600);
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.stat-val {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-weight: 600;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-val .unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-faint);
  margin-left: 4px;
}
.stat-sub {
  margin-top: 6px;
  font-family: 'Geist', sans-serif;
  font-size: 11.5px;
  color: var(--ink-faint);
}
@media (max-width: 860px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-card { padding: 15px 16px; }
  .stat-val { font-size: 22px; }
}

/* ============================== TWO-COLUMN ============================== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* ============================== TABLE ============================== */
.tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.exp {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.exp thead th {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sky-600);
  text-align: left;
  padding: 13px 18px;
  background: rgba(232, 241, 251, 0.45);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.exp tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid rgba(10, 22, 40, 0.06);
  color: var(--ink-soft);
  vertical-align: middle;
}
table.exp tbody tr:last-child td { border-bottom: 0; }
table.exp tbody tr { transition: background 150ms; }
table.exp tbody tr:hover { background: rgba(232, 241, 251, 0.4); }
table.exp td.num, table.exp .num {
  font-variant-numeric: tabular-nums;
  font-family: 'Geist Mono', ui-monospace, monospace;
  white-space: nowrap;
}
table.exp td.mono, .mono {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12.5px;
}
table.exp a { color: var(--sky-600); font-weight: 500; }
table.exp td .muted, .muted { color: var(--ink-faint); }
table.exp .arrow { color: var(--ink-faint); margin: 0 6px; }

/* Row enter flash (live updates) */
.new-row { animation: flash 1.5s ease-out; }
@keyframes flash {
  from { background: rgba(76, 180, 140, 0.16); }
  to   { background: transparent; }
}

/* Mobile: turn list tables into stacked cards */
@media (max-width: 560px) {
  table.exp.stackable thead { display: none; }
  table.exp.stackable, table.exp.stackable tbody, table.exp.stackable tr, table.exp.stackable td { display: block; width: 100%; }
  table.exp.stackable tbody tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px 4px;
    margin: 0 0 10px;
    background: rgba(255, 255, 255, 0.5);
  }
  table.exp.stackable tbody tr:hover { background: rgba(255, 255, 255, 0.5); }
  table.exp.stackable tbody td {
    padding: 7px 14px;
    border-bottom: 1px solid rgba(10, 22, 40, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    text-align: right;
    white-space: normal;
    word-break: break-all;
  }
  table.exp.stackable tbody td:last-child { border-bottom: 0; }
  table.exp.stackable tbody td::before {
    content: attr(data-label);
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sky-600);
    text-align: left;
    flex-shrink: 0;
  }
}

/* ============================== BADGES ============================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.badge.success { background: var(--ok-bg);   border: 1px solid var(--ok-bd);   color: var(--ok); }
.badge.success::before { background: var(--ok); }
.badge.failed  { background: var(--bad-bg);  border: 1px solid var(--bad-bd);  color: var(--bad); }
.badge.failed::before { background: var(--bad); }
.badge.pending { background: var(--pend-bg); border: 1px solid var(--pend-bd); color: var(--pend); }
.badge.pending::before { background: var(--pend); animation: aere-sky-pulse 1.6s infinite; }
.badge.neutral { background: rgba(168, 200, 232, 0.22); border: 1px solid rgba(168, 200, 232, 0.55); color: var(--sky-600); }
.badge.neutral::before { display: none; }
.badge.contract { background: rgba(138, 111, 184, 0.16); border: 1px solid rgba(138, 111, 184, 0.45); color: #6a4f9b; }
.badge.contract::before { display: none; }

/* ============================== COPY BUTTON ============================== */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-faint);
  cursor: pointer;
  vertical-align: middle;
  transition: all 150ms;
  box-shadow: none;
}
.copy-btn:hover { background: rgba(168, 200, 232, 0.25); border-color: var(--sky-400); color: var(--sky-600); box-shadow: none; }
.copy-btn svg { width: 12px; height: 12px; stroke: currentColor; fill: none; pointer-events: none; }
.copy-btn.copied { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok); }

/* ============================== STATES ============================== */
.state {
  padding: 40px 24px;
  text-align: center;
  font-family: 'Geist', sans-serif;
  color: var(--ink-faint);
}
.state .state-title {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 1.3rem;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.state p { font-size: 14px; margin: 0 auto 18px; max-width: 420px; }
.state .retry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 24px rgba(31, 90, 143, 0.2);
  transition: all 200ms;
}
.state .retry:hover { background: var(--sky-600); }
.state.error .state-title { color: var(--bad); }

/* ============================== SKELETON SHIMMER ============================== */
.skel {
  display: inline-block;
  height: 1em;
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(100deg, rgba(168,200,232,0.18) 30%, rgba(168,200,232,0.42) 50%, rgba(168,200,232,0.18) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.skel.line { height: 12px; margin: 4px 0; }
.skel.w40 { width: 40%; } .skel.w60 { width: 60%; } .skel.w80 { width: 80%; }
.stat-val .skel { height: 24px; width: 70%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Pagination */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.pager .info {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink-faint);
}
.pager .btns { display: flex; gap: 8px; }
.pager button {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  cursor: pointer;
  box-shadow: none;
  transition: all 200ms;
}
.pager button:hover:not(:disabled) { background: rgba(168, 200, 232, 0.25); border-color: var(--sky-400); }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================== FOOTER ============================== */
.exp-footer {
  margin-top: 48px;
  padding: 26px 22px 30px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.exp-footer .row {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  flex-wrap: wrap;
}
.exp-footer a {
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
}
.exp-footer .legal {
  margin-top: 14px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* Toast for copy feedback */
.exp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 12px 36px rgba(31, 90, 143, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms, transform 200ms;
  z-index: 2000;
}
.exp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
