*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.028em; line-height: 1.08; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(10,10,12,.7);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-line);
  transition: background .2s, border-color .2s;
}
/* floats over a full-height hero and only gets a background once you scroll */
.nav-overlay {
  position: fixed; left: 0; right: 0;
  background: transparent; border-bottom-color: transparent; backdrop-filter: none;
}
.nav-overlay.solid {
  background: rgba(10,10,12,.72); border-bottom-color: var(--glass-line);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}

.nav-burger {
  display: none; width: 40px; height: 40px; border-radius: 11px;
  border: 1px solid var(--glass-line); background: var(--glass-2); color: var(--text);
  align-items: center; justify-content: center;
  backdrop-filter: var(--blur-soft); -webkit-backdrop-filter: var(--blur-soft);
}
.nav-burger svg { width: 18px; height: 18px; }
.nav-menu {
  display: none; position: absolute; top: calc(var(--nav-h) - 8px); right: 16px; left: 16px;
  flex-direction: column; padding: 8px;
  background: rgba(18,18,22,.88);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line-2); border-radius: var(--radius-l); box-shadow: var(--shadow-lg);
}
.nav-menu.open { display: flex; }
.nav-menu a { padding: 11px 12px; border-radius: 9px; font-size: 15px; color: var(--muted); }
.nav-menu a:hover { color: var(--text); background: var(--glass-hi); }
.nav .wrap { display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.02em; font-size: 17px; }
.brand svg { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a {
  padding: 7px 12px; border-radius: 8px; font-size: 14px; color: var(--muted);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--glass-hi); }
.nav-links a.on { color: var(--text); background: var(--glass-2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--glass-line); background: var(--glass-2);
  font-size: 14px; font-weight: 550; letter-spacing: -.01em;
  backdrop-filter: var(--blur-soft); -webkit-backdrop-filter: var(--blur-soft);
  transition: border-color .15s, background .15s, transform .1s;
}
.btn:hover { border-color: var(--glass-line-2); background: var(--glass-hi); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: #f2f2f2; border-color: #f2f2f2; color: #000; font-weight: 550; }
.btn-primary:hover { background: #fff; border-color: #fff; opacity: .92; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- data status chip ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--glass-line); background: var(--glass-2);
  backdrop-filter: var(--blur-soft); -webkit-backdrop-filter: var(--blur-soft);
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.dot.live { background: var(--up); box-shadow: 0 0 0 3px rgba(61,220,151,.15); }
.dot.off { background: var(--warn); }

/* ---------- footer ---------- */
.foot {
  margin-top: 110px; border-top: 1px solid var(--glass-line);
  padding: 52px 0 44px; color: var(--muted); font-size: 13.5px;
}
.foot .wrap {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 44px 60px; align-items: start;
}
.foot-note { max-width: 560px; line-height: 1.7; }
.foot-note .brand { margin-bottom: 14px; }
.foot-note p { margin-bottom: 11px; }
.foot-note p:last-child { margin-bottom: 0; }

/* Flex, not a fixed column count: mountFoot() builds this list, and the Follow
   column disappears when no handle is set. A hardcoded repeat(3) left a gap
   where the fourth column was supposed to go. */
.foot-cols { display: flex; flex-wrap: wrap; gap: 46px; }
.foot-col h4 {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--dim); font-weight: 600; margin-bottom: 14px;
}
.foot-col a {
  display: block; padding: 6px 0; color: var(--muted); font-size: 14px;
  white-space: nowrap; transition: color .15s;
}
.foot-col a:hover { color: var(--text); }
.foot-col .ext { color: var(--dim); font-size: 12px; }

.foot-copy { grid-column: 1 / -1; color: var(--dim); font-size: 12.5px; padding-top: 8px; }

@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .wrap { padding: 0 16px; }
}
/* Narrow phones cannot fit the brand, the feed status and the wallet button on
   one line. The status dot stays as a light, with the full text on its title. */
@media (max-width: 700px) {
  .nav .wrap { gap: 12px; }
  #feed-text { display: none; }
  .chip { padding: 0 9px; }
  .btn { white-space: nowrap; }
}

@media (max-width: 900px) {
  .foot .wrap { grid-template-columns: 1fr; gap: 34px; }
  .foot-cols { gap: 32px; }
}
@media (max-width: 560px) {
  .foot-cols { gap: 24px 20px; }
  .foot-col { flex: 1 1 40%; }
  .foot-col a { white-space: normal; }
}

/* ---------------- wallet picker ---------------- */
#walletpick {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.wp-card {
  width: min(380px, calc(100vw - 32px));
  background: var(--glass-2); border: 1px solid var(--glass-line-2);
  border-radius: 16px; padding: 18px 20px 16px;
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
}
.wp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.wp-head b { font-size: 15px; }
.wp-rows { display: grid; gap: 6px; }
.wp-row {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 12px; border-radius: 10px; cursor: pointer; text-align: left;
  background: var(--glass-hi); border: 1px solid var(--glass-line);
  color: var(--text); font: 500 13.5px/1 var(--sans, inherit);
}
.wp-row:hover { border-color: var(--glass-line-2); background: rgba(255,255,255,.06); }
.wp-row img { width: 24px; height: 24px; border-radius: 6px; }
.wp-dot { width: 24px; height: 24px; border-radius: 6px; background: var(--fade); }
.wp-note { font-size: 13px; line-height: 1.6; color: var(--muted); }
.wp-note p { margin: 0 0 10px; }
.wp-note p:last-child { margin: 0; }

/* The external-link mark is drawn at the logo's stroke weight, not a ↗ glyph
   borrowed from whatever font happens to load. */
.ext {
  display: inline-block; vertical-align: 1px; margin-left: 2px;
  fill: none; stroke: currentColor; stroke-width: 1.3;
  stroke-linecap: round; stroke-linejoin: round; opacity: .65;
}
a:hover .ext { opacity: 1; }

/* A connected wallet that cannot pay a transaction fee. */
#connect.warn { box-shadow: inset 0 0 0 1px rgba(245, 165, 36, .45); }
.wp-links { margin-top: 14px; }
.wp-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
