:root {
  --bg: #020403;
  --panel: rgba(0, 16, 7, 0.74);
  --panel-soft: rgba(7, 0, 18, 0.62);
  --green: #27ff68;
  --green-soft: rgba(39, 255, 104, 0.68);
  --green-dim: rgba(186, 255, 200, 0.7);
  --purple: #d58cff;
  --purple-soft: rgba(188, 83, 255, 0.55);
  --purple-dim: rgba(227, 184, 255, 0.78);
  --pink: #ff62a8;
  --line: rgba(39, 255, 104, 0.28);
  --line-purple: rgba(188, 83, 255, 0.42);
  --shadow-green: 0 0 24px rgba(39, 255, 104, 0.14);
  --shadow-purple: 0 0 28px rgba(188, 83, 255, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: #000;
  color: var(--green);
  font-family: "Courier New", monospace;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at 50% 12%, rgba(143, 0, 255, 0.25), transparent 28%),
    radial-gradient(circle at 12% 28%, rgba(39, 255, 104, 0.08), transparent 28%),
    radial-gradient(circle at 88% 42%, rgba(188, 83, 255, 0.14), transparent 32%),
    linear-gradient(to bottom, #020705 0%, #000 58%, #090015 100%);
}

#matrix-rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.22;
  z-index: 1;
  pointer-events: none;
}

.scanline-layer,
.screen-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.scanline-layer {
  z-index: 90;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      rgba(0, 0, 0, 0.15) 2px,
      rgba(0, 0, 0, 0.15) 4px
    );
  mix-blend-mode: overlay;
  opacity: 0.48;
}

.screen-vignette {
  z-index: 91;
  background:
    radial-gradient(ellipse at center, transparent 44%, rgba(0, 0, 0, 0.74) 100%);
}

.page-shell {
  position: relative;
  z-index: 2;
  width: min(1240px, 94vw);
  margin: 0 auto;
  padding: 24px 0 46px;
}

.top-bar,
.hero-panel,
.hypothesis-panel,
.test-card,
.agent-panel,
.control-section,
.live-panel,
.protocol-panel,
.leaderboard-panel,
.identity-panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(0, 255, 90, 0.045), transparent),
    var(--panel);
  box-shadow:
    var(--shadow-green),
    inset 0 0 24px rgba(39, 255, 104, 0.065);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 13px;
}

.terminal-brand,
.top-status {
  color: rgba(186, 255, 200, 0.9);
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow:
    0 0 10px var(--purple),
    0 0 24px rgba(188, 83, 255, 0.72);
  animation: blink 1.35s infinite;
}

.status-online {
  color: #aaffbc;
  text-shadow: 0 0 10px rgba(39, 255, 104, 0.9);
}

.status-warning {
  color: var(--purple);
  text-shadow: 0 0 10px rgba(188, 83, 255, 0.85);
}

.home-link {
  color: var(--purple);
  text-decoration: none;
  border: 1px solid var(--line-purple);
  background: rgba(80, 0, 130, 0.22);
  padding: 6px 10px;
}

.home-link:hover {
  color: white;
  background: rgba(188, 83, 255, 0.25);
}

