/* ==========================================================================
   Act 4: Dual Cinema Filmstrip embedded at the end of the letter
   ========================================================================== */

.film-section {
  margin: 34px calc(-1 * clamp(24px, 7vw, 46px)) 0;
  padding: 6px 0 4px;
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.film-section.is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.film-section.is-hidden {
  display: none;
}

.film-divider {
  width: 56px;
  height: 1px;
  margin: 0 auto 24px;
  background: linear-gradient(
    90deg,
    rgba(176, 152, 122, 0) 0%,
    rgba(176, 152, 122, 0.5) 50%,
    rgba(176, 152, 122, 0) 100%
  );
}

.film-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
  overflow: hidden;
  /* Soft left/right edge blend into the letter paper */
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 7%,
    #000 93%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 7%,
    #000 93%,
    transparent 100%
  );
}

.film-row {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #27221E 0%, #1F1B18 50%, #26211D 100%);
  padding: 15px 0;
  box-shadow:
    0 8px 18px -6px rgba(42, 32, 22, 0.32),
    inset 0 1px 0 rgba(255, 244, 226, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45);
}

/* Continuous 35mm cinema sprocket perforations top & bottom */
.film-row::before,
.film-row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 7px;
  z-index: 2;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(246, 239, 228, 0.82) 0px,
    rgba(246, 239, 228, 0.82) 8px,
    transparent 8px,
    transparent 18px
  );
  opacity: 0.72;
}

.film-row::before {
  top: 4px;
}

.film-row::after {
  bottom: 4px;
}

.film-track {
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
}

.film-frame {
  flex: 0 0 auto;
  width: clamp(112px, 31vw, 148px);
  aspect-ratio: 4 / 3;
  margin-right: 10px;
  border-radius: 2px;
  overflow: hidden;
  background: #302A25;
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 230, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.35);
  position: relative;
}

.film-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  display: block;
  filter: contrast(1.02) saturate(0.96);
  pointer-events: none;
}

/* Subtle warm film sheen over frames */
.film-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 244, 224, 0.06) 0%,
    rgba(0, 0, 0, 0) 45%,
    rgba(20, 14, 10, 0.1) 100%
  );
  pointer-events: none;
}
