:root {
  color-scheme: dark;
  --bg: #05070c;
  --panel: rgba(12, 18, 30, 0.82);
  --panel-strong: rgba(16, 23, 38, 0.94);
  --line: rgba(169, 184, 216, 0.18);
  --line-bright: rgba(139, 92, 246, 0.45);
  --text: #f5f7fb;
  --muted: #abb6cb;
  --faint: #77839c;
  --violet: #8b5cf6;
  --violet-2: #b46cff;
  --mint: #5be7a9;
  --amber: #ffd166;
  --coral: #ff7a90;
  --blue: #72b7ff;
  --mono: "IBM Plex Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

#networkCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background:
    linear-gradient(rgba(5, 7, 12, 0.8), rgba(5, 7, 12, 0.94)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.026) 0 1px, transparent 1px 80px);
}

.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.topbar {
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 54px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 12, 0.72);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 2px solid var(--violet);
  clip-path: polygon(50% 0, 96% 25%, 96% 75%, 50% 100%, 4% 75%, 4% 25%);
  display: grid;
  place-items: center;
  color: var(--violet-2);
  background: rgba(139, 92, 246, 0.12);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  font-weight: 800;
}

.brand small {
  margin-top: 2px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 650;
}

.desktop-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-nav a {
  min-height: 36px;
  padding: 9px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.desktop-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

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

.network-pill,
.icon-link {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 19, 32, 0.75);
  display: inline-flex;
  align-items: center;
}

.network-pill {
  gap: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

#statusDot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.14);
}

#statusDot.good {
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(91, 231, 169, 0.14);
}

#statusDot.bad {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 122, 144, 0.14);
}

.icon-link {
  width: 38px;
  justify-content: center;
  color: var(--muted);
}

.icon-link svg {
  width: 18px;
  height: 18px;
}

.hero {
  min-height: calc(100vh - 72px);
  padding: clamp(54px, 8vw, 116px) clamp(18px, 6vw, 92px) clamp(34px, 6vw, 72px);
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--line);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  display: grid;
  gap: 22px;
}

.eyebrow {
  margin: 0;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  width: min(760px, 100%);
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.96;
  font-weight: 850;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.hero-copy {
  max-width: 660px;
  color: #d5dbea;
  font-size: 18px;
  line-height: 1.65;
}

.search-card {
  width: min(760px, 100%);
  min-height: 62px;
  border: 1px solid rgba(169, 184, 216, 0.22);
  border-radius: 8px;
  background: rgba(11, 16, 28, 0.86);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.34);
}

.search-card svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.search-card input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.search-card input::placeholder {
  color: var(--faint);
}

.search-card button,
.btn {
  min-height: 46px;
  border: 1px solid rgba(139, 92, 246, 0.44);
  border-radius: 7px;
  background: rgba(139, 92, 246, 0.16);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
}

.search-card button,
.btn.primary {
  background: #7c3aed;
  border-color: #9f67ff;
  box-shadow: 0 10px 34px rgba(124, 58, 237, 0.34);
}

.btn svg {
  width: 17px;
  height: 17px;
}

.quick-links,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-links a {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 19, 32, 0.74);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quick-links a:hover {
  color: var(--text);
  border-color: var(--line-bright);
}

.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.chain-stage {
  position: absolute;
  right: clamp(-120px, 2vw, 80px);
  top: 12%;
  width: min(760px, 58vw);
  height: min(620px, 62vw);
  perspective: 900px;
  opacity: 0.92;
}

.chain-grid {
  position: absolute;
  inset: 18% 10% 10%;
  transform: rotateX(62deg) rotateZ(-34deg);
  transform-style: preserve-3d;
  border: 1px solid rgba(139, 92, 246, 0.3);
  background:
    repeating-linear-gradient(90deg, rgba(139, 92, 246, 0.2) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(91, 231, 169, 0.11) 0 1px, transparent 1px 72px);
}

.chain-grid span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 0 0 24px rgba(91, 231, 169, 0.7);
}

.chain-grid span:nth-child(1) { left: 12%; top: 16%; }
.chain-grid span:nth-child(2) { left: 52%; top: 8%; background: var(--violet-2); }
.chain-grid span:nth-child(3) { right: 10%; top: 34%; }
.chain-grid span:nth-child(4) { left: 22%; bottom: 14%; background: var(--violet-2); }
.chain-grid span:nth-child(5) { left: 62%; bottom: 8%; }
.chain-grid span:nth-child(6) { right: 16%; bottom: 20%; background: var(--violet-2); }
.chain-grid span:nth-child(7) { left: 40%; top: 46%; }
.chain-grid span:nth-child(8) { right: 34%; top: 58%; background: var(--violet-2); }

.chain-core {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 180px;
  height: 180px;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) rotateX(-18deg) rotateY(32deg);
  animation: floatCore 7s ease-in-out infinite;
}

@keyframes floatCore {
  0%, 100% { transform: translate(-50%, -50%) rotateX(-18deg) rotateY(32deg) translateY(0); }
  50% { transform: translate(-50%, -50%) rotateX(-12deg) rotateY(52deg) translateY(-14px); }
}

