:root {
  color-scheme: dark;
  --text: rgba(245, 247, 242, 0.95);
  --muted: rgba(230, 235, 226, 0.68);
  --faint: rgba(230, 235, 226, 0.44);
  --panel: rgba(61, 65, 60, 0.6);
  --panel-dark: rgba(24, 29, 25, 0.45);
  --line: rgba(255, 255, 255, 0.15);
  --line-soft: rgba(255, 255, 255, 0.09);
  --ok: #8ccc8a;
  --warn: #d7bc72;
  --down: #d98080;
  --unknown: #9ea7a0;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(5, 8, 5, 0.44), rgba(5, 8, 5, 0.64)),
    url("https://images.unsplash.com/photo-1448375240586-882707db888b?auto=format&fit=crop&w=2400&q=85")
      center / cover fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 48% 28%, rgba(255, 255, 255, 0.09), transparent 30%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.48));
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: clamp(18px, 4vw, 48px);
}

.status-board {
  width: min(560px, 100%);
  padding: clamp(22px, 4.5vw, 38px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(108, 112, 105, 0.34), rgba(35, 40, 36, 0.66)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px) saturate(108%);
  -webkit-backdrop-filter: blur(15px) saturate(108%);
}

.board-header {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
  padding: 8px 0 22px;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 9vw, 5.25rem);
  line-height: 0.9;
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 0.96rem;
  font-weight: 750;
}

h3 {
  margin: 22px 0 9px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overall-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.overall-pill[data-state="ok"] {
  color: var(--ok);
}

.overall-pill[data-state="warning"] {
  color: var(--warn);
}

.overall-pill[data-state="down"] {
  color: var(--down);
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 18%, transparent);
}

.overall-pill[data-state="checking"] .pulse {
  animation: pulse 1.2s ease-in-out infinite;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 24px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: var(--line-soft);
}

.summary-item {
  min-height: 76px;
  padding: 14px 12px;
  background: rgba(22, 26, 23, 0.42);
}

.summary-label {
  display: block;
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.summary-item strong {
  display: block;
  font-size: clamp(1rem, 3.2vw, 1.36rem);
  line-height: 1;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.refresh-button,
.imprint-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
  cursor: pointer;
}

.refresh-button:hover,
.imprint-button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.refresh-button:disabled {
  cursor: wait;
  color: var(--faint);
}

.service-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(9, 12, 10, 0.28);
}

.service-group {
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.025);
}

.service-group + .service-group {
  border-top: 1px solid var(--line);
}

.service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.service-row:last-child {
  border-bottom: 0;
}

.service-main {
  min-width: 0;
}

.service-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  font-weight: 800;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: var(--unknown);
  box-shadow: 0 0 0 5px rgba(158, 167, 160, 0.16);
}

.service-row[data-state="ok"] .status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 5px rgba(140, 204, 138, 0.16);
}

.service-row[data-state="warning"] .status-dot {
  background: var(--warn);
  box-shadow: 0 0 0 5px rgba(215, 188, 114, 0.18);
}

.service-row[data-state="down"] .status-dot {
  background: var(--down);
  box-shadow: 0 0 0 5px rgba(217, 128, 128, 0.18);
}

.service-url,
.service-kind,
.metric-label {
  color: var(--faint);
  font-size: 0.78rem;
}

.service-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-cell {
  min-width: 104px;
  text-align: right;
}

.status-text {
  display: block;
  font-weight: 850;
}

.service-row[data-state="ok"] .status-text {
  color: var(--ok);
}

.service-row[data-state="warning"] .status-text {
  color: var(--warn);
}

.service-row[data-state="down"] .status-text {
  color: var(--down);
}

.service-latency {
  display: block;
  margin-top: 5px;
  color: var(--faint);
  font-size: 0.76rem;
}

.incident-copy {
  margin: 18px 2px 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  text-align: center;
}

.board-footer {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.meta-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.meta-list div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--panel-dark);
}

.meta-list dt {
  color: var(--faint);
  font-size: 0.72rem;
}

.meta-list dd {
  margin: 5px 0 0;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
}

.imprint-button {
  width: fit-content;
  justify-self: center;
}

.skeleton {
  position: relative;
  overflow: hidden;
  min-height: 82px;
  border-bottom: 1px solid var(--line-soft);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 16px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.11), transparent),
    linear-gradient(rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.11));
  background-size:
    40% 100%,
    100% 100%;
  background-position:
    -40% 0,
    0 0;
  background-repeat: no-repeat;
  animation: loading 1.1s linear infinite;
}

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

@keyframes loading {
  to {
    background-position:
      140% 0,
      0 0;
  }
}

@media (max-width: 620px) {
  .page-shell {
    align-items: start;
    padding: 12px;
  }

  .status-board {
    border-radius: 26px;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .meta-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .section-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .refresh-button {
    width: 100%;
  }

  .service-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .status-cell {
    text-align: left;
  }
}
