:root {
  --bg: #f3f6f4;
  --bg-deep: #e7eee9;
  --surface: #ffffff;
  --ink: #14201a;
  --ink-muted: #5a6b62;
  --line: #d2ddd6;
  --brand: #0f6b4c;
  --brand-soft: #d8efe6;
  --operational: #1f8a5b;
  --degraded: #c48a12;
  --partial: #c45c1a;
  --major: #b3261e;
  --maintenance: #3a6ea5;
  --no-data: #c5cfc8;
  --shadow: 0 18px 40px rgba(20, 32, 26, 0.06);
  --radius: 14px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Sora", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d9efe6 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #e8f0e4 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  line-height: 1.5;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(20, 32, 26, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 32, 26, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 880px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 6px;
  background: linear-gradient(145deg, #14855f, #0a4f38);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.header-nav {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem 1.25rem 4rem;
}

.banner {
  margin: 1.25rem 0 1.5rem;
  padding: 1.5rem 1.5rem 1.35rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  border-left-width: 5px;
  animation: rise 0.55s ease both;
}

.banner--none,
.banner--operational {
  border-left-color: var(--operational);
  background: color-mix(in srgb, var(--operational) 12%, #fff);
}

.banner--minor {
  border-left-color: var(--degraded);
  background: color-mix(in srgb, var(--degraded) 14%, #fff);
}

.banner--major {
  border-left-color: var(--partial);
  background: color-mix(in srgb, var(--partial) 14%, #fff);
}

.banner--critical {
  border-left-color: var(--major);
  background: color-mix(in srgb, var(--major) 14%, #fff);
}

.banner--maintenance {
  border-left-color: var(--maintenance);
  background: color-mix(in srgb, var(--maintenance) 14%, #fff);
}

.banner--loading {
  border-left-color: var(--line);
}

.banner-label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.banner-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.banner-summary {
  margin: 0.65rem 0 0;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--ink);
  max-width: 42rem;
}

.banner-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  margin-top: 0.85rem;
}

.banner-fact {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.banner-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.banner-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #fff;
  background: var(--ink-muted);
}

.banner-stat strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.banner-stat.is-operational { background: var(--operational); }
.banner-stat.is-degraded_performance { background: var(--degraded); }
.banner-stat.is-partial_outage { background: var(--partial); }
.banner-stat.is-major_outage { background: var(--major); }
.banner-stat.is-maintenance { background: var(--maintenance); }

.banner-affected {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.banner-affected-title {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.banner-affected-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.banner-affected-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  font-size: 0.88rem;
}

.banner-affected-list .status-badge {
  font-size: 0.68rem;
  padding: 0.2rem 0.45rem;
}

.banner-affected-host,
.banner-affected-note {
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.banner-affected-more {
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.banner-meta {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.15rem;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend .dot {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
  background: var(--no-data);
}

.legend .dot.operational { background: var(--operational); }
.legend .dot.degraded_performance { background: var(--degraded); }
.legend .dot.partial_outage { background: var(--partial); }
.legend .dot.major_outage { background: var(--major); }
.legend .dot.maintenance { background: var(--maintenance); }
.legend .dot.no_data { background: var(--no-data); }

.uptime-note {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.group {
  margin-bottom: 1.75rem;
  animation: rise 0.6s ease both;
}

.group:nth-child(2) { animation-delay: 0.08s; }

.group-title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.host-block {
  margin-bottom: 1.15rem;
}

.host-block.is-open .host-chevron {
  transform: rotate(90deg);
}

.host-services {
  margin: 0.35rem 0 0 0.85rem;
  padding: 0.55rem 0 0.15rem 0.85rem;
  border-left: 2px solid var(--line);
}

.host-services[hidden] {
  display: none;
}

.host-services-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.host-toggle {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.host-toggle:hover .host-toggle-label {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.host-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.host-chevron {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--ink-muted);
  border-bottom: 2px solid var(--ink-muted);
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.host-service-count {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.component--toggleable .component-name {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.host-status-note {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin-left: 1.05rem;
}

.component {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  align-items: center;
  padding: 0.95rem 1rem;
  margin-bottom: 0.55rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.component.is-operational {
  background: color-mix(in srgb, var(--operational) 14%, #fff);
  border-color: color-mix(in srgb, var(--operational) 28%, var(--line));
}

.component.is-degraded_performance {
  background: color-mix(in srgb, var(--degraded) 18%, #fff);
  border-color: color-mix(in srgb, var(--degraded) 35%, var(--line));
}

.component.is-partial_outage {
  background: color-mix(in srgb, var(--partial) 18%, #fff);
  border-color: color-mix(in srgb, var(--partial) 35%, var(--line));
}

.component.is-major_outage {
  background: color-mix(in srgb, var(--major) 16%, #fff);
  border-color: color-mix(in srgb, var(--major) 35%, var(--line));
}

.component.is-maintenance {
  background: color-mix(in srgb, var(--maintenance) 16%, #fff);
  border-color: color-mix(in srgb, var(--maintenance) 32%, var(--line));
}

.component--host {
  border-left-width: 4px;
}

.component--host.is-operational { border-left-color: var(--operational); }
.component--host.is-degraded_performance { border-left-color: var(--degraded); }
.component--host.is-partial_outage { border-left-color: var(--partial); }
.component--host.is-major_outage { border-left-color: var(--major); }
.component--host.is-maintenance { border-left-color: var(--maintenance); }

.component--service {
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.4rem;
}

.component--service .component-name {
  font-size: 0.88rem;
  font-weight: 500;
}

.component-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.component-status,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  color: #fff;
  background: var(--ink-muted);
}

.status-badge.is-operational { background: var(--operational); }
.status-badge.is-degraded_performance { background: var(--degraded); }
.status-badge.is-partial_outage { background: var(--partial); }
.status-badge.is-major_outage { background: var(--major); }
.status-badge.is-maintenance { background: var(--maintenance); }

.uptime-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.uptime-bar {
  display: flex;
  flex: 1;
  gap: 1px;
  height: 1.65rem;
  min-width: 0;
}

.uptime-cell {
  flex: 1;
  min-width: 0;
  border-radius: 1px;
  background: var(--no-data);
  position: relative;
}

.uptime-cell.operational { background: var(--operational); }
.uptime-cell.degraded_performance { background: var(--degraded); }
.uptime-cell.partial_outage { background: var(--partial); }
.uptime-cell.major_outage { background: var(--major); }
.uptime-cell.maintenance { background: var(--maintenance); }

.uptime-cell:hover {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  z-index: 1;
}

.uptime-pct {
  flex-shrink: 0;
  width: 4.5rem;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.incidents-section {
  margin-top: 2.5rem;
  animation: rise 0.65s ease both;
  animation-delay: 0.12s;
}

.incidents-section h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.incident {
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.incident:last-child {
  border-bottom: 1px solid var(--line);
}

.incident-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.incident-meta {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.incident-update {
  position: relative;
  padding: 0.55rem 0 0.55rem 1rem;
  margin-left: 0.35rem;
  border-left: 2px solid var(--line);
}

.incident-update::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.85rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.incident-update strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.15rem;
}

.incident-update p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink);
}

.incident-update time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.muted {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.site-footer {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

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

@media (max-width: 560px) {
  .component {
    grid-template-columns: 1fr;
  }

  .component-status {
    justify-self: start;
  }

  .uptime-pct {
    width: auto;
  }

  .legend {
    gap: 0.5rem 0.85rem;
  }
}
