@font-face {
  font-family: "Geist";
  src: url("assets/fonts/geist-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/geist-mono-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #171717;
  --surface-raised: #202322;
  --surface-hover: #262626;
  --border: #323735;
  --border-strong: #4b5350;
  --text: #f5f7f6;
  --text-soft: #c1c8c5;
  --muted: #8e9894;
  --subtle: #69736f;
  --brand: #00ffa3;
  --brand-hover: #00c07b;
  --brand-press: #009661;
  --brand-soft: #70ffcb;
  --brand-deep: #003726;
  --error: #ff7272;
  --radius: 8px;
  --topbar-height: 68px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 14% -8%, rgba(0, 255, 163, 0.08), transparent 27rem),
    var(--bg);
  color: var(--text);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 5;
  border-radius: var(--radius);
  background: var(--brand);
  color: #07130e;
  padding: 10px 14px;
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.96);
}

.topbar-shell {
  display: flex;
  width: min(100% - 32px, 1440px);
  min-height: var(--topbar-height);
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar-actions,
.panel-heading,
.token-identity,
.status-line,
.feed-meta {
  display: flex;
  align-items: center;
}

.brand-link {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  flex: 0 0 auto;
}

.brand-link img {
  display: block;
  height: auto;
}

.brand-full {
  width: 132px;
  min-width: 128px;
}

.brand-mark {
  display: none !important;
}

.topbar-actions {
  gap: 12px;
}

.repo-link {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--text);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease;
}

.repo-link:hover {
  border-color: var(--brand-hover);
  background: var(--surface-hover);
}

.live-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 12px;
}

.live-state i,
.feed-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--subtle);
}

.live-state.is-live {
  color: var(--brand-soft);
}

.live-state.is-live i,
.feed-pulse {
  background: var(--brand);
}

