/*
 * The public status page. Hand-written rather than built by Tailwind, because
 * the page is rendered on the server with no client bundle at all; the values
 * are the same tokens src/client/styles.css defines, and
 * tests/client/styles.test.ts holds the two together.
 */
:root {
  --neutral-50: #f6f6f5;
  --neutral-100: #f0f0ee;
  --neutral-200: #e7e7e5;
  --neutral-300: #d6d6d3;
  --neutral-500: #6b6b6b;
  --neutral-600: #545452;
  --neutral-800: #242423;
  --neutral-900: #1a1a1a;
  --up-ink: #156a3a;
  --up-wash: #e7f6ed;
  --up-dot: #22a35a;
  --late-ink: #8f4f05;
  --late-wash: #fdf1e2;
  --late-dot: #e8860c;
  --down-ink: #b42318;
  --down-wash: #fdeaea;
  --down-dot: #e5484d;
  --maintenance-ink: oklch(50% 0.18 281.88);
  --maintenance-wash: oklch(96% 0.03 281.88);
  --maintenance-dot: oklch(62.9% 0.2054 281.88);
  --surface: #ffffff;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --card-shadow: 0 1px 2px rgb(17 17 17 / 0.05);
}

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

html {
  background: var(--neutral-50);
  color: var(--neutral-800);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 2rem;
}

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

/* Balanced wrapping suits short headings; on a paragraph it breaks lines
   early and reads as a mistake. */
h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.page-head {
  margin-bottom: 2rem;
}

.page-head h1 {
  font-size: 2.25rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--neutral-900);
}

.lede {
  margin-top: 0.5rem;
  font-size: 1.0625rem;
  color: var(--neutral-600);
}

/* The banner says the one thing most visitors came for, so it is the largest
   block of colour on the page; every other status is a small word. */
.banner {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--neutral-200);
  margin-bottom: 2.5rem;
}

.banner h2 {
  font-size: 1.25rem;
  font-weight: 750;
  color: var(--neutral-900);
}

.banner .dot {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--neutral-300);
}

.banner.s-operational {
  background: var(--up-wash);
  border-color: transparent;
}
.banner.s-operational .dot {
  background: var(--up-dot);
}
.banner.s-degraded {
  background: var(--late-wash);
  border-color: transparent;
}
.banner.s-degraded .dot {
  background: var(--late-dot);
}
.banner.s-partial_outage,
.banner.s-major_outage {
  background: var(--down-wash);
  border-color: transparent;
}
.banner.s-partial_outage .dot,
.banner.s-major_outage .dot {
  background: var(--down-dot);
}
.banner.s-maintenance {
  background: var(--maintenance-wash);
  border-color: transparent;
}
.banner.s-maintenance .dot {
  background: var(--maintenance-dot);
}

section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--neutral-600);
  margin-bottom: 0.75rem;
}

.components ul {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--neutral-200);
  border-radius: 1.25rem;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.component {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--neutral-100);
}

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

.component-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.component-name {
  font-weight: 650;
  color: var(--neutral-900);
}

.component-description {
  margin-top: 0.125rem;
  font-size: 0.875rem;
  color: var(--neutral-500);
}

.status {
  font-size: 0.875rem;
  font-weight: 650;
  white-space: nowrap;
  color: var(--neutral-500);
}

.status.s-operational {
  color: var(--up-ink);
}
.status.s-degraded {
  color: var(--late-ink);
}
.status.s-partial_outage,
.status.s-major_outage {
  color: var(--down-ink);
}
.status.s-maintenance {
  color: var(--maintenance-ink);
}

.history {
  margin-top: 0.875rem;
}

.bars {
  display: flex;
  gap: 2px;
  height: 2rem;
}

.bar {
  flex: 1;
  min-width: 2px;
  border-radius: 999px;
  background: var(--neutral-200);
}

.bar.s-operational {
  background: var(--up-dot);
}
.bar.s-degraded {
  background: var(--late-dot);
}
.bar.s-partial_outage {
  background: var(--down-dot);
  opacity: 0.6;
}
.bar.s-major_outage {
  background: var(--down-dot);
}
.bar.s-maintenance {
  background: var(--maintenance-dot);
}

.history-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--neutral-500);
  font-variant-numeric: tabular-nums;
}

.incident {
  background: var(--surface);
  border: 1px solid var(--neutral-200);
  border-radius: 1.25rem;
  box-shadow: var(--card-shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.875rem;
}

.incident-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.incident h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--neutral-900);
}

.stage {
  flex-shrink: 0;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: var(--neutral-100);
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--neutral-800);
  white-space: nowrap;
}

.affected {
  font-size: 0.875rem;
  color: var(--neutral-500);
  margin-top: 0.25rem;
}

.updates {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.updates li {
  padding: 0.875rem 1rem;
  border-radius: 0.875rem;
  background: var(--neutral-50);
}

.updates p + p {
  margin-top: 0.5rem;
}

.update-head {
  font-size: 0.8125rem;
  color: var(--neutral-500);
  margin-bottom: 0.25rem;
}

.update-head strong {
  color: var(--neutral-800);
  font-weight: 700;
}

.past-day {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--neutral-200);
}

.past-date {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: 0.375rem;
}

.past-day .incident {
  margin-top: 0.5rem;
}

.empty {
  font-size: 0.9375rem;
  color: var(--neutral-500);
}

footer {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--neutral-500);
}

@media (max-width: 40rem) {
  main {
    padding-top: 2.25rem;
  }
  .page-head h1 {
    font-size: 1.75rem;
  }
  .bars {
    gap: 1px;
  }
  .component-head {
    flex-direction: column;
    gap: 0.125rem;
  }
}
