/* Service plaques assembled from separate parts.
   Each service has its own stone from the user (assets/svc-stones/<service>-{stone,eng,peb}.webp,
   one shared canvas per service so the layers align): clean stone, carved swoosh + leaf, and its pebbles.
   Leaf bed / grass cushion, the tool and corner tufts come from assets/svc-parts and assets/svc.
   Every part starts from the stone's base, one after another, like a drawn cartoon; then the groove is
   drawn along its length, the leaf pops at its end and the words are written into the stone.
   Per-plaque inputs: --ar (stone canvas height / width) and data-stone. */

@property --groove{syntax:'<percentage>';inherits:false;initial-value:100%}

.plaque.kit{--ar:.45;--lx:68%;position:relative;display:block;width:100%;aspect-ratio:500/520;padding:0;background:none;filter:none;
  container-type:inline-size;transform-origin:50% 96%;
  /* stone box: 98cqw wide, sitting 3cqw above the plaque bottom */
  --st-b:3cqw;--st-h:calc(98cqw * var(--ar));--st-top:calc(var(--st-b) + var(--st-h))}
.plaque.kit>*{position:absolute;display:block}
.plaque.kit img{height:auto;filter:none;transition:none}

/* stone group: stone + carving + words (+ pebbles in the same box, outside the group so they can drop) */
.plaque.kit>span.k-stone,.kit .k-peb{left:1%;right:auto;width:98%;bottom:var(--st-b);top:auto;aspect-ratio:1/var(--ar);transform:none;font-size:inherit;text-shadow:none}
.plaque.kit>span.k-stone{z-index:3;filter:drop-shadow(0 2.2cqw 1.8cqw #0007);transform-origin:50% 100%;clip-path:none!important;animation-name:none}
.kit .k-stone>img{position:absolute;inset:0;width:100%;height:100%}
.kit .k-peb{z-index:5;filter:drop-shadow(0 .8cqw .6cqw #0006)}

/* carved groove (left part of the carving layer) and its leaf (right part) */
.kit .k-eng{-webkit-mask:linear-gradient(90deg,#000 var(--lx),transparent 0);mask:linear-gradient(90deg,#000 var(--lx),transparent 0)}
.kit .k-leaf{clip-path:inset(0 0 0 var(--lx));transform-origin:var(--lx) 80%}
.kit[data-stone=design]{--lx:69%}
.kit[data-stone=pruning]{--lx:69.5%}

/* live carved words, centred in the face above the swoosh */
.plaque.kit span.k-text{position:absolute;top:8%;left:10%;right:10%;bottom:35%;width:auto;height:auto;transform:none;display:grid;place-items:center;text-align:center;
  font-family:Heebo,sans-serif;font-weight:900;font-size:14cqw;line-height:1;color:#3a1f08;letter-spacing:-.01em;
  text-shadow:0 .3cqw 0 #fff3d699,0 -.25cqw 0 #1a0a0280;mix-blend-mode:multiply}

/* words sit centred in the visible face: below the bed that covers the stone's top, above the carved groove
   (top = bed sink + 3%, bottom = groove top - 3%, measured from each stone's artwork) */
.plaque.kit span.k-text{left:13%;right:13%;font-size:11.4cqw;line-height:1.04;text-wrap:balance}
.plaque.kit[data-stone=lawn] span.k-text{top:20%;bottom:26.7%}
.plaque.kit[data-stone=irrigation] span.k-text{top:17%;bottom:28%}
.plaque.kit[data-stone=design] span.k-text{top:18%;bottom:26%;font-size:12cqw}
.plaque.kit[data-stone=pruning] span.k-text{top:15.5%;bottom:26.7%;font-size:11.8cqw}
.plaque.kit[data-stone=maintenance] span.k-text{top:17.6%;bottom:27%}

/* what grows on top of the stone: bed sinks a little behind the stone's top edge, tool sits in the bed */
.kit .k-bed{left:1%;width:98%;bottom:calc(var(--st-top) - var(--bed-sink,6cqw));z-index:1;transform-origin:50% 100%}
.kit .k-tool{left:50%;translate:-50% 0;bottom:calc(var(--st-top) - var(--tool-sink,3cqw));z-index:2;transform-origin:50% 100%;filter:drop-shadow(0 1.4cqw 1.2cqw #0005)}
.kit[data-stone=lawn]{--bed-sink:7cqw;--tool-sink:1cqw}
.kit[data-stone=lawn] .k-tool{width:80%;margin-left:-3%}
.kit[data-stone=irrigation] .k-tool{width:78%;margin-left:3%;scale:-1 1}
.kit[data-stone=design]{--bed-sink:7cqw;--tool-sink:1cqw}
.kit[data-stone=design] .k-tool{width:62%}
.kit[data-stone=pruning]{--tool-sink:2cqw}
.kit[data-stone=pruning] .k-tool{width:72%}
.kit[data-stone=maintenance]{--tool-sink:2cqw}
.kit[data-stone=maintenance] .k-tool{width:66%;margin-left:3%}

/* small things at the base: tufts at the stone's bottom corners, in front of the stone, behind the pebbles */
.kit .k-tuft{z-index:4;width:22%;bottom:0;transform-origin:50% 100%}
.kit .k-tuft.l{left:-4%}
.kit .k-tuft.r{right:-3%;width:17%;transform:scaleX(-1)}
.kit[data-stone=maintenance] .k-tuft.l{width:16%;left:-2%}
.kit[data-stone=maintenance] .k-tuft.r{width:21%}
.kit[data-stone=lawn] .k-tuft.r{width:14%}
.kit[data-stone=pruning] .k-tuft.r{width:13%}

@media(hover:hover){.plaque.kit:hover{animation:stone-wiggle .6s cubic-bezier(.3,.7,.35,1)}}
.plaque.kit:active{scale:.97}
.plaque.kit:focus-visible{outline:3px solid #f2b552;outline-offset:2px;border-radius:20px}

/* ---------- motion ---------- */
.motion-enabled .svc .plaque.kit{opacity:1;transform:none}
.motion-enabled .svc:not(.in) .kit :is(.k-bed,.k-tool,.k-tuft,.k-peb,.k-leaf),.motion-enabled .svc:not(.in) .plaque.kit>span.k-stone{opacity:0}
.motion-enabled .svc:not(.in) .kit .k-eng{--groove:0%}
.motion-enabled .svc:not(.in) .kit .k-text{clip-path:circle(0% at 50% 100%);opacity:0}
/* the groove reveal: a soft-tipped mask that runs left to right, stopping where the leaf begins */
.motion-enabled .kit .k-eng{-webkit-mask:linear-gradient(90deg,#000 calc(var(--groove) - 2.5%),transparent var(--groove)) 0 0/var(--lx) 100% no-repeat;
  mask:linear-gradient(90deg,#000 calc(var(--groove) - 2.5%),transparent var(--groove)) 0 0/var(--lx) 100% no-repeat}

.motion-enabled .svc.in .plaque.kit{--d:calc(var(--i,0) * 300ms + .35s)}
.motion-enabled .svc.in .plaque.kit>span.k-stone{animation:stone-grow 1.1s var(--d) cubic-bezier(.3,.7,.35,1) both}
.motion-enabled .svc.in .kit .k-rock{animation:stone-paint 1s calc(var(--d) + .15s) ease both}
.motion-enabled .svc.in .kit .k-bed{animation:kit-pop .8s calc(var(--d) + .4s) cubic-bezier(.3,.7,.35,1) both,stone-paint .9s calc(var(--d) + .45s) ease both}
.motion-enabled .svc.in .kit .k-tool{animation:kit-pop .9s calc(var(--d) + .6s) cubic-bezier(.3,.7,.35,1) both,stone-paint 1s calc(var(--d) + .65s) ease both}
.motion-enabled .svc.in .kit .k-tuft.l{animation:kit-sprout .6s calc(var(--d) + .9s) cubic-bezier(.3,1.5,.5,1) both}
.motion-enabled .svc.in .kit .k-tuft.r{animation:kit-sprout-r .6s calc(var(--d) + 1s) cubic-bezier(.3,1.5,.5,1) both}
.motion-enabled .svc.in .kit .k-peb{animation:kit-drop .55s calc(var(--d) + 1.05s) cubic-bezier(.3,1.6,.5,1) both}
.motion-enabled .svc.in .kit .k-eng{animation:kit-groove .75s calc(var(--d) + 1.2s) cubic-bezier(.45,0,.4,1) both}
.motion-enabled .svc.in .kit .k-leaf{animation:kit-leaf .55s calc(var(--d) + 1.9s) cubic-bezier(.3,1.6,.5,1) both}
.motion-enabled .svc.in .kit .k-text{transform-origin:50% 100%;animation:kit-write 1s calc(var(--d) + 2.05s) cubic-bezier(.5,0,.3,1) both}

@keyframes kit-pop{0%{opacity:0;transform:scale(0)}15%{opacity:1}52%{transform:scale(1.12,.88)}70%{transform:scale(.94,1.07)}86%{transform:scale(1.02,.99)}100%{opacity:1;transform:none}}
@keyframes kit-sprout{0%{opacity:0;transform:scale(.4,0)}30%{opacity:1}100%{opacity:1;transform:none}}
@keyframes kit-sprout-r{0%{opacity:0;transform:scaleX(-1) scale(.4,0)}30%{opacity:1}100%{opacity:1;transform:scaleX(-1)}}
@keyframes kit-drop{0%{opacity:0;transform:translateY(-60%)}40%{opacity:1}100%{opacity:1;transform:none}}
@keyframes kit-groove{from{--groove:0%}to{--groove:102.5%}}
@keyframes kit-leaf{0%{opacity:0;transform:scale(0) rotate(-25deg)}30%{opacity:1}100%{opacity:1;transform:none}}
/* the words are drawn out of one point under them: a circle opens from the bottom centre while they rise and settle */
@keyframes kit-write{0%{clip-path:circle(0% at 50% 100%);opacity:0;transform:translateY(8%) scale(.6)}15%{opacity:1}70%{transform:translateY(-2%) scale(1.04)}100%{clip-path:circle(120% at 50% 100%);opacity:1;transform:none}}

@media(max-width:600px){.svc .plaques{gap:4px 10px}.svc-band{padding-bottom:128px}}
@media(prefers-reduced-motion:reduce){
  .motion-enabled .svc .kit *{animation:none!important;opacity:1!important;filter:none}
  .motion-enabled .svc .kit .k-text{clip-path:none!important}
  .motion-enabled .svc .kit .k-eng{--groove:102.5%!important}}
body.paused .svc .kit *{animation:none!important;opacity:1!important}
body.paused .svc .kit .k-text{clip-path:none!important}
body.paused .svc .kit .k-eng{--groove:102.5%!important}