main,
footer {
  width: min(100% - 32px, 1440px);
  margin-inline: auto;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(480px, 0.8fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 36px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-soft);
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(32px, 3vw, 48px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.masthead-copy > p:last-child {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
}

.snapshot-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
}

.snapshot-stats > div {
  min-width: 0;
  border-left: 1px solid var(--border);
  padding-left: 20px;
}

.snapshot-stats dt {
  color: var(--muted);
  font-size: 12px;
}

.snapshot-stats dd {
  overflow: hidden;
  margin: 6px 0 0;
  color: var(--text);
  font-family: "Geist Mono", monospace;
  font-size: clamp(16px, 2vw, 24px);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-heading h2 {
  margin-bottom: 4px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.toolbar label,
.search-control span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

input,
select {
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #101211;
  color: var(--text);
}

input {
  padding: 9px 12px;
}

input::placeholder {
  color: var(--muted);
}

select {
  padding: 8px 34px 8px 11px;
}

.toolbar {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}

.search-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

#searchInput {
  width: clamp(190px, 23vw, 320px);
}

.data-status {
  margin: 0 0 0 10px;
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  white-space: nowrap;
}

.refresh-button {
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #101211;
  color: var(--text-soft);
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.refresh-button:hover:not(:disabled) {
  border-color: var(--brand-hover);
  background: var(--surface-raised);
  color: var(--brand-soft);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.workspace {
  min-width: 0;
}

.ranking-panel,
.feed-panel,
.methodology {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(23, 23, 23, 0.82);
}

.panel-heading {
  min-height: 68px;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding: 13px 16px;
}

.model-label {
  border: 1px solid rgba(0, 255, 163, 0.3);
  border-radius: 999px;
  background: rgba(0, 255, 163, 0.08);
  color: var(--brand-soft);
  padding: 6px 10px;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.table-shell {
  max-height: calc(100dvh - 240px);
  min-height: 500px;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 1030px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  border-bottom: 1px solid #252a28;
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
}

thead th {
  position: sticky;
  top: 29px;
  z-index: 1;
  background: #111312;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

thead .group-row th {
  top: 0;
  height: 29px;
  border-bottom-color: var(--border);
  color: var(--brand-soft);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.018);
}

tbody tr:hover {
  background: var(--surface-hover);
}

.rank-column,
.rank-cell {
  width: 38px;
  color: var(--subtle);
  text-align: right;
}

.numeric {
  text-align: right;
}

.token-identity {
  min-width: 180px;
  gap: 10px;
}

.token-avatar-shell {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-raised);
}

.token-avatar,
.token-avatar-fallback {
  width: 100%;
  height: 100%;
}

.token-avatar {
  display: block;
  object-fit: cover;
}

.token-avatar[hidden],
.token-avatar-fallback[hidden] {
  display: none !important;
}

.token-avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  font-weight: 700;
}

.token-copy {
  min-width: 0;
}

.token-copy a {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-copy a:hover,
.mcap-link:hover {
  color: var(--brand-soft);
  text-decoration: underline;
}

.token-copy small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcap-link {
  color: var(--text);
  font-family: "Geist Mono", monospace;
  font-weight: 650;
  text-decoration: none;
}

.yield-value {
  color: var(--brand-soft);
  font-family: "Geist Mono", monospace;
  font-weight: 650;
}

.yield-value.previous {
  color: var(--text-soft);
}

.payout-time {
  color: var(--text-soft);
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  font-weight: 700;
}

.status-badge.paying {
  background: rgba(0, 255, 163, 0.11);
  color: var(--brand-soft);
}

.status-badge.stale,
.status-badge.never {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.quote-symbol {
  color: var(--text-soft);
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  font-weight: 650;
}

.feed-panel {
  overflow: hidden;
  margin-top: 16px;
}

.feed-heading {
  min-height: 68px;
}

.feed-pulse {
  flex: 0 0 auto;
}

.feed-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
}

.feed-item {
  display: block;
  min-width: 0;
  background: rgba(23, 23, 23, 0.98);
  padding: 12px 14px;
  text-decoration: none;
}

.feed-item:hover {
  background: var(--surface-hover);
}

.feed-main,
.feed-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.feed-main strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-amount {
  flex: 0 0 auto;
  color: var(--brand-soft);
  font-family: "Geist Mono", monospace;
  font-size: 12px;
}

.feed-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.feed-empty,
.empty-state {
  color: var(--muted);
  padding: 32px 18px;
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  color: var(--text-soft);
  margin-bottom: 4px;
}

.mobile-ranking {
  display: none;
}

.methodology {
  margin-top: 16px;
  padding: 0 18px;
}

.methodology summary {
  cursor: pointer;
  padding: 16px 0;
  color: var(--text-soft);
  font-weight: 650;
}

.methodology-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 1px solid var(--border);
  padding: 18px 0 22px;
}

.methodology-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.methodology-grid strong {
  color: var(--text-soft);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding: 22px 0 34px;
  color: var(--subtle);
  font-size: 12px;
}

footer a {
  color: var(--muted);
}

.skeleton-row td {
  height: 58px;
}

.skeleton {
  display: inline-block;
  height: 11px;
  border-radius: 4px;
  background: #2c312f;
}

@media (prefers-reduced-motion: no-preference) {
  .live-state.is-live i,
  .feed-pulse {
    animation: pulse 2.2s ease-in-out infinite;
  }
}

@keyframes pulse {
  50% { opacity: 0.32; }
}

@media (max-width: 1120px) {
  .masthead {
    grid-template-columns: 1fr;
  }

  .snapshot-stats {
    max-width: 720px;
  }

  .feed-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .methodology-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar-shell {
    width: min(100% - 24px, 1440px);
    gap: 12px;
  }

  .brand-full {
    display: none !important;
  }

  .brand-mark {
    display: block !important;
    width: auto;
    height: 24px !important;
  }

  main,
  footer {
    width: min(100% - 24px, 1440px);
  }

  .masthead {
    padding-top: 30px;
  }

  h1 {
    font-size: clamp(34px, 11vw, 48px);
  }

  .snapshot-stats {
    grid-template-columns: 1fr 1fr;
    gap: 18px 0;
  }

  .snapshot-stats > div:nth-child(3) {
    grid-column: 1 / -1;
  }

  .toolbar {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 10px;
    padding-block: 14px;
  }

  .search-control {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr;
    margin: 0;
  }

  #searchInput {
    width: 100%;
  }

  .data-status {
    grid-column: 1 / -1;
    margin: 4px 0 0;
    white-space: normal;
  }

  .refresh-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .model-label {
    white-space: normal;
  }

  .table-shell {
    display: none;
  }

  .mobile-ranking {
    display: block;
  }

  .mobile-card {
    border-bottom: 1px solid var(--border);
    padding: 15px;
  }

  .mobile-card:last-child {
    border-bottom: 0;
  }

  .mobile-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .mobile-card-head .token-identity {
    min-width: 0;
    flex: 1;
  }

  .mobile-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 14px;
  }

  .mobile-metrics div {
    border-left: 1px solid var(--border);
    padding-left: 10px;
  }

  .mobile-metrics span,
  .mobile-metrics strong {
    display: block;
  }

  .mobile-metrics span {
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-metrics strong {
    margin-top: 2px;
    font-family: "Geist Mono", monospace;
    font-size: 13px;
  }

  .methodology-grid {
    grid-template-columns: 1fr;
  }

  .feed-list {
    grid-template-columns: minmax(0, 1fr);
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar,
  .ranking-panel,
  .feed-panel {
    background: var(--bg);
    backdrop-filter: none;
  }
}
