/* Hunch design system. Dark terminal, editorial serif, mono numbers. */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0a0b0e;
  --bg-2: #0f1117;
  --panel: #12141c;
  --panel-2: #171a23;
  --line: #22252f;
  --line-2: #2d313d;
  --ink: #ebe8de;
  --ink-2: #c9c6bc;
  --muted: #868b98;
  --faint: #5c6170;
  --accent: #d8ab4c;
  --accent-ink: #1a1405;
  --accent-soft: rgba(216, 171, 76, 0.12);
  --up: #3ddc97;
  --up-soft: rgba(61, 220, 151, 0.12);
  --down: #ff5c7a;
  --down-soft: rgba(255, 92, 122, 0.12);
  --warn: #f5b84a;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 10px;
  --max: 1180px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(216, 171, 76, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(124, 140, 255, 0.06), transparent 60%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: 20px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.up { color: var(--up); }
.down { color: var(--down); }
.gold { color: var(--accent); }
.kicker {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--up); margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 3px var(--up-soft); }
.kicker .dot.off { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
.kicker .dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(245,184,74,.15); }

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; }
h1 { font-size: clamp(40px, 6.4vw, 78px); line-height: 1.0; }
h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.08; }
h3 { font-size: 24px; line-height: 1.2; }
h1 em, h2 em { font-style: italic; color: var(--accent); }
p { margin: 0; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 62ch; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(10, 11, 14, 0.78);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 24px; letter-spacing: -0.01em; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--accent);
  display: grid; place-items: center;
  color: var(--accent); font-size: 15px; font-family: var(--serif);
  background: radial-gradient(circle at 50% 40%, rgba(216,171,76,.28), transparent 70%);
}
.nav nav { display: flex; gap: 22px; margin-left: 8px; font-size: 14px; color: var(--ink-2); }
.nav nav a.active, .nav nav a:hover { color: var(--ink); }
.nav nav a.active { position: relative; }
.nav nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -21px; height: 2px; background: var(--accent); }
.nav .spacer { flex: 1; }
.nav .live { font-size: 12px; }
@media (max-width: 780px) {
  .nav nav { display: none; }
  .nav .wrap { gap: 14px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink); font-weight: 500; font-size: 14px;
  cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s, transform .15s;
}
.btn:hover { border-color: var(--accent); color: var(--ink); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: #e6bb5c; color: var(--accent-ink); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

/* Panels / tiles */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-pad { padding: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile { background: var(--panel); padding: 18px 20px; }
.tile .kicker { margin-bottom: 10px; }
.tile .v { font: 500 28px/1 var(--mono); letter-spacing: -0.02em; }
.tile .sub { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 6px;
  font: 500 11.5px/1.6 var(--mono); letter-spacing: .02em;
  border: 1px solid var(--line-2); color: var(--ink-2); background: var(--panel-2);
}
.badge.gold { color: var(--accent); border-color: rgba(216,171,76,.35); background: var(--accent-soft); }
.badge.up { color: var(--up); border-color: rgba(61,220,151,.3); background: var(--up-soft); }
.badge.down { color: var(--down); border-color: rgba(255,92,122,.3); background: var(--down-soft); }
.badge.warn { color: var(--warn); border-color: rgba(245,184,74,.3); background: rgba(245,184,74,.1); }
.badge.dim { color: var(--muted); }
.stance-constructive { color: var(--up); }
.stance-watch { color: var(--warn); }
.stance-cautious { color: var(--muted); }

/* Conviction bar */
.conv { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; }
.conv .bar { width: 56px; height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.conv .bar i { display: block; height: 100%; background: var(--accent); }
.conv.hi .bar i { background: var(--up); }
.conv.lo .bar i { background: var(--faint); }

/* Tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); position: sticky; top: 0; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr.row-link { cursor: pointer; }
tbody tr.row-link:hover { background: var(--panel-2); }
.token { display: flex; align-items: center; gap: 10px; min-width: 0; }
.token .ico { width: 26px; height: 26px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line-2); flex: 0 0 26px; display: grid; place-items: center; font: 500 11px var(--mono); color: var(--muted); overflow: hidden; }
.token .ico img { width: 100%; height: 100%; object-fit: cover; }
.token .sym { font-weight: 600; }
.token .name { font-size: 12px; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.addr { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.addr:hover { color: var(--accent); }

/* Sparkline */
.spark { width: 100%; height: 42px; display: block; }
.spark path { fill: none; stroke-width: 1.5; }
.spark .area { fill: url(#sparkfill); stroke: none; }

/* Sections */
section { padding-block: 64px; }
section.tight { padding-block: 40px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head .kicker { margin-bottom: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

hr.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Footer */
footer { border-top: 1px solid var(--line); padding-block: 40px 60px; color: var(--muted); font-size: 13px; }
footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; margin-bottom: 28px; }
footer .cols a { display: block; color: var(--ink-2); margin-bottom: 6px; }
footer .legal { font-size: 12px; line-height: 1.6; color: var(--faint); max-width: 110ch; }
footer .legal p + p { margin-top: 10px; }
@media (max-width: 780px) { footer .cols { grid-template-columns: 1fr; } }

/* Utilities */
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.hide { display: none !important; }
.skeleton { color: transparent; background: linear-gradient(90deg, var(--panel-2), var(--line), var(--panel-2)); background-size: 200% 100%; animation: sk 1.2s infinite linear; border-radius: 4px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line-2); padding: 10px 14px; border-radius: 8px; font-size: 13px; z-index: 50; }

/* Long unbroken strings (contract addresses, pasted CAs in posts) must wrap on phones. */
.addr, .thesis-box p, .thesis-box li, .panel .small, .ca, td .addr { overflow-wrap: anywhere; }
.detail-head > div { min-width: 0; max-width: 100%; }
.detail-head .row > .addr { word-break: break-all; }
@media (max-width: 640px) {
  .detail-head .token .sym { font-size: 26px; }
  .detail-head > div:last-child { text-align: left; }
}

/* Grid/flex children must be allowed to shrink below content width (phone overflow). */
.detail-grid > *, .grid-2 > *, .grid-3 > *, .stack > *, .panel { min-width: 0; max-width: 100%; }
.spark { max-width: 100%; }
