@font-face {
  font-family: "Plex";
  src: url("/fonts/IBMPlexSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex";
  src: url("/fonts/IBMPlexSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "JBMono";
  src: url("/fonts/JetBrainsMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root,
[data-theme="dark"] {
  --canvas: #141413;
  --surface: #1f1e1d;
  --muted-surface: #262624;
  --card: #30302e;
  --ink: #faf9f5;
  --text: #c2c0b6;
  --muted: #9c9a92;
  --line: rgba(222, 220, 209, 0.11);
  --line-strong: rgba(222, 220, 209, 0.18);
  --red: #e2362f;
  --red-deep: #c42a24;
  --hover: #2a2a28;
  --ok: #3aa76d;
  --warn: #d79b2e;
  --none: #34332f;
  color-scheme: dark;
}

[data-theme="light"] {
  --canvas: #eaeaec;
  --surface: #ffffff;
  --muted-surface: #f3f4f3;
  --card: #ffffff;
  --ink: #181b19;
  --text: #5d625e;
  --muted: #737973;
  --line: #e5e7e4;
  --line-strong: #d3d7d3;
  --red: #c0211d;
  --red-deep: #a61b17;
  --hover: #f6f7f6;
  --ok: #2f8f5b;
  --warn: #b97c12;
  --none: #dcdfdc;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--canvas);
}
body {
  color: var(--ink);
  font: 400 15px/1.5 "Plex", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
svg {
  display: block;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
::selection {
  color: #fff;
  background: var(--red);
}
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.skip {
  position: fixed;
  top: 10px;
  left: -9999px;
  z-index: 50;
}
.skip:focus {
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--canvas);
}

.page {
  width: min(880px, calc(100% - 40px));
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.btn--plain {
  color: var(--text);
}
.btn--plain:hover {
  color: var(--ink);
  background: var(--hover);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}
.top__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.top__brand svg {
  width: 28px;
  height: 28px;
}
.top__brand small {
  font: 400 11px "JBMono", Consolas, monospace;
  color: var(--muted);
}
.top__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.theme {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--text);
}
.theme:hover {
  background: var(--hover);
  color: var(--ink);
}
.theme svg {
  width: 18px;
  height: 18px;
}
.theme .sun,
[data-theme="light"] .theme .moon {
  display: none;
}
[data-theme="light"] .theme .sun {
  display: block;
}

.main {
  display: grid;
  gap: 16px;
  padding: 18px 0 10px;
}

.summary {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 26px 26px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.summary h1 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.summary p {
  margin-top: 2px;
  font: 400 12.5px "JBMono", Consolas, monospace;
  color: var(--muted);
}
.summary__light {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: none;
  background: var(--muted);
}
.summary[data-level="up"] .summary__light {
  background: var(--ok);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 18%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
.summary[data-level="degraded"] .summary__light,
.summary[data-level="stale"] .summary__light {
  background: var(--warn);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--warn) 18%, transparent);
}
.summary[data-level="down"] .summary__light,
.summary[data-level="error"] .summary__light {
  background: var(--red);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--red) 18%, transparent);
}
.summary[data-level="down"],
.summary[data-level="error"] {
  border-color: color-mix(in srgb, var(--red) 45%, transparent);
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 9px color-mix(in srgb, var(--ok) 6%, transparent);
  }
}

.notice {
  padding: 18px 22px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
}
.notice h2 {
  font: 500 12px "JBMono", Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--warn);
}
.notice p {
  margin-top: 4px;
  color: var(--text);
  white-space: pre-line;
}

.services {
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.services__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.services__head h2 {
  font-size: 15px;
  font-weight: 500;
}
.services__head p {
  font-size: 12.5px;
  color: var(--muted);
}

.service {
  padding: 20px 24px 18px;
}
.service + .service {
  border-top: 1px solid var(--line);
}
.service__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.service__name h3 {
  font-size: 15.5px;
  font-weight: 500;
}
.service__name p {
  font-size: 13px;
  color: var(--muted);
}
.service__state {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}
.service__facts {
  font: 400 12px "JBMono", Consolas, monospace;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--muted-surface);
  color: var(--text);
}
.pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.pill--up {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 13%, transparent);
}
.pill--up .pill__dot {
  background: var(--ok);
}
.pill--degraded {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, transparent);
}
.pill--degraded .pill__dot {
  background: var(--warn);
}
.pill--down {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 13%, transparent);
}
.pill--down .pill__dot {
  background: var(--red);
}

.bars {
  display: grid;
  grid-template-columns: repeat(90, 1fr);
  gap: 2px;
  height: 30px;
  margin-top: 16px;
}
.bar {
  border-radius: 2px;
  background: var(--none);
  transition: opacity 0.15s;
}
.bar:hover {
  opacity: 0.7;
}
.bar--up {
  background: var(--ok);
}
.bar--slow {
  background: color-mix(in srgb, var(--ok) 55%, var(--warn));
}
.bar--part {
  background: var(--warn);
}
.bar--down {
  background: var(--red);
}
.scale {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  font: 400 11.5px "JBMono", Consolas, monospace;
  color: var(--muted);
}
.scale__uptime {
  color: var(--text);
}

.nojs {
  padding: 16px;
  color: var(--text);
}

.foot {
  display: grid;
  gap: 10px;
  padding: 26px 0 34px;
  font-size: 13px;
  color: var(--text);
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.foot a:hover {
  color: var(--red);
}

@media (max-width: 640px) {
  .page {
    width: calc(100% - 24px);
  }
  .top__actions .btn:first-child {
    display: none;
  }
  .summary {
    padding: 20px;
  }
  .summary h1 {
    font-size: 20px;
  }
  .services__head {
    display: grid;
    gap: 2px;
  }
  .service {
    padding: 18px 16px 16px;
  }
  .service__head {
    display: grid;
  }
  .service__state {
    justify-items: start;
    text-align: left;
  }
  .bars {
    grid-template-columns: repeat(45, 1fr);
  }
  .bars .bar:nth-child(-n + 45) {
    display: none;
  }
  .scale span:first-child {
    visibility: hidden;
  }
}

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