:root {
  --bg: #030a11;
  --surface: rgba(6, 21, 32, 0.88);
  --ink: #d9fff8;
  --muted: #86c9c2;
  --teal: #18f6d0;
  --cyan: #36c7ff;
  --amber: #f0b84e;
  --green: #6cf08a;
  --accent: #18f6d0;
  --accent-hover: #89fff0;
  --border: rgba(24, 246, 208, 0.3);
  --shadow: 0 0 34px rgba(24, 246, 208, 0.16);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 42%, rgba(24, 246, 208, 0.18), transparent 28rem),
    linear-gradient(120deg, rgba(2, 16, 26, 0.96), rgba(1, 5, 11, 0.98)),
    var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: var(--accent-hover);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 4px;
}

.hud-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(24, 246, 208, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 246, 208, 0.07) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent);
}

.command-header,
.command-footer {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.command-header {
  min-height: 76px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(3, 10, 17, 0.78);
  backdrop-filter: blur(16px);
}

.brand {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.nav a {
  padding: 8px 0;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 6px;
}

.command-shell {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.58fr);
  align-items: end;
  gap: 24px;
  padding: 16px 0 28px;
}

.hero-copy {
  display: grid;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  max-width: 13ch;
  color: #effffb;
  font-size: 4rem;
  text-shadow: 0 0 28px rgba(24, 246, 208, 0.42);
}

h2 {
  font-size: 1.35rem;
}

.subtitle {
  max-width: 60ch;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(24, 246, 208, 0.18);
  box-shadow: var(--shadow);
}

.status-strip div {
  min-width: 0;
  padding: 16px;
  background: rgba(4, 16, 25, 0.92);
}

.status-label,
.metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.status-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--accent-hover);
  font-size: 1.15rem;
}

.command-layout {
  display: grid;
  grid-template-columns: minmax(430px, 1.35fr) minmax(280px, 0.72fr);
  gap: 18px;
  align-items: stretch;
}

.hud-panel,
.agent-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(24, 246, 208, 0.08), transparent 38%),
    var(--surface);
  box-shadow: var(--shadow);
}

.hud-panel::before,
.agent-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-top: 1px solid rgba(54, 199, 255, 0.22);
  border-left: 1px solid rgba(54, 199, 255, 0.16);
  pointer-events: none;
}

.hud-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 24px;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.launch-list {
  display: grid;
  gap: 12px;
  width: 100%;
}

.launch-button {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(24, 246, 208, 0.28);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(1, 12, 19, 0.7);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.launch-button:hover {
  border-color: var(--accent);
  background: rgba(24, 246, 208, 0.1);
  transform: translateY(-2px);
}

.launch-icon {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(54, 199, 255, 0.34);
  border-radius: 50%;
  color: var(--accent-hover);
  background: rgba(54, 199, 255, 0.1);
}

.launch-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.launch-button strong,
.launch-button small {
  display: block;
}

.launch-button small {
  color: var(--muted);
  font-size: 0.82rem;
}

.core-display {
  min-height: 620px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}

.radar {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.radar-ring,
.radar-cross,
.radar-core,
.radar-sweep,
.agent-ping {
  position: absolute;
}

.radar-ring {
  inset: var(--ring-inset);
  border: 2px solid rgba(24, 246, 208, 0.46);
  border-radius: 50%;
  box-shadow: inset 0 0 24px rgba(24, 246, 208, 0.12), 0 0 18px rgba(24, 246, 208, 0.12);
}

.ring-one { --ring-inset: 7%; }
.ring-two { --ring-inset: 20%; border-style: dashed; }
.ring-three { --ring-inset: 35%; border-color: rgba(54, 199, 255, 0.62); }

.radar-cross {
  background: rgba(24, 246, 208, 0.28);
}

.radar-cross.horizontal {
  width: 100%;
  height: 1px;
}

.radar-cross.vertical {
  width: 1px;
  height: 100%;
}

.radar-core {
  width: 23%;
  aspect-ratio: 1;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-hover), rgba(24, 246, 208, 0.22) 42%, transparent 70%);
  box-shadow: 0 0 44px rgba(24, 246, 208, 0.8);
}

.radar-sweep {
  width: 50%;
  height: 50%;
  top: 50%;
  left: 50%;
  transform-origin: 0 0;
  background: linear-gradient(45deg, rgba(24, 246, 208, 0.34), transparent 66%);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  animation: sweep 5s linear infinite;
}

.agent-ping {
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent-hover);
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan);
  animation: ping 2.8s ease-in-out infinite;
}

.ping-one { top: 24%; left: 67%; }
.ping-two { top: 62%; left: 73%; animation-delay: 0.4s; }
.ping-three { top: 70%; left: 30%; animation-delay: 0.8s; }
.ping-four { top: 32%; left: 23%; animation-delay: 1.2s; }

.core-readout {
  width: min(100%, 560px);
  margin-top: -34px;
  padding: 18px;
  border: 1px solid rgba(54, 199, 255, 0.28);
  border-radius: 8px;
  background: rgba(0, 11, 18, 0.78);
  box-shadow: 0 0 24px rgba(54, 199, 255, 0.12);
}

.core-readout p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
}

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

.metric-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(24, 246, 208, 0.2);
  border-radius: 8px;
  background: rgba(24, 246, 208, 0.07);
}

.metric-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1rem;
}

.command-log {
  display: grid;
  gap: 10px;
  width: 100%;
  min-height: 192px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.command-log li {
  padding: 9px 0 9px 14px;
  border-left: 2px solid rgba(24, 246, 208, 0.58);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #001714;
  background: var(--accent);
  box-shadow: 0 0 22px rgba(24, 246, 208, 0.38);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pulse-button {
  width: 100%;
}

.agent-section {
  padding-top: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.mesh-status {
  min-width: 130px;
  padding: 8px 12px;
  border: 1px solid rgba(108, 240, 138, 0.28);
  border-radius: 999px;
  color: var(--green);
  background: rgba(108, 240, 138, 0.08);
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
}

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

.agent-card {
  min-height: 190px;
  padding: 18px;
}

.agent-topline {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.agent-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 16px var(--green);
}

.agent-topline strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.agent-topline small {
  color: var(--cyan);
  font-weight: 800;
}

.agent-card p {
  margin: 16px 0;
  color: var(--muted);
}

.agent-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(54, 199, 255, 0.12);
}

.agent-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--accent));
  box-shadow: 0 0 18px rgba(24, 246, 208, 0.58);
  transition: width 0.6s ease;
}

.agent-card output {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.command-footer {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.command-footer a {
  text-decoration: none;
}

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

@keyframes ping {
  50% {
    transform: scale(1.45);
    opacity: 0.62;
  }
}

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

@media (max-width: 1120px) {
  .command-layout {
    grid-template-columns: 1fr;
  }

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

  .core-display {
    min-height: 560px;
  }
}

@media (max-width: 760px) {
  .command-header,
  .command-footer,
  .command-shell {
    width: calc(100% - 32px);
  }

  .command-header,
  .command-footer,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .command-hero,
  .side-stack,
  .agent-grid,
  .status-strip {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 100%;
    font-size: 2.6rem;
  }

  .hud-panel,
  .agent-card {
    padding: 20px;
  }

  .core-display {
    min-height: auto;
  }

  .radar {
    width: min(100%, 360px);
  }

  .core-readout {
    margin-top: -12px;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 2.3rem;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }
}
