/* Typography and palette follow www.telescope.co: Nunito Sans for interface
   and headings, Source Serif 4 for prose, Tailwind's stone greys and the
   terracotta and seafoam brand colours. */

@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("/static/fonts/nunito-sans.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/source-serif-4.woff2") format("woff2");
}

:root {
  --bg: #fafaf9;
  --card: #ffffff;
  --ink: #1c1917;
  --prose: #57534e;
  --muted: #78716c;
  --border: #e7e5e4;
  --button: #111827;
  --accent: #dd7165;

  --green: #3f9f68;
  --yellow: #e0aa2e;
  --orange: #e07a3f;
  --red: #cf4a3f;
  --blue: #3d7c85;
  --nodata: #dbd8d2;

  /* Darker shades of the same hues, for text on a light background. */
  --green-text: #2f7d50;
  --yellow-text: #9a6d0b;
  --orange-text: #b65a1f;
  --red-text: #b2382e;
  --blue-text: #356e76;

  --sans: "Nunito Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--button); outline-offset: 2px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
small { font-size: 14px; color: var(--muted); }
code { padding: 1px 4px; background: var(--border); font-size: 0.9em; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.color-secondary { color: var(--muted); }
.container { width: 90%; max-width: 850px; margin: 0 auto; }
.page-incident .container { max-width: 640px; }

/* Masthead */
.masthead { padding-top: 64px; margin-bottom: 64px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 700; letter-spacing: -0.015em; }
.brand:hover { text-decoration: none; }

/* Overall status, shown only when nothing is unresolved */
.page-status {
  margin-bottom: 64px;
  padding: 16px 22px;
  background: var(--green);
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
}
.page-status.status-minor { background: var(--yellow); }
.page-status.status-major { background: var(--orange); }
.page-status.status-critical { background: var(--red); }
.page-status.status-maintenance { background: var(--blue); }

/* Unresolved incidents and scheduled maintenance */
.unresolved-incidents { margin-bottom: 64px; }
.unresolved-incident + .unresolved-incident { margin-top: 24px; }
.unresolved-incident .incident-title {
  padding: 14px 22px;
  background: var(--ink);
  color: #ffffff;
  font-size: 20px;
  line-height: 1.4;
}
.unresolved-incident.impact-minor .incident-title { background: var(--yellow); }
.unresolved-incident.impact-major .incident-title { background: var(--orange); }
.unresolved-incident.impact-critical .incident-title { background: var(--red); }
.unresolved-incident.impact-maintenance .incident-title { background: var(--blue); }
.unresolved-incident .updates {
  margin: 0;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
}
.unresolved-incident .update + .update { margin-top: 18px; }

/* Updates, wherever they are listed */
.updates { list-style: none; }
.update { overflow-wrap: break-word; }
.update strong { font-weight: 700; }
.update .message, .message { font-family: var(--serif); color: var(--prose); font-size: 17px; line-height: 1.6; }
.impact-note { color: var(--muted); font-weight: 600; }
.maintenance-time { color: var(--prose); }

/* Components */
.components-section { margin-bottom: 64px; }
.components-uptime-link { margin-bottom: 8px; text-align: right; font-size: 14px; color: var(--muted); }
.components-uptime-link a { color: var(--ink); }
.components { margin: 0; padding: 0; list-style: none; background: var(--card); border: 1px solid var(--border); }
.component { padding: 18px 22px 16px; }
.component + .component { border-top: 1px solid var(--border); }
.component-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.component-head .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.component-head .host { color: var(--muted); font-weight: 400; }
.component-status { flex: none; font-size: 14px; font-weight: 600; color: var(--green-text); }
.component-status.degraded { color: var(--yellow-text); }
.component-status.partial { color: var(--orange-text); }
.component-status.major { color: var(--red-text); }
.component-status.maintenance { color: var(--blue-text); }

.bars { display: flex; gap: 2px; height: 34px; margin: 10px 0 0; padding: 0; list-style: none; }
.bar { flex: 1; min-width: 0; background: var(--green); }
.bar.degraded { background: var(--yellow); }
.bar.partial { background: var(--orange); }
.bar.major { background: var(--red); }
.bar.nodata { background: var(--nodata); }
.bar:hover { filter: brightness(0.85); }
.bar a { display: block; height: 100%; }
.bar a:focus-visible { outline-offset: 1px; }

.legend { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--muted); }
.legend-item { flex: none; }
.legend .spacer { flex: 1; height: 1px; margin: 10px 14px 0; background: var(--border); }
.days-short { display: none; }

/* Past incidents */
.incidents-list { margin-top: 64px; }
.incidents-list > h2 { font-size: 30px; line-height: 1.25; }
.status-day { margin-top: 32px; }
.status-day .date { margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); font-size: 19px; }
.incident-container { margin-bottom: 24px; }
.incident-container:last-child { margin-bottom: 0; }
.incident-container .incident-title { font-size: 19px; line-height: 1.4; }
.incident-container .updates { margin: 0; padding: 0; }
.incident-container .update { margin: 8px 0; }

