html.changelog-page,
.changelog-page body {
  height: auto;
  min-height: 100%;
  overflow: visible;
  color: var(--ui-ink);
}

.changelog-shell {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 48px max(20px, env(safe-area-inset-right)) 24px max(20px, env(safe-area-inset-left));
}

/* The leather cover carries the title; everything below is paper. */
.changelog-heading {
  padding: 28px 32px;
  margin-bottom: 20px;
}

.changelog-heading h1 {
  margin: 16px 0;
  color: var(--ui-white);
  font-size: clamp(2.6rem, 9vw, 4.5rem);
  letter-spacing: -0.055em;
  line-height: 1.1;
  text-shadow: none;
}

.changelog-heading > p:last-child {
  max-width: 44rem;
  margin: 0;
  color: var(--ui-sage);
  line-height: 1.6;
}

.changelog-nav {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 12px 18px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 28%);
}

.version-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}

.version-picker label {
  color: var(--ui-muted);
  font-size: 0.75rem;
}

.version-picker select,
.changelog-retry {
  min-height: 44px;
  max-width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--ui-ink);
  border-radius: var(--ui-radius);
  background: var(--ui-white);
  color: var(--ui-ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.version-picker select:focus-visible,
.changelog-retry:focus-visible {
  outline: 2px solid var(--ui-gold);
  outline-offset: 3px;
}

.changelog-status {
  padding: 14px 18px;
  color: var(--ui-muted);
  line-height: 1.6;
}

.changelog-releases {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

/* Each release is a page of the journal. */
.release-card {
  padding: clamp(24px, 4vw, 36px);
  overflow-wrap: anywhere;
}

.release-card:target::before {
  border-color: var(--ui-gold);
}

.release-card,
#changelog-title {
  scroll-margin-top: 100px;
}

.release-heading {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ui-rule);
}

/* A copper diamond breaks the rule under each release title. */
.release-heading::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  background: var(--ui-copper);
  transform: translateX(-50%) rotate(45deg);
}

.release-heading h2 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.release-heading time {
  color: var(--ui-muted);
  font-size: 0.8rem;
}

/* Version badges are small bookmarks. */
.release-badge {
  padding: 5px 10px 11px;
  background: var(--ui-sage);
  color: var(--ui-ink);
  font-size: 0.7rem;
  font-weight: 800;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), 50% 100%, 0 calc(100% - 6px));
}

.release-card h3 {
  margin: 22px 0 10px;
  color: var(--ui-copper);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.release-card ul {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--ui-ink);
  font-size: 0.95rem;
  line-height: 1.75;
}

.release-card li::marker {
  color: var(--ui-copper);
}

.release-card code {
  color: var(--ui-ink);
  font-size: 0.9em;
  border: 1px solid var(--ui-rule-faint);
  border-radius: 3px;
  background: var(--ui-paper);
  padding: 2px 5px;
}

.release-card a,
.changelog-page noscript a {
  color: var(--ui-copper);
  text-underline-offset: 3px;
}

.changelog-footer {
  padding-top: 20px;
  text-align: center;
}

.changelog-footer .menu-link {
  color: var(--ui-gold);
}

@media (max-width: 620px) {
  .changelog-shell {
    padding-top: 20px;
  }

  .changelog-nav {
    align-items: stretch;
    flex-direction: column;
    padding: 10px 14px;
  }

  .version-picker {
    justify-content: space-between;
  }

  .release-card,
  #changelog-title {
    scroll-margin-top: 170px;
  }
}
