/* klarwerk 홈페이지 */
:root {
  --bg: #F5F5F4;
  --paper: #FFFFFF;
  --surface: #EBEBE9;
  --line: #DADAD7;
  --line-soft: #E6E6E3;
  --ink: #191B20;
  --ink-soft: #4B4F58;
  --ink-faint: #6B7079;
  --on-ink: #FAFAFA;
  --accent: #E5602A;
  --accent-ink: #B8491D;
  --accent-tint: #FCEDE6;
  --danger: #DC2626;
  --r: 10px;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", serif;
  --sans: "Pretendard Variable", Pretendard, -apple-system, system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  --header-h: 64px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --shadow-card: 0 1px 2px rgba(25, 27, 32, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-snap-type: y proximity; }
/* 넓고 충분히 높은 화면에서만 섹션 단위로 딱딱 넘김(탭 이동 느낌) */
@media (min-width: 1024px) and (min-height: 760px) { html { scroll-snap-type: y mandatory; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all; overflow-wrap: break-word;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
a, button, select, label { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 30;
  padding: 10px 14px; border-radius: var(--r);
  background: var(--ink); color: var(--on-ink); font-size: 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ───────── 워드마크(소문자 명조 + 주황 점) ───────── */
.wm {
  position: relative; display: inline-block;
  font-family: var(--serif); font-weight: 600; line-height: 1;
  color: var(--ink); text-decoration: none;
}
.wm-text { display: inline-block; line-height: 1; letter-spacing: 0; }
.wm-dot {
  position: absolute; left: 0; top: 0;
  border-radius: 50%; background: var(--accent);
  opacity: 0; transition: opacity .4s var(--ease);
  will-change: transform; pointer-events: none;
}
.wm.is-ready .wm-dot { opacity: 1; }

/* ───────── 헤더 · 스크롤 탭 ───────── */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 20;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line-soft); }
.wm--head {
  font-size: 24px; padding-top: 8px;
  transition: opacity .35s var(--ease), visibility 0s linear 0s;
}
.hero-in .wm--head { opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility 0s linear .35s; }

.tabs { position: relative; display: flex; gap: 28px; margin-left: auto; }
.tabs a {
  padding: 10px 0; font-size: 14px; font-weight: 500; line-height: 1.2;
  color: var(--ink-faint); text-decoration: none; transition: color .25s;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); }
.tabs-bar {
  position: absolute; left: 0; bottom: 2px; width: 1px; height: 2px;
  background: var(--accent); transform-origin: left center;
  transform: translateX(0) scaleX(0);
  transition: transform .55s var(--ease);
}
.now { display: none; font-size: 14px; font-weight: 500; color: var(--ink-soft); margin-left: auto; }
@media (max-width: 767px) {
  .tabs { display: none; }
  .now { display: block; }
}

/* ───────── 섹션 공통 ───────── */
.panel {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  scroll-snap-align: start;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--header-h) + clamp(24px, 5vh, 56px)) var(--gutter) clamp(32px, 6vh, 64px);
}
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; }
.sec-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(28px, 3.4vw, 40px); line-height: 1.3; letter-spacing: -.01em;
  text-wrap: balance;
}

