/* Status page: dark, quiet, and readable at a glance. Green means the whole
   thing is up; the moment it is not, colour and copy change together. */

:root {
  --bg: #07080b;
  --bg-soft: #0d0f14;
  --card: #101319;
  --line: #1e232d;
  --line-soft: #171b23;
  --text: #eef1f6;
  --text-dim: #8a93a5;
  --text-faint: #5b6475;
  --ok: #34d399;
  --ok-dim: #0f3f31;
  --warn: #fbbf24;
  --down: #f87171;
  --down-dim: #40191c;
  --none: #262c37;
  --radius: 16px;
}

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

html {
  background: var(--bg);
}

body {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* A single soft light behind everything, tinted by the overall state. */
.glow {
  position: fixed;
  inset: -30vh 0 auto 0;
  height: 90vh;
  pointer-events: none;
  background: radial-gradient(50% 50% at 50% 40%, rgba(52, 211, 153, 0.16), transparent 70%);
  transition: background 0.8s ease;
  z-index: 0;
}

body.is-partial .glow {
  background: radial-gradient(50% 50% at 50% 40%, rgba(251, 191, 36, 0.16), transparent 70%);
}

body.is-down .glow {
  background: radial-gradient(50% 50% at 50% 40%, rgba(248, 113, 113, 0.18), transparent 70%);
}

main,
.top,
.foot {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

/* ── top bar ────────────────────────────────────────────────────────── */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--text);
  color: #000;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.03em;
}

.brand-text {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.top-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background-color 0.3s ease;
}

.live-dot.on {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.live-dot.off {
  background: var(--down);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.16);
}

/* ── hero ───────────────────────────────────────────────────────────── */

.hero {
  padding: clamp(36px, 8vw, 76px) 0 clamp(28px, 5vw, 48px);
  text-align: center;
}

.hero-ring {
  position: relative;
  width: 74px;
  height: 74px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.hero-pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.8);
}

/* The ring breathes while everything is fine. */
.hero-ring::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--ok);
  opacity: 0;
  animation: breathe 2.8s ease-out infinite;
}

body.is-partial .hero-pulse {
  background: var(--warn);
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.75);
}

body.is-partial .hero-ring::after {
  border-color: var(--warn);
}

body.is-down .hero-pulse {
  background: var(--down);
  box-shadow: 0 0 22px rgba(248, 113, 113, 0.75);
}

body.is-down .hero-ring::after {
  border-color: var(--down);
  animation-duration: 1.4s;
}

@keyframes breathe {
  0% {
    transform: scale(1);
    opacity: 0.75;
  }
  70% {
    transform: scale(1.55);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.hero-title {
  font-size: clamp(28px, 5.2vw, 46px);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-wrap: balance;
}

.hero-sub {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: clamp(14px, 1.7vw, 16px);
}

/* ── cards ──────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: 12px;
  padding-bottom: 28px;
}

.card {
  padding: 18px 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.state {
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--none);
}

.state.ok {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
}

.state.down {
  background: var(--down);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.12);
}

.card-titles {
  margin-right: auto;
  min-width: 0;
}

.card-name {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-note {
  color: var(--text-faint);
  font-size: 13px;
}

.card-right {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 13px;
  color: var(--text-dim);
}

.card-right b {
  color: var(--text);
  font-weight: 600;
}

.verdict {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--ok-dim);
  color: var(--ok);
}

.verdict.bad {
  background: var(--down-dim);
  color: var(--down);
}

/* ── 90-day bar ─────────────────────────────────────────────────────── */

.bars {
  display: flex;
  gap: 2px;
  align-items: stretch;
  height: 34px;
  margin-top: 16px;
}

.bar {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
  background: var(--none);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.bar.ok {
  background: linear-gradient(180deg, var(--ok), #1c9c72);
}

.bar.warn {
  background: linear-gradient(180deg, var(--warn), #b47f0c);
}

.bar.down {
  background: linear-gradient(180deg, var(--down), #b93d3d);
}

.bar:hover {
  transform: scaleX(1.6);
  filter: brightness(1.25);
}

.scale {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 11px;
  color: var(--text-faint);
}

/* ── response chart ─────────────────────────────────────────────────── */

.spark {
  display: block;
  width: 100%;
  height: 42px;
  margin-top: 14px;
  overflow: visible;
}

.spark path.line {
  fill: none;
  stroke: var(--ok);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.spark path.area {
  fill: url(#sparkFill);
  stroke: none;
}

.card.bad .spark path.line {
  stroke: var(--down);
}

.spark-empty {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-faint);
}

/* ── legend, footer ─────────────────────────────────────────────────── */

.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 6px 0 30px;
  font-size: 12px;
  color: var(--text-faint);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chip {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--none);
}

.chip-ok {
  background: var(--ok);
}

.chip-warn {
  background: var(--warn);
}

.chip-down {
  background: var(--down);
}

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-block: 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--text-faint);
}

.foot a {
  color: var(--text-dim);
  text-decoration: none;
}

.foot a:hover {
  color: var(--text);
}

.notice {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--text-dim);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .hero-ring::after,
  .card {
    animation: none;
  }
}
