/* Journey · sketchbook story page, scoped under .page--journey */

.page--journey { background: var(--paper); }

/* ---------- Type ---------- */

.page--journey .chapter__title,
.page--journey .closing__title {
  font-weight: 300;
  font-size: var(--fs-title);
  letter-spacing: -.03em;
  line-height: 1;
}

.page--journey .closing__title { font-size: var(--fs-closing); }

.page--journey .chapter__text {
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: 1.5;
  max-width: 34ch;
}

/* ---------- Hero ---------- */

.page--journey .hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-32) var(--gutter) var(--sp-64);
  overflow-x: clip;
}

.page--journey .hero__doodles {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page--journey .hero__column {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--hero-gap);
  text-align: center;
}

.page--journey .hero__title {
  font-weight: 300;
  font-size: var(--fs-hero);
  letter-spacing: -.03em;
  line-height: .98;
  text-align: center;
  white-space: nowrap;
}

/* SplitText line masks: a little room below so descenders (j, y) are not clipped */
.page--journey .hero-line-mask {
  padding-bottom: .1em;
  margin-bottom: -.1em;
}

.page--journey .hero__support {
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--muted);
  max-width: 24ch;
}

.page--journey .hero__arrow {
  display: block;
  width: var(--s);
  height: var(--s);
  margin-top: var(--sp-8);
}

.page--journey .hero__arrow svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ---------- Badge ---------- */

.page--journey .badge {
  position: absolute;
  right: var(--gutter);
  bottom: var(--sp-64);
  width: 104px;
  height: 104px;
  z-index: 1;
}

.page--journey .badge svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: spin 14s linear infinite;
}

.page--journey .badge text {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-badge);
  text-transform: uppercase;
  letter-spacing: .2em;
  fill: var(--ink);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Story ---------- */

.page--journey .story {
  position: relative;
  padding: var(--sp-64) var(--gutter) var(--sp-128);
  overflow-x: clip;
}

.page--journey .thread {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.page--journey .thread__dot { fill: var(--ink); }

.page--journey .chapter,
.page--journey .note-row,
.page--journey .closing {
  position: relative;
  z-index: 1;
}

/* the thread svg is the first child, so spacing is keyed on rows, not on "* + *" */
.page--journey .chapter + .chapter,
.page--journey .note-row + .chapter,
.page--journey .closing { margin-top: var(--chapter-gap); }

.page--journey .note-row {
  margin-top: calc(var(--chapter-gap) + var(--note-pull));
  margin-bottom: var(--note-pull);
}

/* ---------- Chapters ---------- */

.page--journey .chapter__inner {
  display: grid;
  column-gap: var(--grid-gap);
  align-items: center;
  width: fit-content;
  max-width: 100%;
}

.page--journey .chapter--media-left .chapter__inner {
  grid-template-columns: var(--card-w) minmax(0, var(--copy-w));
  margin-left: auto;
}

.page--journey .chapter--media-right .chapter__inner {
  grid-template-columns: minmax(0, var(--copy-w)) var(--card-w);
  margin-right: auto;
}

.page--journey .chapter__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--copy-gap);
}

.page--journey .chapter__media {
  position: relative;
  margin: 0;
  width: var(--card-w);
}

/* ---------- Cards ---------- */

.page--journey .card {
  position: relative;
  rotate: var(--tilt, 0deg);
}

.page--journey .card--main {
  width: 100%;
  z-index: 1;
}

.page--journey .card--small {
  position: absolute;
  width: var(--small-w);
  z-index: 2;
}

.page--journey .card--br { right: -18%; bottom: -14%; }
.page--journey .card--tl { left: -17%; top: -7%; }
.page--journey .card--bl { left: -18%; bottom: -11%; }
.page--journey .card--tr { right: -17%; top: -8%; }

.page--journey .card__paper {
  position: relative;
  background: var(--grain) repeat, var(--card);
  border-radius: var(--r-card);
  padding: var(--card-pad);
}

.page--journey .card__photo {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--placeholder);
}

.page--journey .card--landscape .card__photo { aspect-ratio: 16 / 11; }

.page--journey .card__photo.is-loaded { background: transparent; }

.page--journey .card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
}

.page--journey .card__pin {
  position: absolute;
  left: 50%;
  top: -10px;
  z-index: 3;
  width: 22px;
  height: auto;
  translate: -50% 0;
  rotate: 6deg;
  filter: drop-shadow(-3px 3px 3px rgba(0, 0, 0, .6));
}

.page--journey .card__shadow {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
  filter: blur(5px);
  opacity: .3;
  translate: -6px 6px;
}

.page--journey .card--deep > .card__shadow {
  filter: blur(6px);
  opacity: .5;
  translate: -10px 10px;
}

/* ---------- Notes ---------- */

.page--journey .card--note {
  width: var(--note-w);
  margin-left: calc(var(--nx) - var(--note-w) / 2);
}

.page--journey .card--note .card__paper { padding: var(--note-pad); }

.page--journey .note__text {
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: var(--fs-note);
  line-height: 1.15;
  text-align: center;
  color: var(--ink);
}

/* ---------- Doodles ---------- */

.page--journey .doodle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  translate: -50% -50%;
  rotate: var(--r, 0deg);
  z-index: 0;
  pointer-events: none;
}

.page--journey .doodle--over { z-index: 4; }

.page--journey .doodle svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ---------- Closing ---------- */

.page--journey .closing { text-align: center; }

.page--journey .closing__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--copy-gap);
  width: fit-content;
  margin-inline: auto;
}

.page--journey .button {
  display: inline-block;
  margin-top: var(--sp-12);
  padding: 12px 32px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-button);
  line-height: 1.5;
  text-decoration: none;
  box-shadow: none;
}

.page--journey .button:focus-visible {
  outline: 2px solid var(--mark);
  outline-offset: 3px;
}

/* ---------- Footer ---------- */

.page--journey .footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--sp-64) var(--gutter);
}

/* ---------- Phones ---------- */

@media (max-width: 760px) {
  .page--journey .doodle { display: none; }

  .page--journey .chapter--media-left .chapter__inner,
  .page--journey .chapter--media-right .chapter__inner {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--sp-48);
    width: 100%;
    margin-inline: 0;
  }

  .page--journey .chapter__media {
    order: -1;
    width: min(70vw, 320px);
    margin-inline: auto;
  }

  .page--journey .card--note { margin-inline: auto; }
}

/* ---------- Motion pre-hide (html.motion is set by the inline head script) ---------- */

.motion .page--journey [data-intro],
.motion .page--journey .hero__title,
.motion .page--journey .card--main,
.motion .page--journey .card--small,
.motion .page--journey .chapter__copy > *,
.motion .page--journey .closing__copy > *,
.motion .page--journey .card--note { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .page--journey .badge svg { animation: none; }
}
