/* DarkCrawl status page. Colours and dots follow the website's tokens
   (website/site/src/styles/tokens.css, home.css .dot and .step-dot); light by default, dark
   with the device. System fonts only: the page loads nothing but its own two files. */
:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --ink: #0a0a0a;
  --muted: #5f5d58;
  --body: #34332f;
  --line: #dddcd6;
  --card: #fdfcf9;
  --cardline: #cfcdc6;
  --dot: #b5b3ac;
  --ring: #dedcd5;
  --red: #b91c1c;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f0f0e;
    --ink: #f2f1ec;
    --muted: #a3a19a;
    --body: #cfcdc6;
    --line: #2b2a28;
    --card: #171715;
    --cardline: #363531;
    --dot: #5a5853;
    --ring: #2a2926;
    --red: #f26b6b;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
a:hover {
  opacity: 0.7;
}
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 28px 0 40px;
}
.home {
  font-weight: 700;
  font-size: 19px;
  text-decoration: none;
}
.label {
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h2 {
  margin: 0 0 16px;
  font-size: 17px;
}

/* The current state: one large dot beside the headline. */
.now {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.now-dot {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 10px;
  border-radius: 50%;
  border: 2px solid var(--ring);
}
.state-ok .now-dot {
  background: var(--ink);
  border-color: var(--ink);
}
.state-degraded .now-dot,
.state-down .now-dot {
  border-color: var(--red);
  background: radial-gradient(circle, var(--red) 0 38%, transparent 42%);
}
.state-partial .now-dot {
  border-color: var(--dot);
  background: linear-gradient(90deg, var(--dot) 0 50%, transparent 50% 100%);
}
.note {
  margin: 8px 0 0;
  color: var(--muted);
}
.state-stale .note,
.state-missing .note {
  color: var(--body);
}

/* One row per checked name. */
.components {
  list-style: none;
  margin: 0;
  padding: 8px 0 32px;
}
.component {
  display: grid;
  grid-template-columns: 12px auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.component .host {
  color: var(--muted);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.component .state {
  text-align: right;
}

/* The 90 days: three rows of 30 dots (six of 15 on a phone). The kinds differ in shape as
   well as colour, so a red-weak eye can tell them apart: a solid dot (every check passed), a
   half-filled dot (some failed), a ring with a centre (5 minutes or more failed), an empty
   ring (no results). */
.dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.up {
  background: var(--ink);
}
.dot.part {
  border: 1.5px solid var(--dot);
  background: linear-gradient(90deg, var(--dot) 0 50%, transparent 50% 100%);
}
.dot.down {
  border: 2px solid var(--red);
  background: radial-gradient(circle, var(--red) 0 38%, transparent 42%);
}
.dot.none {
  border: 1.5px solid var(--ring);
}
.dots {
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.dots .dot {
  width: 100%;
  height: auto;
  max-width: 14px;
  aspect-ratio: 1;
}
.axis {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 15px;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend .dot {
  width: 10px;
  height: 10px;
}

.about {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--body);
}
.about p,
.checks {
  margin: 0 0 14px;
}
.checks {
  padding-left: 20px;
}
.checks li {
  margin-bottom: 8px;
}

/* Text for screen readers only (each dot's day and result). */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .wrap {
    padding: 0 16px 48px;
  }
  h1 {
    font-size: 24px;
  }
  .dots {
    grid-template-columns: repeat(15, minmax(0, 1fr));
  }
  .component {
    grid-template-columns: 12px 1fr auto;
  }
  .component .host {
    grid-column: 2 / 4;
    grid-row: 2;
  }
}
