/* Scroll coordinates are signed viewport distances, not animation timers.
   All photographic layers sample the same original sheet at the same position. */
#pieces .cc-confection{display:none}
@media screen and (prefers-reduced-motion:no-preference){
 html.cc-motion-ready:not([data-cc-motion="off"]) #collection .section-heading{perspective:840px;--cc-heading:0}
 html.cc-motion-ready:not([data-cc-motion="off"]) #collection .section-heading h2{
   transform-origin:0 70%;transform:translate3d(0,calc(var(--cc-heading)*28px),calc(var(--cc-heading)*-55px)) rotateX(calc(var(--cc-heading)*-9deg))
 }
 html.cc-motion-ready:not([data-cc-motion="off"]) #collection .section-heading .book-label{
   transform-origin:left;transform:translate3d(calc(var(--cc-heading)*17px),calc(var(--cc-heading)*-11px),5px)
 }
 html.cc-motion-ready:not([data-cc-motion="off"]) #collection .section-intro{
   transform:translate3d(0,calc(var(--cc-heading)*14px),0)
 }
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces{position:relative}
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces .piece{
   --cc-sign:1;--cc-entry:0;--cc-travel:0;--cc-bank:1;--cc-rise:50px;--cc-float:15px;
   --cc-angle:8deg;--cc-turn:6deg;--cc-shift:6px;
   --cc-cut:polygon(11.5% 46%,15% 38%,22% 31%,28% 28%,37.5% 25%,40.5% 20%,43% 26%,48% 24%,54% 22%,61% 25%,68% 24%,75% 29%,81% 38%,83.5% 49%,82% 59%,78.5% 66%,73% 72%,66% 76.5%,54% 79%,41% 79%,30% 76.5%,21% 72%,15% 65%,12% 56%);
   perspective:880px;perspective-origin:50% 48%
 }
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces .piece:nth-child(2){
   --cc-sign:-1;--cc-bank:-1;
   --cc-cut:polygon(7% 70%,9% 66%,13% 62%,26% 57%,37% 51%,49% 43%,58% 37%,67% 31%,75% 23%,83% 18%,88.5% 16%,92.5% 18.5%,93% 23.5%,90% 29.5%,84% 36.5%,77% 44%,68% 50%,54% 60%,43% 65.5%,28% 72%,15% 76.5%,9% 76%,7% 74%);
 }
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces .piece:nth-child(3){
   --cc-cut:polygon(23% 43%,25% 36%,31% 30%,38% 26%,44% 21%,49% 20%,58% 22%,66% 23%,72% 29%,75% 36%,77% 44%,77.5% 53%,75% 62%,70% 68%,63% 73%,54% 76%,44% 75%,35% 72%,29% 68%,25% 60%,23% 54%);
 }
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces .piece-picture{
   transform-origin:50% 78%;
   transform:translate3d(0,calc(var(--cc-entry)*var(--cc-rise)),calc(var(--cc-entry)*-42px)) rotateX(calc(var(--cc-entry)*var(--cc-angle))) rotateY(calc(var(--cc-entry)*var(--cc-turn)*var(--cc-bank)));
   /* Only the print's frame opens. The image itself is never tinted or faded. */
   clip-path:inset(calc(var(--cc-entry)*8%) calc(var(--cc-entry)*2.5%) 0)
 }
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces .piece-picture:before,
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces .cc-confection{
   transform-origin:50% 51%;transition:none;
   transform:translate3d(0,calc(-50% + var(--cc-travel)*var(--cc-float)),0) scale(calc(1.075 + var(--cc-entry)*.055))
 }
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces .cc-confection{
   display:block;position:absolute;top:50%;left:0;width:100%;aspect-ratio:1;pointer-events:none;
   background:url('./assets/collection.webp') var(--pic-x) 50% / 300% 100%;
   clip-path:var(--cc-cut);
   transform:translate3d(calc(var(--cc-sign)*var(--cc-travel)*var(--cc-shift)),calc(-50% + var(--cc-travel)*(var(--cc-float) - 7px)),0) scale(calc(1.084 + var(--cc-entry)*.055))
 }
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces .piece-code{
   transform:perspective(580px) translate3d(calc(var(--cc-entry)*6px),calc(var(--cc-entry)*8px + var(--cc-travel)*4px),calc(var(--cc-entry)*17px))
 }
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces .piece-details{
   transform-origin:0 45%;transform:translate3d(calc(var(--cc-entry)*var(--cc-sign)*12px),calc(var(--cc-entry)*-16px + var(--cc-travel)*5px),calc(var(--cc-entry)*18px))
 }
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces .piece-note{transform:translateY(calc(var(--cc-entry)*13px))}
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces .piece:focus-visible{
   --cc-entry:0!important;--cc-travel:0!important
 }
}
/* Let each photograph occupy its own space on a phone. These are ordinary
   document rows, never a pinned carousel, and the entire row remains the button. */
