@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Syne:wght@400;600;700;800&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface-2: #1a1a24;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text-primary: #f0f0f8;
  --text-secondary: #8888a8;
  --text-muted: #55556a;

  --green-glow: rgba(34, 197, 94, 0.15);
  --green-mid: #22c55e;
  --green-dim: #16a34a;
  --green-text: #4ade80;

  --yellow-glow: rgba(234, 179, 8, 0.15);
  --yellow-mid: #eab308;
  --yellow-dim: #a16207;
  --yellow-text: #fde047;

  --red-glow: rgba(239, 68, 68, 0.15);
  --red-mid: #ef4444;
  --red-dim: #b91c1c;
  --red-text: #f87171;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: "Syne", sans-serif;
  min-height: 100vh;
  background-image:
    radial-gradient(
      ellipse 80% 40% at 50% -10%,
      rgba(99, 102, 241, 0.08) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 40% 30% at 80% 100%,
      rgba(34, 197, 94, 0.04) 0%,
      transparent 50%
    );
}

/* ── Header ── */
.head {
  text-align: center;
  padding: 3.5rem 1rem 1rem;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.head span:not(.live-badge) {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

/* ── Live badge ── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  font-weight: 500;
  color: var(--green-text);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 100px;
  padding: 4px 12px;
  margin: 0.6rem auto 0;
}

.live-badge::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-mid);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}

/* ── Container ── */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  max-width: 1200px;
  margin: 2.5rem auto;
  padding: 0 1.5rem 1rem;
}

/* ── Service card ── */
.box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.1rem 1.1rem 0.9rem;
  min-height: 90px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: default;
  overflow: hidden;
  transition:
    border-color 0.35s ease,
    background-color 0.35s ease,
    transform 0.25s ease,
    box-shadow 0.35s ease;
}

.box::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.box:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background: var(--surface-2);
}

/* Service name */
.box-name {
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  z-index: 1;
}

/* Latency / status row */
.box-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.6rem;
  z-index: 1;
}

.box-latency {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color 0.35s ease;
}

.box-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition:
    background-color 0.35s ease,
    box-shadow 0.35s ease;
}

/* ── Status: green (online / low latency) ── */
.box.status-green {
  border-color: rgba(34, 197, 94, 0.2);
}
.box.status-green::before {
  background: var(--green-glow);
  opacity: 1;
}
.box.status-green .box-dot {
  background: var(--green-mid);
  box-shadow: 0 0 8px var(--green-mid);
}
.box.status-green .box-latency {
  color: var(--green-text);
}
.box.status-green:hover {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 8px 32px rgba(34, 197, 94, 0.08);
}

/* ── Status: warning / yellow (moderate latency) ── */
.box.warning,
.box.status-yellow {
  border-color: rgba(234, 179, 8, 0.2) !important;
  background: var(--surface) !important;
}
.box.warning::before,
.box.status-yellow::before {
  background: var(--yellow-glow) !important;
  opacity: 1 !important;
}
.box.warning .box-dot,
.box.status-yellow .box-dot {
  background: var(--yellow-mid);
  box-shadow: 0 0 8px var(--yellow-mid);
}
.box.warning .box-latency,
.box.status-yellow .box-latency {
  color: var(--yellow-text);
}
.box.warning:hover,
.box.status-yellow:hover {
  border-color: rgba(234, 179, 8, 0.4) !important;
  box-shadow: 0 8px 32px rgba(234, 179, 8, 0.08);
}

/* ── Status: error / red (offline / high latency) ── */
.box.error {
  border-color: rgba(239, 68, 68, 0.2) !important;
  background: var(--surface) !important;
}
.box.error::before {
  background: var(--red-glow) !important;
  opacity: 1 !important;
}
.box.error .box-dot {
  background: var(--red-mid);
  box-shadow: 0 0 8px var(--red-mid);
}
.box.error .box-latency {
  color: var(--red-text);
}
.box.error:hover {
  border-color: rgba(239, 68, 68, 0.4) !important;
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.08);
}

/* ── Footer ── */
footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem 1rem 2rem;
  flex-wrap: wrap;
}

.credits {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.Learn {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.Learn:hover {
  color: var(--text-secondary);
  border-color: var(--border-hover);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .container {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    padding: 0 1rem 1rem;
  }
  .box {
    min-height: 80px;
    padding: 0.9rem 0.9rem 0.75rem;
  }
}
