/* Colors for light mode. */
:root {
  color-scheme: light dark;
  --paper: #fdfdfc;
  --ink: #191919;
  --muted: #595959;
  --rule: #dcdcd8;
}

/* Dark mode follows the device setting. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141414;
    --ink: #ececea;
    --muted: #a8a8a4;
    --rule: #33332f;
  }
}

* {
  box-sizing: border-box;
}

body {
  max-width: 42rem;
  margin: 0 auto;
  padding: 4rem 1.25rem;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
}

/* Section labels, each with a line above. */
h2 {
  margin: 3rem 0 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

h3 {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
}

p {
  margin: 0 0 0.75rem;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.headline {
  margin-top: 0.75rem;
  font-size: 1.25rem;
  line-height: 1.45;
}

.meta,
.tag,
time {
  color: var(--muted);
}

.tag {
  font-size: 0.875rem;
  font-weight: 400;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

article + article {
  margin-top: 2rem;
}

/* Case study pages. */
.page-header {
  margin-top: 2.5rem;
}

/* Challenge headings and numbered steps. */
section > h3 {
  margin-top: 1.75rem;
}

section > h2 + h3 {
  margin-top: 0;
}

ol,
ul {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.25rem;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Role on the left, years on the right. */
.timeline li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

time {
  white-space: nowrap;
}

/* Less top space and smaller story titles on phones. */
@media (max-width: 30rem) {
  body {
    padding-top: 2rem;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }
}

/* Cleaner printing. */
@media print {
  body {
    padding: 0;
    font-size: 11pt;
  }

  article {
    break-inside: avoid;
  }
}
