/* fx-touch: print tilt and gloss, pen underlines, band headlines rising from a torn edge, button magnet and ink press (fx-touch.js) */

/* ---------- album prints ---------- */
/* perspective() lives in the print's own transform so the vanishing point sits on the photo, not the middle of the wrap with its bio below */
.tch .print{transform:perspective(900px) rotate(var(--r,0deg)) rotateX(calc(var(--tch-rx,0) * 1deg)) rotateY(calc(var(--tch-ry,0) * 1deg));
  filter:drop-shadow(calc(var(--tch-ry,0) * -1.3px) calc(16px + var(--tch-rx,0) * 1.1px) 22px rgba(0,0,0,.5));
  transition:translate .35s var(--spring),scale .35s var(--spring)}
.tch .print .pp{position:relative}
.tch-sheen{position:absolute;inset:14px 14px 40px;pointer-events:none;opacity:var(--tch-on,0);mix-blend-mode:screen;
  background:radial-gradient(circle at calc(var(--tch-mx,50) * 1%) calc(var(--tch-my,50) * 1%),rgba(255,248,230,.42),rgba(255,248,230,0) 50%),
    linear-gradient(calc(100deg + var(--tch-ry,0) * 3deg),rgba(255,255,255,0) 30%,rgba(255,250,236,.16) calc(42% + var(--tch-mx,50) * .16%),rgba(255,255,255,0) 64%)}
.tch .print.tch-lift,.tch .print-wrap:focus-within .print{translate:0 -8px;scale:1.02;filter:drop-shadow(0 28px 30px rgba(0,0,0,.55))}

/* the pen stroke under each name replaces the thin link underline once the script is here */
.tch-ul{position:relative}
.tch-ul.li-link{text-decoration-color:transparent}
.tch-pen{position:absolute;left:-3px;top:100%;margin-top:-.34em;overflow:visible;pointer-events:none;color:var(--gold)}
.tch-pen path{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1}
.tch-pen .p1{stroke-width:2.3;transition:stroke-dashoffset .8s cubic-bezier(.5,0,.2,1) .15s}
.tch-pen .p2{stroke-width:1.2;opacity:.7;transition:stroke-dashoffset .55s cubic-bezier(.4,0,.2,1) .9s}
.tch-drawn .tch-pen path{stroke-dashoffset:0}
.li-link.tch-ul:hover .tch-pen,.li-link.tch-ul:focus-visible .tch-pen{color:var(--gold-3)}

/* ---------- band headlines ---------- */
.tch-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;-webkit-user-select:none;user-select:none}
/* each word sits in a slot clipped at its foot; a torn strip of paper lies along that foot and the word climbs out from behind it.
   --k comes from the band (app.js); words start one after another between --k .38 and .58 and each takes .12 to rise */
.tch-w{display:inline-block;position:relative;padding-bottom:.22em;margin-bottom:-.22em;clip-path:inset(-1em -.6em 0 -.6em);
  --wp:clamp(0,calc((var(--k,1) - .38 - var(--i,0)) / .12),1)}
.tch-w>span{display:inline-block;transform:translateY(calc((1 - var(--wp)) * 135%)) rotate(calc((1 - var(--wp)) * 5deg));transform-origin:0 100%}
.tch-w::after{content:"";position:absolute;left:-.04em;right:-.3em;bottom:0;height:.2em;background:#F4EADB;
  -webkit-mask:var(--tch-tear) 0 0/2.2em 100% repeat-x;mask:var(--tch-tear) 0 0/2.2em 100% repeat-x;
  transform:scaleY(calc(1 - var(--wp)));transform-origin:50% 100%;opacity:calc(.92 - var(--wp) * .4)}

/* ---------- buttons ---------- */
.tch-rel{position:relative}
.tch-ink{position:absolute;inset:0;overflow:hidden;border-radius:inherit;pointer-events:none}
.tch-ink i{position:absolute;display:block;background:radial-gradient(closest-side,currentColor 62%,rgba(0,0,0,0) 100%);
  border-radius:47% 53% 44% 56%/55% 46% 54% 45%;opacity:0;transform:translate(-50%,-50%) scale(.04)}

@media (prefers-reduced-motion:reduce){
  .tch .print{transform:rotate(var(--r,0deg));transition:none}
  .tch-pen path{transition:none;stroke-dashoffset:0}
  .tch-w>span{transform:none}
  .tch-w::after{display:none}
}
