:root {
  --paper: #f4f1ea;
  --surface: #fbfaf6;
  --ink: #1a1916;
  --muted: #6b665b;
  --faint: #706b62;
  --line: #e0dccf;
  --line-strong: #cdc8b8;

  --deploy: #1a774f;
  --deploy-soft: #e3f1e8;
  --incident: #b73d0b;
  --incident-soft: #f8e7dc;
  --comment: #3457b3;
  --comment-soft: #e3e8f6;

  --pad: clamp(1.1rem, 5vw, 2.75rem);
  --measure: 64ch;

  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--paper);
  color: var(--ink);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

#content-slot {
  display: block;
}

.page {
  margin: 0 auto;
  max-width: 980px;
  padding: clamp(1.75rem, 5vw, 3.25rem) var(--pad) 5rem;
}

/* ---- Masthead -------------------------------------------------- */

.masthead {
  align-items: end;
  border-bottom: 1px solid var(--line-strong);
  display: grid;
  gap: 1rem 2.5rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
  padding-bottom: 1.5rem;
}

.eyebrow {
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  margin: 0 0 0.6rem;
  text-transform: uppercase;
}

h1 {
  font-family: ui-serif, "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 5.2vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.02;
  margin: 0;
}

.masthead__lede {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
  max-width: 42ch;
}

/* ---- Controls -------------------------------------------------- */

.controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 600;
  gap: 0.5rem;
  line-height: 1;
  padding: 0.5rem 0.7rem 0.5rem 0.85rem;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.chip__count {
  background: var(--paper);
  border-radius: 999px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  min-width: 1.5rem;
  padding: 0.18rem 0.4rem;
  text-align: center;
}

.chip--active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.chip--active .chip__count {
  background: rgba(255, 255, 255, 0.16);
  color: var(--surface);
}

.refresh {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 600;
  gap: 0.4rem;
  padding: 0.5rem 0.4rem;
  text-decoration: none;
}

.refresh:hover {
  color: var(--ink);
}

.refresh svg {
  fill: none;
  height: 1rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 1rem;
}

/* ---- Result line ----------------------------------------------- */

.result {
  align-items: baseline;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.85rem;
  gap: 0.35rem;
  margin: 1.4rem 0 0;
}

.result strong {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.result__scope {
  color: var(--ink);
  font-weight: 600;
}

.result__id {
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}

/* ---- Timeline -------------------------------------------------- */

.feed {
  display: grid;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.event {
  column-gap: 1.1rem;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  padding: 1.25rem 0;
  position: relative;
}

.event + .event {
  border-top: 1px solid var(--line);
}

/* continuous connector line behind the node column, anchored to the row */
.event::before {
  background: var(--line-strong);
  bottom: 0;
  content: "";
  left: 1.25rem;
  position: absolute;
  top: 0;
  width: 1px;
  z-index: 0;
}

/* trim the line so it tucks under the first and last icon */
.event:first-child::before {
  top: 2.3rem;
}

.event:last-child::before {
  bottom: auto;
  height: 2.3rem;
  top: 0;
}

.event__node {
  align-self: start;
  display: grid;
  place-items: center;
  position: relative;
  width: 2.5rem;
  z-index: 1;
}

.event__icon {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  display: inline-flex;
  height: 2.1rem;
  justify-content: center;
  position: relative;
  width: 2.1rem;
  z-index: 1;
}

.event__icon svg {
  fill: none;
  height: 1.1rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  width: 1.1rem;
}

.event--deploys .event__icon {
  background: var(--deploy-soft);
  border-color: var(--deploy);
  color: var(--deploy);
}

.event--incidents .event__icon {
  background: var(--incident-soft);
  border-color: var(--incident);
  color: var(--incident);
}

.event--comments .event__icon {
  background: var(--comment-soft);
  border-color: var(--comment);
  color: var(--comment);
}

.event__body {
  min-width: 0;
}

.event__head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  justify-content: space-between;
}

.event__meta {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 0.4rem;
  margin: 0;
}

.event__actor {
  color: var(--ink);
  font-weight: 650;
}

.event__action {
  color: var(--muted);
}

.event__kind {
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  padding: 0.12rem 0.38rem;
  text-transform: uppercase;
}

.event__kind--deploys {
  background: var(--deploy-soft);
  color: var(--deploy);
}

.event__kind--incidents {
  background: var(--incident-soft);
  color: var(--incident);
}

.event__kind--comments {
  background: var(--comment-soft);
  color: var(--comment);
}

.event__age {
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.event__title {
  font-family: ui-serif, "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
  margin: 0.45rem 0 0.3rem;
}

.event__detail {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  max-width: var(--measure);
}

.event__id {
  align-self: start;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
  white-space: nowrap;
}

/* ---- Responsive ------------------------------------------------ */

@media (max-width: 720px) {
  .masthead {
    grid-template-columns: 1fr;
  }

  .masthead__lede {
    max-width: var(--measure);
  }

  .event {
    column-gap: 0.85rem;
    grid-template-columns: 2.1rem minmax(0, 1fr);
  }

  .event::before {
    left: 1.05rem;
  }

  .event:first-child::before {
    top: 2.15rem;
  }

  .event:last-child::before {
    height: 2.15rem;
  }

  .event__node {
    width: 2.1rem;
  }

  .event__icon {
    height: 1.85rem;
    width: 1.85rem;
  }

  .event__icon svg {
    height: 1rem;
    width: 1rem;
  }

  .event__id {
    grid-column: 2;
    margin-top: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
