/* Public snaps UI — Rio Blocks dark + EOS Rio cyan heritage */
:root {
  --bg: #050505;
  --bg-elev: #0c0c0c;
  --bg-card: #111113;
  --bg-card-hover: #16161a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f0f0f0;
  --muted: #888;
  --faint: #5a5a5a;
  --teal: #14b8a6;
  --teal-dim: rgba(20, 184, 166, 0.15);
  --cyan: #00aee7; /* EOS Rio heritage */
  --amber: #f59e0b;
  --danger: #f87171;
  --radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--teal);
  text-decoration: none;
}
a:hover {
  color: #2dd4bf;
  text-decoration: underline;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  width: 80vw;
  height: 50vh;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(20, 184, 166, 0.12) 0%,
    rgba(0, 174, 231, 0.06) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.topbar,
.wrap,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.95rem 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand:hover {
  text-decoration: none;
  opacity: 0.92;
}
.brand img {
  display: block;
  flex-shrink: 0;
  height: auto;
  object-fit: contain;
}

/* Horizontal EOS Rio logo (black asset → white on dark bar) */
.logo-eosrio {
  height: 40px;
  width: auto;
  max-width: min(168px, 38vw);
  filter: brightness(0) invert(1);
}
.brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.brand-eosrio {
  justify-self: start;
}

/* Rio Blocks wordmark (viewBox 670×180) */
.logo-rb {
  height: 32px;
  width: auto;
  max-width: min(180px, 42vw);
  opacity: 0.95;
}
.brand-rb {
  justify-self: end;
}

.topbar-mid {
  justify-self: center;
}

@media (max-width: 560px) {
  .topbar-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "eos rb"
      "pill pill";
    row-gap: 0.65rem;
  }
  .brand-eosrio {
    grid-area: eos;
  }
  .brand-rb {
    grid-area: rb;
  }
  .topbar-mid {
    grid-area: pill;
  }
  .logo-eosrio {
    height: 34px;
  }
  .logo-rb {
    height: 28px;
  }
  .brand-sub {
    display: none;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--bg-elev);
}
.pill.live {
  color: var(--teal);
  border-color: rgba(20, 184, 166, 0.35);
  background: var(--teal-dim);
}
.pill.live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}
.pill.warn {
  color: var(--amber);
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
}
.pill.err {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.1);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.hero {
  margin-bottom: 1.75rem;
}
.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}
.hero h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.accent {
  background: linear-gradient(120deg, var(--cyan), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  margin: 0 0 1.5rem;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 720px) {
  .hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.metric {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}
.metric span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin-bottom: 0.25rem;
}
.metric strong {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.metric a {
  font-family: var(--mono);
  font-size: 0.85rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem 0 1rem;
}
.search {
  flex: 1 1 220px;
  max-width: 360px;
}
.search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  padding: 0.7rem 0.9rem;
  outline: none;
}
.search input:focus {
  border-color: rgba(20, 184, 166, 0.5);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}
.toolbar-actions {
  display: flex;
  gap: 0.5rem;
}

.btn {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 550;
  border-radius: 10px;
  padding: 0.6rem 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn.ghost:hover {
  background: var(--bg-card);
  border-color: var(--border-strong);
}
.btn.primary {
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  color: #041016;
  border: none;
}
.btn.primary:hover {
  filter: brightness(1.08);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.banner {
  border-radius: 12px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--muted);
  margin-bottom: 1rem;
}
.banner.error {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}

.chain-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chain-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.chain-card[open] {
  border-color: rgba(20, 184, 166, 0.28);
  background: var(--bg-card-hover);
}
.chain-card summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 1.2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}
.chain-card summary::-webkit-details-marker {
  display: none;
}
.chain-card summary:hover {
  background: rgba(255, 255, 255, 0.02);
}

.chain-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: #0a0a0a center/contain no-repeat;
  background-color: #0a0a0a;
  flex-shrink: 0;
}

.chain-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.chain-head .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 174, 231, 0.15);
  color: #7dd3fc;
}
.badge.zstd {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}
.badge.count {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.chain-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.chain-stats b {
  color: var(--text);
  font-weight: 550;
}
.chain-stats .mono {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.chain-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}
.chev {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.chain-card[open] .chev {
  transform: rotate(180deg);
  color: var(--teal);
  border-color: rgba(20, 184, 166, 0.4);
}

.chain-body {
  border-top: 1px solid var(--border);
  padding: 0 0.5rem 0.75rem;
  overflow-x: auto;
}

table.snap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 680px;
}
.snap-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  font-weight: 600;
  padding: 0.85rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.snap-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
.snap-table tr:last-child td {
  border-bottom: none;
}
.snap-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.snap-table .mono {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.snap-table .latest-row td {
  background: rgba(20, 184, 166, 0.05);
}
.tag-latest {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal);
  margin-left: 0.4rem;
}

.dl {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--cyan);
}
.dl:hover {
  color: #38c4f0;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.row-actions a,
.row-actions button {
  font-size: 0.78rem;
  font-family: inherit;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}
.row-actions a:hover,
.row-actions button:hover {
  color: var(--text);
  border-color: var(--border-strong);
  text-decoration: none;
}

.howto {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
}
.howto h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}
.howto ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--muted);
}
.howto li {
  margin-bottom: 0.35rem;
}
.code-block {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  background: #000;
  border: 1px solid var(--border);
  overflow-x: auto;
  color: #d1fae5;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
}

.footer {
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding: 2rem 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.footer .muted {
  color: var(--faint);
  font-size: 0.82rem;
  max-width: 48rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  margin-top: 0.35rem;
}
.footer-links a {
  color: var(--muted);
}
.footer-links a:hover {
  color: var(--text);
}

@media (max-width: 640px) {
  .chain-card summary {
    grid-template-columns: auto 1fr;
  }
  .chain-cta {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
