:root {
  --bg: #0d0f15;
  --panel: #161922;
  --chassis: #12141b;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #eceef2;
  --text-dim: #8b92a3;
  --text-faint: #565c6c;
  --amber: #e8a33d;
  --online: #4ad38a;
  --online-glow: rgba(74, 211, 138, 0.55);
  --offline: #4d525f;
  --focus: #8fb4ff;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  background-image: radial-gradient(
    circle at 18% -10%,
    rgba(232, 163, 61, 0.08),
    transparent 45%
  );
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 48px 20px 64px;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- rack shell ---------- */

.rack {
  width: 100%;
  max-width: 760px;
  background: var(--panel);
  border-radius: 28px;
  padding: 10px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 60px -24px rgba(0, 0, 0, 0.65),
    0 2px 10px rgba(0, 0, 0, 0.35);
}

.rack-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 18px;
}

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

.brand-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px 2px rgba(232, 163, 61, 0.55);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.brand-domain {
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- hero ---------- */

.hero {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 18px 20px 30px;
  flex-wrap: wrap;
}

.hero-reading {
  display: flex;
  align-items: baseline;
  font-family: var(--font-display);
  line-height: 1;
}

.hero-number {
  font-size: 84px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.hero-slash {
  font-size: 28px;
  color: var(--text-faint);
  font-weight: 500;
  margin-left: 2px;
}

.hero-text {
  flex: 1;
  min-width: 220px;
  padding-bottom: 6px;
}

.hero-label {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.35;
  color: var(--text);
  text-wrap: balance;
  max-width: 30ch;
}

/* ---------- chassis / channels ---------- */

.chassis {
  background: var(--chassis);
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.channel {
  display: grid;
  grid-template-columns: 52px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  transition: background-color 0.15s ease;
}

.channel:first-child {
  border-top: none;
}

.channel:hover {
  background: rgba(255, 255, 255, 0.015);
}

.channel-id {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-no {
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.led {
  --led-color: var(--offline);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--led-color);
  box-shadow: 0 0 0 0 transparent;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.led[data-online="true"] {
  --led-color: var(--online);
  box-shadow: 0 0 8px 1px var(--online-glow);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .led[data-online="true"] {
    animation: none;
  }
}

.channel-body {
  min-width: 0;
}

.channel-name {
  margin: 0 0 3px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

.channel-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.45;
  text-wrap: pretty;
}

.channel-meta {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  text-align: right;
}

.channel-tag {
  font-size: 11px;
  color: var(--text-faint);
}

.channel-state {
  font-size: 11px;
  color: var(--text-faint);
}

.channel[data-state-online="true"] .channel-state {
  color: var(--online);
}

.channel-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  min-width: 40px;
  padding: 0 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.channel-open:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.channel-open:active {
  transform: scale(0.96);
}

.channel-open:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.channel-open .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ---------- footer ---------- */

.rack-bottom {
  padding: 16px 18px 8px;
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
}

/* ---------- responsive ---------- */

@media (min-width: 560px) {
  .channel-meta {
    display: flex;
  }
  .channel {
    grid-template-columns: 52px 1fr auto auto;
  }
}

@media (max-width: 559px) {
  .hero {
    gap: 14px;
  }
  .hero-number {
    font-size: 64px;
  }
  .channel {
    grid-template-columns: 40px 1fr auto;
    row-gap: 10px;
  }
  .channel-open span {
    display: none;
  }
  .channel-open {
    width: 40px;
    padding: 0;
  }
}
