:root {
  --bg: #07100e;
  --panel: rgba(13, 28, 24, 0.78);
  --panel-solid: #0c1b17;
  --line: rgba(187, 255, 226, 0.12);
  --line-bright: rgba(187, 255, 226, 0.24);
  --text: #effff8;
  --muted: #86a79b;
  --green: #6fffb9;
  --green-dim: #2d9e70;
  --lime: #c6ff70;
  --cyan: #73d9ff;
  --red: #ff7b72;
  --orange: #ffb86b;
  --sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--sans);
  background:
    linear-gradient(rgba(111, 255, 185, .024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 255, 185, .024) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 60%, rgba(2, 8, 7, .8));
  z-index: -1;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.ambient {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: -2;
  opacity: .11;
}

.ambient-a { top: -260px; right: -100px; background: var(--green); }
.ambient-b { bottom: -340px; left: -160px; background: var(--cyan); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 76px;
  padding: 0 clamp(24px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 14, .78);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
}

.brand-mark {
  position: relative;
  width: 27px;
  height: 27px;
  border: 1px solid var(--green);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(111, 255, 185, .2);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  transform: translate(-50%, -50%);
}

.brand-mark::before { transform: translate(-9px, -2px); }
.brand-mark::after { transform: translate(5px, -2px); }
.brand-mark span { box-shadow: 0 0 9px var(--green); }

.topbar-right { display: flex; align-items: center; gap: 24px; }

.secure-label,
.updated-at {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--muted);
}

.secure-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
}

.secure-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px var(--green);
}

main {
  width: min(1440px, calc(100% - clamp(32px, 8vw, 120px)));
  margin: 0 auto;
}

.hero {
  min-height: 500px;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: 60px;
  padding: 74px 0 58px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--green);
  font: 600 10px/1.3 var(--mono);
  letter-spacing: .2em;
}

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

h1 {
  margin-bottom: 24px;
  font-size: clamp(52px, 6.3vw, 96px);
  line-height: .92;
  letter-spacing: -.065em;
  font-weight: 640;
}

h1 em {
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 1px rgba(198, 255, 112, .65);
}

.hero-copy {
  max-width: 540px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.orbit-card {
  position: relative;
  min-height: 390px;
  display: grid;
  place-items: center;
}

.orbit {
  position: absolute;
  width: min(31vw, 370px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.orbit::before,
.orbit::after {
  content: "";
  position: absolute;
  inset: 16%;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.orbit::after { inset: 33%; }

.orbit-ring {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid transparent;
}

.ring-a {
  border-top-color: var(--green);
  border-right-color: rgba(111, 255, 185, .3);
  animation: spin 12s linear infinite;
}

.ring-b {
  inset: 16%;
  border-left-color: var(--cyan);
  animation: spin 8s linear infinite reverse;
}

.orbit-core {
  position: absolute;
  inset: calc(50% - 8px);
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 34px 8px rgba(111, 255, 185, .34);
}

.orbit-node {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

.node-a { left: 4%; top: 32%; }
.node-b { right: 18%; top: 9%; }
.node-c { right: -1%; bottom: 42%; background: var(--cyan); }

@keyframes spin { to { transform: rotate(360deg); } }

.overall-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-transform: uppercase;
}

.overall-copy strong {
  margin: 9px 0 2px;
  font: 650 clamp(44px, 5vw, 68px)/1 var(--mono);
  letter-spacing: -.08em;
}

.overall-copy strong small { color: var(--muted); font-size: .5em; }
.overall-copy > span:last-child { color: var(--muted); font: 10px var(--mono); letter-spacing: .18em; }

.overall-state {
  padding: 6px 10px;
  border: 1px solid rgba(111, 255, 185, .3);
  border-radius: 99px;
  color: var(--green);
  background: rgba(111, 255, 185, .08);
  font: 700 9px var(--mono);
  letter-spacing: .18em;
}

.overall-state.warning {
  color: var(--red);
  border-color: rgba(255, 123, 114, .35);
  background: rgba(255, 123, 114, .08);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(12, 27, 23, .64);
  backdrop-filter: blur(14px);
}

.summary-strip > div {
  min-height: 96px;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.summary-strip > div:last-child { border-right: 0; }

.summary-label {
  margin-bottom: 9px;
  color: var(--muted);
  font: 9px var(--mono);
  letter-spacing: .14em;
}

.summary-strip strong {
  font: 600 16px var(--mono);
  letter-spacing: -.02em;
}

.fleet-section, .detail-section { padding: 96px 0 20px; }

.section-heading,
.detail-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(31px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -.045em;
  font-weight: 580;
}

.legend {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font: 10px var(--mono);
}

.legend span { display: flex; gap: 7px; align-items: center; }
.legend i { width: 6px; height: 6px; border-radius: 50%; }
.online-dot { background: var(--green); box-shadow: 0 0 7px var(--green); }
.offline-dot { background: var(--red); }

.node-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.node-card {
  position: relative;
  min-height: 310px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(17, 37, 31, .87), rgba(8, 20, 17, .75));
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}

.node-card::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  top: -85px;
  right: -60px;
  border-radius: 50%;
  background: var(--green);
  filter: blur(55px);
  opacity: .06;
}

.node-card:hover,
.node-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--line-bright);
  outline: none;
}

.node-card.selected { border-color: rgba(111, 255, 185, .48); }
.node-card.offline::after { background: var(--red); opacity: .08; }

.node-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 25px;
}

.node-name {
  min-width: 0;
}

