html,
body {
  margin: 0;
  padding: 0;
}

/* ================= ACTIVITIES ================= */

.activities-section {
  padding: clamp(72px, 9vw, 120px) 0 clamp(40px, 6vw, 80px);
  background: #f2f5f1;
  overflow: hidden;
}

.activities-head {
  max-width: 640px;
  margin: 0 auto clamp(64px, 8vw, 110px);
  text-align: center;
}

.section-title {
  margin-bottom: 16px;
  color: var(--river);
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-underline {
  display: block;
  width: 72px;
  height: 5px;
  margin: 0 auto 22px;
  border-radius: 6px 2px 6px 2px;
  background: linear-gradient(90deg, var(--bamboo), var(--lodge-green));
}

.section-intro {
  margin: 0 auto;
  color: #56636e;
  font-size: 1.05rem;
  line-height: 1.75;
}

/* One activity: text on one side, photos on the other.
   Every second one swaps sides. */
.activity {
  --gap: clamp(64px, 7vw, 110px);
  position: relative;
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--gap);
  align-items: center;
  margin-bottom: clamp(88px, 11vw, 150px);
}

.activity.is-reversed {
  grid-template-columns: 7fr 5fr;
}

.activity.is-reversed .activity-text {
  order: 2;
}

.activity-text {
  position: relative;
}

.activity-text > * {
  max-width: 440px;
}

/* Activity number: a leaf-shaped stop on the river.
   It sits in the gap between the text and the photos,
   and lights up green when the river reaches it. */
