/* Deadman's Switch — a devtool that should feel like a devtool.
   Dark, high contrast, monospace where identity matters. */

:root {
  --bg: #0a0b0d;
  --surface: #101216;
  --surface-2: #161a20;
  --border: #232830;
  --text: #e6e8eb;
  --dim: #858e9a;
  --dimmer: #5a626d;

  --critical: #ff6b6b;
  --warn: #f0a742;
  --ok: #4ec9a5;
  --accent: #7aa2f7;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;

  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

body {
  /* A faint pulse behind the hero — the only decoration on the page. */
  background-image: radial-gradient(ellipse 900px 400px at 50% -100px, rgba(122, 162, 247, 0.09), transparent 70%);
  background-repeat: no-repeat;
}

.wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 20px;
}

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

header {
  padding: 72px 0 40px;
  text-align: center;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 22px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--critical);
  box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.6);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.55); }
  70%  { box-shadow: 0 0 0 11px rgba(255, 107, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
}

h1 {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.022em;
  margin: 0 0 18px;
  font-weight: 640;
}

h1 em {
  font-style: normal;
  color: var(--critical);
}

.sub {
  font-size: 17px;
  color: var(--dim);
  max-width: 620px;
  margin: 0 auto;
}

.sub strong { color: var(--text); font-weight: 560; }

/* ---------- install line ---------- */

.install {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 11px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 14px;
}

.install .prompt { color: var(--dimmer); }

.copy {
  border: 0;
  background: transparent;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 5px;
}
.copy:hover { color: var(--text); background: var(--surface-2); }

/* ---------- fleet switcher ---------- */

.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 52px 0 20px;
}

.tab {
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--dim);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.tab:hover { color: var(--text); border-color: #2f3742; }
.tab[aria-selected="true"] {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(122, 162, 247, 0.09);
}
.tab .n { color: var(--dimmer); }
.tab[aria-selected="true"] .n { color: var(--accent); }

/* ---------- report ---------- */

.report {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.report-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--dim);
  flex-wrap: wrap;
}

.verdict { font-family: var(--sans); font-size: 14px; }
.verdict.bad { color: var(--critical); }
.verdict.warn { color: var(--warn); }
.verdict.good { color: var(--ok); }

.band {
  padding: 16px 18px 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--dimmer);
}

.project {
  padding: 12px 18px 15px;
  border-top: 1px solid rgba(35, 40, 48, 0.6);
}
.project:first-of-type { border-top: 0; }

.project-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  transform: translateY(-1px);
}
.dot.critical { background: var(--critical); }
.dot.warn { background: var(--warn); }
.dot.info { background: var(--dimmer); }
.dot.ok { background: var(--ok); }

.pname {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
}

.pstate {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
}

.preason {
  color: var(--dim);
  font-size: 13.5px;
  margin: 6px 0 0 17px;
  max-width: 720px;
}

/* The reasoning, under the counts rather than beside them. */
.pwhy {
  color: var(--dimmer, var(--dim));
  font-size: 12.5px;
  margin: 2px 0 0 17px;
  max-width: 720px;
}

.jobs {
  margin: 11px 0 0 17px;
  display: grid;
  gap: 3px;
}

.job {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 3px 0;
}

.job .mk { text-align: center; }
.mk.healthy { color: var(--ok); }
.mk.late { color: var(--warn); }
.mk.dead,
.mk.stalled,
.mk.never { color: var(--critical); }
.mk.paused, .mk.bounded { color: var(--dimmer); }

.job .jn { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .js { color: var(--dim); text-align: right; white-space: nowrap; font-size: 12px; }

.more {
  margin: 8px 0 0 17px;
  font-size: 12.5px;
  color: var(--dimmer);
  font-family: var(--mono);
}

.report-foot {
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--dimmer);
  font-family: var(--mono);
}

/* ---------- drop zone ---------- */

.drop {
  margin-top: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--dim);
  font-size: 13.5px;
  transition: border-color 0.12s, background 0.12s;
}
.drop.over { border-color: var(--accent); background: rgba(122, 162, 247, 0.06); }
.drop code { font-family: var(--mono); color: var(--text); font-size: 12.5px; }

/* ---------- rules ---------- */

section.rules { padding: 66px 0 20px; }

h2 {
  font-size: 21px;
  letter-spacing: -0.012em;
  margin: 0 0 6px;
  font-weight: 620;
}

.lede { color: var(--dim); margin: 0 0 24px; font-size: 14.5px; max-width: 640px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 10px;
}

.rule {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
}

.rule h3 {
  font-family: var(--mono);
  font-size: 13px;
  margin: 0 0 6px;
  font-weight: 500;
  color: var(--text);
}

.rule p { margin: 0; font-size: 13px; color: var(--dim); }
.rule .seen { display: block; margin-top: 8px; color: var(--dimmer); font-size: 12px; font-style: italic; }

footer {
  padding: 52px 0 64px;
  color: var(--dimmer);
  font-size: 13px;
  text-align: center;
}
footer a { color: var(--dim); }

@media (max-width: 620px) {
  header { padding: 48px 0 30px; }
  .job { grid-template-columns: 16px minmax(0, 1fr); }
  .job .js { grid-column: 2; text-align: left; }
}

/* ---------- menu bar section ---------- */

.install-sub { margin-top: 20px; margin-bottom: 4px; }

.bar-demo {
  margin: 26px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

/* The two states side by side. The point of the whole feature is that the
   first one is what you see almost every day, so it goes first and stays
   visually quieter than the alert. */
.bar-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
}

.bar-item { min-width: 30px; }
.bar-item.quiet { color: var(--dimmer); }
.bar-item.bad { color: var(--critical); font-weight: 600; }
.bar-label { color: var(--dim); font-family: var(--sans); font-size: 13px; }

.bar-menu {
  margin-top: 8px;
  padding: 10px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  max-width: 100%;
  overflow-x: auto;
}

.bar-row { padding: 0 16px; white-space: nowrap; }
.bar-row.head { color: var(--dimmer); font-size: 11px; }
.bar-row.crit { color: var(--critical); }
.bar-row.detail {
  color: var(--dim);
  padding-left: 32px;
  /* Prose, not a stat line: wrapping reads better than a sideways scroll,
     and a cut-off sentence looks broken rather than scrollable. */
  white-space: normal;
}

.bar-sep {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

@media (max-width: 620px) {
  .bar-menu { font-size: 11px; }
  .bar-row.detail { padding-left: 24px; }
}
