/* hero-collage — layered torn-paper collage in the hero (partials/hero-collage.html).
   Base rules are the resting layout (also what no-JS and reduced motion get);
   the staged entrance lives under .js and is released by hero-collage.js (.is-in). */

.fx-hero-collage{--fx-hero-collage-slide:cubic-bezier(.25,.55,.3,1)}
/* the mask boxes overlap each other: only the torn shapes themselves take the pointer */
.fx-hero-collage .px{pointer-events:none}

/* ---------- layer anatomy ---------- */
.fx-hero-collage-d,.fx-hero-collage-pop{display:block;width:100%;height:100%}
.fx-hero-collage-m{position:absolute;inset:0;overflow:hidden;transform:rotate(var(--fx-hero-collage-r))}
/* the slide sits 6% inside its mask so the shadow and the tilt never get cut */
.fx-hero-collage-s{position:absolute;inset:6%;filter:drop-shadow(0 8px 10px rgba(30,33,31,.22))}
.fx-hero-collage-art{position:absolute;inset:0;background:var(--chalk);pointer-events:auto}
.fx-hero-collage-ph{position:absolute;inset:0}
.fx-hero-collage-ph>*,.fx-hero-collage-poster svg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.fx-hero-collage-ph img{transform:scale(var(--fx-hero-collage-zoom,1));transition:transform 1.1s var(--out)}

/* ---------- pieces: box, resting tilt (r), entrance pre-tilt (k), wipe origin (x,y), cue (t) ---------- */
.fx-hero-collage-paper{left:18%;top:-3%;width:90%;height:98%;
  --fx-hero-collage-r:5deg;--fx-hero-collage-k:-6deg;--fx-hero-collage-x:112%;--fx-hero-collage-y:0;--fx-hero-collage-t:0s}