.activity-number {
  position: absolute;
  top: 0;
  right: calc(var(--gap) / -2 - 28px);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  max-width: none;
  border: 2px solid var(--bamboo);
  border-radius: 20px 6px 20px 6px;
  background: #f2f5f1;
  color: var(--river);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition:
    background-color 0.5s ease,
    border-color 0.5s ease,
    color 0.5s ease,
    box-shadow 0.5s ease,
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.activity.is-reversed .activity-number {
  right: auto;
  left: calc(var(--gap) / -2 - 28px);
}

.activity-number.is-reached {
  border-color: transparent;
  background: linear-gradient(135deg, #2fa36b 0%, #1f7a4f 50%, #145637 100%);
  box-shadow:
    0 0 0 7px rgba(47, 163, 107, 0.14),
    0 12px 26px -8px rgba(20, 86, 55, 0.7);
  color: #fff;
  transform: scale(1.06);
}

.activity:hover .activity-number {
  border-radius: 6px 20px 6px 20px;
}

/* ----- the river ----- */

.activities-section {
  position: relative;
}

.activities-section > *:not(.river-route) {
  position: relative;
  z-index: 1;
}

.river-route {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.river-bed {
  fill: none;
  stroke: rgba(98, 150, 120, 0.16);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.river-water {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(47, 163, 107, 0.45));
}

/* the faint current flowing along the water */
.river-current {
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 1 18;
  animation: riverFlow 2.4s linear infinite;
}

@keyframes riverFlow {
  to {
    stroke-dashoffset: -38;
  }
}

.activity-title {
  position: relative;
  margin-bottom: 16px;
  padding-bottom: 16px;
  color: var(--river);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.activity-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background: var(--lodge-green);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.activity:hover .activity-title::after {
  width: 96px;
}

.activity-text p {
  margin: 0;
  color: #56636e;
  font-size: 1.02rem;
  line-height: 1.8;
}

/* ----- photos ----- */

.activity-img {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 40px 10px 40px 10px;
  background: var(--river);
  box-shadow: 0 34px 64px -34px rgba(8, 24, 38, 0.6);
  transition: border-radius 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.activity-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 1.3s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 1s ease;
}

.activity-img:hover {
  border-radius: 10px 40px 10px 40px;
}

.activity-img:hover img {
  transform: scale(1.06);
}

/* one photo, with a gold frame set off behind it */
.activity-media-single {
  position: relative;
  padding: 0 0 26px 26px;
}

.activity-media-single::before {
  content: "";
  position: absolute;
  top: 26px;
  right: 26px;
  bottom: 0;
  left: 0;
  border: 2px solid var(--bamboo);
  border-radius: 40px 10px 40px 10px;
}

.activity.is-reversed .activity-media-single {
  padding: 0 26px 26px 0;
}

.activity.is-reversed .activity-media-single::before {
  right: 0;
  left: 26px;
}

.activity-media-single .activity-img {
  aspect-ratio: 4 / 3;
}

/* two photos side by side, the second one set lower */
.activity-media-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.activity-media-pair .activity-img {
  aspect-ratio: 3 / 4;
}

.activity-media-pair .activity-img:nth-child(2) {
  margin-top: 56px;
  border-radius: 10px 40px 10px 40px;
}

.activity-media-pair .activity-img:nth-child(2):hover {
  border-radius: 40px 10px 40px 10px;
}

/* one wide photo with two below */
.activity-media-trio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.activity-media-trio .activity-img:first-child {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 8;
}

.activity-media-trio .activity-img:not(:first-child) {
  aspect-ratio: 1 / 1;
}

/* photos settle in from a slight zoom as they scroll into view
   (only when JavaScript is running, so nothing stays hidden without it) */
.js-reveal .activity-img img {
  opacity: 0;
  transform: scale(1.18);
}

.js-reveal .activity-img.is-visible img {
  opacity: 1;
  transform: scale(1);
}

.js-reveal .activity-img.is-visible:hover img {
  transform: scale(1.06);
}

/* ----- full-width photo bands ----- */

.activity-band {
  position: relative;
  height: clamp(300px, 42vw, 560px);
  margin: 0 0 clamp(88px, 11vw, 150px);
  overflow: hidden;
}

/* the photo is a little taller than the band so it can drift
   slowly as the page scrolls (see js/pages/gallery.js) */
.activity-band img {
  position: absolute;
  top: -12%;
  left: 0;
  display: block;
  width: 100%;
  height: 124%;
  object-fit: cover;
  will-change: transform;
}

.activity-band::before,
.activity-band::after {
  z-index: 1;
}

/* fade the band softly into the page above and below */
.activity-band::before,
.activity-band::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 22%;
  pointer-events: none;
}

.activity-band::before {
  top: 0;
  background: linear-gradient(to bottom, #f2f5f1, rgba(242, 245, 241, 0));
}

.activity-band::after {
  bottom: 0;
  background: linear-gradient(to top, #f2f5f1, rgba(242, 245, 241, 0));
}

/* ----- tablets and phones ----- */

@media (max-width: 991px) {
  .activity,
  .activity.is-reversed {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .activity.is-reversed .activity-text {
    order: 0;
  }

  /* on narrow screens the river runs down the left edge */
  .activity,
  .activity.is-reversed {
    padding-left: 60px;
  }

  .activity-text {
    position: static;
  }

  .activity-text > * {
    max-width: 560px;
  }

  .activity-number,
  .activity.is-reversed .activity-number {
    top: 0;
    left: 0;
    right: auto;
    width: 42px;
    height: 42px;
    border-radius: 15px 5px 15px 5px;
    font-size: 0.82rem;
  }

  .activity-media-pair .activity-img:nth-child(2) {
    margin-top: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .activity-number,
  .river-current,
  .activity-title::after,
  .activity-img,
  .activity-img img {
    transition: none;
    animation: none;
  }

  .js-reveal .activity-img img {
    opacity: 1;
    transform: none;
  }
}

/* ================= SCROLL-IN TRANSITIONS =================
   As each activity scrolls into view: the river stop pops in,
   the title and text glide in from the river's side one after
   the other, the line under the title draws itself, and the
   photos settle in one after another. Only when JavaScript runs
   (body.js-reveal), so nothing stays hidden without it. */

.activity-number {
  scale: 1;
  opacity: 1;
}

.activity-title,
.activity-text p {
  transition:
    opacity 0.8s ease,
    translate 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.activity-number {
  transition:
    background-color 0.5s ease,
    border-color 0.5s ease,
    color 0.5s ease,
    box-shadow 0.5s ease,
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    scale 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.4s ease;
}

.activity.is-visible .activity-title {
  transition-delay: 0.12s;
}

.activity.is-visible .activity-text p {
  transition-delay: 0.26s;
}

.activity.is-visible .activity-title::after {
  transition-delay: 0.45s;
}

/* text comes from the side the river is on */
.activity {
  --from: 32px;
}

.activity.is-reversed {
  --from: -32px;
}

.js-reveal .activity:not(.is-visible) .activity-number {
  scale: 0.4;
  opacity: 0;
}

.js-reveal .activity:not(.is-visible) .activity-title,
.js-reveal .activity:not(.is-visible) .activity-text p {
  opacity: 0;
  translate: var(--from) 0;
}

.js-reveal .activity:not(.is-visible) .activity-title::after {
  width: 0;
}

/* photos in a pair or trio settle in one after another */
.activity-media .activity-img:nth-child(2) img {
  transition-delay: 0.15s;
}

.activity-media .activity-img:nth-child(3) img {
  transition-delay: 0.3s;
}

.activity-img:hover img {
  transition-delay: 0s;
}

@media (max-width: 991px) {
  .activity,
  .activity.is-reversed {
    --from: 0px;
  }

  .js-reveal .activity:not(.is-visible) .activity-title,
  .js-reveal .activity:not(.is-visible) .activity-text p {
    translate: 0 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal .activity:not(.is-visible) .activity-number,
  .js-reveal .activity:not(.is-visible) .activity-title,
  .js-reveal .activity:not(.is-visible) .activity-text p {
    scale: 1;
    opacity: 1;
    translate: none;
  }

  .js-reveal .activity:not(.is-visible) .activity-title::after {
    width: 40px;
  }
}

/* ================= DAY INTO NIGHT =================
   The first activities sit on the light mist. After Swimming Pool a
   tall "dusk" stretch blends slowly through sand and gold into the
   river blue, and the evening activities (Campfire onwards) sit on
   that blue, flowing into the dark footer.
   The dusk and night backgrounds are painted below the river line,
   so the river keeps flowing through them. */

.activities-section {
  padding-bottom: 0;
}

/* these two are not positioned on purpose: their colour must sit
   underneath the river, while their contents sit above it */
.activities-section > .activity-dusk,
.activities-section > .activity-night {
  position: static;
  z-index: auto;
}

.activity-night > * {
  position: relative;
  z-index: 1;
}

.activity-dusk {
  height: clamp(380px, 48vw, 680px);
  margin-top: calc(clamp(88px, 11vw, 150px) * -0.6);
  background: linear-gradient(
    to bottom,
    #f2f5f1 0%,
    #f2f4ef 4.2%,
    #f1f1ea 8.3%,
    #f0ede5 12.5%,
    #efebe1 16.7%,
    #eee9de 20.8%,
    #ebe3d2 25%,
    #e8dcc5 29.2%,
    #e6d8bd 33.3%,
    #e3d3b6 37.5%,
    #dcc6a3 41.7%,
    #d5ba92 45.8%,
    #d1b58c 50%,
    #bda27c 54.2%,
    #aa906c 58.3%,
    #a08967 62.5%,
    #82735b 66.7%,
    #6e6553 70.8%,
    #5f5b50 75%,
    #43494a 79.2%,
    #394347 83.3%,
    #283741 87.5%,
    #1a2d3c 91.7%,
    #132837 95.8%,
    #0c2232 100%
  );
}

.activity-night {
  margin-top: -2px; /* overlaps the dusk so no hairline shows between them */
  padding-top: clamp(40px, 6vw, 90px);
  padding-bottom: clamp(40px, 6vw, 80px);
  background: var(--river);
  color: var(--mist);
}

/* photo bands fade into the colour around them */
.activity-band.is-night {
  background: var(--river);
}

.activity-band.is-night::before {
  background: linear-gradient(to bottom, var(--river), rgba(12, 34, 50, 0));
}

.activity-band.is-night::after {
  background: linear-gradient(to top, var(--river), rgba(12, 34, 50, 0));
}

/* night colours */
.activity-night .activity-title {
  color: #fff;
}

.activity-night .activity-title::after {
  background: var(--bamboo);
}

.activity-night .activity-text p {
  color: var(--mist-muted);
}

.activity-night .activity-number {
  background: var(--river);
  color: var(--mist);
}

.activity-night .activity-img {
  box-shadow:
    0 34px 70px -30px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.activity-night .activity-media-single::before {
  border-color: rgba(200, 164, 100, 0.7);
}

.activity-night .activity-number.is-reached {
  border-color: transparent;
  background: linear-gradient(135deg, #2fa36b 0%, #1f7a4f 50%, #145637 100%);
  color: #fff;
}

/* ================= CHAPTER TITLES =================
   "Day Activities" and "Night Activities": a leaf-shaped label centred
   on the page, with the river flowing behind it like a sign on the bank. */

.activities-head {
  margin-bottom: clamp(48px, 6vw, 72px);
}

.chapter-title {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto clamp(72px, 9vw, 120px);
  padding: 12px 30px 12px 14px;
  border: 1px solid rgba(200, 164, 100, 0.65);
  border-radius: 26px 8px 26px 8px;
  background: #f2f5f1;
  box-shadow: 0 20px 44px -26px rgba(8, 24, 38, 0.45);
  transition:
    opacity 0.8s ease,
    translate 1s cubic-bezier(0.22, 1, 0.36, 1),
    scale 1s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.chapter-title:hover {
  border-radius: 8px 26px 8px 26px;
}

.chapter-title h2 {
  margin: 0;
  color: var(--river);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.chapter-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 16px 5px 16px 5px;
  background: linear-gradient(135deg, #e3cb94 0%, #c8a464 55%, #a8854a 100%);
  color: #fff;
  font-size: 1.3rem;
}

.chapter-title.is-night {
  border-color: rgba(200, 164, 100, 0.55);
  background: var(--river);
  box-shadow:
    0 20px 44px -22px rgba(0, 0, 0, 0.8),
    0 0 40px -10px rgba(200, 164, 100, 0.25);
}

.chapter-title.is-night h2 {
  color: #fff;
}

.chapter-title.is-night .chapter-icon {
  background: rgba(200, 164, 100, 0.14);
  box-shadow: inset 0 0 0 1px rgba(200, 164, 100, 0.5);
  color: var(--bamboo-light);
}

.js-reveal .chapter-title:not(.is-visible) {
  opacity: 0;
  translate: 0 24px;
  scale: 0.96;
}

@media (max-width: 991px) {
  /* on narrow screens the label sits on the river at the left */
  .chapter-title {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal .chapter-title:not(.is-visible) {
    opacity: 1;
    translate: none;
    scale: 1;
  }
}

/* ================= END OF THE RIVER =================
   A gold divider between the last activity and the footer.
   The river ends at the small leaf in its centre. */

.activity-night {
  padding-bottom: 0;
}

.river-end {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1320px;
  height: 1px;
  margin: clamp(40px, 5vw, 64px) auto 0;
  padding: 0 24px;
  border-bottom: 24px solid transparent; /* room so the leaf isn't cut off */
  box-sizing: content-box;
  background: linear-gradient(
    90deg,
    rgba(200, 164, 100, 0),
    rgba(200, 164, 100, 0.55) 20%,
    rgba(200, 164, 100, 0.55) 80%,
    rgba(200, 164, 100, 0)
  );
  background-clip: content-box;
}

.river-end-leaf {
  width: 16px;
  height: 16px;
  border-radius: 8px 2px 8px 2px;
  background: linear-gradient(135deg, #e3cb94, #c8a464 60%, #a8854a);
  box-shadow:
    0 0 0 6px var(--river),
    0 0 18px rgba(200, 164, 100, 0.5);
  transform: rotate(45deg);
}