.node-name strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  letter-spacing: -.02em;
}

.node-name span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font: 10px var(--mono);
}

.status-pill {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 7px 10px;
  border-radius: 99px;
  color: var(--green);
  background: rgba(111, 255, 185, .08);
  font: 700 9px var(--mono);
  letter-spacing: .12em;
}

.status-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.offline .status-pill { color: var(--red); background: rgba(255, 123, 114, .08); }

.metric-row {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 11px;
  margin: 12px 0;
}

.metric-row label {
  color: var(--muted);
  font: 9px var(--mono);
  letter-spacing: .08em;
}

.metric-row output {
  text-align: right;
  font: 11px var(--mono);
}

.meter {
  display: block;
  width: 100%;
  height: 4px;
  border: 0;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 99px;
  background: rgba(255, 255, 255, .07);
}

.meter::-webkit-progress-bar {
  border-radius: inherit;
  background: rgba(255, 255, 255, .07);
}

.meter::-webkit-progress-value {
  border-radius: inherit;
  background: var(--green);
  box-shadow: 0 0 10px rgba(111, 255, 185, .35);
}

.meter::-moz-progress-bar {
  border-radius: inherit;
  background: var(--green);
  box-shadow: 0 0 10px rgba(111, 255, 185, .35);
}

.meter.medium::-webkit-progress-value { background: var(--orange); }
.meter.medium::-moz-progress-bar { background: var(--orange); }
.meter.high::-webkit-progress-value { background: var(--red); }
.meter.high::-moz-progress-bar { background: var(--red); }
.meter.unavailable::-webkit-progress-value { background: transparent; box-shadow: none; }
.meter.unavailable::-moz-progress-bar { background: transparent; box-shadow: none; }

.node-foot {
  margin-top: 24px;
  padding-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.node-foot span {
  color: var(--muted);
  font: 9px var(--mono);
  letter-spacing: .08em;
}

.node-foot strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font: 12px var(--mono);
  letter-spacing: 0;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 250px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px dashed var(--line-bright);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong { margin: 14px 0 5px; color: var(--text); }
.empty-state p { margin: 0; font-size: 13px; }

.loader {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.detail-section { scroll-margin-top: 80px; }

.detail-meta {
  margin: 12px 0 0;
  color: var(--muted);
  font: 11px var(--mono);
}

.range-control {
  display: flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 16, 13, .7);
}

.range-control button {
  min-width: 48px;
  padding: 9px 11px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font: 700 9px var(--mono);
  cursor: pointer;
}

.range-control button:hover { color: var(--text); }
.range-control button.active { color: var(--bg); background: var(--green); }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
}

.chart-card,
.detail-stats {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 24, 20, .75);
}

.chart-card { padding: 22px; min-width: 0; }

.chart-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font: 9px var(--mono);
  letter-spacing: .12em;
}

.chart-legend { display: flex; align-items: center; gap: 8px; }
.chart-legend i { width: 18px; height: 2px; margin-left: 8px; }
.cpu-line { background: var(--green); }
.memory-line { background: var(--cyan); }

.chart-wrap { position: relative; height: 320px; margin-top: 17px; }
#historyChart { display: block; width: 100%; height: 100%; }

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font: 11px var(--mono);
}

.detail-stats {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.detail-stat {
  flex: 1;
  min-height: 88px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.detail-stat:last-child { border-bottom: 0; }
.detail-stat span { color: var(--muted); font: 9px var(--mono); letter-spacing: .12em; }
.detail-stat strong { display: block; margin-top: 8px; font: 600 20px var(--mono); }
.detail-stat small { color: var(--muted); font-size: 10px; }

footer {
  width: min(1440px, calc(100% - clamp(32px, 8vw, 120px)));
  margin: 84px auto 0;
  padding: 26px 0 38px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 9px var(--mono);
  letter-spacing: .1em;
}

footer b { color: var(--green); }

@media (max-width: 1040px) {
  .hero { grid-template-columns: 1fr .75fr; gap: 20px; }
  .node-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-strip > div:nth-child(2) { border-right: 0; }
  .summary-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .topbar { height: 64px; padding: 0 20px; }
  .updated-at { display: none; }
  main, footer { width: calc(100% - 32px); }
  .hero { min-height: auto; grid-template-columns: 1fr; padding-top: 58px; }
  h1 { font-size: clamp(48px, 15vw, 72px); }
  .orbit-card { min-height: 330px; }
  .orbit { width: min(78vw, 330px); }
  .node-grid { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-stats { display: grid; grid-template-columns: repeat(2, 1fr); }
  .detail-stat { border-right: 1px solid var(--line); }
  .section-heading, .detail-header { align-items: flex-start; flex-direction: column; }
  .fleet-section, .detail-section { padding-top: 72px; }
}

@media (max-width: 500px) {
  .secure-label { font-size: 8px; }
  .summary-strip { grid-template-columns: 1fr; }
  .summary-strip > div { min-height: 82px; border-right: 0; border-bottom: 1px solid var(--line); }
  .summary-strip > div:nth-child(3) { border-bottom: 1px solid var(--line); }
  .summary-strip > div:last-child { border-bottom: 0; }
  .legend { display: none; }
  .detail-stats { grid-template-columns: 1fr; }
  .detail-stat { border-right: 0; }
  .range-control { width: 100%; }
  .range-control button { flex: 1; min-width: 0; }
  .chart-card { padding: 16px 10px 10px; }
  .chart-wrap { height: 260px; }
  footer { flex-direction: column; line-height: 1.7; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
