/* Works (source: /motion): a horizontal strip of films. A vertical wheel moves it sideways; hovering a film plays its
   silent preview with the title over it; the title "עבודות" and the "בית" link sit at the left edge (mirrored). */
/* film size from the source at 1707px: 600 x 338 with 54px between (35.15vw / 3.16vw) */
.works { display: flex; align-items: center; --fw: clamp(320px, 35.15vw, 680px); }
/* the strip runs right to left from beside the title (as in the source); it enters 1s after .5s from 100px aside */
.strip { display: flex; align-items: center; gap: clamp(24px, 3.16vw, 60px); height: 100%; margin-inline-start: 51px; overflow-x: auto; overflow-y: hidden; padding-inline: 340px 90px; scrollbar-width: none; flex: 1; overscroll-behavior-x: contain; animation: strip-in 1s ease-in-out .5s both; }
@keyframes strip-in { from { opacity: 0; transform: translateX(-100px); } }
.strip::-webkit-scrollbar { display: none; }
.film { flex: none; position: relative; width: var(--fw); aspect-ratio: 16 / 9; background: var(--surface); overflow: hidden; cursor: pointer; }
.film img, .film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film video { z-index: 0; }
/* hover: the still fades out in 800ms over the playing preview; back in 300ms */
.film img { z-index: 1; transition: opacity .3s var(--swing); }
.film:hover img, .film:focus-visible img, .film.on img { opacity: 0; transition-duration: .8s; }
.film .t { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff; text-align: center; padding: 10px; opacity: 0; z-index: 2; transition: opacity .8s var(--swing); background: linear-gradient(rgba(21, 17, 15, .1), rgba(21, 17, 15, .45)); }
.film .t b { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 2.7vw, 46px); line-height: 1; letter-spacing: .1em; }
.film .t span { font-size: 14px; letter-spacing: .04em; }
.film:hover .t, .film:focus-visible .t, .film.on .t { opacity: 1; }
/* the big title sits at the start (right) edge; it drifts in 40px and fades in with the strip, and fades out (300ms)
   once the films slide under it */
.works .title { position: absolute; right: 51px; top: 0; bottom: 0; width: 320px; display: flex; align-items: center; justify-content: center; z-index: 4; pointer-events: none; transition: opacity .3s var(--swing); }
.works .title.faded { opacity: 0; }
.works .title h1 { animation: title-in 1s ease-in-out .5s both; }
@keyframes title-in { from { opacity: 0; transform: translateX(40px); } }
.works .title h1 { margin: 0; font-family: var(--display); font-size: clamp(46px, 4.2vw, 64px); letter-spacing: .2em; padding-inline-start: .2em; line-height: 1; }
.works .homelink { top: 50%; transform: translateY(-50%); height: calc(var(--fw) * 9 / 16 + 2px); } /* as tall as the films, like the source */
.works .foot { position: absolute; bottom: 34px; inset-inline: 90px; display: flex; justify-content: space-between; align-items: center; z-index: 5; }
.works .count { font-size: 13px; letter-spacing: .06em; color: var(--faint); }
.works .count b { color: var(--accent); font-weight: 500; }

@media (max-width: 1024px) {
  .works { display: block; padding-top: 74px; }
  .works .title { position: static; width: auto; background: none; justify-content: flex-start; padding: 0 20px 16px; }
  .works .title h1 { font-size: 46px; letter-spacing: .16em; }
  .strip { display: block; overflow: visible; padding: 0; margin: 0; height: auto; }
  .film { width: 100%; margin: 0 0 2px; }
  .film .t { opacity: 1; align-items: flex-start; justify-content: flex-end; padding: 14px 16px; background: linear-gradient(rgba(21, 17, 15, 0) 45%, rgba(21, 17, 15, .6)); text-align: right; }
  .film .t b { font-size: 28px; letter-spacing: .06em; }
  .works .foot { display: none; }
  /* a touch "hovers" and stays: the still keeps its place until site.js marks the card .on, once its preview plays
     (it used to fade on the touch and leave the card blank); no image menu, selection or tap flash on a long press */
  .film { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
  .film:hover img, .film:focus-visible img { opacity: 1; }
  .film.on img { opacity: 0; }
}

/* the end of the strip: one more card, an invitation to talk about a film (to the contact page) */
.end-card { flex: none; width: var(--fw); aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; border: 1px solid var(--ink); text-align: center; padding: 20px; transition: background-color .35s var(--swing), color .35s var(--swing); }
.end-card b { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 2.4vw, 40px); line-height: 1; letter-spacing: .1em; }
.end-card span { font-size: 14px; letter-spacing: .06em; }
.end-card:hover, .end-card:focus-visible { background: var(--ink); color: var(--ground); }
@media (max-width: 1024px) { .end-card { width: auto; margin: 14px 20px 30px; } }
