/* ───────── 벽에 걸어보기: 조작부 ───────── */
.wall-sec { padding-bottom: clamp(64px, 9vw, 110px); scroll-margin-top: 70px; }
.wall-wrap { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: clamp(20px, 3vw, 40px); align-items: center; }
.wall-ctrl { display: flex; flex-direction: column; gap: 18px; }
.wall-title { font-size: 22px; font-weight: 600; margin: 4px 0 0; line-height: 1.35; }
.wall-row { display: flex; flex-direction: column; gap: 8px; }
.ctrl-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.swatches, .pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; padding: 0; position: relative; }
.sw span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sw-paper { background: #eeeae3; }
.sw-linen { background: repeating-linear-gradient(0deg, #e0d5c2 0 2px, #d6cab4 2px 3px); }
.sw-brick { background: linear-gradient(#ebe8e2 0 42%, #cfcac1 42% 50%, #ebe8e2 50% 92%, #cfcac1 92%); }
.sw-sage { background: #b7c0ad; }
.sw-night { background: #3a3937; }
.sw.is-on { outline: 2px solid var(--ink); outline-offset: 3px; }
.pill { font: inherit; font-size: 14px; font-weight: 500; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer; line-height: 1.2; }
.pill small { display: block; font-size: 11px; font-weight: 400; opacity: .75; margin-top: 2px; }
.pill.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.wall-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { font-family: inherit; background: transparent; cursor: pointer; }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #000; }
.frame-note { font-size: 13px; color: var(--muted); margin: 0; }

/* ───────── 장면 (위치·크기는 site.js 가 mm 단위로 계산) ───────── */
.wall { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 2px; background: var(--wall); transition: background .4s; isolation: isolate; }
.wall[data-wall="paper"] { --wall: #eeeae3; }
.wall[data-wall="linen"] { --wall: #ddd2bf; }
.wall[data-wall="brick"] { --wall: #ebe8e2; }
.wall[data-wall="sage"]  { --wall: #b7c0ad; }
.wall[data-wall="night"] { --wall: #3a3937; }

/* 벽 질감 — 도장면은 옅은 노이즈, 린넨은 가로세로 결, 벽돌은 줄눈 */
.wall-tex {
  position: absolute; inset: 0; pointer-events: none; opacity: .55; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22220%22 height=%22220%22%3E%3Cfilter id=%22n%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%22.75%22 numOctaves=%223%22 stitchTiles=%22stitch%22/%3E%3CfeColorMatrix values=%220 0 0 0 .5 0 0 0 0 .47 0 0 0 0 .43 0 0 0 .35 0%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23n)%22/%3E%3C/svg%3E");
}
.wall[data-wall="linen"] .wall-tex {
  background-image:
    repeating-linear-gradient(0deg, rgba(90, 70, 40, .07) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(90, 70, 40, .05) 0 1px, transparent 1px 4px),
    url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22220%22 height=%22220%22%3E%3Cfilter id=%22n%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%22.6%22 numOctaves=%222%22/%3E%3CfeColorMatrix values=%220 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .38 0 0 0 .25 0%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23n)%22/%3E%3C/svg%3E");
}
.wall[data-wall="brick"] .wall-tex {
  opacity: 1; mix-blend-mode: normal;
  background-size: var(--brick-w, 60px) var(--brick-h2, 40px), 220px 220px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22200%22 height=%22134%22%3E%3Crect width=%22200%22 height=%22134%22 fill=%22%23ebe8e2%22/%3E%3Cg fill=%22%23cfc9bf%22%3E%3Crect y=%2257%22 width=%22200%22 height=%2210%22/%3E%3Crect y=%22124%22 width=%22200%22 height=%2210%22/%3E%3Crect x=%220%22 width=%2210%22 height=%2257%22/%3E%3Crect x=%22100%22 y=%2267%22 width=%2210%22 height=%2257%22/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22220%22 height=%22220%22%3E%3Cfilter id=%22n%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%22.9%22 numOctaves=%223%22/%3E%3CfeColorMatrix values=%220 0 0 0 .5 0 0 0 0 .48 0 0 0 0 .45 0 0 0 .25 0%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23n)%22/%3E%3C/svg%3E");
  background-blend-mode: multiply;
}

/* 창에서 들어오는 빛 — 왼쪽 위가 밝고 모서리가 어둡다 */
.wall-light {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 26% 16%, rgba(255, 250, 240, .38), transparent 60%),
    radial-gradient(ellipse 120% 100% at 50% 40%, transparent 55%, rgba(0, 0, 0, .2));
}
.wall[data-wall="night"] .wall-light {
  background:
    radial-gradient(ellipse 70% 60% at 26% 16%, rgba(255, 240, 215, .14), transparent 60%),
    radial-gradient(ellipse 120% 100% at 50% 40%, transparent 50%, rgba(0, 0, 0, .38));
}

.baseboard { position: absolute; left: 0; right: 0; background: linear-gradient(#f6f3ee, #dcd6cc); box-shadow: 0 -1px 0 rgba(0, 0, 0, .08); }
.floor {
  position: absolute; left: 0; right: 0; bottom: 0;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .07) 0 1px, transparent 1px 12.5%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 30px, transparent 30px 70px),
    linear-gradient(#b99673, #98765a);
}
.sideboard { position: absolute; background: linear-gradient(#a88462, #8b684b); box-shadow: 0 12px 20px -8px rgba(0, 0, 0, .4); }
.sideboard .sb-top { position: absolute; left: -1.5%; right: -1.5%; top: -5%; height: 6%; background: linear-gradient(#c8a583, #a7835f); box-shadow: 0 2px 3px rgba(0, 0, 0, .22); }
.sideboard .sb-door { position: absolute; top: 12%; bottom: 20%; width: 45%; border: 1px solid rgba(0, 0, 0, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.sideboard .sb-door:nth-of-type(2) { left: 3.5%; }
.sideboard .sb-door:nth-of-type(3) { right: 3.5%; }
.sideboard .sb-door::after { content: ""; position: absolute; top: 45%; width: 2px; height: 14%; background: rgba(40, 28, 18, .55); border-radius: 1px; }
.sideboard .sb-door:nth-of-type(2)::after { right: 8%; }
.sideboard .sb-door:nth-of-type(3)::after { left: 8%; }
.sideboard .sb-leg { position: absolute; bottom: -17.6%; width: 2.2%; height: 17.6%; background: #5a4230; }
.sideboard .sb-leg:nth-of-type(4) { left: 6%; }
.sideboard .sb-leg:nth-of-type(5) { right: 6%; }
.vase {
  position: absolute; border-radius: 45% 45% 38% 38% / 55% 55% 45% 45%;
  background: radial-gradient(circle at 35% 30%, #f7f3ec, #dcd4c6 58%, #bdb2a0);
  box-shadow: 3px 5px 8px rgba(0, 0, 0, .22);
}
.vase::before { /* 마른 가지 */
  content: ""; position: absolute; left: 48%; bottom: 80%; width: 1.2px; height: 95%;
  background: #6b5a45; transform: rotate(-8deg); transform-origin: bottom;
  box-shadow: 6px -12px 0 -0.2px #6b5a45, -5px -20px 0 -0.2px #6b5a45;
}

/* 액자 — 프레임 폭·그림자는 실제 mm 에 맞춰 JS 가 --fw·--sh 로 넣는다 */
.wall-frames { position: absolute; display: flex; }
.frame {
  position: relative; flex: none; background: var(--fc, #1f1d1b); padding: var(--fw, 6px);
  box-shadow: 0 var(--sh, 10px) calc(var(--sh, 10px) * 2) calc(var(--sh, 10px) * -.6) rgba(0, 0, 0, .42), 0 1px 2px rgba(0, 0, 0, .25);
  transition: width .5s ease, height .5s ease, padding .3s;
}
.frame::before { /* 몰딩: 바깥 모서리 하이라이트 + 안쪽 턱 그림자 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .2), inset -1px -1px 0 rgba(0, 0, 0, .35);
}
.frame-in { position: relative; width: 100%; height: 100%; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.frame-in img { width: 100%; height: 100%; object-fit: cover; transition: opacity .35s; }
.frame-in::after { /* 유리 반사 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, .04) 28%, transparent 40%, transparent 72%, rgba(255, 255, 255, .07) 86%, transparent 100%),
    linear-gradient(0deg, rgba(0, 0, 0, .1), transparent 30%);
}
.frame.is-swap img { opacity: 0; }
.wall[data-frame="black"]  .frame { --fc: linear-gradient(145deg, #3a3633, #141211); }
.wall[data-frame="oak"]    .frame { --fc: repeating-linear-gradient(90deg, rgba(120, 80, 40, .12) 0 2px, transparent 2px 7px), linear-gradient(145deg, #cfa878, #a67c4f); }
.wall[data-frame="walnut"] .frame { --fc: repeating-linear-gradient(90deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 6px), linear-gradient(145deg, #74503a, #43281a); }
.wall[data-frame="white"]  .frame { --fc: linear-gradient(145deg, #fdfcf9, #e2ded6); }
.wall[data-frame="none"]   .frame { --fc: transparent; padding: 0; }
.wall[data-frame="none"]   .frame::before,
.wall[data-frame="none"]   .frame-in::after { display: none; }
.wall[data-frame="none"]   .frame-in { box-shadow: none; }

@media (max-width: 900px) {
  .wall-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .wall { aspect-ratio: 4 / 3.3; }
  .sizes .pill { padding: 6px 11px; }
}
