/* =========================================================
   Section · film strip — the gallery photos rolling past on a
   tilted strip of film between the hero and the ticker.
   Frames are built by js/ui/film-strip.js; without scripts the
   strip isn't shown (the gallery below still has every photo).
   ========================================================= */

/* ---------- Film strip ---------- */
.film {
  --fh: clamp(118px, 12.5vw, 176px);   /* frame height */
  --rail: 32px;                        /* sprocket edge above and below the frames */
  display: none;
  position: relative; z-index: 1;
  margin-top: clamp(-64px, -4.5vw, -28px);   /* tucks into the hero's bottom padding */
  padding: clamp(30px, 3vw, 40px) 0 clamp(26px, 2.6vw, 36px);
  overflow-x: clip;                    /* the tilted band is wider than the page */
}
.js .film { display: block; }
.film[hidden] { display: none; }

.film__band { position: relative; margin-inline: -48px; rotate: -1.6deg; }
.film__view {
  overflow: hidden;
  background: var(--night);
  box-shadow: 0 30px 60px -30px rgba(13, 14, 53, .55);
}
.film__track { display: flex; width: max-content; animation: marquee 60s linear infinite reverse paused; }
.film.is-rolling .film__track { animation-play-state: running; }
.film.is-rolling .film__view:hover .film__track,
.film.is-rolling .film__view:focus-within .film__track { animation-play-state: paused; }

/* one copy of the photos, with its own sprocket holes so the two copies tile without a seam */
.film__set {
  display: flex; gap: 10px;
  margin: 0; padding: var(--rail) 5px; list-style: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='9'%3E%3Crect x='6' width='12' height='9' rx='2.5' fill='%23F3F4F8' fill-opacity='.82'/%3E%3C/svg%3E") left top 8px / 24px 9px repeat-x,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='9'%3E%3Crect x='6' width='12' height='9' rx='2.5' fill='%23F3F4F8' fill-opacity='.82'/%3E%3C/svg%3E") left bottom 8px / 24px 9px repeat-x;
}
.film__frame { position: relative; flex: none; }
.film__btn {
  display: block; height: var(--fh); padding: 0;
  border: 0; border-radius: 4px; overflow: hidden;
  background: var(--ink-deep); cursor: zoom-in;
}
.film__btn img, .film__btn video {   /* tall phone shots are cropped to 3:4 on the strip; the viewer shows them whole */
  display: block; width: auto; height: 100%; min-width: calc(var(--fh) * .75);
  object-fit: cover;
  transition: transform .7s var(--mech), filter .35s;
}
.film__set:hover .film__btn:not(:hover) :is(img, video) { filter: grayscale(.7) brightness(.6); }
.film__btn:hover :is(img, video) { transform: scale(1.06); }
.film__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* frame number + title, printed along the film's edge */
.film__no {
  position: absolute; top: calc(100% + 5px); left: 2px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 500 9.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255, 205, 143, .62);
  pointer-events: none;
}
.film__frame:hover .film__no, .film__frame:focus-within .film__no {
  z-index: 1; max-width: none; padding-right: 8px;
  background: var(--night); color: var(--accent);
}

/* labels stuck onto the tape */
.film__head {
  position: absolute; left: 50%; bottom: 100%; z-index: 2;
  translate: -50% 50%;
  width: min(1200px, 100% - 96px - 2 * clamp(16px, 4vw, 40px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  pointer-events: none;
}
.film__rec, .film__more {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 14px; border-radius: 999px;
  font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 10px 24px -12px rgba(13, 14, 53, .5);
  pointer-events: auto;
}
.film__rec { background: var(--surface); border: 1px solid var(--edge); color: var(--ink); }
.film__rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1.2s steps(1) infinite; }
.film__more {
  background: var(--ink); border: 1px solid var(--ink); color: var(--accent-light); text-decoration: none;
  transition: background-color .2s, color .2s, transform .35s var(--servo);
}
.film__more:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
.film__more:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 640px) {
  .film { --rail: 28px; }
  .film__band { rotate: -2.4deg; }
  .film__rec, .film__more { padding: 7px 11px; font-size: 10px; }
}
@media (max-width: 400px) {
  .film__more { display: none; }
}

/* reduced motion: the strip stands still and scrolls sideways instead */
@media (prefers-reduced-motion: reduce) {
  .film__track { animation: none; }
  .film__view { overflow-x: auto; scrollbar-width: thin; }
}
