/* Humble's persistent folder labels, expressed in the existing Villavy palette. */
.joining-content {
  max-width: 1424px;
  margin-inline: auto;
  padding: 164px var(--gutter) 0;
}
.joining-opening {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
  padding-bottom: 64px;
}
.joining-opening h1 {
  font-size: clamp(56px, 6.6vw, 92px);
  line-height: 1.01;
  text-wrap: initial;
}
.joining-intro {
  padding: 0;
}
.joining-intro > p {
  font-size: 20px;
  line-height: 1.5;
  color: var(--olive);
}

@media (min-width: 961px) {
  .joining-opening h1 br {
    display: none;
  }
}
.joining-intro br {
  display: none;
}
.joining-faq {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  align-items: start;
  gap: 10%;
  padding: 100px 0 84px;
  scroll-margin-top: 112px;
}
.joining-faq h2 {
  max-width: 11ch;
  font-size: clamp(38px, 4.6vw, 66px);
  line-height: 1.05;
}
@media (max-width: 760px) {
  .joining-faq {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 72px 0 52px;
  }
  .joining-faq h2 {
    max-width: 14ch;
    font-size: 40px;
  }
}

.joining-stack {
  list-style: none;
  padding: 0;
  margin: 0;
  isolation: isolate;
}
.joining-chapter {
  --paper: var(--sand);
  position: relative;
  margin: 0 0 96px;
  scroll-margin-top: 104px;
}
.chapter-you {
  --paper: #ece8dc;
}
.chapter-group {
  --paper: #e1e5d8;
}
.joining-chapter:last-child {
  margin-bottom: 0;
}
.chapter-tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: calc(100% / 3 - 12px);
  height: 48px;
  padding: 8px 24px;
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  font-size: 15px;
}
.chapter-you .chapter-tab {
  margin-left: calc(100% / 3);
}
.chapter-group .chapter-tab {
  margin-left: calc(200% / 3);
}
.chapter-surface {
  display: grid;
  grid-template-columns: 1fr 1.85fr;
  gap: 36px;
  padding: 28px;
  background: var(--paper);
  border-radius: 0 24px 24px 24px;
  min-height: 430px;
  height: clamp(430px, 58svh, 560px);
  box-shadow: 0 14px 28px -22px rgb(32 44 37 / 35%);
}
.chapter-you .chapter-surface,
.chapter-group .chapter-surface {
  border-top-left-radius: 24px;
}
.chapter-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 6px 18px 14px;
  min-width: 0;
}
.chapter-tab h2 {
  margin: 0;
  font: inherit;
  letter-spacing: normal;
}
.chapter-copy p {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.45;
  margin: 0;
  max-width: 28ch;
  color: var(--olive);
}

.chapter-photo {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-radius: 18px;
}
.chapter-house img {
  object-position: 50% 47%;
}
.chapter-you img {
  object-position: 48% 55%;
}
.chapter-group img {
  object-position: 50% 78%;
}
/* Offset statements make the handover from Villavy to guests readable. */
.joining-roles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12%;
  max-width: 1100px;
  margin: 96px auto 0;
  padding: 0 24px 30px;
}
.joining-role-you {
  position: relative;
  padding-top: 176px;
}
.role-arrow {
  position: absolute;
  top: -6px;
  left: -182px;
  width: 260px;
  height: 180px;
  color: var(--lemon);
  pointer-events: none;
  overflow: visible;
}
.role-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.role-arrow .arrow-tip {
  stroke-width: 3.6;
}
.role-arrow-narrow {
  display: none;
}
.joining-role p {
  max-width: 35ch;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.45;
  color: var(--olive);
  margin: 0;
}
.joining-next {
  position: relative;
  text-align: center;
  margin: 0 auto;
  padding: 168px 0 130px;
}
.joining-next .role-arrow {
  top: -4px;
  left: calc(50% - 103px);
  width: 300px;
  height: 160px;
}
.joining-next h2 {
  font-size: clamp(42px, 5.1vw, 70px);
  line-height: 1.05;
}