@media screen and (max-width:620px){
 #collection .pieces{gap:clamp(26px,7vw,38px)}
 #collection .piece{display:flex;flex-flow:column;gap:0;align-items:stretch;padding:0 0 15px;border-top:0;border-bottom:1px solid #d8c6ae}
 #collection .piece-picture{aspect-ratio:1.72}
 #collection .piece-details{padding:12px 1px 0}
 #collection .piece-code{top:10px;left:11px;font-size:9px;padding:5px 7px}
 #collection .piece-line{gap:12px}
 #collection .piece-name{font-size:clamp(30px,8.9vw,39px)}
 #collection .piece-note{margin-top:4px}
 #collection .piece-arrow{width:29px;height:29px}
}
@media screen and (max-width:799px) and (prefers-reduced-motion:no-preference){
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces .piece{--cc-rise:29px;--cc-angle:10deg;--cc-turn:5deg;--cc-shift:3px;--cc-float:9px}
 html.cc-motion-ready:not([data-cc-motion="off"]) #pieces .piece-details{transform:translate3d(calc(var(--cc-entry)*var(--cc-sign)*5px),calc(var(--cc-entry)*9px + var(--cc-travel)*4px),0)}
}
@media screen and (min-width: 800px) and (min-height: 560px) and (prefers-reduced-motion: no-preference) {
  html.cc-motion-ready #pieces {
    display:flex; flex-direction:column; gap:clamp(18px,3vh,34px);
    position:relative; isolation:isolate;
  }
  html.cc-motion-ready #pieces .piece {
    --pin:clamp(14px,3.5vh,36px); --layer:0;
    width:100%; flex:none; height:clamp(280px,43vh,435px);
    position:sticky; top:calc(var(--pin) + var(--layer) * 28px);
    z-index:calc(1 + var(--layer)); transform-origin:50% 0;
    transform:scale(var(--cc-depth,1)); display:grid; align-content:stretch;
    align-items:stretch; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);
    border-block:1px solid currentColor; padding:0;
    border-radius:0; background:var(--paper);
  }
  html.cc-motion-ready #pieces .piece:nth-child(2){--layer:1}
  html.cc-motion-ready #pieces .piece:nth-child(3){--layer:2}
  html.cc-motion-ready #pieces .piece-picture {
    height:100%; width:100%; aspect-ratio:auto; border-radius:0; grid-area:1/1;
  }
  html.cc-motion-ready #pieces .piece-details {
    grid-area:1/2; align-self:center; padding:18px clamp(24px,5vw,86px);
  }
  html.cc-motion-ready #pieces .piece:nth-child(2) .piece-picture{grid-area:1/2}
  html.cc-motion-ready #pieces .piece:nth-child(2) .piece-details{grid-area:1/1}
  html.cc-motion-ready #pieces .piece-name {font-size:clamp(38px,4.5vw,76px)}
  html.cc-motion-ready #pieces .piece-note {max-width:32ch; margin-top:12px}
  html.cc-motion-ready #pieces .piece-arrow {height:38px;width:38px}
  html.cc-motion-ready #pieces .piece-code {top:9px}
  html.cc-motion-ready #pieces .piece:focus-visible {z-index:5}
  html.cc-motion-ready[data-cc-motion="off"] #pieces .piece {position:relative;top:0;transform:none}
}
@media print {
  [data-cc-reveal]{opacity:1!important;transform:none!important;clip-path:none!important;animation:none!important}
}
