/* ============================================================
   Design tokens
   Palette: near-black base, signal-board accents
   ============================================================ */
:root {
  --bg: #0B0D10;
  --panel: #13161B;
  --panel-hover: #171B21;
  --border: #232830;
  --text: #E7E9EC;
  --text-dim: #8A9099;
  --text-faint: #545A64;

  --up: #39D98A;
  --up-dim: #1B6B47;
  --down: #FF5C5C;
  --down-dim: #7A2C2C;
  --unknown: #5A6270;

  --font-display: 'JetBrains Mono', 'Courier New', monospace;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --radius: 6px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--up); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--font-display);
  background: var(--panel);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Subtle scanline atmosphere, very low opacity, fixed */
.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.015) 0px,
    rgba(255,255,255,0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

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

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 13, 16, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.brand__dim { color: var(--text-faint); font-weight: 500; }

.brand__mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--unknown);
  box-shadow: 0 0 0 0 rgba(57, 217, 138, 0);
  transition: background 0.3s ease;
}
.brand__mark[data-state="up"] {
  background: var(--up);
  animation: pulse-up 2s ease-in-out infinite;
}
.brand__mark[data-state="down"] {
  background: var(--down);
  animation: pulse-down 1.2s ease-in-out infinite;
}

@keyframes pulse-up {
  0%, 100% { box-shadow: 0 0 0 0 rgba(57, 217, 138, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(57, 217, 138, 0); }
}
@keyframes pulse-down {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 92, 92, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(255, 92, 92, 0); }
}

.topbar__meta {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-dim);
}
.topbar__sep { margin: 0 8px; color: var(--text-faint); }

/* ============================================================
   Board / layout
   ============================================================ */
.board {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  position: relative;
  z-index: 2;
}

.hero { margin-bottom: 40px; max-width: 640px; }

.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.hero__sub {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0;
  max-width: 560px;
}

/* ============================================================
   Groups & rows
   ============================================================ */
.groups { display: flex; flex-direction: column; gap: 28px; }

.group__label {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin: 0 0 10px;
  padding-left: 2px;
}

.group__rows {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--panel-hover); }

.row__dot-wrap { display: flex; align-items: center; justify-content: center; }

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot--up { background: var(--up); }
.dot--down { background: var(--down); }
.dot--unknown { background: var(--unknown); }

.row__dot.dot--up { box-shadow: 0 0 8px rgba(57, 217, 138, 0.45); }
.row__dot.dot--down {
  box-shadow: 0 0 8px rgba(255, 92, 92, 0.5);
  animation: pulse-down 1.2s ease-in-out infinite;
}

.row__info { min-width: 0; }

.row__name {
  font-weight: 600;
  font-size: 14.5px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.row__url {
  color: var(--text-faint);
  font-size: 12px;
  font-family: var(--font-display);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row__badge {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}
.row__badge--up { color: var(--up); background: rgba(57, 217, 138, 0.12); }
.row__badge--down { color: var(--down); background: rgba(255, 92, 92, 0.14); }
.row__badge--unknown { color: var(--text-dim); background: rgba(90, 98, 112, 0.18); }

.row__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.row__latency {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-dim);
  min-width: 52px;
  text-align: right;
  white-space: nowrap;
}

/* Heartbeat strip — signature element */
.heartbeat {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 18px;
}

.heartbeat__bar {
  width: 4px;
  height: 100%;
  border-radius: 1px;
  background: var(--unknown);
  opacity: 0.35;
}
.heartbeat__bar[data-up="true"] { background: var(--up); opacity: 0.9; }
.heartbeat__bar[data-up="false"] { background: var(--down); opacity: 0.95; }

@media (max-width: 640px) {
  .row { grid-template-columns: 12px 1fr; }
  .row__right { grid-column: 1 / -1; justify-content: space-between; padding-left: 26px; margin-top: 8px; }
  .heartbeat { display: none; } /* keep mobile rows compact */
}

/* ============================================================
   Legend & footer
   ============================================================ */
.legend {
  display: flex;
  gap: 24px;
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.legend__item { display: flex; align-items: center; gap: 6px; }

.footer {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px 48px;
  color: var(--text-faint);
  font-size: 12.5px;
  position: relative;
  z-index: 2;
}

/* ============================================================
   Empty / loading states
   ============================================================ */
.empty-state {
  padding: 32px;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
