/* ── DESIGN TOKENS ───────────────────────────────── */
:root {
  --bg:        #0b0f14;
  --surface:   #131920;
  --surface2:  #1a2230;
  --border:    #243040;
  --text:      #e2eaf5;
  --muted:     #7a92b0;
  --code-bg:   #0f1620;
  --shadow:    rgba(0,0,0,.6);
  --accent:    #f7a133;
  --gold:      #f7a133;
  --green:     #3ecf6e;
  --blue:      #4fa8e8;
  --purple:    #b07ff0;
  --red:       #f06060;
  --teal:      #2dd4bf;
  --pkt:       #f7a133;
  --t: background .3s, color .3s, border-color .3s, box-shadow .3s;
}
[data-theme="light"] {
  --bg:       #f0f4fa;
  --surface:  #ffffff;
  --surface2: #e8eef7;
  --border:   #cdd6e4;
  --text:     #1a2535;
  --muted:    #5a7090;
  --code-bg:  #e4eaf4;
  --shadow:   rgba(0,0,0,.1);
}

html { transition: var(--t); scroll-behavior: smooth; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Sora', -apple-system, sans-serif;
  line-height: 1.6;
  transition: var(--t);
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAVBAR ────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,15,20,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--t);
}
[data-theme="light"] nav {
  background: rgba(240,244,250,.92);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #f7a133, #e07b10);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #000;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}
.nav-logo-text {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.nav-logo-text span { color: var(--pkt); }
.search-wrap {
  flex: 1;
  max-width: 560px;
  position: relative;
}
.search-wrap input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px 8px 40px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  outline: none;
  transition: border-color .15s, var(--t);
}
.search-wrap input:focus { border-color: var(--pkt); }
.search-wrap input::placeholder { color: var(--muted); }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-link {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--surface2); text-decoration: none; }
.theme-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: var(--t);
  flex-shrink: 0;
}
.theme-btn:hover { border-color: var(--pkt); }

/* ── SEARCH MODAL ──────────────────────────────────── */
.search-modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.search-modal-backdrop.open { display: flex; }
.search-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: min(600px, 94vw);
  box-shadow: 0 24px 64px var(--shadow);
  overflow: hidden;
}
.search-modal-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.search-modal-top input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: .9rem;
  outline: none;
}
.search-modal-top input::placeholder { color: var(--muted); }
.search-close {
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.search-close:hover { color: var(--text); background: var(--surface2); }
.search-results { padding: 12px; max-height: 400px; overflow-y: auto; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
}
.search-result-item:hover { background: var(--surface2); }
.search-result-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.icon-block  { background: rgba(79,168,232,.15); color: var(--blue); border: 1px solid rgba(79,168,232,.25); }
.icon-tx     { background: rgba(62,207,110,.15); color: var(--green); border: 1px solid rgba(62,207,110,.25); }
.icon-addr   { background: rgba(247,161,51,.15); color: var(--pkt); border: 1px solid rgba(247,161,51,.25); }
.search-result-main { flex: 1; min-width: 0; }
.search-result-type { font-size: .7rem; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.search-result-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-empty { padding: 32px; text-align: center; color: var(--muted); font-size: .88rem; }

/* ── STATS BAR ─────────────────────────────────────── */
.stats-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  transition: var(--t);
}
.stats-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.stats-inner::-webkit-scrollbar { display: none; }
.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px 14px 0;
  border-right: 1px solid var(--border);
  margin-right: 24px;
  white-space: nowrap;
  flex-shrink: 0;
}
.stat-item:last-child { border-right: none; margin-right: 0; }
.stat-icon { font-size: 16px; }
.stat-body {}
.stat-lbl { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.stat-val { font-size: .92rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; color: var(--text); }
.stat-val.pkt-color { color: var(--pkt); }
.stat-val.green { color: var(--green); }

/* ── MAIN LAYOUT ───────────────────────────────────── */
.main-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* ── PANEL ─────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: var(--t);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.panel-title {
  font-size: .88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.panel-more {
  font-size: .76rem;
  color: var(--blue);
  font-weight: 600;
}
.panel-more:hover { text-decoration: underline; }

/* ── BLOCK / TX LIST ───────────────────────────────── */
.list-item {
  display: grid;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  transition: background .1s;
  cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--surface2); }
.block-item { grid-template-columns: 56px 1fr auto; }
.tx-item    { grid-template-columns: 1fr 80px; }
.item-icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}
.item-icon-block { background: rgba(79,168,232,.12); color: var(--blue); border: 1px solid rgba(79,168,232,.2); }
.item-icon-tx    { background: rgba(62,207,110,.12); color: var(--green); border: 1px solid rgba(62,207,110,.2); }
.item-main {}
.item-primary {
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  font-weight: 600;
  color: var(--blue);
}
.item-secondary { font-size: .73rem; color: var(--muted); margin-top: 2px; }
.item-right { text-align: right; }
.item-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  font-weight: 600;
  color: var(--pkt);
}
.item-age { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: .7rem;
  font-weight: 600;
  vertical-align: middle;
}
.badge-coinbase { background: rgba(247,161,51,.12); color: var(--pkt); border: 1px solid rgba(247,161,51,.25); }
.badge-tx       { background: rgba(62,207,110,.12);  color: var(--green); border: 1px solid rgba(62,207,110,.25); }

