/* History, Sources and the 404 page. */

.page-head {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px var(--gutter) 30px;
  display: grid;
  gap: 12px;
}
.page-head h1 {
  font-size: clamp(44px, 12vw, 96px);
  font-stretch: 118%;
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.page-head h1 em {
  display: block;
  font-style: normal;
  color: var(--accent);
}
/* the title lines up with the column of moments or sources under it */
.history-page .page-head,
.sources-page .page-head {
  max-width: 920px;
}
.page-head .lede {
  max-width: 38em;
  font-size: 18px;
  color: var(--muted);
}

/* ---------- the timeline: a line with stations, and a small train riding it ---------- */

.timeline {
  --rail: 30px;
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: 10px var(--gutter) 20px calc(var(--gutter) + var(--rail) + 26px);
}
.track {
  position: absolute;
  left: calc(var(--gutter) + var(--rail) - 3px);
  top: 0;
  bottom: 0;
  width: 6px;
  border-radius: 3px;
  background: var(--line);
}
.track-fill {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: var(--teal);
  transform-origin: top;
  transform: scaleY(0);
}
.tram {
  position: absolute;
  left: -17px;
  top: -14px;
  width: 40px;
  height: 28px;
  z-index: 3;
  transform: translate3d(0, 0, 0);
}
.tram svg {
  width: 40px;
  height: 28px;
  transform: rotate(90deg);
}
.tram-body {
  fill: var(--orange);
}
.tram-win {
  fill: #fff6e5;
}
.tram-band {
  fill: var(--ink);
}
.tram-wheel {
  fill: var(--ink);
}
:root[data-theme="dark"] .tram-band,
:root[data-theme="dark"] .tram-wheel {
  fill: #0b0c18;
}

.era h2 {
  position: relative;
  font-size: clamp(26px, 6.4vw, 40px);
  margin: 26px 0 18px;
}
.era:first-of-type h2 {
  margin-top: 6px;
}
.moments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}
.moment {
  position: relative;
  padding: 16px 18px 18px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  transition: border-color 0.3s ease;
}
.moment::before {
  content: "";
  position: absolute;
  left: -37px;
  top: 20px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 4px solid var(--teal);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.moment.passed::before {
  background: var(--teal);
}
.moment.here {
  border-color: var(--orange);
}
.moment.here::before {
  background: var(--orange);
  border-color: var(--orange);
}
.moment .year {
  font: 800 15px/1.1 var(--display);
  font-stretch: 112%;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-transform: uppercase;
}
.moment h3 {
  font-size: 23px;
}
.moment > p:not(.year) {
  max-width: 40em;
}
.moment figure {
  margin: 8px 0 0;
  display: grid;
  gap: 6px;
}
.moment img {
  width: 100%;
  max-width: 520px;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 12px;
  background: var(--wall-2);
}
.moment figcaption {
  font-size: 13.5px;
  color: var(--muted);
}
.end-note {
  max-width: 920px;
  margin: 10px auto 56px;
  padding: 0 var(--gutter);
  color: var(--muted);
}
.end-note a {
  color: var(--accent);
  font-weight: 650;
}

@media (min-width: 760px) {
  .timeline {
    --rail: 40px;
  }
  .moment {
    grid-template-columns: 170px minmax(0, 1fr);
    column-gap: 22px;
    align-items: start;
  }
  .moment .year {
    grid-row: 1 / span 3;
    font-size: 22px;
    line-height: 1.1;
  }
  .moment figure {
    grid-column: 2;
  }
}

/* ---------- sources ---------- */

.sources {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 var(--gutter) 56px;
  display: grid;
  gap: 30px;
}
.sources h2 {
  font-size: clamp(24px, 5.4vw, 34px);
  margin-bottom: 6px;
}
.sources section > p {
  color: var(--muted);
  margin-bottom: 10px;
}
.sources ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.sources li {
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.sources li a {
  font-weight: 650;
}
.sources .what {
  display: block;
  font-size: 14px;
  color: var(--muted);
}
.sources .what a {
  font-weight: 400;
}

/* ---------- the 404 page ---------- */

.lost {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px var(--gutter) 64px;
  display: grid;
  gap: 28px;
}
.lost-art .window {
  aspect-ratio: 4 / 2.8;
}
.lost-words {
  display: grid;
  gap: 14px;
  align-content: center;
}
.lost-words h1 {
  font-size: clamp(34px, 8vw, 64px);
}
.lost-words > p:not(.eyebrow) {
  font-size: 18px;
  color: var(--muted);
}
.lost .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
@media (min-width: 900px) {
  .lost {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    min-height: calc(100svh - 260px);
  }
}
