:root {
  --bg: #111114;
  --bg-2: #18181d;
  --bg-3: #222228;
  --bg-4: #2a2a32;
  --ink: #eaeaea;
  --muted: #8b8b96;
  --line: #2e2e38;
  --neon: #00ff88;
  --neon-dim: rgba(0, 255, 136, 0.14);
  --neon-glow: 0 0 18px rgba(0, 255, 136, 0.35);
  --red: #ff3344;
  --red-dim: rgba(255, 51, 68, 0.18);
  --amber: #ffb020;
  --font-ui: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "Consolas", "Courier New", ui-monospace, monospace;
  --radius: 12px;
  --max: 1080px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(0, 255, 136, 0.06), transparent 50%),
    radial-gradient(900px 500px at 110% 0%, rgba(0, 140, 255, 0.05), transparent 45%),
    var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 40%, transparent 80%);
  z-index: 0;
}

.crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 3px
  );
  opacity: 0.35;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
}

.hero {
  margin-bottom: 2.75rem;
}

.hero__tag {
  margin: 0 0 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon);
}

.hero__title {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: var(--neon-glow);
  line-height: 1.1;
}

.hero__sub {
  margin: 0.7rem 0 1.1rem;
  color: var(--muted);
  max-width: 36rem;
}

.hero__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.hero__meta[data-state="ok"] {
  border-color: rgba(0, 255, 136, 0.35);
  color: var(--neon);
}

.hero__meta[data-state="error"] {
  border-color: rgba(255, 51, 68, 0.45);
  color: var(--red);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(139, 139, 150, 0.5);
}

.hero__meta[data-state="ok"] .pulse {
  background: var(--neon);
  animation: pulse 1.6s ease-out infinite;
}

.hero__meta[data-state="error"] .pulse {
  background: var(--red);
}

.hero__meta[data-state="loading"] .pulse {
  animation: pulse 1.2s ease-out infinite;
}

.sep {
  opacity: 0.45;
}

.section {
  margin-bottom: 2.5rem;
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.55rem;
}

.section__head h2 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section__head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.15rem 1.15rem 1.2rem;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  min-height: 11.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--muted);
}

.card[data-up="true"]::before {
  background: var(--neon);
  box-shadow: var(--neon-glow);
}

.card[data-up="false"]::before {
  background: var(--red);
}

.card:hover {
  transform: translateY(-2px);
  border-color: #3d3d4a;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
  box-shadow: 0 0 0 3px rgba(85, 85, 85, 0.25);
}

.status-dot[data-status="up"] {
  background: var(--neon);
  box-shadow: 0 0 0 3px var(--neon-dim), 0 0 10px var(--neon);
  animation: pulse 1.8s ease-out infinite;
}

.status-dot[data-status="down"] {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-dim);
}

.status-dot[data-status="soon"] {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.2);
}

.card__badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid rgba(255, 176, 32, 0.35);
  padding: 0.12rem 0.4rem;
}

.card__name {
  margin: 0.2rem 0 0;
  font-size: 1.25rem;
}

.card__desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}

.card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.4rem;
  padding: 0.55rem 0.75rem;
  color: var(--neon);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--neon-dim);
  border: 1px solid rgba(0, 255, 136, 0.28);
}

.card__btn:hover,
.card__btn:focus-visible {
  background: rgba(0, 255, 136, 0.22);
  outline: none;
}

.term {
  background: #141418;
  border: 1px solid var(--line);
  overflow: hidden;
}

.term[data-state="error"] {
  border-color: rgba(255, 51, 68, 0.4);
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: #1c1c22;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.term__dots {
  display: flex;
  gap: 5px;
}

.term__dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #444;
}

.term__dots i:nth-child(1) { background: #ff5f56; }
.term__dots i:nth-child(2) { background: #ffbd2e; }
.term__dots i:nth-child(3) { background: #27c93f; }

.term__title {
  color: var(--muted);
  flex: 1;
}

.term__live {
  color: var(--muted);
  letter-spacing: 0.12em;
}

.term[data-state="ok"] .term__live {
  color: var(--neon);
}

.term[data-state="error"] .term__live {
  color: var(--red);
}

.term__nodata {
  margin: 0;
  padding: 0.85rem 1rem 0;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.1rem;
}

.metric {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 0.85rem 0.95rem;
}

.metric__label,
.services__title {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.metric__value {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.metric__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.metric__row .metric__value {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink);
}

.metric__row .metric__value--pct {
  font-size: 1.05rem;
}

.metric__pct {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.metric__sub {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.bar {
  margin-top: 0.65rem;
  height: 10px;
  background: #0d0d10;
  border: 1px solid #2a2a32;
  overflow: hidden;
}

.bar__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00c46a, var(--neon));
  box-shadow: var(--neon-glow);
  transition: width 0.5s ease, background 0.3s ease;
}

.bar[data-level="warn"] .bar__fill {
  background: linear-gradient(90deg, #d68a00, var(--amber));
  box-shadow: 0 0 12px rgba(255, 176, 32, 0.35);
}

.bar[data-level="crit"] .bar__fill {
  background: linear-gradient(90deg, #c01020, var(--red));
  box-shadow: 0 0 12px rgba(255, 51, 68, 0.4);
}

.services {
  padding: 0 1.1rem 1.2rem;
}

.services__title {
  margin: 0 0 0.7rem;
}

.services__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.services__list li {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 0.92rem;
}

.services__list li[data-up="true"] {
  border-color: rgba(0, 255, 136, 0.28);
}

.services__list li[data-up="false"] {
  border-color: rgba(255, 51, 68, 0.28);
}

.svc__icon {
  font-size: 0.95rem;
}

.svc__id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.foot {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(0, 255, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

@media (min-width: 700px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .services__list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 980px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse,
  .status-dot,
  .bar__fill,
  .card {
    animation: none !important;
    transition: none !important;
  }
}
