@charset "utf-8";
/* CSS Document */

/* ---------- Slide-in section (scroll-pinned) ---------- */

/* Tall wrapper: its extra height is the scrolling the section stays pinned for.
   Don't put overflow:hidden on this or any parent, or the pinning (sticky) stops working. */
.sit-track {
  --sit-h: 700px;            /* section height */
  position: relative;
  height: calc(var(--sit-h) + var(--sit-delay, 50vh) + var(--sit-slide, 100vh) + var(--sit-hold, 70vh));
}

.sit-section {
  --sit-p: 0;                /* image progress, set by the script (0 = off-screen, 1 = met) */
  --sit-t: 0;                /* text opacity, set by the script */
  box-sizing: border-box;
  width: 100%;
  height: var(--sit-h);
  position: sticky;          /* pins while the track scrolls past */
  top: max(0px, calc((100vh - var(--sit-h)) / 2));   /* pinned in the middle of the screen */
  display: flex;
  justify-content: center;   /* images meet in the middle */
  align-items: center;
  overflow: hidden;          /* hides the images while they're off to the sides */
  background: #fff;
}

.sit-img {
  width: 50%;                /* each image fills half the section */
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: var(--sit-p);
  will-change: transform, opacity;
}

/* Each image starts one full width outside its half and travels in with the scroll */
.sit-img-left  { transform: translateX(calc((var(--sit-p) - 1) * 100%)); }
.sit-img-right { transform: translateX(calc((1 - var(--sit-p)) * 100%)); }

/* Centred text, fades in once the images have met */
.sit-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: 90%;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 5rem);
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);  /* keeps it readable over any photo */
  opacity: var(--sit-t);
}

/* Reduced motion: no pinning, everything just shows */
@media (prefers-reduced-motion: reduce) {
  .sit-track   { height: auto; }
  .sit-section { position: relative; top: auto; }
}

/* Tablet */
@media (max-width: 1024px) {
  .sit-track { --sit-h: 500px; }
}

/* Phone */
@media (max-width: 600px) {
  .sit-track { --sit-h: 320px; }
}
