.months-list {
  --bark: #b49983;
  --wood: #ceb69f;
  --leaf: #88a293;
  --branch-width: clamp(61px, 9vw, 108px);
  --branch-rise: clamp(29px, 3.4vw, 39px);
  --branch-top: 36px;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 0;
  width: min(100%, 1000px);
  margin: 28px auto 0;
  padding-block-start: 9px;
}

.months-list::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 22px;
  left: 50%;
  width: 7px;
  transform: translateX(-50%);
  border-radius: 55% 55% 3px 3px / 30px 30px 3px 3px;
  background: linear-gradient(90deg, #a68c78, var(--wood) 38%, #bc9a80 72%, #aa8c76);
}

.month-node {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--branch-width);
  min-width: 0;
  align-self: start;
  grid-column: 1;
}

.month-node:nth-child(even) {
  grid-column: 2;
  grid-template-columns: var(--branch-width) minmax(0, 1fr);
  margin-top: clamp(75px, 9.5vw, 110px);
}

/* The curved end meets the trunk lower than the end attached to the photo. */
.month-branch {
  position: relative;
  align-self: start;
  grid-area: 1 / 2;
  height: var(--branch-rise);
  margin-top: var(--branch-top);
  border: solid var(--bark);
  border-width: 2px 2px 0 0;
  border-top-right-radius: 94% 100%;
  pointer-events: none;
}

.month-node:nth-child(even) .month-branch {
  grid-column: 1;
  transform: scaleX(-1);
}

.month-branch::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 9px;
  top: -9px;
  left: 14%;
  background: var(--leaf);
  border-radius: 100% 0 100% 0;
  transform: rotate(78deg);
  box-shadow: inset 0 -1px #546f602e;
}

.month-branch::after {
  content: "";
  position: absolute;
  bottom: -4px;
  right: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #ae8c74;
  background: #ead7c4;
}

.month-card {
  position: relative;
  display: flex;
  flex-direction: column;
  grid-area: 1 / 1;
  justify-self: end;
  width: min(100%, 365px);
  padding: 14px 15px 15px;
  color: inherit;
  text-align: left;
  min-width: 0;
  border: 1px solid #e8d6cd;
  border-radius: 14px;
  background: linear-gradient(145deg, #fffdf8, #fdf8f1);
  box-shadow: 0 3px 8px #6952450c, 0 9px 22px #6952450a;
  transition: border-color .2s, box-shadow .2s;
}

.month-node:nth-child(even) .month-card {
  grid-column: 2;
  justify-self: start;
}

.month-card:hover {
  border-color: #bd8b93;
  box-shadow: 0 4px 12px #69524516, 0 9px 22px #69524514;
}

.month-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  gap: 10px;
  padding: 0 2px 11px;
}

.month-meta time {
  color: #694653;
  font: 700 clamp(1.1rem, 2.1vw, 1.28rem)/1.22 Georgia, serif;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: .04em;
}

.month-meta span {
  color: var(--muted);
  font-size: .85rem;
  white-space: nowrap;
}

.month-stack {
  position: relative;
  display: grid;
  width: calc(100% - 27px);
  margin: 1px 0 14px 3px;
  isolation: isolate;
}

.month-print {
  position: relative;
  grid-area: 1 / 1;
  z-index: calc(5 - var(--photo-index, 0));
  display: block;
  min-width: 0;
  padding: 5px 5px 8px;
  border: 1px solid #ded4c8;
  border-radius: 3px;
  background: #fffefa;
  box-shadow: 0 2px 6px #4a302e2c;
  transition: transform .24s ease;
}

.month-print:nth-child(2) { --offset: 6px; --drop: 3px; --tilt: -3deg }
.month-print:nth-child(3) { --offset: 11px; --drop: 6px; --tilt: 2deg }
.month-print:nth-child(4) { --offset: 16px; --drop: 9px; --tilt: -4deg }
.month-print:nth-child(5) { --offset: 22px; --drop: 12px; --tilt: 5deg }

.month-print:nth-child(n+2) {
  transform: translate(var(--offset), var(--drop)) rotate(var(--tilt));
}

.month-card:hover .month-stack:not([data-count="1"]) .month-print:first-child {
  transform: translate(-2px, -2px) rotate(-1deg);
}

.month-print img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.62;
  object-fit: cover;
  object-position: center 35%;
  border-radius: 1px;
}

.month-stack[data-count="1"] {
  width: 100%;
  margin: 0;
}

.month-stack[data-count="1"] img {
  object-fit: contain;
  background: radial-gradient(ellipse at 50% 35%, #faf2e9, #eee3d7);
}

.month-cover-caption {
  display: block;
  margin-top: 9px;
  padding-inline: 2px;
  color: #68574d;
  font-size: .86rem;
  line-height: 1.55;
}

.month-node.month-node-future {
  grid-column: 1 / -1;
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 19px auto 0;
}

.month-node-future .month-branch { display: none }

.month-card.month-card-future {
  width: auto;
  padding: 11px 23px;
  border-style: dashed;
  border-color: #d0b5a4;
  background: #fcf2ec;
  box-shadow: none;
}

.month-card-future .month-meta { gap: 12px; padding: 0 }
.month-card-future .month-meta span {
  font-family: var(--serif);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: .07em;
  color: #784c5d;
}

@media (max-width: 650px) {
  .months-list {
    --branch-width: clamp(28px, 8vw, 43px);
    --branch-rise: 24px;
    --branch-top: 27px;
    --trunk-offset: 10px;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px 0;
    margin-top: 18px;
    padding-inline-start: var(--trunk-offset);
  }

  .months-list::before { left: var(--trunk-offset); width: 5px }

  .month-node,
  .month-node:nth-child(even) {
    grid-column: 1;
    grid-template-columns: var(--branch-width) minmax(0, 1fr);
    margin-top: 0;
  }

  .month-node .month-branch { grid-column: 1; transform: scaleX(-1) }
  .month-branch::before { width: 9px; height: 6px; top: -5px }

  .month-node .month-card {
    grid-column: 2;
    justify-self: start;
    width: min(100%, 445px);
    padding: 11px 13px 13px;
  }

  .month-meta { padding-bottom: 8px }
  .month-meta span { font-size: .82rem }
  .month-stack { width: calc(100% - 25px) }

  .month-node.month-node-future {
    margin: 1px 0 0;
    display: grid;
    width: 100%;
  }

  .month-node-future .month-branch { display: block; margin-top: 8px }
  .month-node-future .month-branch::after { display: none }
  .month-node .month-card-future { width: auto; padding: 9px 12px }
}

@media (prefers-reduced-motion: reduce) {
  .month-card, .month-print { transition: none }
}