.hero-panel {
  margin-top: 18px;
  padding: clamp(18px, 3vw, 34px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 20px;
  align-items: stretch;
  border-color: var(--line-purple);
  background:
    radial-gradient(circle at 78% 12%, rgba(188, 83, 255, 0.24), transparent 34%),
    linear-gradient(rgba(0, 255, 90, 0.055), transparent),
    rgba(3, 8, 6, 0.82);
  box-shadow:
    var(--shadow-purple),
    inset 0 0 34px rgba(188, 83, 255, 0.09);
}

.eyebrow,
.section-kicker {
  display: block;
  margin: 0 0 8px;
  color: var(--purple);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  color: #aaffbc;
  font-size: clamp(42px, 7vw, 92px);
  line-height: 0.92;
  letter-spacing: 0.08em;
  text-shadow:
    0 0 5px var(--green),
    0 0 26px rgba(39, 255, 104, 0.56);
}

.hero-text {
  max-width: 850px;
  margin: 16px 0 0;
  color: var(--purple-dim);
  line-height: 1.58;
  font-size: 14px;
}

.hero-readout {
  border: 1px solid rgba(188, 83, 255, 0.34);
  background:
    linear-gradient(rgba(188, 83, 255, 0.08), transparent),
    rgba(12, 0, 24, 0.58);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.hero-readout div {
  border-left: 2px solid var(--purple-soft);
  background: rgba(0, 0, 0, 0.24);
  padding: 10px;
}

.hero-readout span,
.stat-box span,
.identity-item span {
  display: block;
  color: var(--green-dim);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero-readout strong,
.identity-item strong {
  display: block;
  margin-top: 6px;
  color: var(--purple);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.hypothesis-panel {
  margin-top: 16px;
  padding: 18px;
  border-color: var(--line-purple);
  background:
    linear-gradient(120deg, rgba(188, 83, 255, 0.13), transparent),
    rgba(10, 0, 20, 0.62);
  box-shadow:
    var(--shadow-purple),
    inset 0 0 24px rgba(188, 83, 255, 0.08);
}

.hypothesis-panel p {
  margin: 0;
  color: rgba(236, 212, 255, 0.95);
  line-height: 1.62;
  font-size: clamp(14px, 1.5vw, 17px);
}

.experiment-map {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.test-card {
  position: relative;
  padding: 16px;
  overflow: hidden;
  min-height: 245px;
}

.test-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  opacity: 0.18;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent, currentColor, transparent);
}

.test-control {
  color: var(--green);
}

.test-math {
  color: var(--purple);
}

.test-ml {
  color: #aaffbc;
  border-color: rgba(188, 83, 255, 0.58);
  box-shadow:
    var(--shadow-purple),
    inset 0 0 26px rgba(188, 83, 255, 0.09);
}

.test-number {
  color: currentColor;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.84;
}

.test-card h2,
.panel-heading h2 {
  margin: 8px 0 9px;
  color: #aaffbc;
  font-size: clamp(18px, 2.3vw, 28px);
  line-height: 1.05;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-shadow:
    0 0 6px rgba(39, 255, 104, 0.72),
    0 0 18px rgba(39, 255, 104, 0.28);
}

.test-card p,
.panel-description,
.protocol-step p,
.footer-note {
  color: var(--purple-dim);
  line-height: 1.52;
  font-size: 13px;
}

.test-purpose {
  margin-top: 14px;
  border: 1px solid rgba(39, 255, 104, 0.18);
  background: rgba(0, 0, 0, 0.28);
  padding: 10px;
  color: rgba(186, 255, 200, 0.84);
  font-size: 12px;
  line-height: 1.45;
}

.test-purpose span {
  display: block;
  margin-bottom: 4px;
  color: var(--purple);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.dashboard-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.agent-panel,
.control-section,
.live-panel,
.protocol-panel,
.leaderboard-panel {
  padding: 16px;
}

.ml-panel {
  border-color: rgba(188, 83, 255, 0.58);
  background:
    radial-gradient(circle at 85% 0%, rgba(188, 83, 255, 0.16), transparent 32%),
    var(--panel);
}

.math-panel {
  border-color: rgba(163, 97, 255, 0.42);
  background:
    radial-gradient(circle at 85% 0%, rgba(115, 67, 255, 0.12), transparent 32%),
    var(--panel);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.pill,
.live-badge {
  flex: none;
  display: inline-block;
  border: 1px solid var(--line-purple);
  padding: 6px 9px;
  background: rgba(80, 0, 130, 0.24);
  color: var(--purple);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(188, 83, 255, 0.16);
}

.pill-control {
  color: #aaffbc;
  border-color: rgba(39, 255, 104, 0.36);
  background: rgba(0, 38, 12, 0.28);
}

.pill-math {
  color: #d2b4ff;
}

.pill-ml {
  color: #ffd8ff;
}

.live-badge {
  color: #aaffbc;
  border-color: rgba(39, 255, 104, 0.45);
  animation: glowPulse 1.6s infinite;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0;
}

.stat-box {
  min-height: 78px;
  padding: 11px;
  border: 1px solid rgba(39, 255, 104, 0.2);
  background: rgba(0, 0, 0, 0.3);
}

.stat-box strong {
  display: block;
  margin-top: 9px;
  color: #aaffbc;
  font-size: clamp(20px, 2.5vw, 32px);
  line-height: 1;
  text-shadow:
    0 0 9px rgba(39, 255, 104, 0.72),
    0 0 20px rgba(39, 255, 104, 0.34);
}

.chart-card {
  border: 1px solid rgba(39, 255, 104, 0.18);
  background: rgba(0, 0, 0, 0.26);
  padding: 12px;
  margin-top: 10px;
}

.chart-card h3 {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bar-list {
  display: grid;
  gap: 7px;
}

.bar-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 62px;
  gap: 8px;
  align-items: center;
  color: rgba(186, 255, 200, 0.78);
  font-size: 11px;
}

.bar-shell {
  height: 10px;
  border: 1px solid rgba(39, 255, 104, 0.22);
  background: rgba(0, 0, 0, 0.36);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  background:
    linear-gradient(90deg, rgba(39, 255, 104, 0.62), rgba(188, 83, 255, 0.88));
  box-shadow: 0 0 9px rgba(188, 83, 255, 0.62);
}

.bar-fill.negative {
  background:
    linear-gradient(90deg, rgba(188, 83, 255, 0.72), rgba(255, 98, 168, 0.82));
}

.control-section {
  margin-top: 16px;
  border-color: rgba(39, 255, 104, 0.24);
  background:
    linear-gradient(rgba(0, 255, 90, 0.035), transparent),
    rgba(0, 10, 4, 0.62);
}

.control-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lower-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 14px;
}

.feed-list {
  display: grid;
  gap: 7px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.feed-item {
  border-left: 2px solid var(--purple-soft);
  background: rgba(0, 0, 0, 0.3);
  padding: 9px 10px;
  color: rgba(186, 255, 200, 0.84);
  font-size: 11px;
  line-height: 1.42;
}

.feed-item strong {
  color: var(--purple);
}

.feed-item em {
  color: #aaffbc;
  font-style: normal;
}

.protocol-step {
  border-left: 2px solid var(--purple-soft);
  background: rgba(0, 0, 0, 0.26);
  padding: 10px 11px;
  margin-top: 10px;
}

.protocol-step strong {
  color: #aaffbc;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.protocol-step p {
  margin: 5px 0 0;
  font-size: 12px;
}

.leaderboard-panel {
  margin-top: 16px;
}

.table-like {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 88px 70px 76px 76px;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(39, 255, 104, 0.18);
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 9px;
  color: rgba(186, 255, 200, 0.82);
  font-size: 11px;
}

.table-row.header {
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(0, 20, 8, 0.42);
}

.identity-panel {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: rgba(0, 10, 4, 0.45);
}

.identity-item {
  border: 1px solid rgba(39, 255, 104, 0.18);
  background: rgba(0, 0, 0, 0.24);
  padding: 9px;
}

.footer-note {
  margin: 18px auto 0;
  max-width: 920px;
  color: rgba(186, 255, 200, 0.62);
  text-align: center;
  font-size: 12px;
}

@keyframes blink {
  0%, 45% {
    opacity: 1;
  }

  46%, 100% {
    opacity: 0.28;
  }
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(39, 255, 104, 0.12);
  }

  50% {
    box-shadow: 0 0 18px rgba(39, 255, 104, 0.48);
  }
}

@media (max-width: 1050px) {
  .hero-panel,
  .dashboard-grid,
  .lower-grid,
  .control-chart-grid,
  .experiment-map,
  .identity-panel {
    grid-template-columns: 1fr;
  }

  .hero-readout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .top-bar,
  .panel-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid,
  .hero-readout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-row {
    grid-template-columns: 1fr 64px 52px;
    overflow-x: auto;
  }

  .table-row span:nth-child(4),
  .table-row span:nth-child(5),
  .table-row strong:nth-child(4),
  .table-row strong:nth-child(5) {
    display: none;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: min(96vw, 1240px);
  }

  .stats-grid,
  .hero-readout {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .bar-row {
    grid-template-columns: 64px minmax(0, 1fr) 52px;
  }
}