/* ============================================================
   움직임 — 철거(타일 깨기) · 설비(배관 깔기) 인터랙션
   motion.js 가 요소를 만들어 넣음. 동작을 줄이는 설정이면 정지 화면만.
   ============================================================ */

/* 헤더 아래: 스크롤만큼 물이 차는 배관 */
.pipe-progress{position:absolute;left:0;right:0;bottom:-1px;height:3px;pointer-events:none;overflow:hidden}
.pipe-progress i{display:block;height:100%;transform-origin:left;transform:scaleX(var(--p,0));
  background:linear-gradient(90deg,var(--green-d),var(--green) 40%,var(--water));transition:transform .12s linear}

/* 스크롤하면 올라오며 나타남 */
.rv{opacity:0;transform:translateY(24px);transition:opacity .9s cubic-bezier(.2,.7,.2,1),transform .9s cubic-bezier(.2,.7,.2,1);transition-delay:var(--d,0s)}
.rv.in{opacity:1;transform:none}

/* 히어로: 형광펜이 그어지고, 아래 선은 배관처럼 채워짐 */
.hero h1 b{background-repeat:no-repeat!important;background-size:0% 100%!important;transition:background-size 1.1s cubic-bezier(.65,0,.2,1) .45s}
.hero.ready h1 b{background-size:100% 100%!important}
.hero h1 .h-lead{display:inline-block;opacity:0;transform:translateY(14px);transition:opacity .8s,transform .8s cubic-bezier(.2,.7,.2,1)}
.hero.ready h1 .h-lead{opacity:1;transform:none}
.hero-foot{position:relative}
.hero-pipe{position:absolute;left:0;right:0;top:0;height:2px;background:var(--line)}
.hero-pipe i{position:absolute;inset:0;background:var(--ink);transform-origin:left;transform:scaleX(0);transition:transform 1.4s cubic-bezier(.65,0,.2,1) .2s}
.hero-pipe b{position:absolute;top:50%;left:0;width:10px;height:10px;margin:-5px 0 0 -5px;border-radius:50%;background:var(--water);box-shadow:0 0 0 4px rgba(79,179,255,.18);opacity:0;transition:left 1.4s cubic-bezier(.65,0,.2,1) .2s,opacity .3s .2s}
.hero.ready .hero-pipe i{transform:scaleX(1)}
.hero.ready .hero-pipe b{left:100%;opacity:1}
@media(max-width:860px){.hero-pipe{display:none}}

/* 띠 안의 글은 그림 위로 */
.band > .wrap{position:relative;z-index:1}

/* 철거 띠: 타일 벽 */
.demo-canvas{position:absolute;inset:0;width:100%;height:100%;z-index:0;display:block;touch-action:pan-y;
  cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cpath d='M20 3l11 11-4 4-11-11z' fill='%23f5d63d' stroke='%23111' stroke-width='1.5'/%3E%3Cpath d='M17 10l7 7-13 13-5 1 1-5z' fill='%23d2d6db' stroke='%23111' stroke-width='1.5'/%3E%3C/svg%3E") 4 30,crosshair}
.demo-hint{position:absolute;right:20px;bottom:16px;z-index:2;font-size:12px;color:rgba(255,255,255,.45);pointer-events:none;transition:opacity .6s}
.demo-hint.off{opacity:0}

/* 설비 띠: 배관 */
.pipe-svg{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;overflow:visible}
.pipe-svg .p-out{fill:none;stroke:#0a1a36;stroke-width:18;stroke-linecap:round;stroke-linejoin:round}
.pipe-svg .p-body{fill:none;stroke:#2b5190;stroke-width:11;stroke-linecap:round;stroke-linejoin:round}
.pipe-svg .p-shine{fill:none;stroke:rgba(255,255,255,.16);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transform:translate(-2px,-3px)}
.pipe-svg .p-water{fill:none;stroke:var(--water);stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:10 16;opacity:0;transition:opacity .8s}
.pipe-svg.flow .p-water{opacity:.95;animation:pflow .9s linear infinite}
@keyframes pflow{to{stroke-dashoffset:-26}}
.pipe-svg .joint{fill:#3a64a8;stroke:#0a1a36;stroke-width:2;opacity:0;transform-box:fill-box;transform-origin:center;transform:scale(.4);transition:opacity .3s,transform .4s cubic-bezier(.3,1.6,.5,1)}
.pipe-svg .joint.on{opacity:1;transform:none}
.pipe-svg .valve{opacity:0;transition:opacity .4s}
.pipe-svg .valve.on{opacity:1}
.pipe-svg .valve .wheel{transform-box:fill-box;transform-origin:center;transition:transform 1.2s cubic-bezier(.3,1.4,.5,1)}
.pipe-svg.flow .valve .wheel{transform:rotate(180deg)}

/* 목공 띠: 각재로 벽 틀 짜기 */
.band-3{position:relative;overflow:hidden;padding-top:176px}
@media(max-width:640px){.band-3{padding-top:124px}}
.wood-svg{position:absolute;inset:0;width:100%;height:100%;z-index:0;overflow:visible}
.wood-svg .wd{fill:#ecdcc0;stroke:#d6bd93;stroke-width:1}
.wood-svg .grain{fill:none;stroke:#dcc49d;stroke-width:1;stroke-linecap:round}
.wood-svg .bplate{transform-box:fill-box;transform-origin:left center}
.wood-svg .tplate{transition:none}
.wood-svg .stud{transform-box:fill-box;transform-origin:center bottom}
.wood-svg .stud.tap rect.wd{animation:tap .38s cubic-bezier(.3,1.6,.5,1)}
@keyframes tap{40%{fill:#e3cca5;transform:translateY(3px)}}
.wood-svg .screw{fill:#9aa1a9;opacity:0;transform-box:fill-box;transform-origin:center;transform:scale(2.4);transition:opacity .25s,transform .35s cubic-bezier(.3,1.6,.5,1)}
.wood-svg .screw.on{opacity:1;transform:none}

/* 최근 현장 카드 사진 살짝 확대 */
.work{will-change:transform}

@media(prefers-reduced-motion:reduce){
  .rv{opacity:1;transform:none;transition:none}
  .hero h1 b{background-size:100% 100%!important;transition:none}
  .hero h1 .h-lead{opacity:1;transform:none;transition:none}
  .hero-pipe i{transform:none;transition:none}
  .pipe-svg .p-water{animation:none}
}
