:root {
  color-scheme: dark;
  --bg: #07111f;
  --surface: #0c1829;
  --surface-2: #101f34;
  --line: rgba(148, 163, 184, .14);
  --text: #f7fbff;
  --muted: #91a3b9;
  --cyan: #35bdf5;
  --cyan-soft: rgba(53, 189, 245, .12);
  --green: #35d07f;
  --green-soft: rgba(53, 208, 127, .13);
  --red: #fb5e69;
  --red-soft: rgba(251, 94, 105, .13);
  --amber: #f7b84b;
  --amber-soft: rgba(247, 184, 75, .13);
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% -10%, rgba(53, 189, 245, .10), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: "AR One Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.hidden { display: none !important; }

.site-header {
  width: min(1120px, calc(100% - 40px));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.brand img { border-radius: 10px; object-fit: contain; }
.brand strong { color: var(--cyan); }
.site-header nav { display: flex; align-items: center; gap: 28px; }
.site-header nav a { color: var(--muted); font-size: 14px; font-weight: 600; }
.site-header nav a:hover { color: var(--text); }
.site-header .contact-link {
  padding: 10px 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

main { width: min(920px, calc(100% - 40px)); margin: 0 auto; padding: 84px 0 110px; }
.hero { text-align: center; margin-bottom: 42px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(53, 208, 127, .11);
  animation: pulse 2s infinite;
}
.hero h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1.05;
  letter-spacing: -.045em;
}
.hero p { max-width: 610px; margin: 18px auto 0; color: var(--muted); font-size: 17px; line-height: 1.65; }

.overall-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 17px;
  align-items: center;
  min-height: 94px;
  padding: 21px 23px;
  background: var(--surface);
  border: 1px solid rgba(53, 208, 127, .28);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.overall-card.status-partial_outage,
.overall-card.status-major_outage { border-color: rgba(251, 94, 105, .4); }
.overall-card.status-degraded,
.overall-card.status-maintenance,
.overall-card.status-unknown { border-color: rgba(247, 184, 75, .4); }
.overall-icon {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--green-soft);
}
.overall-icon::before,
.overall-icon::after {
  content: "";
  position: absolute;
  background: var(--green);
  border-radius: 2px;
}
.overall-icon::before { width: 8px; height: 3px; left: 12px; top: 24px; transform: rotate(44deg); }
.overall-icon::after { width: 18px; height: 3px; left: 17px; top: 21px; transform: rotate(-48deg); }
.status-partial_outage .overall-icon,
.status-major_outage .overall-icon { background: var(--red-soft); }
.status-partial_outage .overall-icon::before,
.status-partial_outage .overall-icon::after,
.status-major_outage .overall-icon::before,
.status-major_outage .overall-icon::after { background: var(--red); width: 20px; height: 3px; left: 13px; top: 22px; }
.status-partial_outage .overall-icon::before,
.status-major_outage .overall-icon::before { transform: rotate(45deg); }
.status-partial_outage .overall-icon::after,
.status-major_outage .overall-icon::after { transform: rotate(-45deg); }
.status-degraded .overall-icon,
.status-maintenance .overall-icon,
.status-unknown .overall-icon,
.status-no_data .overall-icon { background: var(--amber-soft); }
.status-degraded .overall-icon::before,
.status-maintenance .overall-icon::before,
.status-unknown .overall-icon::before,
.status-no_data .overall-icon::before { width: 4px; height: 15px; left: 21px; top: 11px; transform: none; background: var(--amber); }
.status-degraded .overall-icon::after,
.status-maintenance .overall-icon::after,
.status-unknown .overall-icon::after,
.status-no_data .overall-icon::after { width: 4px; height: 4px; left: 21px; top: 31px; transform: none; background: var(--amber); }
.overall-copy { display: flex; flex-direction: column; gap: 5px; }
.overall-copy strong { font-size: 18px; letter-spacing: -.02em; }
.overall-copy span { color: var(--muted); font-size: 13px; }
.refresh-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
#refresh-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
#refresh-button:hover { color: var(--text); border-color: rgba(53, 189, 245, .35); }
#refresh-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#refresh-button.loading svg { animation: spin .8s linear infinite; }

.content-section { margin-top: 66px; }
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 19px;
}
.section-kicker { color: var(--cyan); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.section-heading h2 { margin: 5px 0 0; font-size: 25px; letter-spacing: -.035em; }
.legend { display: flex; gap: 15px; color: var(--muted); font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.online { background: var(--green); }
.legend-dot.offline { background: var(--red); }
.legend-dot.maintenance { background: var(--amber); }

.category-list, .incident-list { display: grid; gap: 14px; }
.category-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.category-header { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.category-header h3 { margin: 0; font-size: 16px; }
.category-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.component-row { padding: 17px 22px; }
.component-row + .component-row { border-top: 1px solid var(--line); }
.component-top { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.component-name { font-size: 14px; font-weight: 600; }
.component-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.component-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.component-status.offline { color: var(--red); }
.component-status.maintenance, .component-status.unknown { color: var(--amber); }
.availability-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; margin-top: 14px; }
.uptime-bars { height: 27px; display: flex; gap: 3px; align-items: stretch; }
.uptime-bar {
  flex: 1;
  min-width: 3px;
  background: rgba(145, 163, 185, .16);
  border-radius: 2px;
  transition: transform .18s ease;
}
.uptime-bar:hover { transform: scaleY(1.16); }
.uptime-bar.good { background: rgba(53, 208, 127, .76); }
.uptime-bar.warn { background: rgba(247, 184, 75, .83); }
.uptime-bar.bad { background: rgba(251, 94, 105, .85); }
.component-metrics { min-width: 96px; text-align: right; }
.component-metrics strong { display: block; font-size: 13px; }
.component-metrics span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }

.incident-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.incident-card summary { list-style: none; cursor: pointer; }
.incident-card summary::-webkit-details-marker { display: none; }
.incident-card[open] .incident-head { background: rgba(16, 31, 52, .45); }
.incident-card.active { border-left: 3px solid var(--amber); }
.incident-card.impact-major,
.incident-card.impact-critical { border-left-color: var(--red); }
.incident-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 19px 21px;
}
.incident-head h3 { margin: 0; font-size: 15px; }
.incident-meta { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 8px 12px; color: var(--muted); font-size: 11px; }
.incident-badge {
  align-self: start;
  padding: 6px 9px;
  border-radius: 99px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.incident-badge.resolved { color: var(--green); background: var(--green-soft); }
.incident-summary-end { display: flex; align-items: center; gap: 11px; }
.incident-toggle {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s ease;
}
.incident-card[open] .incident-toggle { transform: rotate(225deg) translate(-2px, -2px); }
.incident-updates { border-top: 1px solid var(--line); padding: 2px 21px 12px; }
.incident-update { position: relative; padding: 16px 0 7px 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.incident-update::before { content: ""; position: absolute; left: 0; top: 22px; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
.incident-update + .incident-update { border-top: 1px solid rgba(148, 163, 184, .08); }
.incident-update strong { display: block; margin-bottom: 3px; color: var(--text); font-size: 11px; text-transform: uppercase; }
.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: rgba(12, 24, 41, .55);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 13px;
}
.skeleton-card {
  height: 188px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.4s infinite;
}
.error-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  padding: 13px 16px;
  border: 1px solid rgba(251, 94, 105, .4);
  border-radius: 11px;
  background: #26141a;
  color: #ffdce0;
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .25s ease;
}
.error-toast.show { opacity: 1; transform: translateY(0); }

footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 42px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.footer-brand { font-size: 15px; }
footer p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.footer-links { display: flex; gap: 22px; color: var(--muted); font-size: 12px; }
.footer-links a:hover { color: var(--text); }

@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(53, 208, 127, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes skeleton { to { background-position: -200% 0; } }

@media (max-width: 720px) {
  .site-header { min-height: 70px; }
  .site-header nav a:not(.contact-link) { display: none; }
  main { padding-top: 58px; }
  .hero { margin-bottom: 30px; }
  .overall-card { grid-template-columns: auto 1fr; padding: 18px; }
  .refresh-meta { grid-column: 1 / -1; justify-content: flex-end; }
  .section-heading { align-items: start; flex-direction: column; }
  .legend { flex-wrap: wrap; }
  .component-row, .category-header { padding-left: 17px; padding-right: 17px; }
  .availability-row { grid-template-columns: 1fr; }
  .component-metrics { display: flex; align-items: center; gap: 8px; text-align: left; }
  .component-metrics span { margin: 0; }
  .uptime-bars { gap: 2px; }
  .incident-head { padding: 17px; }
  .incident-updates { padding-left: 17px; padding-right: 17px; }
  footer { align-items: flex-start; flex-direction: column; }
  .footer-links { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