.cube-face {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(180, 108, 255, 0.78);
  background: rgba(76, 29, 149, 0.38);
  display: grid;
  place-items: center;
  color: #c8a3ff;
  font-family: var(--mono);
  font-size: 42px;
  font-weight: 900;
  text-shadow: 0 0 28px rgba(180, 108, 255, 0.9);
  box-shadow: inset 0 0 34px rgba(139, 92, 246, 0.34), 0 0 50px rgba(124, 58, 237, 0.28);
}

.face-front { transform: translateZ(90px); }
.face-back { transform: rotateY(180deg) translateZ(90px); }
.face-right { transform: rotateY(90deg) translateZ(90px); }
.face-left { transform: rotateY(-90deg) translateZ(90px); }
.face-top { transform: rotateX(90deg) translateZ(90px); }
.face-bottom { transform: rotateX(-90deg) translateZ(90px); }

.node {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(180, 108, 255, 0.75);
  background: rgba(139, 92, 246, 0.24);
  transform: rotate(45deg);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.35);
}

.node-a { left: 20%; top: 18%; }
.node-b { right: 24%; top: 13%; width: 26px; height: 26px; }
.node-c { left: 25%; bottom: 22%; width: 24px; height: 24px; }
.node-d { right: 12%; bottom: 28%; width: 18px; height: 18px; }

.live-strip {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  transform: translateY(-30px);
  backdrop-filter: blur(18px);
}

.live-strip article {
  min-width: 0;
  min-height: 112px;
  padding: 22px;
  display: grid;
  gap: 6px;
  border-right: 1px solid var(--line);
}

.live-strip article:last-child {
  border-right: 0;
}

.live-strip span,
.data-row small,
.summary-list span,
.portal-card span,
.validator-row small {
  color: var(--muted);
}

.live-strip strong {
  min-width: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 24px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.live-strip small {
  color: var(--mint);
  font-size: 11px;
  font-weight: 750;
}

.content-grid,
.portal-grid {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto 32px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(300px, 0.75fr);
  gap: 14px;
}

.activity-panel,
.summary-panel,
.portal-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(16px);
}

.activity-panel,
.summary-panel {
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head a {
  color: var(--violet-2);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.section-head.compact {
  margin-bottom: 12px;
}

.data-list,
.summary-list,
.validator-list,
.side-stack {
  display: grid;
  gap: 10px;
}

.data-row,
.validator-row,
.summary-item {
  min-width: 0;
  border: 1px solid rgba(169, 184, 216, 0.11);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.data-row,
.validator-row {
  padding: 11px 12px;
  display: grid;
  align-items: center;
  gap: 10px;
}

.data-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.data-icon,
.validator-rank {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(139, 92, 246, 0.16);
  color: var(--violet-2);
  font-family: var(--mono);
  font-weight: 800;
  font-size: 12px;
}

.data-row strong,
.validator-row strong {
  display: block;
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.data-row small,
.validator-row small {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.data-value {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.summary-item {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.summary-item strong {
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

.validator-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.validator-row .score {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 44px;
}

.portal-card {
  min-height: 150px;
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.portal-card:hover {
  border-color: var(--line-bright);
  transform: translateY(-2px);
}

.portal-card svg {
  width: 34px;
  height: 34px;
  color: var(--violet-2);
}

.portal-card strong {
  font-size: 15px;
}

.portal-card span {
  font-size: 13px;
  line-height: 1.5;
}

.empty-state {
  min-height: 116px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .desktop-nav {
    justify-self: start;
  }

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

  .side-stack {
    grid-column: span 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .desktop-nav {
    display: none;
  }

  .network-pill {
    max-width: 150px;
  }

  #networkMode {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero {
    min-height: auto;
    padding-top: 58px;
  }

  .hero-visual {
    opacity: 0.38;
  }

  .chain-stage {
    width: 780px;
    height: 620px;
    right: -420px;
    top: 8%;
  }

  h1 {
    font-size: 48px;
  }

  .hero-copy {
    font-size: 16px;
  }

  .search-card {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 58px;
  }

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

  .live-strip,
  .content-grid,
  .portal-grid {
    width: min(100% - 28px, 620px);
  }

  .live-strip,
  .content-grid,
  .portal-grid,
  .side-stack {
    grid-template-columns: 1fr;
  }

  .live-strip {
    transform: none;
    margin-top: 10px;
    margin-bottom: 24px;
  }

  .live-strip article {
    min-height: 92px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .live-strip article:last-child {
    border-bottom: 0;
  }

  .side-stack {
    grid-column: auto;
  }

  .portal-grid {
    padding-bottom: 28px;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 12px 14px;
  }

  .brand small,
  .icon-link {
    display: none;
  }

  .hero {
    padding-inline: 14px;
  }

  h1 {
    font-size: 40px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .data-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .data-value {
    grid-column: 2;
    text-align: left;
  }
}
