:root {
  --paper: #f3f6f4;
  --surface: #ffffff;
  --ink: #15282e;
  --muted: #5c6f73;
  --line: #d5dedc;
  --clear: #1f7a55;
  --clear-wash: #dcefe5;
  --review: #a86400;
  --review-wash: #f8e9c8;
  --problem: #b42318;
  --problem-wash: #f9dad5;
  --idle-wash: #e3e9e8;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --text: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --measure: 1180px;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--text);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- the state band: the one thing meant to be read from across the room ---- */

.state { background: var(--idle-wash); border-bottom: 6px solid var(--muted); }
[data-state="ok"] > .state { background: var(--clear-wash); border-bottom-color: var(--clear); }
[data-state="warn"] > .state { background: var(--review-wash); border-bottom-color: var(--review); }
[data-state="crit"] > .state { background: var(--problem); border-bottom-color: #7a1710; color: #fff; }

.state__inner { max-width: var(--measure); margin: 0 auto; padding: 1.25rem 1.5rem 2.25rem; }
.state__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; }
.state__brand { font: 700 1.05rem/1 var(--display); letter-spacing: -0.01em; }
.state__signout { background: none; border: 0; padding: 0.25rem 0; text-decoration: underline; text-underline-offset: 3px; font-size: 0.9rem; }

.state h1 {
  font: 700 clamp(2.1rem, 5.4vw, 4rem)/1.02 var(--display);
  letter-spacing: -0.025em;
  max-width: 18ch;
  text-wrap: balance;
}
.state__meta { margin-top: 1rem; font-size: 1rem; max-width: 60ch; }
.state__meta a { margin-left: 0.35rem; text-underline-offset: 3px; }

.state__run {
  margin-top: 1.5rem;
  background: var(--ink);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.6rem 1.3rem;
  font-weight: 600;
}
.state__run:disabled { background: transparent; color: inherit; border-style: dashed; }
[data-state="crit"] .state__run { background: #fff; color: var(--problem); border-color: #fff; }
[data-state="crit"] .state__run:disabled { background: transparent; color: #fff; }

.sites { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-bottom: 1.5rem; font-weight: 500; }
.sites a { text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.sites a[aria-current="page"] { border-bottom-color: currentColor; }

/* ---- layout ---- */

.layout {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 3.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .layout__log { order: -1; }
}

h2 { font: 700 1.35rem/1.2 var(--display); letter-spacing: -0.01em; }

/* ---- checks ---- */

.checks + .checks { margin-top: 2.5rem; }
.checks__note { color: var(--muted); font-size: 0.92rem; margin-top: 0.25rem; max-width: 46ch; }
.checks ul { margin-top: 1rem; border-top: 1px solid var(--line); }

.check { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); gap: 0.75rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.check__label { font-weight: 500; }
.check__detail { color: var(--muted); font-size: 0.9rem; white-space: pre-line; overflow-wrap: anywhere; }

/* Shape as well as colour, so the state survives a greyscale screen. */
.check__mark { width: 0.8rem; height: 0.8rem; margin-top: 0.38rem; border-radius: 50%; border: 2px solid var(--clear); }
.check--warn .check__mark { border: 0; border-radius: 2px; background: var(--review); transform: rotate(45deg); }
.check--crit .check__mark { border: 0; background: var(--problem); box-shadow: 0 0 0 3px var(--problem-wash); }
.check--unknown .check__mark { border: 2px dashed var(--muted); }
.check--warn .check__detail, .check--crit .check__detail { color: var(--ink); }
.check--crit .check__label { color: var(--problem); }

/* ---- log ---- */

.log__head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
.log__tabs { display: flex; gap: 1.25rem; font-weight: 500; }
.log__tabs a { text-decoration: none; color: var(--muted); padding-bottom: 3px; border-bottom: 2px solid transparent; }
.log__tabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.log__all, .entry__action {
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
}
.log__all { margin-left: auto; }
.log__all:hover, .entry__action:hover { background: var(--ink); color: #fff; }

.log__list { margin-top: 1rem; }
.log__day { margin-top: 1.5rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 500; font-size: 0.92rem; }
.log__day:first-child { margin-top: 0; }
.log__empty { padding: 1.5rem 0; color: var(--muted); max-width: 52ch; border-top: 1px solid var(--line); }

.entry {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr) auto;
  gap: 0.25rem 1rem;
  align-items: start;
  padding: 0.85rem 0 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid transparent;
}
.entry--warn { border-left-color: var(--review); background: linear-gradient(90deg, var(--review-wash), transparent 55%); }
.entry--crit { border-left-color: var(--problem); background: linear-gradient(90deg, var(--problem-wash), transparent 55%); }
.entry--done { border-left-color: var(--line); background: none; }
.entry--done .entry__title { font-weight: 400; }

.entry__time { color: var(--muted); font-size: 0.9rem; padding-top: 0.1rem; }
.entry__title { font-weight: 600; overflow-wrap: anywhere; }
.entry__detail { margin-top: 0.2rem; font-size: 0.92rem; white-space: pre-line; overflow-wrap: anywhere; }
.entry__source, .entry__reviewed { margin-top: 0.3rem; color: var(--muted); font-size: 0.85rem; }
.entry--info .entry__title { font-weight: 400; }

@media (max-width: 560px) {
  .entry { grid-template-columns: minmax(0, 1fr); }
  .entry__action { justify-self: start; margin-top: 0.4rem; }
}

/* ---- sign in ---- */

.signin { max-width: 24rem; margin: 0 auto; padding: 18vh 1.5rem 4rem; }
.signin h1 { font: 700 2.6rem/1 var(--display); letter-spacing: -0.02em; }
.signin > p { margin-top: 0.75rem; color: var(--muted); }
.signin form { margin-top: 2rem; display: grid; gap: 0.5rem; }
.signin label { font-weight: 500; }
.signin input { font: inherit; padding: 0.7rem 0.8rem; border: 1px solid var(--ink); border-radius: 6px; background: var(--surface); }
.signin button { margin-top: 0.75rem; background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: 0.75rem 1.3rem; font-weight: 600; justify-self: start; }
.signin__error { color: var(--problem); font-weight: 500; }
