/* ==========================================================================
   Closing call to action: a loose fan of five prints.
   They spring out from a single stack when scrolled into view and can be
   dragged (they ease back into place). Sizes scale with the screen; on
   phones the prints overlap more so all five still fit.
   Driven by js/cta-photos.js.
   ========================================================================== */

.ct-section {
  --gap: .727;                 /* spacing between prints, in print widths */
  --span: 3.908;               /* 4 * gap + 1: width of the whole fan     */
  --s: min(220px, (100vw - 40px) / var(--span));
  --ct-ease: cubic-bezier(.22, 1.18, .36, 1);
  position: relative;
  overflow: hidden;
  background: #f3f3f4;
  padding: 120px 0 110px;
  text-align: center;
}

/* faint drafting grid that fades out toward the edges */
.ct-section::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 34%;
  height: 420px;
  background-image:
    linear-gradient(to right, rgba(93, 97, 103, .5) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(93, 97, 103, .5) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .16;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 55%, transparent 100%);
  pointer-events: none;
}

/* ---- text ------------------------------------------------------------- */
.ct-head { position: relative; max-width: 640px; margin: 0 auto; }
.ct-eyebrow {
  display: block;
  margin-bottom: 18px;
  font-family: 'Work Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: #5d6167;
}
.ct-head h2 {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.08;
  letter-spacing: -.03em;
  color: #161617;
}
.ct-head p { max-width: 44ch; margin: 0 auto; font-size: 17px; line-height: 1.7; }

/* ---- fan of prints ---------------------------------------------------- */
.ct-fan {
  position: relative;
  width: 100%;
  height: calc(var(--s) * 1.55);
  margin: 64px 0 52px;
}
.ct-photo {
  position: absolute;
  left: 50%;
  top: 0;
  width: var(--s);
  height: calc(var(--s) * 1.25);   /* portrait prints */
  margin-left: calc(var(--s) / -2);
  z-index: var(--z);
  transform: translate(0, 0) rotate(0deg);          /* stacked, before reveal */
  transition: transform 1.3s var(--ct-ease) calc(var(--o) * .13s);
  touch-action: pan-y;                              /* page still scrolls vertically */
}
.ct-fan.is-in .ct-photo {
  transform:
    translate(calc(var(--k) * var(--gap) * var(--s)), calc(var(--yf) * var(--s)))
    rotate(var(--r));
}
.ct-photo:hover, .ct-photo.is-drag { z-index: 60; }

.ct-card {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 24px;
  overflow: hidden;
  cursor: grab;
  background: #ddd;
  box-shadow:
    0 2px 4px rgba(17, 17, 18, .06),
    0 28px 50px -22px rgba(17, 17, 18, .5);
  transition: transform .5s cubic-bezier(.34, 1.5, .64, 1), box-shadow .4s ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.ct-photo:hover .ct-card {
  transform: scale(1.08) rotate(var(--hr, 2deg));
  box-shadow: 0 2px 4px rgba(17, 17, 18, .06), 0 34px 60px -22px rgba(17, 17, 18, .55);
}
.ct-photo.is-drag .ct-card {
  cursor: grabbing;
  transition: none;
  transform: translate(var(--dx, 0), var(--dy, 0)) scale(1.12);
}
.ct-card img {
  display: block;
  width: 100%; height: 100%;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.ct-action { position: relative; display: flex; justify-content: center; }
.ct-action .default_btn { margin-top: 0; }

/* ---- phones: print fan is tighter so all five fit --------------------- */
@media (max-width: 767px) {
  .ct-section { --gap: .5; --span: 3; padding: 84px 0 76px; }
  .ct-head h2 { margin-bottom: 14px; }
  .ct-head p { font-size: 15px; padding: 0 6px; }
  .ct-fan { margin: 44px 0 40px; height: calc(var(--s) * 1.52); }
  .ct-card { border-radius: 16px; }
  .ct-section::before { top: 38%; height: 320px; background-size: 38px 38px; }
}