.impact-minor a, .incident-name.impact-minor { color: var(--yellow-text); }
.impact-major a, .incident-name.impact-major { color: var(--orange-text); }
.impact-critical a, .incident-name.impact-critical { color: var(--red-text); }
.impact-maintenance a, .incident-name.impact-maintenance { color: var(--blue-text); }
.unresolved-incident .incident-title a { color: #ffffff; }

.since { margin-top: 32px; font-size: 14px; }

/* Incident history */
.history-nav { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.pager {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--button);
  color: #ffffff;
  font-size: 22px;
}
.pager:hover { text-decoration: none; opacity: 0.85; }
.pager.disabled { background: var(--border); color: var(--muted); }
.month { margin-top: 48px; }
.month-title { margin-bottom: 24px; padding-bottom: 10px; border-bottom: 1px solid var(--border); font-size: 30px; line-height: 1.25; }
.incident-data { margin-bottom: 26px; }
.incident-link { font-size: 19px; line-height: 1.4; }
.incident-data .message { margin-top: 4px; }
.incident-data .secondary { margin-top: 2px; font-size: 14px; }

/* Incident report */
.incident-page { padding-top: 72px; }
.incident-page > header { margin-bottom: 48px; text-align: center; }
.incident-name { font-size: 40px; line-height: 1.15; }
.subheader { margin-top: 14px; font-family: var(--serif); font-size: 22px; color: var(--muted); }
.scheduled-for { margin-top: 12px; }
.incident-updates { margin: 0; padding: 0; list-style: none; }
.update-row { display: flex; gap: 2rem; margin-bottom: 28px; overflow-wrap: break-word; }
.update-title { flex: 0 0 26%; font-size: 19px; line-height: 1.5; }
.update-body { flex: 1; min-width: 0; }
.update-body .impact-note { margin-bottom: 4px; font-size: 14px; }
.update-timestamp { margin-top: 6px; font-size: 14px; color: var(--muted); }
.components-affected { margin-top: 28px; padding: 14px 18px; background: var(--card); border: 1px solid var(--border); font-size: 14px; color: var(--muted); }

/* Footer */
.page-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin: 72px 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

@media (max-width: 600px) {
  .masthead { padding-top: 40px; margin-bottom: 40px; }
  .page-status, .unresolved-incidents, .components-section { margin-bottom: 40px; }
  .component-head { flex-wrap: wrap; }
  /* Ninety bars are too thin on a phone, so show the last thirty. */
  .bars .bar:nth-child(-n+60) { display: none; }
  .days-long { display: none; }
  .days-short { display: inline; }
  /* The no-data note rarely falls inside thirty days and crowds the legend. */
  .legend .light, .legend .light + .spacer { display: none; }
  .update-row { flex-direction: column; gap: 4px; }
  .incident-name { font-size: 30px; }
  .history-nav { justify-content: space-between; }
}
