:root {
  --bg-0: #0a1116;
  --bg-1: #101b23;
  --panel: rgba(14, 28, 36, 0.82);
  --panel-border: rgba(151, 215, 239, 0.28);
  --text: #eaf4f7;
  --muted: #9cb8c6;
  --good: #29d3a3;
  --warn: #f6b55f;
  --bad: #ff6d6f;
  --cyan: #67d9ff;
  --amber: #f7a641;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Crimson Pro", serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 12%, #13344a 0%, transparent 38%),
    radial-gradient(circle at 85% 4%, #3f2d1f 0%, transparent 30%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1));
  position: relative;
  overflow-x: hidden;
}

.mesh,
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.mesh {
  background: linear-gradient(110deg, transparent 45%, rgba(103, 217, 255, 0.06) 55%, transparent 64%);
}

.grain {
  opacity: 0.2;
  background-image: radial-gradient(rgba(255, 255, 255, 0.15) 0.6px, transparent 0.6px);
  background-size: 4px 4px;
  mix-blend-mode: soft-light;
}

.deck {
  position: relative;
  z-index: 2;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  display: grid;
  gap: 16px;
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 45px rgba(3, 10, 14, 0.4);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.26em;
  color: var(--cyan);
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.04em;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: #f4fdff;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.hero-meta {
  text-align: right;
  align-self: center;
}

.pulse-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
}

.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 0 0 rgba(246, 181, 95, 0.7);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(103, 217, 255, 0.5);
  }
  70% {
    box-shadow: 0 0 0 13px rgba(103, 217, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(103, 217, 255, 0);
  }
}

.controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.control-group.compact {
  font-family: "Rajdhani", sans-serif;
  color: var(--muted);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

select,
button {
  font-family: "Rajdhani", sans-serif;
}

select {
  border: 1px solid rgba(103, 217, 255, 0.35);
  border-radius: 10px;
  background: rgba(10, 21, 28, 0.9);
  color: #d7eaf2;
  padding: 6px 8px;
}

.btn {
  border: 1px solid rgba(233, 249, 255, 0.25);
  background: rgba(17, 34, 45, 0.95);
  color: #ecf7fb;
  border-radius: 12px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.45);
}

.btn:active {
  transform: translateY(0);
}

.btn-start {
  border-color: rgba(41, 211, 163, 0.6);
  box-shadow: inset 0 0 0 1px rgba(41, 211, 163, 0.25);
}

.btn-stop {
  border-color: rgba(255, 109, 111, 0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 109, 111, 0.2);
}

.btn-ghost {
  border-color: rgba(103, 217, 255, 0.35);
}

.btn.small {
  padding: 6px 10px;
  font-size: 0.9rem;
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  align-items: center;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  border-left: 3px solid rgba(246, 181, 95, 0.5);
  background: rgba(10, 23, 30, 0.58);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.95rem;
  white-space: nowrap;
}

.status-chip.good { border-left-color: rgba(41, 211, 163, 0.9); }
.status-chip.warn { border-left-color: rgba(246, 181, 95, 0.9); }
.status-chip.bad { border-left-color: rgba(255, 109, 111, 0.9); }

.chip-label {
  color: var(--muted);
  font-weight: 500;
}

.chip-value {
  font-weight: 700;
  color: var(--text);
}

.chip-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.muted {
  margin: 0;
  color: var(--muted);
}

.mono {
  font-family: "Rajdhani", sans-serif;
}

.grid-details {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr);
  gap: 12px;
}

.detail {
  padding: 14px 16px;
}

.state-list {
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.state-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(10, 23, 30, 0.58);
}

.state-list dt {
  color: var(--muted);
}

.state-list dd {
  margin: 0;
  text-align: right;
  font-family: "Rajdhani", sans-serif;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 0;
}

.terminal {
  margin: 10px 14px 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(103, 217, 255, 0.25);
  background: rgba(4, 12, 16, 0.93);
  color: #c3f4df;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.95rem;
  line-height: 1.3;
  white-space: pre-wrap;
  overflow: auto;
  max-height: 280px;
}

.terminal.tall {
  max-height: 420px;
}

.markdown-view {
  margin: 10px 14px 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(103, 217, 255, 0.25);
  background: rgba(4, 12, 16, 0.93);
  color: #d7ebf4;
  overflow: auto;
  line-height: 1.4;
}

.markdown-view h1,
.markdown-view h2,
.markdown-view h3,
.markdown-view h4,
.markdown-view h5,
.markdown-view h6 {
  margin: 0.35rem 0 0.55rem;
  font-family: "Rajdhani", sans-serif;
  color: #f3fbff;
}

.markdown-view p {
  margin: 0.3rem 0 0.55rem;
}

.markdown-view ul {
  margin: 0.35rem 0 0.65rem 1.1rem;
  padding: 0;
}

.markdown-view li {
  margin: 0.18rem 0;
}

.markdown-view code {
  font-family: "Rajdhani", sans-serif;
  background: rgba(103, 217, 255, 0.12);
  border: 1px solid rgba(103, 217, 255, 0.28);
  border-radius: 6px;
  padding: 0.05rem 0.3rem;
  color: #b9f6df;
}

.markdown-view pre {
  margin: 0.4rem 0 0.8rem;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(103, 217, 255, 0.22);
  background: rgba(9, 20, 27, 0.96);
  white-space: pre-wrap;
}

.markdown-view pre code {
  border: 0;
  background: transparent;
  padding: 0;
}

.markdown-view a {
  color: #67d9ff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(103, 217, 255, 0.5);
}

.markdown-view a:hover {
  color: #9fecff;
}

.hidden {
  display: none;
}

.reveal-1,
.reveal-2,
.reveal-3,
.reveal-4,
.reveal-5,
.reveal-6 {
  animation: reveal 480ms ease both;
}

.reveal-2 { animation-delay: 80ms; }
.reveal-3 { animation-delay: 130ms; }
.reveal-4 { animation-delay: 180ms; }
.reveal-5 { animation-delay: 230ms; }
.reveal-6 { animation-delay: 280ms; }

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 640px) {
  .hero {
    flex-direction: column;
  }
  .hero-meta {
    text-align: left;
  }
}
