:root {
  --bg: #0B0D0E;
  --surface: #14171A;
  --surface-hover: #191D20;
  --border: #23272B;
  --yellow: #F4B728;
  --cyan: #35D0BA;
  --text: #EDEDED;
  --text-muted: #767C82;
  --danger: #E5484D;

  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

a {
  color: inherit;
}

/* --- Topbar --- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 12px rgba(244, 183, 40, 0.6);
}

.brand-name {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.conn-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.conn-dot.live {
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(53, 208, 186, 0.7);
}

.conn-dot.error {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(229, 72, 77, 0.6);
}

/* --- Hero / pulse --- */

.hero {
  position: relative;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.pulse-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  pointer-events: none;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 8px;
}

.block-height {
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hero-caption {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- Stats grid --- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-card {
  background: var(--surface);
  padding: 24px 28px;
  transition: background 0.2s ease;
}

.stat-card:hover {
  background: var(--surface-hover);
}

.stat-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-value {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--yellow);
}

.mono {
  font-family: var(--font-mono);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Playground --- */

.playground {
  padding: 40px 32px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.playground-header h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.playground-caption {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.playground-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
}

@media (max-width: 720px) {
  .playground-body {
    grid-template-columns: 1fr;
  }
}

.playground-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rpc-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-align: left;
  padding: 12px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.rpc-btn:hover {
  border-color: var(--yellow);
  background: var(--surface-hover);
}

.rpc-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.rpc-btn.loading {
  color: var(--text-muted);
  border-color: var(--cyan);
}

.playground-output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.output-toolbar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.output-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.output-pre {
  margin: 0;
  padding: 16px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
  overflow: auto;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Footer --- */

.page-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}