.fx-hero-collage-paper .fx-hero-collage-art{clip-path:url(#fx-hero-collage-paper1)}
.fx-hero-collage-paper .fx-hero-collage-s{filter:none}

.fx-hero-collage-verm{left:74%;top:2%;width:26%;height:24%;
  --fx-hero-collage-r:-8deg;--fx-hero-collage-k:24deg;--fx-hero-collage-x:0;--fx-hero-collage-y:-112%;--fx-hero-collage-t:.64s}
.fx-hero-collage-verm .fx-hero-collage-art{background:var(--verm);clip-path:url(#fx-hero-collage-verm1)}
.fx-hero-collage-verm .fx-hero-collage-s{filter:drop-shadow(0 3px 4px rgba(30,33,31,.2))}

.fx-hero-collage-a{left:-3%;top:-5%;width:78%;height:70%;
  --fx-hero-collage-r:-3deg;--fx-hero-collage-k:7deg;--fx-hero-collage-x:0;--fx-hero-collage-y:-112%;--fx-hero-collage-t:.12s}
.fx-hero-collage-a .fx-hero-collage-art{clip-path:url(#fx-hero-collage-a1)}
.fx-hero-collage-a .fx-hero-collage-ph{clip-path:url(#fx-hero-collage-a2)}
.fx-hero-collage-a img{object-position:50% 18%}

.fx-hero-collage-poster{left:-14%;top:50%;width:122%;height:36%;
  --fx-hero-collage-r:-5deg;--fx-hero-collage-k:-6deg;--fx-hero-collage-x:-112%;--fx-hero-collage-y:0;--fx-hero-collage-t:.3s}
.fx-hero-collage-poster .fx-hero-collage-art{clip-path:url(#fx-hero-collage-poster1)}

.fx-hero-collage-b{left:46%;top:13%;width:60%;height:50%;
  --fx-hero-collage-r:5deg;--fx-hero-collage-k:9deg;--fx-hero-collage-x:112%;--fx-hero-collage-y:0;--fx-hero-collage-t:.46s}
.fx-hero-collage-b .fx-hero-collage-art{clip-path:url(#fx-hero-collage-b1)}
.fx-hero-collage-b .fx-hero-collage-ph{clip-path:url(#fx-hero-collage-b2)}
.fx-hero-collage-b img{object-position:50% 40%}

.fx-hero-collage-c{left:3%;top:71%;width:40%;height:35%;
  --fx-hero-collage-r:-6deg;--fx-hero-collage-k:-10deg;--fx-hero-collage-x:0;--fx-hero-collage-y:112%;--fx-hero-collage-t:.6s}
.fx-hero-collage-c .fx-hero-collage-art{clip-path:url(#fx-hero-collage-c1)}
.fx-hero-collage-c .fx-hero-collage-ph{clip-path:url(#fx-hero-collage-c2)}
/* cropped in on the laugh and the flying hair; black and white next to the ink letters */
.fx-hero-collage-c img{--fx-hero-collage-zoom:2.2;transform-origin:38% 32%;filter:grayscale(1) contrast(1.08)}

/* ---------- satellites (tag and badge keep the core's .piece-tag/.piece-badge placement) ---------- */
.fx-hero-collage .piece-tag{right:-5%;bottom:1%;--fx-hero-collage-t:.86s}
.fx-hero-collage .piece-badge{--fx-hero-collage-t:1s}
.fx-hero-collage-sp{position:absolute;display:block}
.fx-hero-collage-sp .sparkle{width:100%;height:100%}
.fx-hero-collage-sp1{left:66%;top:-5%;width:30px;height:30px;--fx-hero-collage-t:1.14s}
.fx-hero-collage-sp2{left:57%;bottom:-2%;width:16px;height:16px;color:var(--stone);--fx-hero-collage-t:1.26s}
.fx-hero-collage-sp2 .sparkle{color:inherit;animation-delay:-1.6s}

/* ---------- entrance: every piece waits off its mask, tilted too far, until .is-in ---------- */
.js .fx-hero-collage-m{transform:rotate(calc(var(--fx-hero-collage-r) + var(--fx-hero-collage-k)))}
.js .fx-hero-collage-s{transform:translate3d(var(--fx-hero-collage-x),var(--fx-hero-collage-y),0)}
.js .fx-hero-collage-pop{opacity:0;transform:scale(.5) rotate(-20deg)}
/* the slide lands first; the tilt springs past its rest angle and settles around it */
.js .fx-hero-collage.is-in .fx-hero-collage-s{transform:none;transition:transform .85s var(--fx-hero-collage-slide) var(--fx-hero-collage-t)}
.js .fx-hero-collage.is-in .fx-hero-collage-m{transform:rotate(var(--fx-hero-collage-r));transition:transform 1.25s var(--spring) var(--fx-hero-collage-t)}
.js .fx-hero-collage.is-in .fx-hero-collage-pop{opacity:1;transform:none;
  transition:transform .9s var(--spring) var(--fx-hero-collage-t),opacity .25s linear var(--fx-hero-collage-t)}
/* inside its paper each photo starts pushed in and eases back as the piece lands (hover zoom takes over afterwards) */
.js .fx-hero-collage.is-in .fx-hero-collage-ph img{animation:fx-hero-collage-push 1.7s var(--out) var(--fx-hero-collage-t) backwards}
@keyframes fx-hero-collage-push{from{transform:scale(calc(var(--fx-hero-collage-zoom,1)*1.22))}}

/* ---------- phones: the collage is ~78vw wide, so the tag shrinks to stay a footnote ---------- */
@media (max-width:820px){
  .fx-hero-collage .piece-tag{right:-9%;bottom:-4%}
  .fx-hero-collage .tag{padding:10px 13px;border-radius:12px}
  .fx-hero-collage .tag strong{font-size:.86rem}
  .fx-hero-collage-s{filter:drop-shadow(0 3px 5px rgba(30,33,31,.22))}
  .fx-hero-collage-sp1{width:20px;height:20px}
}

/* ---------- fine pointers: the photo under the cursor leans in a little ---------- */
@media (hover:hover) and (pointer:fine){
  .fx-hero-collage-art:hover img{transform:scale(calc(var(--fx-hero-collage-zoom,1)*1.06))}
}
/* integrator: the torn poster already spells ORV; the core's ghost letters behind it read as a double */
.hero:has(.fx-hero-collage) .hero-letters{display:none}
/* fixer: hero-collage.js moves every [data-depth] layer per pointer frame; promoted, the torn pieces
   (drop-shadow + clip-path over full photos) stop repainting on every move. Desktop only, about 11 layers. */
@media (hover:hover) and (pointer:fine){ .js .fx-hero-collage [data-depth]{will-change:transform} }