.joining-next .primary-action {
  margin-top: 36px;
}
@media (min-width: 961px) and (min-height: 740px) and (prefers-reduced-motion: no-preference) {
  /* Give the last chapter time to dock before the whole stack leaves. */
  .joining-stack.stack-ready {
    display: flex;
    flex-direction: column;
    gap: 96px;
  }
  .joining-stack.stack-ready::after {
    content: "";
    display: block;
    flex: none;
    height: clamp(180px, 28svh, 300px);
  }
  .joining-stack.stack-ready .joining-chapter {
    position: sticky;
    top: 96px;
    margin: 0;
    flex: none;
  }
}
@media (max-width: 1100px) {
  .role-arrow {
    width: 210px;
    height: 154px;
    left: -138px;
    top: 2px;
  }
  .joining-opening {
    gap: 40px;
  }
  .chapter-surface {
    gap: 22px;
    padding: 22px;
    grid-template-columns: 1fr 1.6fr;
  }
  .chapter-copy {
    padding: 20px 4px 14px;
  }
}
@media (max-width: 960px) {
  .joining-content {
    padding-top: 138px;
  }
  .joining-opening {
    gap: 32px;
    padding-bottom: 64px;
  }
  .joining-opening h1 {
    font-size: clamp(50px, 7.4vw, 72px);
  }
  .joining-intro > p {
    font-size: 17px;
  }

  .joining-chapter {
    margin-bottom: 56px;
  }
  .chapter-surface {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 28px;
  }
  .chapter-copy {
    padding: 8px 4px 0;
  }
  .chapter-copy p {
    max-width: 46ch;
    margin: 0;
  }

  .chapter-photo {
    height: 390px;
  }
  .chapter-tab {
    width: 200px;
    padding-inline: 22px;
  }
  .chapter-you .chapter-tab {
    margin-left: calc((100% - 200px) / 2);
  }
  .chapter-group .chapter-tab {
    margin-left: calc(100% - 200px);
  }
  .chapter-group .chapter-surface {
    border-top-right-radius: 0;
  }
  .joining-next {
    padding: 164px 0 94px;
  }
}
@media (max-width: 760px) {
  .joining-roles {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 76px;
    padding: 0 0 12px;
  }
  .joining-role-you {
    padding-top: 112px;
    padding-left: 10%;
  }
  .role-arrow {
    width: 156px;
    height: 108px;
    left: -16px;
    top: -3px;
  }
  .joining-next {
    padding-top: 148px;
  }
  .joining-next .role-arrow {
    top: 8px;
    left: calc(50% - 74px);
    width: 216px;
    height: 115px;
  }
  .role-arrow-wide {
    display: none;
  }
  .role-arrow-narrow {
    display: block;
  }
  .role-arrow path {
    stroke-width: 4.5;
  }
  .joining-role p {
    font-size: 22px;
    margin: 0;
    max-width: 36ch;
  }
}
@media (max-width: 600px) {
  .joining-content {
    padding-top: 126px;
  }
  .joining-opening {
    gap: 26px;
    padding-bottom: 48px;
  }
  .joining-opening h1 {
    font-size: clamp(48px, 11.5vw, 68px);
  }
  .joining-intro {
    padding: 0;
  }
  .joining-intro > p {
    font-size: 16px;
    max-width: 29ch;
  }
  .joining-intro > p br {
    display: none;
  }

  .chapter-tab {
    height: 44px;
    width: 160px;
    font-size: 13px;
    padding-inline: 18px;
    border-radius: 14px 14px 0 0;
  }
  .chapter-you .chapter-tab {
    margin-left: calc((100% - 160px) / 2);
  }
  .chapter-group .chapter-tab {
    margin-left: calc(100% - 160px);
  }
  .chapter-surface {
    padding: 18px;
    gap: 24px;
    border-radius: 0 20px 20px 20px;
  }
  .chapter-you .chapter-surface,
  .chapter-group .chapter-surface {
    border-top-left-radius: 20px;
  }
  .chapter-copy {
    padding: 10px 4px 0;
  }
  .chapter-copy p {
    font-size: 21px;
    line-height: 1.45;
    margin: 0;
  }
  .chapter-photo {
    height: 280px;
    border-radius: 13px;
  }
  .joining-chapter {
    margin-bottom: 40px;
  }
}

.joining-next h2 {
  text-wrap: balance;
}
@media (max-width: 760px) {
  /* Narrow arrow: tip sits above the start of the guest sentence. */
  .joining-role-you .role-arrow {
    left: 12px;
  }
}
@media (max-width: 760px) {
  .joining-next h2 br {
    display: none;
  }
}
@media (min-width: 761px) and (max-width: 960px) {
  /* Two columns are too tight for the wide arrow; use the downward one above the guest sentence. */
  .joining-role-you {
    padding-top: 124px;
  }
  .joining-role-you .role-arrow {
    top: 0;
    left: 8px;
    width: 156px;
    height: 108px;
  }
  .joining-role-you .role-arrow-wide {
    display: none;
  }
  .joining-role-you .role-arrow-narrow {
    display: block;
  }
  .joining-role-you .role-arrow path {
    stroke-width: 4.5;
  }
}