.reveal { transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js .panel:not(.is-seen) .reveal { opacity: 0; transform: translateY(18px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border: 0; border-radius: var(--r);
  background: var(--ink); color: var(--on-ink);
  font: 600 15px/1.2 var(--sans); text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .2s, transform .15s;
}
.btn:hover { background: #2C2F36; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--light:hover { background: var(--surface); }

.ghost {
  border: 0; background: transparent; border-radius: var(--r);
  padding: 10px 12px; font: 500 14px/1.2 var(--sans); color: var(--ink-soft);
  cursor: pointer; transition: background-color .2s, color .2s;
}
.ghost:hover { background: var(--surface); color: var(--ink); }

/* ───────── About ───────── */
.hero .wrap { display: flex; flex-direction: column; gap: clamp(24px, 5vh, 48px); }
.hero-mark { line-height: 0; }
.hero-visual {
  width: 100%; height: auto; aspect-ratio: 21 / 9; max-height: 52vh;
  object-fit: cover; border-radius: var(--r); background: var(--surface);
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 64px; align-items: end;
  padding-top: 28px; border-top: 1px solid var(--line);
}
.etym { font-family: var(--serif); font-weight: 500; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.3; }
.etym .plus { color: var(--accent); margin: 0 .35em; }
.etym .gloss { margin-left: .12em; color: var(--ink-faint); }
.lede { margin-top: 12px; max-width: 34em; color: var(--ink-soft); }
.hero-cta { justify-self: end; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.tagline { font-family: var(--serif); font-weight: 600; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.45; text-wrap: balance; }
@media (max-width: 767px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-cta { justify-self: start; }
}

/* ───────── Portfolio: 2열 같은 크기 카드 + 아이콘(검은 선·주황 채움) ───────── */
.sec-head { margin-bottom: 24px; }
.works { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.work {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 18px; align-items: start;
  padding: 20px 24px; border-radius: var(--r);
  background: var(--paper); box-shadow: var(--shadow-card);
}
.work h3 { font-size: 19px; font-weight: 600; line-height: 1.35; }
.work p { margin-top: 6px; font-size: 15px; line-height: 1.65; color: var(--ink-soft); }
.ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r); background: var(--surface); color: var(--ink); }
.ico svg { width: 28px; height: 28px; }
.ico svg path[opacity] { fill: var(--accent); opacity: 1; }
.work--cta { grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; background: var(--ink); color: var(--on-ink); box-shadow: none; }
.work--cta p { color: rgba(250, 250, 250, .78); }
.work--cta .ico { background: rgba(250, 250, 250, .1); color: var(--on-ink); }
@media (max-width: 767px) { .works { grid-template-columns: 1fr; } }
@media (max-width: 479px) {
  .work { grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 18px; }
  .ico { width: 40px; height: 40px; }
  .ico svg { width: 24px; height: 24px; }
  .work--cta { grid-template-columns: 40px minmax(0, 1fr); }
  .work--cta .btn { grid-column: 2; justify-self: start; }
}

/* ───────── Project Flow ───────── */
.flow-wrap { position: relative; margin-top: clamp(40px, 8vh, 88px); }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0 16px; }
.step {
  position: relative; padding-top: 36px;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  transition-delay: calc(var(--i, 0) * 120ms + 200ms);
}
.step::before {
  content: ""; position: absolute; left: 0; top: 0; z-index: 1;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--ink-faint);
}
.step h3 { font-size: 17px; font-weight: 600; line-height: 1.35; }
.step p { margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
.step--key::before { left: -2px; top: -2px; width: 16px; height: 16px; background: var(--accent); border-color: var(--accent); }
.step--key .key { margin-top: 10px; font-family: var(--serif); font-size: 17px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.step--key strong { color: var(--accent-ink); font-weight: 600; }
/* 첫 점 중심(6px) ~ 마지막 칸 점 중심 */
.flow-line, .flow-runner { position: absolute; left: 6px; right: calc((100% - 96px) / 7 - 6px); }
.flow-line { top: 5.25px; height: 1.5px; background: var(--line); }
.flow-line i { position: absolute; inset: 0; background: var(--ink); transform-origin: left center; transition: transform 1.8s var(--ease) .2s; }
.flow-runner { top: 0; height: 12px; z-index: 2; pointer-events: none; transition: transform 1.8s var(--ease) .2s; }
.flow-runner b { position: absolute; right: -6px; top: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.js .flow-wrap:not(.is-in) .flow-line i { transform: scaleX(0); }
.js .flow-wrap:not(.is-in) .flow-runner { transform: translateX(-100%); }
.js .flow-wrap:not(.is-in) .step { opacity: 0; transform: translateY(10px); }

@media (max-width: 899px) {
  .flow { grid-template-columns: 1fr; gap: 28px; }
  .step { padding: 0 0 0 32px; }
  .step::before { top: 5px; }
  .step--key::before { top: 3px; }
  .step:not(:last-child)::after {
    content: ""; position: absolute; left: 5.25px; top: 22px; bottom: -24px;
    width: 1.5px; background: var(--line);
  }
  .flow-line, .flow-runner { display: none; }
}

/* ───────── 견적 문의 ───────── */
.inq { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px 64px; align-items: start; }
.inq-lede { margin-top: 16px; max-width: 26em; color: var(--ink-soft); }
.inq-alt { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-soft); }
.inq-alt a {
  display: inline-block; margin-top: 4px; font-size: 16px; font-weight: 600; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
.form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px;
  padding: clamp(20px, 3vw, 28px); border-radius: var(--r);
  background: var(--paper); box-shadow: var(--shadow-card);
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field > label { font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--ink-soft); }
.opt { margin-left: 4px; font-weight: 400; color: var(--ink-faint); }
.form input:not([type="checkbox"]), .form select, .form textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: 400 15px/1.4 var(--sans); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .2s;
}
.form select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%236B7079' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.form textarea { min-height: 112px; resize: vertical; }
.form ::placeholder { color: var(--ink-faint); opacity: 1; }
.form :is(input, select, textarea):hover { border-color: #C4C4C0; }
.form :is(input, select, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); border-radius: var(--r); }
.form [aria-invalid="true"] { border-color: var(--danger); }
.err { font-size: 13px; line-height: 1.4; color: var(--danger); }
.err:empty { display: none; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); }
.check small { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-faint); }
.form-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 4px; }
.form-status { margin-right: auto; font-size: 14px; color: var(--danger); }
.form-status:empty { display: none; }
.form-status a { color: inherit; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.form-done { padding: 40px 32px; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow-card); }
.form-done:focus { outline: none; }
.form-done h3 { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.3; }
.form-done p { margin-top: 8px; color: var(--ink-soft); }
@media (max-width: 899px) { .inq { grid-template-columns: 1fr; } }
@media (max-width: 599px) { .form { grid-template-columns: 1fr; } }

/* ───────── Contact 제목 · 푸터 ───────── */
.sec-title--tag { font-size: clamp(26px, 2.8vw, 36px); line-height: 1.4; }
.site-foot { scroll-snap-align: end; padding: 0 var(--gutter) 32px; }
.foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); }
.wm--foot { font-size: 28px; padding-top: 10px; }
.foot small { font-size: 13px; color: var(--ink-faint); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .step, .flow-line i, .flow-runner, .tabs-bar { transition: none; }
  .js .panel:not(.is-seen) .reveal, .js .flow-wrap:not(.is-in) .step { opacity: 1; transform: none; }
  .js .flow-wrap:not(.is-in) .flow-line i, .js .flow-wrap:not(.is-in) .flow-runner { transform: none; }
  ::view-transition-group(*) { animation: none; }
}
