/* 온결 리모델링 (자체 제작 시안)
   세계: 자재 샘플북. 석회빛 회색 바탕, 초록 기 도는 먹색 글자, 행동에만 쓰는 코발트.
   자재 색은 내용물로서 넓은 면을 차지한다. 모서리는 4px 하나. */

:root {
  --stone: #ECEEEA;
  --stone-2: #DCE0D9;
  --paper: #F7F8F5;
  --ink: #17211E;
  --ink-2: #44504B;
  --line: #C5CBC4;
  --edge: #7F8A81;          /* 입력 칸 테두리: 종이색 위에서 3:1 이상 */
  --cobalt: #1C3FCF;
  --cobalt-press: #1632A8;
  --danger: #A3261F;
  --r: 4px;
  --maxw: 1320px;
  --pad: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 2px 8px rgb(23 33 30 / 0.16);
  --sprite: url("assets/img/materials.jpg");
}

/* 고른 조합의 색이 보드와 문의 영역을 물들인다 */
/* 보드 색은 그 조합의 어떤 칩과도 같지 않아야 한다: 같으면 칩이 보드에 묻힌다 */
[data-combo="a"] { --field: #3B422D; --on-field: #F7F8F5; --on-field-2: #DCE2CF; }
[data-combo="b"] { --field: #5E5A53; --on-field: #F7F8F5; --on-field-2: #DEDAD3; }
[data-combo="c"] { --field: #8E9C80; --on-field: #17211E; --on-field-2: #1F2A23; }

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: "Wanted Sans Variable", "Wanted Sans", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
  accent-color: var(--cobalt);
  caret-color: var(--cobalt);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--cobalt); color: #fff; }

:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }

a { color: inherit; text-underline-offset: 0.22em; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, ul, ol, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }

h1 {
  font-size: clamp(2.35rem, 3.6vw + 0.6rem, 3.9rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
}
h2 {
  font-size: clamp(1.75rem, 2.4vw + 0.7rem, 2.75rem);
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
h3 { font-size: 1.375rem; font-weight: 720; letter-spacing: -0.02em; line-height: 1.3; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -64px; z-index: 30;
  padding: 10px 16px; border-radius: var(--r);
  background: var(--ink); color: var(--paper); text-decoration: none;
}
.skip:focus { top: 12px; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  border: 0; border-radius: var(--r);
  background: var(--cobalt); color: #fff;
  font: inherit; font-size: 1rem; font-weight: 680; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { background: var(--cobalt-press); }
.btn:active { transform: translateY(1px); }
.btn-small { min-height: 44px; padding: 0 18px; font-size: 0.9375rem; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* 조합별로 하나만 보이는 내용 */
.c-a, .c-b, .c-c { display: none; }
[data-combo="a"] .c-a, [data-combo="b"] .c-b, [data-combo="c"] .c-c { display: revert; }

/* 내비 */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 32px;
  height: 64px; padding-inline: max(var(--pad), calc((100% - var(--maxw)) / 2));
  background: var(--stone);
}
.brand { font-size: 1.125rem; font-weight: 800; letter-spacing: -0.03em; text-decoration: none; }
.nav nav { display: flex; gap: 28px; margin-left: auto; }
.nav nav a { color: var(--ink-2); font-size: 0.9375rem; font-weight: 560; text-decoration: none; }
.nav nav a:hover { color: var(--ink); text-decoration: underline; }

/* 구획 공통 */
main > section { padding-inline: max(var(--pad), calc((100% - var(--maxw)) / 2)); }
.cases, .schedule, .faq { padding-block: clamp(72px, 8vw, 128px) 0; }
.section-head { margin-bottom: 36px; }
.section-head p { margin-top: 14px; max-width: 46ch; color: var(--ink-2); }

/* 첫 화면: 샘플 보드 */
.hero { padding-block: clamp(20px, 3vw, 40px) 0; }
.hero-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px;
  margin-bottom: 24px;
}
.lede { margin-top: 16px; max-width: 48ch; color: var(--ink-2); font-size: 1.125rem; line-height: 1.55; }

.tabs { display: flex; gap: 4px; }
.tabs label { cursor: pointer; }
.tabs input { position: absolute; opacity: 0; pointer-events: none; }
.tabs span {
  display: flex; align-items: center; min-height: 46px; padding: 0 22px;
  border-radius: var(--r) var(--r) 0 0;
  background: var(--stone-2); color: var(--ink);
  font-size: 0.9375rem; font-weight: 640; letter-spacing: -0.01em;
  transition: background-color 0.5s var(--ease), color 0.3s var(--ease);
}
.tabs label:hover span { background: #CFD5CD; }
.tabs input:checked + span { background: var(--field); color: var(--on-field); }
.tabs label:has(input:focus-visible) span { outline: 2px solid var(--cobalt); outline-offset: 3px; }

.board {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px;
  padding: 20px;
  border-radius: 0 var(--r) var(--r) var(--r);
  background: var(--field); color: var(--on-field);
  transition: background-color 0.5s var(--ease), color 0.3s var(--ease);
}

.room { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.room-frame {
  position: relative; overflow: hidden;
  /* 내비·제목·탭·칩 설명을 뺀 높이: 보드 전체가 첫 화면 안에 들어오게 한다 */
  height: clamp(300px, calc(100dvh - 500px), 560px);
  border-radius: var(--r);
  background: rgb(0 0 0 / 0.18);
}
.room-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.5s var(--ease);
}
[data-combo="a"] .r-a, [data-combo="b"] .r-b, [data-combo="c"] .r-c { opacity: 1; }

/* 측정값은 늘 같은 자리에 표 숫자로 */
.specs { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 16px; }
[data-combo] .specs.c-a, [data-combo] .specs.c-b, [data-combo] .specs.c-c { display: none; }
[data-combo="a"] .specs.c-a, [data-combo="b"] .specs.c-b, [data-combo="c"] .specs.c-c { display: grid; }
.specs dt { color: var(--on-field-2); font-size: 0.8125rem; font-weight: 560; }
.specs dd { font-size: 1.0625rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.chips { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 12px; min-width: 0; }
[data-combo="a"] .chip.c-a, [data-combo="b"] .chip.c-b, [data-combo="c"] .chip.c-c { display: flex; }
.chip {
  position: relative; flex-direction: column; overflow: hidden;
  border-radius: var(--r); background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow);
}
/* 샘플 칩의 타공 구멍: 뒤의 보드 색이 비친다 */
.chip::before {
  content: ""; position: absolute; top: 9px; left: 50%; z-index: 1;
  width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%;
  background: var(--field);
  transition: background-color 0.5s var(--ease);
}
.swatch {
  display: block; flex: 1; min-height: 84px;
  background-color: var(--c);
  background-image: var(--sprite);
  background-size: 400% 300%;
  background-position: calc(var(--x) * 100% / 3) calc(var(--y) * 100% / 2);
}
.label { padding: 11px 13px 13px; }
.code { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.8125rem; }
.code b { font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.code span { color: var(--ink-2); font-weight: 540; }
.name { margin-top: 2px; font-size: 0.9688rem; font-weight: 680; letter-spacing: -0.015em; line-height: 1.35; }
.size { color: var(--ink-2); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }

/* 사진이 아직 없을 때의 빈 칸 */
img.is-broken { display: none !important; }
[data-missing]::after {
  content: "사진 자리: " attr(data-missing);
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  font-size: 0.875rem; font-weight: 560; text-align: center; opacity: 0.8;
}

/* 공사 전후 비교 */
.case-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.case-tabs label, .choices label { cursor: pointer; }
.case-tabs input, .choices input { position: absolute; opacity: 0; pointer-events: none; }
.case-tabs span, .choices span {
  display: flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: var(--r); box-shadow: inset 0 0 0 1.5px var(--edge);
  font-size: 0.9375rem; font-weight: 620;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.case-tabs label:hover span, .choices label:hover span { box-shadow: inset 0 0 0 1.5px var(--ink); }
.case-tabs input:checked + span, .choices input:checked + span {
  background: var(--ink); color: var(--paper); box-shadow: inset 0 0 0 1.5px var(--ink);
}
.case-tabs label:has(input:focus-visible) span, .choices label:has(input:focus-visible) span {
  outline: 2px solid var(--cobalt); outline-offset: 3px;
}

.compare {
  position: relative; overflow: hidden; aspect-ratio: 16 / 9;
  border-radius: var(--r); background: var(--stone-2); color: var(--ink-2);
}
[data-combo] .shot { position: absolute; inset: 0; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* 공사 전 사진을 걷어 내면 공사 후가 드러난다 */
.shot .before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px;
  background: var(--paper); box-shadow: 0 0 0 1px rgb(23 33 30 / 0.22);
  pointer-events: none;
}
.grip {
  position: absolute; top: 50%; left: 50%; width: 40px; height: 56px; margin: -28px 0 0 -20px;
  border-radius: var(--r); background: var(--paper);
  box-shadow: 0 4px 14px rgb(23 33 30 / 0.32);
}
.grip::before, .grip::after {
  content: ""; position: absolute; top: 19px; width: 2px; height: 18px; border-radius: 1px; background: var(--ink);
}
.grip::before { left: 15px; }
.grip::after { right: 15px; }
.compare input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; touch-action: pan-y;
}
.compare:has(input:focus-visible) .grip { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.compare-labels {
  display: flex; justify-content: space-between; margin-top: 10px;
  color: var(--ink-2); font-size: 0.875rem; font-weight: 620;
}

.case-specs { grid-template-columns: 1fr 1.5fr 1fr 2.5fr; gap: 24px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
[data-combo="a"] .case-specs.c-a, [data-combo="b"] .case-specs.c-b, [data-combo="c"] .case-specs.c-c { display: grid; }
.case-specs dt { color: var(--ink-2); font-size: 0.8125rem; font-weight: 560; }
.case-specs dd { font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* 공정표 */
.gantt { --name: 11.5rem; }
.gantt-weeks { display: grid; grid-template-columns: repeat(4, 1fr); margin-left: var(--name); }
.gantt-weeks span {
  padding: 0 0 12px 10px; border-left: 1px solid var(--line);
  color: var(--ink-2); font-size: 0.8125rem; font-weight: 620;
}
.gantt-rows {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, var(--line) 1px, transparent 1px) var(--name) 0 / calc((100% - var(--name)) / 4) 100% repeat-x;
}
.gantt-rows li {
  display: grid; grid-template-columns: var(--name) repeat(20, minmax(0, 1fr));
  align-items: center; min-height: 54px;
}
.task { grid-column: 1; padding-right: 12px; font-size: 0.9688rem; font-weight: 640; letter-spacing: -0.01em; }
.bar {
  grid-column: calc(var(--s) + 1) / span var(--d);
  display: flex; align-items: center; height: 32px; padding-left: 10px;
  border-radius: var(--r); background: var(--ink); color: var(--paper);
  font-size: 0.8125rem; font-variant-numeric: tabular-nums;
}
.bar b { font-weight: 620; }
.when { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 자주 묻는 질문 */
.faq { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 48px; padding-bottom: clamp(72px, 8vw, 128px); }
.faq h2 { position: sticky; top: 96px; align-self: start; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative; padding: 22px 52px 22px 0; list-style: none; cursor: pointer;
  font-size: 1.125rem; font-weight: 680; letter-spacing: -0.015em; line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 16px; height: 2px; margin-top: -1px;
  background: var(--ink); transition: transform 0.3s var(--ease);
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq details p { max-width: 60ch; padding: 0 52px 26px 0; color: var(--ink-2); }

/* 견적 문의: 고른 조합의 색이 구획 전체를 채운다 */
main > .inquiry {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-block: clamp(64px, 7vw, 112px);
  background: var(--field); color: var(--on-field);
  transition: background-color 0.5s var(--ease), color 0.3s var(--ease);
}
.inquiry-side > p { margin-top: 16px; max-width: 34ch; color: var(--on-field-2); }
.picked { margin-top: 36px; }
[data-combo] .picked-name { font-size: 1.25rem; font-weight: 720; letter-spacing: -0.02em; }
.mini { display: flex; gap: 14px; margin-top: 14px; }
[data-combo="a"] .mini .c-a, [data-combo="b"] .mini .c-b, [data-combo="c"] .mini .c-c { display: block; }
.mini li { font-size: 0.8125rem; font-weight: 620; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.mini .swatch { width: 68px; height: 68px; min-height: 0; margin-bottom: 8px; border-radius: var(--r); box-shadow: var(--shadow); }

.form-card {
  padding: clamp(24px, 3vw, 40px); border-radius: var(--r);
  background: var(--paper); color: var(--ink);
  box-shadow: 0 14px 40px rgb(23 33 30 / 0.2);
}
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.choices legend, .field label { display: block; margin-bottom: 9px; padding: 0; font-size: 0.9375rem; font-weight: 680; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field-wide { grid-column: 1 / -1; }
.field input, .field textarea {
  display: block; width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid var(--edge); border-radius: var(--r);
  background: #fff; color: var(--ink);
  font: inherit; font-size: 1rem; line-height: 1.5;
}
.field textarea { resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--ink); }
.field input:focus-visible, .field textarea:focus-visible {
  border-color: var(--cobalt); outline: 2px solid var(--cobalt); outline-offset: 1px;
}
.field [aria-invalid="true"] { border-color: var(--danger); }
.optional { margin-left: 4px; color: var(--ink-2); font-size: 0.8125rem; font-weight: 540; }
.hint { margin-top: 7px; color: var(--ink-2); font-size: 0.8438rem; line-height: 1.5; }
.error { margin-top: 7px; color: var(--danger); font-size: 0.875rem; font-weight: 620; line-height: 1.5; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.form-foot .hint { margin: 0; }

.done > p { margin-top: 10px; color: var(--ink-2); }
.done dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 24px 0 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.done dt { color: var(--ink-2); font-size: 0.9375rem; }
.done dd { font-weight: 680; }
.done:focus { outline: none; }

/* 바닥글 */
.foot {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 4fr) minmax(0, 5fr); gap: 32px;
  padding: 48px max(var(--pad), calc((100% - var(--maxw)) / 2)) 64px;
  color: var(--ink-2); font-size: 0.9063rem; line-height: 1.6;
}
.foot .brand { color: var(--ink); }
.foot address { font-style: normal; }

/* 좁은 화면 */
@media (max-width: 1000px) {
  .board { grid-template-columns: 1fr; }
  .room-frame { height: auto; aspect-ratio: 16 / 10; }
  .chips { grid-template-columns: repeat(4, 1fr); }
  .faq { grid-template-columns: 1fr; gap: 28px; }
  .faq h2 { position: static; }
  main > .inquiry { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr 1fr; }
  .foot .disclaimer { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .nav nav { display: none; }
  .nav .btn { margin-left: auto; }
}

@media (max-width: 760px) {
  .hero-head { flex-direction: column; align-items: stretch; gap: 22px; }
  .tabs span { padding: 0 14px; }
  .chips { grid-template-columns: 1fr 1fr; }
  .compare { aspect-ratio: 4 / 3; }
  .case-specs { grid-template-columns: 1fr 1fr; }
  .case-specs div:last-child { grid-column: 1 / -1; }

  /* 공정표는 막대 대신 목록으로 읽는다 */
  .gantt-weeks { display: none; }
  .gantt-rows { background: none; }
  .gantt-rows li { grid-template-columns: 1fr auto; min-height: 0; padding: 14px 0; border-top: 1px solid var(--line); }
  .bar { display: none; }
  .when {
    position: static; width: auto; height: auto; overflow: visible; clip: auto;
    grid-column: 2; color: var(--ink-2); font-size: 0.875rem; font-variant-numeric: tabular-nums;
  }
}

@media (max-width: 560px) {
  .board { padding: 14px; gap: 14px; }
  .tabs { gap: 3px; }
  .tabs label { flex: 1; }
  .tabs span { justify-content: center; padding: 0 6px; font-size: 0.875rem; }
  .specs { grid-template-columns: 1fr 1.7fr 1fr; gap: 10px; }
  .fields { grid-template-columns: 1fr; }
  .mini { gap: 10px; }
  .mini .swatch { width: 60px; height: 60px; }
  .foot { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
