:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-soft: #10182e;
  --panel: rgba(18, 26, 45, 0.86);
  --panel-strong: rgba(23, 35, 61, 0.92);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f7fb;
  --muted: #a8b2c7;
  --soft: #d8deeb;
  --orange: #ff8a1f;
  --green: #39d98a;
  --blue: #58a6ff;
  --red: #ff5c7a;
  --yellow: #ffd166;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 4%, rgba(255, 138, 31, 0.3), transparent 26rem),
    radial-gradient(circle at 82% 18%, rgba(88, 166, 255, 0.22), transparent 31rem),
    linear-gradient(135deg, #070a12 0%, var(--bg) 46%, #111827 100%);
  color: var(--text);
}

button,
a {
  font: inherit;
}

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

.shell {
  display: grid;
  grid-template-columns: 17.5rem minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.25rem;
  border-right: 1px solid var(--line);
  background: rgba(6, 10, 21, 0.78);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 3rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #ff9f1c, #ff5c35);
  color: #1a0d04;
  font-weight: 900;
  box-shadow: 0 16px 40px rgba(255, 138, 31, 0.24);
}

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

.brand small,
.panel-label,
.eyebrow,
.metric span,
.signal-card span,
.microcopy {
  color: var(--muted);
}

.nav-list {
  display: grid;
  gap: 0.35rem;
}

.nav-list a {
  padding: 0.8rem 0.85rem;
  border-radius: 0.45rem;
  color: var(--soft);
}

.nav-list a:hover,
.nav-list a.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.sidebar-panel {
  margin-top: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-panel strong {
  display: block;
  margin-top: 0.3rem;
}

.sidebar-panel p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

main {
  width: min(100%, 95rem);
  margin: 0 auto;
  padding: 1.5rem;
}

.hero {
  min-height: clamp(25rem, 42vh, 38rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  padding: clamp(1.25rem, 3vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(90deg, rgba(8, 13, 27, 0.76), rgba(8, 13, 27, 0.3)),
    url("https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&w=1800&q=80")
      center / cover;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(0deg, rgba(8, 13, 27, 0.82), transparent);
  pointer-events: none;
}

.hero-copy,
.hero-actions {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 62rem;
  font-size: clamp(2.6rem, 5.4vw, 6.8rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(1.05rem, 1.3vw, 1.35rem);
}

.hero p:not(.eyebrow) {
  max-width: 48rem;
  margin: 1rem 0 0;
  color: var(--soft);
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  align-self: end;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button {
  min-height: 2.8rem;
  border: 0;
  border-radius: 0.45rem;
  padding: 0 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  background: linear-gradient(135deg, #ffad33, #ff6b1a);
  color: #170c03;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  border: 1px solid var(--line);
}

.signal-grid,
.content-grid {
  display: grid;
  gap: 1rem;
}

.signal-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 1rem 0;
}

.signal-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--panel);
  backdrop-filter: blur(22px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
}

.signal-card {
  min-height: 9rem;
  padding: 1rem;
  display: grid;
  align-content: space-between;
  position: relative;
  overflow: hidden;
}

.signal-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.28rem;
  background: var(--accent);
}

.accent-orange {
  --accent: var(--orange);
}

.accent-green {
  --accent: var(--green);
}

.accent-blue {
  --accent: var(--blue);
}

.accent-red {
  --accent: var(--red);
}

.signal-card strong {
  display: block;
  margin-top: 0.6rem;
  font-size: clamp(1.3rem, 2vw, 2rem);
  line-height: 1.05;
  word-break: break-word;
}

.signal-card small {
  color: var(--muted);
  line-height: 1.35;
}

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

.wide {
  grid-column: 1 / -1;
}

.panel {
  padding: 1rem;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pill {
  min-height: 1.8rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

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

.metric {
  min-height: 5.8rem;
  padding: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.metric span,
.metric strong {
  display: block;
}

.metric span {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric strong {
  margin-top: 0.45rem;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}

.risk-meter {
  height: 0.65rem;
  overflow: hidden;
  border-radius: 999px;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.08);
}

.risk-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  transition: width 0.5s ease;
}

.hash-box,
pre {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.45rem;
  background: #080d19;
  color: #dbeafe;
}

.hash-box {
  padding: 1rem;
  line-height: 1.6;
  word-break: break-all;
}

.map-shell {
  position: relative;
  min-height: clamp(18rem, 42vw, 34rem);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.45rem;
  background: #080d19;
}

.map-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  border: 0;
}

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 138, 31, 0.12), transparent),
    #080d19;
}

.map-panel.has-map .map-empty {
  display: none;
}

.map-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.8rem;
  color: var(--orange);
  font-weight: 800;
}

.microcopy {
  margin: 0.8rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

pre {
  margin: 0;
  min-height: 22rem;
  max-height: 42rem;
  overflow: auto;
  padding: 1rem;
  line-height: 1.5;
  font-size: 0.86rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(26rem, calc(100vw - 2rem));
  transform: translateY(150%);
  transition: transform 0.25s ease;
  padding: 0.9rem 1rem;
  border-radius: 0.45rem;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 10;
}

.toast.visible {
  transform: translateY(0);
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .hero,
  .signal-grid,
  .content-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-copy,
  .hero-actions,
  .wide {
    grid-column: 1 / -1;
  }

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

@media (max-width: 680px) {
  main,
  .sidebar {
    padding: 0.85rem;
  }

  .nav-list,
  .hero,
  .signal-grid,
  .content-grid,
  .metric-grid,
  .metric-grid.compact {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 35rem;
    padding: 1rem;
  }

  .hero-actions {
    justify-content: stretch;
  }

  .hero-actions button {
    flex: 1 1 12rem;
  }

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