/* Written by Thomas Conway */
:root {
  color-scheme: light;
  --background: #f8f7f2;
  --surface: #fffefa;
  --ink: #292823;
  --muted: #77756d;
  --line: #dedcd3;
  --operational: #6eaa2c;
  --operational-dark: #588c20;
  --degraded: #e6a126;
  --outage: #d35a4a;
  --maintenance: #647fc3;
  --unknown: #d8d6cf;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

.header {
  display: flex;
  min-height: 176px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: block;
  text-decoration: none;
}

.brand-logo {
  position: relative;
  display: block;
  width: 232px;
  overflow: hidden;
  aspect-ratio: 545 / 110;
}

.brand-logo img {
  position: absolute;
  top: -123.6%;
  left: -11.2%;
  width: 122.2%;
  max-width: none;
  height: auto;
}

.header-button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 4px;
  color: white;
  background: #25241f;
  font-size: 0.67rem;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

.header-button:hover {
  background: #11110f;
}

.status-banner {
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 12px;
  padding: 18px 21px;
  border-radius: 4px;
  color: white;
  background: #8a8983;
  font-size: 1rem;
  font-weight: 560;
  transition: background 180ms ease;
}

.status-banner.is-operational {
  color: white;
  background: var(--operational);
}

.status-banner.is-degraded {
  color: white;
  background: var(--degraded);
}

.status-banner.is-outage {
  color: white;
  background: var(--outage);
}

.status-banner.is-maintenance {
  color: white;
  background: var(--maintenance);
}

.banner-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.66);
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15);
}

.uptime-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 92px;
  margin-bottom: 14px;
}

.uptime-heading h1,
.incidents > h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.uptime-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 0;
  border: 0;
  color: #55534d;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  text-decoration: underline;
  text-decoration-color: #b9b6ad;
  text-underline-offset: 3px;
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.refresh-button:disabled span {
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.services-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.service {
  padding: 22px 20px 20px;
}

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

.service-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 25px;
}

.service h2,
.incident-entry h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 520;
}

.service p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.service-state {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: #88867e;
  font-size: 0.74rem;
  font-weight: 540;
}

.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.is-operational {
  color: var(--operational-dark);
}

.is-degraded {
  color: #b97b0d;
}

.is-outage {
  color: var(--outage);
}

.is-maintenance {
  color: var(--maintenance);
}

.is-checking,
.is-unknown {
  color: #88867e;
}

.uptime-bars {
  display: grid;
  grid-template-columns: repeat(90, minmax(2px, 1fr));
  gap: 2px;
  height: 33px;
  margin-top: 13px;
}

.uptime-bar {
  min-width: 1px;
  border-radius: 1px;
  background: var(--unknown);
}

.uptime-bar.is-operational {
  background: var(--operational);
}

.uptime-bar.is-degraded {
  background: var(--degraded);
}

.uptime-bar.is-outage {
  background: var(--outage);
}

.uptime-bar.is-maintenance {
  background: var(--maintenance);
}

.uptime-scale {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 13px;
  margin-top: 8px;
  color: #918f87;
  font-size: 0.67rem;
}

.uptime-scale::before,
.uptime-scale::after {
  content: "";
  height: 1px;
  background: #d7d4cc;
}

.uptime-scale > span:first-child {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  padding-right: 9px;
  background: var(--surface);
  z-index: 1;
}

.uptime-scale .uptime-number {
  grid-column: 2;
  grid-row: 1;
  white-space: nowrap;
}

.uptime-scale > span:last-child {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  padding-left: 9px;
  background: var(--surface);
  z-index: 1;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 13px;
  margin-top: 13px;
  color: #7e7c74;
  font-size: 0.65rem;
}

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

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 1px;
}

.legend-operational {
  background: var(--operational);
}

.legend-degraded {
  background: var(--degraded);
}

.legend-outage {
  background: var(--outage);
}

.legend-maintenance {
  background: var(--maintenance);
}

.legend-unknown {
  background: var(--unknown);
}

.last-checked {
  margin: 13px 0 0;
  color: #918f87;
  font-size: 0.68rem;
  text-align: right;
}

.incidents {
  margin-top: 82px;
}

.incidents > h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.incident-entry {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 28px;
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
}

.incident-date {
  color: #76746c;
  font-size: 0.76rem;
  font-weight: 560;
}

.incident-entry h3 {
  margin-bottom: 7px;
}

.incident-entry p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.incident-entry.has-maintenance h3 {
  color: var(--maintenance);
}

.incident-entry.has-warning h3 {
  color: #b97b0d;
}

.incident-entry.has-outage h3 {
  color: var(--outage);
}

footer {
  display: flex;
  min-height: 132px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #8c8980;
  font-size: 0.68rem;
}

footer p {
  margin: 0;
}

footer nav {
  display: flex;
  gap: 20px;
}

footer a {
  text-underline-offset: 3px;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(39, 147, 92, 0.28);
  outline-offset: 4px;
}

.noscript {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  box-shadow: 0 10px 40px rgba(20, 20, 15, 0.12);
  font-size: 0.78rem;
  text-align: center;
}

@media (max-width: 620px) {
  .page {
    width: min(100% - 28px, 840px);
  }

  .header {
    min-height: 124px;
  }

  .brand {
    width: min(210px, 58vw);
  }

  .brand-logo {
    width: 100%;
  }

  .header-button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.58rem;
  }

  .uptime-heading {
    align-items: start;
    flex-direction: column;
    gap: 9px;
    margin-top: 66px;
  }

  .uptime-bars {
    grid-template-columns: repeat(45, minmax(2px, 1fr));
  }

  .uptime-bar:nth-child(-n + 45) {
    display: none;
  }

  .legend {
    justify-content: flex-start;
  }

  .incident-entry {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
