/* film — "A day in it": three photo prints (close crops) and three captions.
   Base rules = the plain fallback (no JS / reduced motion): a staggered row of prints.
   Under html.js the section is a fixed 250vh with a sticky 100vh stage, the prints
   stack into one deck and js/fx/film.js flings them away one by one. */

.fx-film{position:relative;margin-top:clamp(70px,10vw,150px)}
.fx-film-pin{display:flex;flex-direction:column;gap:clamp(26px,4vw,56px)}
.fx-film .sec-head h2{white-space:nowrap}

.fx-film-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(14px,2vw,30px)}
.fx-film-item{display:flex;flex-direction:column;gap:16px}
.fx-film-item:nth-child(even){margin-top:clamp(14px,3vw,44px)}

/* a print: photo on top of the drawn fallback, inside a chalk border */
.fx-film-card-in{position:relative;aspect-ratio:4/5;overflow:hidden;border:5px solid var(--chalk);border-radius:var(--r-img);background:var(--line);box-shadow:0 24px 38px -26px rgba(30,33,31,.55)}
.fx-film-card-in svg,.fx-film-card-in img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.fx-film-card-in img{transform:scale(var(--fx-film-z,1));transform-origin:var(--fx-film-o,50% 50%)}
.fx-film-shade{position:absolute;inset:0;background:var(--ink);opacity:0}

.fx-film-time{display:flex;align-items:center;gap:.8em}
.fx-film-time::before{content:"";width:1.6em;height:2px;background:var(--verm)}
.fx-film-line{margin-top:.55em;font-family:var(--display);font-stretch:118%;font-weight:620;letter-spacing:-.025em;line-height:1.06;font-size:clamp(1.05rem,1.45vw,1.5rem);text-wrap:balance}
.fx-film-note{margin-top:1em;color:var(--stone-ink)}

/* counter and progress only make sense while the deck is being driven */
.fx-film-count,.fx-film-bar{display:none}

@media (max-width:820px){
  .fx-film-list{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:30px}
  .fx-film-item:first-child{grid-column:1/-1}
  .fx-film-item:nth-child(even){margin-top:0}
}

/* =====================================================================
   MOTION LAYER (html.js) — fixed height, sticky stage, one deck
   ===================================================================== */
.js .fx-film{height:250vh}
.js .fx-film-pin{position:sticky;top:0;height:100vh;height:100svh;overflow:hidden;gap:0;padding-block:clamp(18px,3.4vh,40px)}
.js .fx-film-stage{--fx-film-w:min(28vw,52vh);flex:1;min-height:0;padding-bottom:clamp(14px,2.6vh,30px);display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;column-gap:clamp(28px,5vw,90px)}
.js .fx-film-list,.js .fx-film-item{display:contents}

/* deck: every print shares one grid cell; film.js sets transform/opacity per print */
.js .fx-film-card{grid-area:1/2;position:relative;width:var(--fx-film-w);will-change:transform;transition:transform .9s var(--spring),opacity .5s ease}
.js .fx-film-card.is-gone{transition:transform .72s cubic-bezier(.6,-.3,.74,.05)}           /* pull back, then fling */
.js .fx-film-stage:not(.is-dealt) .fx-film-card{transition:none}                              /* before the deal: jump, so arriving from below shows no stray flings */
.js .fx-film-stage.is-rev .fx-film-card{transition-timing-function:var(--out)}              /* scrolling back: land softly */
.js .fx-film-item:nth-child(1) .fx-film-card{z-index:5}
.js .fx-film-item:nth-child(2) .fx-film-card{z-index:4}
.js .fx-film-item:nth-child(3) .fx-film-card{z-index:3}
.js .fx-film-card-in{transition:transform .3s ease-out}                                      /* smooths the scroll-driven lean */
.js .fx-film-shade{transition:opacity .7s ease}

/* captions: one cell, each slides through its own mask (up when passed, from below when next) */
.js .fx-film-cap{grid-area:1/3;overflow:hidden;max-width:25em}
.js .fx-film-cap-in{transform:translate3d(0,106%,0);opacity:0;transition:transform .5s cubic-bezier(.6,0,.85,.25),opacity .3s ease}
.js .fx-film-item.is-past .fx-film-cap-in{transform:translate3d(0,-106%,0)}
.js .fx-film-item.is-on .fx-film-cap-in{transform:none;opacity:1;transition:transform .85s var(--out) .24s,opacity .5s ease .24s}
.js .fx-film-line{font-size:clamp(1.2rem,2.35vw,2.5rem)}
.js .fx-film-note{opacity:0;transition:opacity .3s ease}
.js .fx-film-item.is-on .fx-film-note{opacity:1;transition:opacity .6s ease .7s}

/* counter: a fixed 0 and a rolling column 1–5 */
.js .fx-film-count{grid-area:1/1;align-self:end;display:flex;align-items:flex-end;gap:.9em;color:var(--stone-ink)}
.fx-film-count .label{padding-bottom:.9em;white-space:nowrap}
.fx-film-num{display:flex;color:var(--ink);font-family:var(--display);font-stretch:125%;font-weight:700;letter-spacing:-.04em;font-variant-numeric:tabular-nums;line-height:.86;font-size:clamp(4.2rem,15vw,15rem)}
.fx-film-roll{display:block;height:.86em;overflow:hidden}
.fx-film-roll-in{display:block;transition:transform .85s var(--spring) .12s}
.fx-film-roll-in i{display:block;height:.86em;font-style:normal}

/* progress: hairline track, vermilion fill, five times of day */
.js .fx-film-bar{display:block}
.fx-film-track{display:block;position:relative;height:1px;background:var(--line)}
.fx-film-track i{position:absolute;inset:-1px 0 0;height:2px;background:var(--verm);transform:scaleX(0);transform-origin:left}
.fx-film-ticks{display:flex;justify-content:space-between;padding-top:12px;color:var(--ink)}
.fx-film-ticks span{opacity:.62;transition:opacity .4s ease}
.fx-film-ticks .is-on{opacity:1}

@media (max-width:1200px){
  /* the side column is narrower than "Moment 0N / 05" in one row: stack the label over the number */
  .js .fx-film-count{flex-direction:column;align-items:flex-start;gap:6px}
  .js .fx-film-count .label{padding:0}
  .js .fx-film-count .label:last-child{display:none}
}
@media (max-width:820px){
  /* phone: deck on top (about 62vw), counter and caption share the row below */
  .js .fx-film-stage{--fx-film-w:min(62vw,40vh);grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto;align-content:center;column-gap:16px;row-gap:clamp(18px,3.4vh,30px)}
  .js .fx-film-card{grid-area:1/1/2/3;justify-self:center;margin-top:calc(var(--fx-film-w)*.2)}
  .js .fx-film-count{grid-area:2/1;align-self:start}
  .js .fx-film-cap{grid-area:2/2;align-self:start}
}
/* integrator: on phones the fixed scroll-ui pill sits over the pinned header; start the stage below it */
@media (max-width:820px){ .js .fx-film-pin{padding-top:max(64px,calc(env(safe-area-inset-top) + 58px))} }
