/* ============ CLUTTER ============
   two lots of it:
   1. GOODS IN, at the very bottom of the shop: slushie machine, baskets, trolley, roll cage, cone, the mop and the sign
   2. round the leaked terminal: a pipe that drips, a bulb, a moth
   everything is a shape or an emoji for now. Annie's drawings swap in from the list at the top of clutter.js */

.clut-marker{text-align:center;font-family:var(--gothic);font-size:clamp(20px,5vw,30px);color:var(--ink2);margin:30px 0 6px;letter-spacing:.02em;opacity:.8}
.clut-sub{text-align:center;font:9px/1.6 var(--mono);letter-spacing:.2em;text-transform:uppercase;color:var(--faint2);margin:0 0 4px}
.clut{position:relative;height:400px;max-width:760px;margin:0 auto;overflow:hidden}

/* one thing on the floor */
.cl{position:absolute;appearance:none;-webkit-appearance:none;border:0;background:none;padding:2px;margin:0;cursor:pointer;font-family:var(--mono);color:var(--ink);
  display:flex;flex-direction:column;align-items:center;gap:3px;z-index:2;-webkit-tap-highlight-color:transparent;transition:left 1.4s linear,bottom 1.4s linear}
.cl:focus-visible,.cl-tank:focus-visible,.tc-b:focus-visible{outline:2px dashed var(--red);outline-offset:3px}
.cl-f{display:block;font-size:44px;line-height:1.05}
.cl-f img{display:block;height:auto}
.cl-lb{font-size:8px;letter-spacing:.2em;text-transform:uppercase;color:var(--faint2);line-height:1.5;white-space:nowrap}
.cl-say{position:absolute;left:50%;bottom:100%;transform:translateX(-50%);width:max-content;max-width:200px;background:var(--paper);border:1px solid var(--ink);
  padding:6px 9px;font:10.5px/1.45 var(--mono);letter-spacing:.02em;text-align:left;text-transform:none;color:var(--ink);opacity:0;pointer-events:none;transition:opacity .25s;z-index:9}
.talk>.cl-say{opacity:1}
.talk{z-index:8}
.edge-l>.cl-say{left:0;transform:none}
.edge-r>.cl-say{left:auto;right:0;transform:none}
.cl.go .cl-f{animation:clhop .4s steps(1) infinite}
@keyframes clhop{0%{transform:translateY(0) rotate(-5deg)}50%{transform:translateY(-5px) rotate(5deg)}100%{transform:translateY(0) rotate(-5deg)}}

