/* Updates — short backstory, compact changelog. This page only. */

.page-updates .beat {
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}

.page-updates .beat > h1,
.page-updates .beat > h2,
.page-updates .beat > p,
.page-updates .beat > .updates-log {
  max-width: var(--maxw);
}

.page-updates .beat > h1 {
  margin-bottom: .65rem;
}

.page-updates .beat > h2 {
  font-size: 1.25rem;
  margin-top: 1.75rem;
  margin-bottom: .65rem;
  scroll-margin-top: 5.5rem;
}

.page-updates .updates-log {
  --node: .62rem;
  --rail-gap: .7rem;
  --rail: calc(var(--node) + var(--rail-gap));
  --node-x: calc(-1 * var(--rail) + var(--node) / 2);
  /* Mobile: center the node on the date row (summary padding + half the date). */
  --node-y: calc(.7rem + .375rem);
  margin-top: .35rem;
}

.page-updates .updates-log details {
  position: relative;
  padding-left: var(--rail);
}

.page-updates .updates-log summary::before {
  content: "";
  position: absolute;
  z-index: 1;
  box-sizing: border-box;
  left: var(--node-x);
  top: var(--node-y);
  width: var(--node);
  height: var(--node);
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--paper);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}

.page-updates .updates-log summary::after,
.page-updates .updates-detail::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: var(--node-x);
  width: 2px;
  background: var(--rule);
  transform: translateX(-50%);
}

.page-updates .updates-log summary::after {
  top: 0;
  bottom: 0;
}

.page-updates .updates-log details:first-child summary::after {
  top: var(--node-y);
}

.page-updates .updates-log details:last-child:not([open]) summary::after {
  bottom: auto;
  height: var(--node-y);
}

.page-updates .updates-log details:last-child[open] summary::after {
  height: auto;
  bottom: 0;
}

.page-updates .updates-detail::before {
  top: 0;
  bottom: 0;
}

.page-updates .updates-log summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.5rem;
  grid-template-areas: "when plus" "title plus";
  column-gap: .75rem;
  row-gap: .15rem;
  align-items: center;
  padding: .7rem 0;
  border-radius: .2rem;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.page-updates .updates-log summary::-webkit-details-marker {
  display: none;
}

.page-updates .updates-log summary::marker {
  content: "";
}

.page-updates .updates-log summary:focus {
  outline: none;
}

.page-updates .updates-log summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.page-updates .updates-log time {
  display: block;
  grid-area: when;
  margin: 0;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .75rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  color: var(--ink-soft);
}

.page-updates .updates-title {
  display: block;
  grid-area: title;
  font-weight: 600;
  line-height: 1.3;
}

.page-updates .updates-plus {
  grid-area: plus;
  justify-self: end;
  align-self: center;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 1.375rem;
  height: 1.375rem;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--rule));
  border-radius: 50%;
  background: var(--paper);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1;
  color: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .page-updates .updates-log summary,
  .page-updates .updates-plus,
  .page-updates .updates-log summary::before {
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
  }
}

.page-updates .updates-log summary:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--paper));
}

.page-updates .updates-log details[open] summary::before {
  background: var(--accent);
}

.page-updates .updates-log summary:hover .updates-plus {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.page-updates .updates-plus::before {
  content: "";
  display: block;
  width: .62rem;
  height: .62rem;
  background:
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}

.page-updates .updates-log details[open] .updates-plus::before {
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}

.page-updates .updates-detail {
  position: relative;
  padding: 0 1.75rem .85rem 0;
}

.page-updates .updates-detail p {
  margin: 0;
}

@media (min-width: 42rem) {
  .page-updates .updates-log {
    --node-y: 50%;
  }

  .page-updates .updates-log details:first-child summary::after {
    top: 50%;
  }

  .page-updates .updates-log details:last-child:not([open]) summary::after {
    height: auto;
    top: 0;
    bottom: 50%;
  }

  .page-updates .updates-log summary {
    grid-template-columns: 7.25rem minmax(0, 1fr) 1.5rem;
    grid-template-areas: "when title plus";
    align-items: center;
    padding: .55rem 0;
  }

  .page-updates .updates-detail {
    padding: 0 2rem .9rem 8rem;
  }
}