/* ── TX DETAIL ROWS ────────────────────────────────── */
.tx-from-to {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.addr-short {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--blue);
}
.arrow { color: var(--muted); font-size: .7rem; }

/* ── DETAIL PAGE ───────────────────────────────────── */
.detail-page {
  display: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
}
.detail-page.active { display: block; }
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .83rem;
  font-weight: 600;
  margin-bottom: 20px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background .12s, color .12s;
}
.detail-back:hover { background: var(--surface2); color: var(--text); }
.detail-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.detail-title .hash {
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
  font-weight: 400;
  color: var(--muted);
  word-break: break-all;
}
.kv-table { width: 100%; }
.kv-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.kv-row:last-child { border-bottom: none; }
.kv-key { font-size: .8rem; color: var(--muted); font-weight: 600; padding-top: 2px; }
.kv-val {
  font-size: .85rem;
  font-family: 'JetBrains Mono', monospace;
  word-break: break-all;
}
.kv-val.normal { font-family: 'Sora', sans-serif; }
.addr-clickable { cursor: pointer; }
.addr-clickable:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .kv-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ── TICKER ────────────────────────────────────────── */
.ticker-bar {
  background: linear-gradient(90deg, #f7a133 0%, #e07b10 100%);
  padding: 7px 0;
  overflow: hidden;
  position: relative;
}
.ticker-inner {
  display: flex;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 48px;
  font-size: .75rem;
  font-weight: 600;
  color: rgba(0,0,0,.75);
  font-family: 'JetBrains Mono', monospace;
}
.ticker-sep { color: rgba(0,0,0,.3); }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ── HERO SEARCH ───────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 56px 24px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--t);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% -10%, rgba(247,161,51,.1) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pkt);
  margin-bottom: 12px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.hero h1 span { color: var(--pkt); }
.hero-sub {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.hero-search {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}
.hero-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 56px 14px 20px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: .88rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s, var(--t);
  box-shadow: 0 4px 20px var(--shadow);
}
.hero-search input:focus {
  border-color: var(--pkt);
  box-shadow: 0 0 0 3px rgba(247,161,51,.15), 0 4px 20px var(--shadow);
}
.hero-search input::placeholder { color: var(--muted); }
.hero-search-btn {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: var(--pkt);
  border: none;
  border-radius: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: opacity .15s;
}
.hero-search-btn:hover { opacity: .85; }

/* ── PAGE TOGGLE ───────────────────────────────────── */
#home-page { display: block; }
.page { display: none; }
.page.active { display: block; }

/* ── FOOTER ────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  transition: var(--t);
}
footer a { color: var(--blue); }
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: .85rem; }

/* ── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-link { display: none; }
  .hero { padding: 40px 16px 36px; }
  .main-wrap { padding: 20px 16px; }
  .kv-row { grid-template-columns: 1fr; }
}
