:root {
  --ink: #0c1f1c;
  --ink-soft: #1a332e;
  --foam: #f2f7f5;
  --mist: #d7e6e1;
  --line: rgba(12, 31, 28, 0.12);
  --teal: #0f6b58;
  --teal-bright: #1a9b7e;
  --amber: #c9921a;
  --coral: #c44a3a;
  --muted: #5d736d;
  --tile: rgba(255, 255, 255, 0.72);
  --tile-hover: rgba(255, 255, 255, 0.92);
  --shadow: 0 1px 0 rgba(12, 31, 28, 0.04);
  --radius: 14px;
  --font-display: "Syne", sans-serif;
  --font-body: "Figtree", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--foam);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(26, 155, 126, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(201, 146, 26, 0.12), transparent 50%),
    linear-gradient(165deg, #eef6f3 0%, #e2ede9 45%, #d5e4df 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 20%, transparent 75%);
}

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 3.5rem;
}

.hero {
  animation: rise 0.7s ease both;
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
}

.brand {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 1rem;
  line-height: 0.95;
}

.brand-primary {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 9vw, 5.2rem);
  letter-spacing: -0.04em;
  color: var(--ink);
}

.brand-secondary {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 4vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--teal);
}

.lede {
  margin: 1rem 0 0;
  max-width: 28rem;
  font-size: 1.1rem;
  color: var(--muted);
}

.summary {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem;
}

.summary-stat {
  min-width: 6.5rem;
  padding: 0.85rem 1.1rem;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: rise 0.7s ease both;
}

.summary-stat:nth-child(1) { animation-delay: 0.08s; }
.summary-stat:nth-child(2) { animation-delay: 0.14s; }
.summary-stat:nth-child(3) { animation-delay: 0.2s; }

.summary-value {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.summary-value.is-up { color: var(--teal-bright); }
.summary-value.is-down { color: var(--coral); }
.summary-meta {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.summary-label {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.btn-refresh {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--foam);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  animation: rise 0.7s ease both;
  animation-delay: 0.24s;
}

.btn-refresh:hover {
  background: var(--ink-soft);
}

.btn-refresh:active {
  transform: translateY(1px);
}

.btn-refresh.is-busy {
  opacity: 0.75;
  cursor: wait;
}

.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 0 0 rgba(26, 155, 126, 0.45);
  animation: pulse-dot 2.2s ease-out infinite;
}

.live-dot.is-stale {
  background: var(--amber);
  animation: none;
}

.live-dot.is-error {
  background: var(--coral);
  animation: none;
}

.notes {
  margin: 1.75rem 0 0;
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--line);
  animation: rise 0.7s ease both;
  animation-delay: 0.28s;
}

.notes p {
  margin: 0;
  max-width: 46rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.notes strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.grid {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem 1.15rem 1.15rem;
  text-decoration: none;
  color: inherit;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
  animation: rise 0.55s ease both;
  opacity: 0;
}

.tile:hover {
  background: var(--tile-hover);
  border-color: rgba(15, 107, 88, 0.35);
  transform: translateY(-2px);
}

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

.tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.tile-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.badge-ok {
  color: var(--teal);
  background: rgba(15, 107, 88, 0.1);
}

.badge-down {
  color: var(--coral);
  background: rgba(196, 74, 58, 0.1);
}

.badge-wait {
  color: var(--muted);
  background: rgba(93, 115, 109, 0.12);
}

.badge-skip {
  color: var(--amber);
  background: rgba(201, 146, 26, 0.12);
}

.tile-inactive {
  opacity: 0.62;
}

.tile-inactive:hover {
  opacity: 0.85;
}

.tile-role {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.tile-meta {
  margin-top: auto;
  display: grid;
  gap: 0.2rem;
  padding-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  opacity: 0.85;
}

.tile-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-meta .url {
  color: var(--teal);
  font-weight: 500;
}

.tile-latency {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.foot {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.foot p {
  margin: 0;
}

.foot-path {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-soft);
}

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

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 155, 126, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(26, 155, 126, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(26, 155, 126, 0);
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(1120px, calc(100% - 1.25rem));
    padding-top: 1.75rem;
  }

  .btn-refresh {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .summary-stat {
    flex: 1 1 calc(50% - 0.75rem);
  }
}
