:root {
  color-scheme: light dark;
  --background: #f5f3ee;
  --surface: #ffffff;
  --text: #191919;
  --muted: #65635f;
  --border: #dedbd3;
  --accent: #ff522b;
  --brand-chrome: #000000;
  --operational: #18794e;
  --degraded: #9a6700;
  --outage: #b42318;
  --unknown: #65635f;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #111110;
    --surface: #1b1b19;
    --text: #f2f0ea;
    --muted: #aaa79f;
    --border: #393834;
    --operational: #59c894;
    --degraded: #e5b95c;
    --outage: #ff8a80;
    --unknown: #aaa79f;
  }
}

* {
  box-sizing: border-box;
}

body {
  min-width: 18rem;
  margin: 0;
  background: var(--background);
  color: var(--text);
  line-height: 1.55;
}

header,
main,
footer {
  width: min(44rem, calc(100% - 2rem));
  margin-inline: auto;
}

header {
  padding-block: 2rem 1.25rem;
}

.brand {
  display: block;
  width: 9rem;
  overflow: hidden;
  border-radius: 0.45rem;
  background: var(--brand-chrome);
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

main {
  display: grid;
  gap: 1rem;
}

.card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--surface);
  padding: 1.25rem;
}

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

.card h2 {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.overall {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-color: var(--unknown);
}

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

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

.overall[data-state="major_outage"] {
  border-color: var(--outage);
}

.overall h1 {
  margin-bottom: 0.15rem;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  line-height: 1.2;
}

.overall time,
.incident-meta,
footer {
  color: var(--muted);
  font-size: 0.9rem;
}

.overall-icon {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--unknown);
  font-size: 1.4rem;
  font-weight: 800;
}

[data-state="operational"] .overall-icon,
.component[data-state="operational"] [data-state] {
  color: var(--operational);
}

[data-state="degraded"] .overall-icon,
.component[data-state="degraded"] [data-state] {
  color: var(--degraded);
}

[data-state="major_outage"] .overall-icon,
.component[data-state="major_outage"] [data-state] {
  color: var(--outage);
}

.component-list {
  border-top: 1px solid var(--border);
}

.component {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.component:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.component [data-state] {
  color: var(--unknown);
  font-weight: 650;
  text-align: right;
}

.incident {
  border-color: var(--degraded);
}

.history {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history li {
  padding-block: 1rem;
  border-top: 1px solid var(--border);
}

.history li:last-child {
  padding-bottom: 0;
}

.history h3 {
  font-size: 1rem;
}

.history p {
  margin-bottom: 0.35rem;
}

.history-empty {
  color: var(--muted);
}

.no-script {
  border-color: var(--unknown);
}

footer {
  padding-block: 1.5rem 3rem;
}

@media (max-width: 32rem) {
  header,
  main,
  footer {
    width: min(100% - 1rem, 44rem);
  }

  header {
    padding-top: 1rem;
  }

  .card {
    padding: 1rem;
  }

  .component {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .component [data-state] {
    text-align: left;
  }
}
