:root {
  --bg: #0b1120;
  --bg-soft: #111a2e;
  --card: #131d33;
  --card-border: #223050;
  --text: #e7edf7;
  --muted: #93a2c0;
  --faint: #63739a;
  --accent: #5b9dff;
  --green: #34d399;
  --green-dim: #0f3d31;
  --amber: #fbbf24;
  --amber-dim: #3d3210;
  --red: #f87171;
  --red-dim: #3d1717;
  --radius: 16px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #16223d 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

/* ---------- Hero / verdict ---------- */
.hero {
  text-align: center;
  padding: 40px 20px 28px;
  border-radius: 24px;
  border: 1px solid var(--card-border);
  background: var(--bg-soft);
  transition: background .4s, border-color .4s, box-shadow .4s;
}
.verdict {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  padding: 0;
}
.verdict-word {
  display: block;
  font-size: clamp(56px, 16vw, 128px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  transition: color .4s;
}
.verdict-sub {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: clamp(15px, 3.5vw, 19px);
  font-weight: 500;
}

/* state colors on the hero */
.hero[data-state="checking"] { border-color: var(--amber-dim); }
.hero[data-state="checking"] .verdict-word { color: var(--amber); animation: pulse 1.2s ease-in-out infinite; }
.hero[data-state="yes"] { border-color: #1c5a48; box-shadow: 0 0 60px -20px var(--green); background: linear-gradient(180deg, var(--green-dim), var(--bg-soft)); }
.hero[data-state="yes"] .verdict-word { color: var(--green); }
.hero[data-state="degraded"] { border-color: #6b5a1c; background: linear-gradient(180deg, var(--amber-dim), var(--bg-soft)); }
.hero[data-state="degraded"] .verdict-word { color: var(--amber); }
.hero[data-state="no"], .hero[data-state="offline"] { border-color: #6b2626; background: linear-gradient(180deg, var(--red-dim), var(--bg-soft)); }
.hero[data-state="no"] .verdict-word, .hero[data-state="offline"] .verdict-word { color: var(--red); }

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

.retest {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 14px;
}
.retest select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 5px 10px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

/* ---------- Metric grid ---------- */
.grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
}
.card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--faint);
  font-weight: 600;
}
.card-value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.card-value.mono { font-family: var(--mono); font-size: 20px; }
.card-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--faint);
  overflow-wrap: anywhere;
}

/* ---------- Per-host probe list ---------- */
.probes { margin-top: 20px; }
.probes-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: 10px;
}
.probe-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.probe-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 8px 12px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.ok { background: var(--green); }
.dot.fail { background: var(--red); }
.probe-host { font-weight: 500; }
.probe-ms { margin-left: auto; font-family: var(--mono); font-size: 13px; color: var(--muted); }

hr { border: 0; border-top: 1px solid var(--card-border); margin: 40px 0; }

/* ---------- Guide ---------- */
.guide h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.guide h3 { font-size: 18px; font-weight: 600; margin-top: 28px; }
.guide p, .guide li { color: #c3cee2; }
.guide ul { padding-left: 20px; }
.guide li { margin: 6px 0; }
.guide a { color: var(--accent); text-decoration: none; }
.guide a:hover { text-decoration: underline; }
code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 2px 6px;
}

/* ---------- Footer ---------- */
footer { margin-top: 44px; color: var(--faint); font-size: 13px; text-align: center; }
footer a { color: var(--muted); }
footer .ver { margin-top: 8px; }

/* ---------- Accessibility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- FAQ ---------- */
.faq { margin-top: 40px; }
.faq h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.faq details {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card);
  margin-top: 10px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--faint);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  margin: 0;
  padding: 0 16px 16px;
  color: #c3cee2;
}