/* ---- the slushie machine. two flavours only: goo or blue ---- */
.cl-slush{position:absolute;left:4%;bottom:190px;width:128px;z-index:2;font-family:var(--mono)}
.cl-slush-top{background:var(--ink);color:var(--paper);font-size:11px;font-weight:700;letter-spacing:.3em;text-align:center;padding:5px 0 4px;border-radius:5px 5px 0 0}
.cl-tanks{display:flex;gap:6px;padding:7px 7px 0;background:#d8d3c6;border-left:2px solid var(--ink);border-right:2px solid var(--ink)}
.cl-tank{position:relative;flex:1;height:92px;appearance:none;-webkit-appearance:none;border:2px solid var(--ink);border-radius:9px 9px 3px 3px;padding:0;cursor:pointer;overflow:hidden;
  background-size:100% 46px;animation:clswirl 2.8s linear infinite;-webkit-tap-highlight-color:transparent}
.cl-tank.goo{background-image:repeating-linear-gradient(160deg,#9be36a 0 12px,#c5f58f 12px 18px,#7fd14a 18px 30px)}
.cl-tank.blue{background-image:repeating-linear-gradient(200deg,#4ab8ff 0 12px,#a6e1ff 12px 18px,#2a94e6 18px 30px);animation-direction:reverse}
@keyframes clswirl{from{background-position:0 0}to{background-position:0 46px}}
.cl-tank span{position:absolute;left:0;right:0;bottom:5px;font:700 9px/1 var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--ink);text-shadow:0 0 3px #fff,0 0 3px #fff}
.cl-tank:active{filter:brightness(1.15)}
.cl-slush-base{position:relative;background:#d8d3c6;border:2px solid var(--ink);border-top:0;border-radius:0 0 4px 4px;height:44px;font-size:7px;letter-spacing:.16em;text-transform:uppercase;color:var(--ink2);text-align:center;padding-top:22px}
.cl-nozzle{position:absolute;top:0;width:10px;height:13px;background:var(--ink);border-radius:0 0 4px 4px}
.cl-nozzle.goo{left:23px}.cl-nozzle.blue{right:23px}
.cl-drip{position:absolute;width:8px;height:12px;border-radius:50% 50% 50% 50%/30% 30% 70% 70%;z-index:3;pointer-events:none;animation:cldrip .55s ease-in forwards}
@keyframes cldrip{from{transform:translateY(0) scaleY(.6);opacity:1}to{transform:translateY(46px) scaleY(1.3);opacity:.9}}
.cl-puddle{position:absolute;left:3%;bottom:150px;width:0;height:0;border-radius:50%;z-index:1;appearance:none;-webkit-appearance:none;border:0;padding:0;cursor:pointer;opacity:.85;
  transition:width .8s ease-out,height .8s ease-out,background .8s;-webkit-tap-highlight-color:transparent}
.cl-puddle>.cl-say{bottom:auto;top:100%}

/* ---- baskets, trolley, cage, cone, and the two old hands ---- */
.cl-legs{display:flex;gap:13px;margin-top:-9px;height:13px}
.cl-legs i{display:block;width:3px;height:13px;background:var(--ink);border-radius:0 0 2px 2px;transform-origin:50% 0}
.cl-legs i::after{content:"";display:block;position:relative;top:11px;left:-1px;width:7px;height:3px;background:var(--ink);border-radius:2px}
.cl-walker.go .cl-f{animation:none}
.cl-walker.go .cl-legs i:first-child{animation:clleg .28s steps(1) infinite}
.cl-walker.go .cl-legs i:last-child{animation:clleg .28s steps(1) infinite reverse}
@keyframes clleg{0%{transform:rotate(28deg)}50%{transform:rotate(-28deg)}100%{transform:rotate(28deg)}}
.cl-trolley{transition:left 7s linear}
.cl-trolley .cl-f{font-size:46px}
.cl-trolley.go .cl-f{animation:clrattle .18s steps(1) infinite}
@keyframes clrattle{0%{transform:translateY(0)}50%{transform:translateY(-2px) rotate(-2deg)}100%{transform:translateY(0)}}
.cl-flip .cl-f{transform:scaleX(-1)}
.cl-trolley.cl-flip.go .cl-f{animation:clrattlef .18s steps(1) infinite}
@keyframes clrattlef{0%{transform:scaleX(-1) translateY(0)}50%{transform:scaleX(-1) translateY(-2px) rotate(-2deg)}100%{transform:scaleX(-1) translateY(0)}}
.cl-cage .cl-f{position:relative;width:92px;height:128px;font-size:0;border:3px solid var(--ink2);border-bottom-width:5px;border-radius:3px;
  background:
    repeating-linear-gradient(90deg,transparent 0 13px,var(--ink2) 13px 15px),
    repeating-linear-gradient(0deg,transparent 0 40px,var(--ink2) 40px 42px)}
.cl-cage .cl-f::after{content:"";position:absolute;left:8px;right:-13px;bottom:-14px;height:9px;
  background:radial-gradient(circle at 5px 5px,var(--ink) 4px,transparent 5px) left/50% 100% no-repeat,radial-gradient(circle at 5px 5px,var(--ink) 4px,transparent 5px) right/50% 100% no-repeat}
.cl-card{position:absolute;bottom:2px;width:13px;border:1px solid #6d5230;background:#b88d55;z-index:-1}
.cl-card:nth-child(1){left:5px;height:96px;transform:rotate(-3deg);background:#c49a62}
.cl-card:nth-child(2){left:22px;height:108px;transform:rotate(2deg)}
.cl-card:nth-child(3){left:40px;height:84px;transform:rotate(-5deg);background:#a87d47}
.cl-card:nth-child(4){left:58px;height:101px;transform:rotate(4deg);background:#c49a62}
.cl-cage .cl-f{z-index:0}
.cl-cage .cl-lb{margin-top:15px}
.cl-eyes{position:absolute;left:30px;top:30px;font-size:20px;line-height:1;z-index:-1;opacity:0;transition:opacity .2s,top .3s}
.cl-cage.peek .cl-eyes{opacity:1;top:16px}
.cl-cage.rattle .cl-f{animation:clshake .35s steps(1) 2}
@keyframes clshake{0%{transform:rotate(-2deg)}50%{transform:rotate(2deg)}100%{transform:rotate(0)}}
.cl-mop.mopping .cl-f{animation:clmop .5s ease-in-out infinite;transform-origin:50% 90%}
@keyframes clmop{0%,100%{transform:rotate(-9deg) translateX(-8px)}50%{transform:rotate(9deg) translateX(8px)}}
.cl-mop .cl-f{animation:clsway 5s ease-in-out infinite;transform-origin:50% 92%}
@keyframes clsway{0%,100%{transform:rotate(-2deg)}50%{transform:rotate(2.5deg)}}
.cl-mop.go .cl-f{animation:clhop .4s steps(1) infinite}

/* ============ ROUND THE TERMINAL ============ */
.tc{position:relative;max-width:640px;height:0;margin:0 auto;z-index:6!important}   /* the shop floor sets z-index on everything in it; this has to sit over the terminal */
.tc-b{position:absolute;appearance:none;-webkit-appearance:none;border:0;background:none;padding:0;margin:0;cursor:pointer;-webkit-tap-highlight-color:transparent;font-family:var(--mono)}
.tc-pipe{left:-50vw;top:-176px;width:calc(50vw + 74%);height:16px;border-radius:0 3px 3px 0;
  background:linear-gradient(180deg,#8d8a82 0,#c9c5b8 30%,#77736a 75%,#55524b 100%);box-shadow:0 2px 0 rgba(0,0,0,.18)}
.tc-pipe::before,.tc-pipe::after{content:"";position:absolute;top:-3px;width:12px;height:22px;border-radius:2px;background:linear-gradient(180deg,#6f6c64,#aaa698 35%,#4c4a44)}
.tc-pipe::before{left:calc(50vw + 12%)}.tc-pipe::after{right:-3px}
.tc-pipe>.cl-say{bottom:auto;top:150%;left:auto;right:8%;transform:none}
.tc-bulb>.cl-say,.tc-moth>.cl-say{bottom:auto;top:130%}
.tc-rust{position:absolute;left:calc(74% - 22px);top:-160px;width:3px;height:10px;border-radius:0 0 3px 3px;background:#8a5a34;opacity:.6;pointer-events:none}
.tc-drop{position:absolute;left:calc(74% - 23px);top:-152px;width:5px;height:8px;border-radius:50% 50% 50% 50%/30% 30% 70% 70%;background:#6fb3c9;pointer-events:none;animation:tcdrop 3.4s cubic-bezier(.6,0,1,.7) infinite}
@keyframes tcdrop{0%{transform:translateY(0) scale(.3);opacity:0}18%{transform:translateY(0) scale(1);opacity:1}55%{transform:translateY(146px) scale(1);opacity:1}58%,100%{transform:translateY(148px) scale(2.2,.3);opacity:0}}
.tc-stain{position:absolute;left:calc(74% - 34px);top:-3px;width:26px;height:7px;border-radius:50%;background:#6fb3c9;opacity:.5;pointer-events:none;animation:tcstain 3.4s ease-out infinite}
@keyframes tcstain{0%,54%{transform:scale(.8);opacity:.3}60%{transform:scale(1.25);opacity:.65}100%{transform:scale(.8);opacity:.3}}
.tc-bulb{left:calc(19% - 14px);top:-160px;width:28px;height:98px}
.tc-cord{position:absolute;left:13px;top:0;width:2px;height:64px;background:var(--ink)}
.tc-cap{position:absolute;left:8px;top:62px;width:12px;height:9px;background:var(--ink2);border-radius:2px 2px 0 0}
.tc-glass{position:absolute;left:3px;top:70px;width:22px;height:26px;border-radius:45% 45% 50% 50%/40% 40% 60% 60%;background:#ffd76a;
  box-shadow:0 0 14px 5px rgba(255,205,90,.75),0 0 60px 26px rgba(255,190,70,.28);animation:tcflick 5.3s steps(1) infinite}
@keyframes tcflick{0%,100%{opacity:1}41%{opacity:.35}43%{opacity:1}44%{opacity:.5}46%{opacity:1}78%{opacity:.7}79%{opacity:1}}
.tc.dark .tc-glass{background:#77736a;box-shadow:none;animation:none}
.tc-bulb{transform-origin:14px 0;animation:tcswing 6s ease-in-out infinite}
@keyframes tcswing{0%,100%{transform:rotate(-2.5deg)}50%{transform:rotate(2.5deg)}}
.tc-moth{left:19%;top:-78px;width:0;height:0;transition:left 2.6s ease-in-out,top 2.6s ease-in-out}
.tc.dark .tc-moth{left:52%;top:16px}
.tc-orbit{position:absolute;left:-11px;top:-11px;width:22px;height:22px;animation:tcorbit 3.1s linear infinite}
@keyframes tcorbit{from{transform:rotate(0) translateX(36px) rotate(0)}to{transform:rotate(360deg) translateX(36px) rotate(-360deg)}}
.tc.dark .tc-orbit{animation-duration:4.6s}
.tc-wing{position:absolute;top:5px;width:10px;height:12px;background:#cfc3a8;border:1px solid #8d8468;animation:tcflap .16s steps(1) infinite}
.tc-wing.l{left:1px;border-radius:80% 10% 60% 30%;transform-origin:100% 50%}
.tc-wing.r{left:11px;border-radius:10% 80% 30% 60%;transform-origin:0 50%;animation-direction:reverse}
@keyframes tcflap{0%{transform:scaleX(1)}50%{transform:scaleX(.35)}100%{transform:scaleX(1)}}

@media (max-width:600px){
  .clut{height:420px}
  .cl-slush{left:2%}
  .cl-say{max-width:170px}
}
@media (prefers-reduced-motion:reduce){
  .cl,.cl-trolley,.tc-moth{transition:none}
  .cl.go .cl-f,.cl-tank,.cl-mop .cl-f,.cl-walker.go .cl-legs i,.cl-trolley.go .cl-f,.tc-drop,.tc-stain,.tc-glass,.tc-bulb,.tc-orbit,.tc-wing,.cl-cage.rattle .cl-f{animation:none}
  .tc-drop{opacity:0}
}

/* ---- 12 Nov: Annie's stickers ---- */
.cl-walker.art.go .cl-f{animation:clhop .4s steps(1) infinite}
.cl-cage.art .cl-f{width:auto;height:auto;border:0;background:none;font-size:0}
.cl-cage.art .cl-f::after{display:none}
.cl-cage.art .cl-eyes{left:30px;top:74px;z-index:1}
.cl-cage.art.peek .cl-eyes{top:58px}
.cl-cage.art .cl-lb{margin-top:2px}
.cl-mop.away{opacity:0;pointer-events:none}
.cl-mop{transition:left 1.4s linear,bottom 1.4s linear,opacity .25s}
.tc-orbit img{position:absolute;left:-9px;top:-5px;width:40px;height:auto;animation:tcflap2 .3s steps(1) infinite}
@keyframes tcflap2{0%{transform:scaleX(1)}50%{transform:scaleX(.72)}100%{transform:scaleX(1)}}
@media (prefers-reduced-motion:reduce){.tc-orbit img,.cl-walker.art.go .cl-f{animation:none}}
