.journey {
  --thread: #914254;
  --gold: #b9925e;
  position: relative;
  overflow: hidden;
  padding: clamp(3.8rem, 7vw, 7rem) 0 clamp(4rem, 6vw, 6rem);
  border-block-start: 1px solid var(--rule);
  background: radial-gradient(ellipse at 12% 18%, #ddbd9121, transparent 42%),
    radial-gradient(ellipse at 91% 68%, #e8c3b32b, transparent 45%), #f8f1e5 url('assets/paper-grain.png');
}

.journey-heading {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-inline: 1rem;
}

.journey-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  margin: 0 0 .7rem;
  color: var(--wine);
  font: 600 .8rem/1.4 var(--sans);
  letter-spacing: .2em;
  text-transform: uppercase;
}

.journey-kicker::before, .journey-kicker::after {
  content: '';
  width: 2rem;
  height: 1px;
  background: var(--gold);
}

.journey-heading h2 {
  margin: 0;
  color: var(--deep);
  font: 400 clamp(3.3rem, 6.4vw, 6.3rem)/1.04 var(--serif);
  letter-spacing: -.047em;
}

.journey-heading em {
  color: var(--thread);
  font-weight: 400;
}

.journey-album {
  position: relative;
  isolation: isolate;
  width: min(86%, 65rem);
  margin: 1.25rem auto 0;
}

.journey-thread {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.journey-thread path {
  fill: none;
  stroke-linecap: round;
}

.thread-guide {
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-dasharray: 2 5;
}

.thread-ink {
  stroke: var(--thread);
  stroke-width: 2;
  stroke-dasharray: 1;
}

.thread-needle {
  display: none;
}

.journey-moving .thread-needle {
  display: block;
}

.thread-needle circle:first-child {
  fill: #f7ebd5;
  stroke: var(--thread);
  stroke-width: 1.5;
}

.thread-needle circle:last-child {
  fill: var(--thread);
}

.journey-chapters {
  display: grid;
  gap: clamp(5rem, 8vw, 7.5rem);
  margin: 0;
  padding: clamp(3.5rem, 5.5vw, 5rem) 0 0;
  list-style: none;
}

.journey-chapter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  column-gap: 19%;
  --tilt: -2.5deg;
}

.journey-chapter:nth-child(even) {
  --tilt: 2.25deg;
}

.journey-chapter:nth-child(even) .journey-photo {
  grid-area: 1 / 2;
}

.journey-chapter:nth-child(even) .journey-words {
  grid-area: 1 / 1;
  justify-self: end;
}

.journey-photo {
  position: relative;
  width: 100%;
  max-width: 25rem;
  margin: 0;
  justify-self: end;
}

.journey-chapter:nth-child(even) .journey-photo {
  justify-self: start;
}

.journey-print {
  position: relative;
  margin: 0;
  padding: clamp(.45rem, .75vw, .72rem);
  padding-bottom: 0;
  border: 1px solid #cabcaa;
  background: #fffcf4 url('assets/paper-grain.png');
  box-shadow: 1px 2px 3px #573c262a, 3px 10px 19px -7px #573c263d;
  transform: rotate(var(--tilt));
}

.journey-print::before, .journey-print::after {
  position: absolute;
  z-index: 1;
  content: '';
  width: clamp(1.25rem, 2.4vw, 2rem);
  aspect-ratio: 1;
  background: linear-gradient(135deg, #b69560, #e3ca95 43%, #a78654 46%, #d8be8e 68%, #a18053);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.journey-print::before { left: -2px; top: -2px; }
.journey-print::after { right: -2px; bottom: -2px; transform: rotate(180deg); }

.journey-print img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.45;
  object-fit: cover;
  background: #dac5a9;
}

.journey-print figcaption {
  padding: .45rem .4rem .3rem;
  text-align: center;
  color: var(--deep);
  font: 400 clamp(1.65rem, 2.6vw, 2.25rem)/1.2 var(--script);
}

.journey-pin {
  position: absolute;
  z-index: 1;
  right: -.62rem;
  top: 50%;
  width: 1.25rem;
  aspect-ratio: 1;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fdf4e5;
  border: 1px solid #aa845a;
  box-shadow: 0 1px 2px #4b30272b;
}

.journey-pin::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--gold);
  transition: background .35s;
}

.journey-chapter:nth-child(even) .journey-pin {
  right: auto;
  left: -.62rem;
}

.journey-reached .journey-pin::after {
  background: var(--thread);
}

.journey-words {
  max-width: 22.5rem;
}

.journey-words h3 {
  margin: 0 0 .66rem;
  color: var(--deep);
  font: 400 clamp(2.4rem, 3.8vw, 3.7rem)/.99 var(--serif);
  letter-spacing: -.036em;
  text-wrap: balance;
}

.journey-words p {
  margin: 0;
  color: #594b43;
  font: 400 clamp(1rem, 1.22vw, 1.125rem)/1.68 var(--sans);
  text-wrap: pretty;
}

@media screen and (prefers-reduced-motion: no-preference) {
  .journey-moving .journey-print, .journey-moving .journey-words {
    transition: transform .72s var(--ease), opacity .6s ease-out;
  }

  .journey-moving .journey-waiting .journey-print {
    opacity: 0;
    transform: translateY(1.5rem) rotate(0);
  }

  .journey-moving .journey-waiting .journey-words {
    opacity: 0;
    transform: translateY(1.1rem);
  }
}

@media (max-width: 650px) {
  .journey-album { width: min(90%, 26rem); }
  .journey-chapters { gap: 5.2rem; padding-top: 3.1rem; }
  .journey-chapter {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.55rem;
    padding-inline: 1.15rem 2rem;
  }
  .journey-chapter:nth-child(even) {
    align-items: flex-end;
    padding-inline: 2rem 1.15rem;
  }
  .journey-photo { max-width: 20.5rem; }
  .journey-chapter .journey-pin { left: -.62rem; right: auto; }
  .journey-chapter:nth-child(even) .journey-pin { right: -.62rem; left: auto; }
  .journey-words { width: 100%; max-width: 20.5rem; }
  .journey-words h3 { font-size: clamp(2.2rem, 8vw, 2.8rem); }
  .journey-words p { line-height: 1.55; }
}

@media print {
  .journey { overflow: visible; }
  .journey-chapter { break-inside: avoid; }
  .journey .journey-print, .journey .journey-words { opacity: 1; transform: none; }
  .journey .thread-ink { stroke-dasharray: none; }
  .journey .thread-needle { display: none; }
}
