/* ------------------------------------------------------------------
   /status/ — service health and incident history.

   Deliberately the plainest page on the site. A status page is read by
   someone whose work just stopped; nothing here should be clever, and
   the four bar colours have to be distinguishable at a glance and
   apart from colour alone (they carry titles and a legend).
   ------------------------------------------------------------------ */

:root {
  --st-up: #7d9b2f;
  --st-partial: #c98a1e;
  --st-down: #b4432a;
  --st-none: #d9d0b8;
}

.st-body { background: var(--bone); padding-top: 81px; }

/* the base sheet's landing-page `h2 { max-width: 12ch }` reaches every page */
.st-body h1,
.st-body h2,
.st-body h3 { max-width: none; }

.st-main { padding: 40px 0 80px; }

.st-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

.st-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.st-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -.015em;
  margin: 0;
  color: var(--ink);
}

/* ---------------------------------------------------------------- banner */

.st-banner {
  border: 1px solid var(--line);
  border-left-width: 4px;
  background: var(--bone-2);
  padding: 20px 22px;
  margin-bottom: 34px;
}

.st-banner-line { margin: 0; font-size: 19px; font-weight: 600; color: var(--ink); }
.st-banner-sub { margin: 6px 0 0; font-size: 14.5px; color: var(--earth-2); }

.st-banner[data-state="operational"] { border-left-color: var(--st-up); background: rgba(125, 155, 47, .09); }
.st-banner[data-state="degraded"] { border-left-color: var(--st-partial); background: rgba(201, 138, 30, .1); }
.st-banner[data-state="down"] { border-left-color: var(--st-down); background: rgba(180, 67, 42, .09); }
.st-banner[data-state="unknown"] { border-left-color: var(--earth-2); }

/* ------------------------------------------------------------ components */

.st-group { margin-bottom: 30px; }

.st-group-head { margin-bottom: 10px; }

.st-group-head h2 {
  margin: 0 0 2px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--earth-3);
}

.st-group-head p { margin: 0; font-size: 13.5px; color: var(--earth-2); }

.st-components { border: 1px solid var(--line); }

.st-component { padding: 20px 22px; }
.st-component + .st-component { border-top: 1px solid var(--line); }

.st-component-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.st-component h3 { margin: 0 0 3px; font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.st-component-head p { margin: 0; font-size: 14px; color: var(--earth-2); line-height: 1.45; }

.st-state {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding-top: 3px;
  color: var(--earth-2);
}

.st-state[data-state="operational"] { color: #5f7722; }
.st-state[data-state="degraded"] { color: #9a6a10; }
.st-state[data-state="down"] { color: var(--st-down); }

/* the 90 bars. `gap` on a flex row lets them shrink to whatever the column
   gives them, so this needs no breakpoints of its own */
.st-bars {
  display: flex;
  gap: 2px;
  align-items: stretch;
  height: 34px;
}

.st-bar {
  flex: 1 1 0;
  min-width: 0;
  background: var(--st-none);
}

.st-bar[data-state="up"] { background: var(--st-up); }
.st-bar[data-state="partial"] { background: var(--st-partial); }
.st-bar[data-state="down"] { background: var(--st-down); }
/* A day nobody measured is drawn as a floor, not a full bar: it must not read
   as a result, and the measured stretch has to be the thing the eye finds. */
.st-bar[data-state="none"] {
  background: var(--st-none);
  align-self: flex-end;
  height: 30%;
}

.st-scale {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--earth-3);
}

.st-uptime { color: var(--earth-2); text-align: center; flex: 1 1 auto; }

/* What is wrong, in one line, right under the component it belongs to. */
.st-failing {
  margin: 0 0 12px;
  padding: 8px 11px;
  background: rgba(180, 67, 42, .08);
  border-left: 3px solid var(--st-down);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.st-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 40px;
  font-size: 12.5px;
  color: var(--earth-2);
}

.st-legend span { display: inline-flex; align-items: center; gap: 7px; }
.st-legend i { width: 10px; height: 10px; display: inline-block; background: var(--st-none); }
.st-legend i[data-state="up"] { background: var(--st-up); }
.st-legend i[data-state="partial"] { background: var(--st-partial); }
.st-legend i[data-state="down"] { background: var(--st-down); }

/* ------------------------------------------------------------------ note */

.st-note {
  border-top: 1px solid var(--line);
  padding-top: 26px;
  margin-bottom: 46px;
}

.st-note h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; color: var(--ink); }
.st-note h3 { margin: 24px 0 10px; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.st-note strong { color: var(--ink); }
.st-note em { font-style: italic; }
.st-note p { margin: 0 0 14px; font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
.st-note a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--earth-2); }

/* -------------------------------------------------------------- history */

.st-history-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  color: var(--ink);
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.st-day { padding: 18px 0; border-bottom: 1px solid var(--line); }

.st-day-title {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--earth-3);
  margin: 0 0 10px;
}

.st-none { margin: 0; font-size: 15px; color: var(--earth-2); }
.st-none-all { padding: 18px 0; border-bottom: 1px solid var(--line); }

.st-incident + .st-incident { margin-top: 22px; padding-top: 22px; border-top: 1px dashed var(--line); }
.st-incident-title { margin: 0 0 8px; font-size: 18px; font-weight: 600; color: var(--ink); line-height: 1.35; }

.st-incident-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--earth-3);
}

.st-impact { color: var(--ink); border-bottom: 2px solid var(--earth-2); padding-bottom: 1px; }
.st-impact-minor { border-bottom-color: var(--st-partial); }
.st-impact-major { border-bottom-color: var(--st-down); }
.st-impact-critical { border-bottom-color: var(--st-down); color: var(--st-down); }
.st-open { color: var(--st-down); }

.st-updates { list-style: none; margin: 0; padding: 0; }
.st-updates li { padding: 0 0 14px 0; }
.st-updates li + li { border-top: 1px solid var(--line); padding-top: 14px; }

.st-update-status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--earth-2);
}

.st-update-resolved { color: #5f7722; }
.st-update-investigating,
.st-update-identified { color: var(--st-down); }
.st-update-monitoring { color: #9a6a10; }

.st-updates p { margin: 5px 0 6px; font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.st-updates time { font-family: var(--mono); font-size: 11px; color: var(--earth-3); }

.st-history-foot { margin: 18px 0 0; font-size: 13.5px; color: var(--earth-3); }

@media (max-width: 640px) {
  .st-component-head { flex-direction: column; gap: 8px; }
  .st-state { padding-top: 0; }
  /* 90 bars in 320px is 1px each: drop to the most recent 45 rather than
     drawing a row nobody can read */
  .st-bar:nth-child(-n+45) { display: none; }
  .st-scale span:first-child { font-size: 0; }
  .st-scale span:first-child::after { content: "45 days ago"; font-size: 10.5px; }
  /* three columns of wrapped mono in 375px is unreadable: the scale keeps one
     row and the uptime figure gets its own */
  .st-scale { flex-wrap: wrap; }
  .st-uptime { order: 3; flex: 1 0 100%; margin-top: 6px; }
}
