/* Wooks AI 대문 — 글자를 지형처럼 다루는 페이지.
   글꼴 Mona Sans 의 폭(wdth 75~125)·굵기(wght 200~900) 축을 숫자 변수(--wd, --wg)로 움직여
   첫 화면·장 제목·바닥 글자가 모두 같은 '글자 지형' 문법으로 움직인다. */

@property --wd { syntax: '<number>'; inherits: true; initial-value: 100; }
@property --wg { syntax: '<number>'; inherits: true; initial-value: 400; }

:root {
  --basalt: #1B201E;   /* 글자·어두운 바탕 */
  --scree: #6F7671;    /* 보조 글자 */
  --flour: #E3E6E1;    /* 빙하 가루빛 바탕 */
  --rule: #C3C8C2;     /* 구분선 */
  --snow: #F6F7F4;     /* 사진 위 글자 */
  --melt: #57C2CF;     /* 빙하 녹은 물빛: 스캔선·초점 표시에만 */
  --melt-deep: #1E7C88;/* 밝은 바탕 위 초점 밑줄(대비 확보용) */
  --iron: #A23F2A;     /* 입력 오류 */
  --display: 'Mona Sans', 'IBM Plex Sans KR', system-ui, sans-serif;
  --text: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --gut: clamp(18px, 3.2vw, 48px);
  --ease-out: cubic-bezier(.16, .84, .12, 1);
  --ease-io: cubic-bezier(.72, 0, .18, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--flour); color: var(--basalt); font: 400 17px/1.75 var(--text); word-break: keep-all; overflow-x: clip; }
body.is-intro { overflow: hidden; }
img { display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--melt); outline-offset: 4px; }

/* 글자 낱자: 축 값은 변수로 */
.ch { display: inline-block; font-variation-settings: 'wdth' var(--wd), 'wght' var(--wg); will-change: transform; }
.w { display: inline-block; white-space: nowrap; }

/* ───────── 첫 화면 ───────── */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; color: var(--snow); background: var(--basalt); isolation: isolate; }
.hero-photo, .hero-photo img, .hero-veil, .stage { position: absolute; inset: 0; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hp-gray { filter: grayscale(1) contrast(1.08) brightness(.82); }
.hp-color { clip-path: inset(0 0 0 0); }
.is-intro .hp-color { clip-path: inset(0 0 100% 0); }
.hp-scan { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--melt); box-shadow: 0 0 18px 2px rgba(87, 194, 207, .65); opacity: 0; }

.hero-veil { background:
  linear-gradient(to bottom, rgba(27, 32, 30, .55), rgba(27, 32, 30, 0) 22%),
  linear-gradient(to top, rgba(27, 32, 30, .72), rgba(27, 32, 30, .08) 58%);
  transition: background-color 1.6s var(--ease-io); }
.is-intro .hero-veil { background-color: rgba(22, 26, 24, .9); }

/* 인트로 막(幕) */
.stage { pointer-events: none; }
.act { position: absolute; left: var(--gut); right: var(--gut); top: 50%; margin: 0; transform: translateY(-52%);
  font-family: var(--display); line-height: .84; letter-spacing: -.02em; visibility: hidden; }
.is-intro .act { visibility: visible; }
.act .ln { display: block; overflow: hidden; padding: .18em 0 .12em; margin-top: -.16em; white-space: nowrap; }
.act1 { font-size: clamp(60px, 12.4vw, 230px); }
.act1 .ln:nth-child(1) { --wg: 300; }
.act1 .ln:nth-child(2) { padding-left: 1.35em; --wg: 520; }
.act1 .ln:nth-child(3) { --wg: 820; }
.act1 .ln:nth-child(3) { text-align: right; }
.act1 .ch { transform: translateY(150%); }
.act2 { font-size: clamp(52px, 10.6vw, 200px); --wd: 112; --wg: 760; }
.act2 .ln:nth-child(2) { text-align: right; }
.act2 .ch { transform: translateY(150%); }

/* 완성 화면: 큰 이름 + 두 줄 문구 */
.hero-type { position: absolute; left: var(--gut); right: var(--gut); bottom: clamp(46px, 7.5vh, 84px); }
.hero-motto { display: flex; justify-content: space-between; gap: 24px; margin: 0 0 1.1vh;
  font: 500 clamp(14px, 1.35vw, 20px)/1.2 var(--display); font-variation-settings: 'wdth' 100, 'wght' 540; letter-spacing: 0; }
.mark { margin: 0; font-family: var(--display); font-size: 20vw; line-height: .8; white-space: nowrap; letter-spacing: -.025em; --wd: 125; --wg: 760;
  clip-path: inset(-40% -10% -6% -10%); padding-bottom: .02em; }
.mark .ch { transform-origin: 50% 100%; }
.is-intro .hero-motto, .is-intro .top { opacity: 0; }
.is-intro .mark .ch { transform: translateY(115%); }
.hero-motto, .top { transition: opacity .9s var(--ease-out) .2s; }

.place { margin: 0; font: 500 13px/1 var(--display); font-variation-settings: 'wdth' 100, 'wght' 520; letter-spacing: .01em; color: var(--snow); white-space: nowrap; }
.place .ch { font-variation-settings: inherit; }
.hero-place { position: absolute; right: var(--gut); bottom: 18px; opacity: .92; }
.skip { position: absolute; left: var(--gut); bottom: 14px; z-index: 3; padding: 8px 0; border: 0; background: none; color: var(--snow); opacity: .72;
  font: 500 13px/1 var(--text); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.skip:hover { opacity: 1; }
body:not(.is-intro) .skip { display: none; }

/* ───────── 위쪽 메뉴(사진·바탕 위에서 모두 읽히도록 차이 혼합) ───────── */
.top { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--gut); color: #fff; mix-blend-mode: difference; font: 500 15px/1 var(--display); font-variation-settings: 'wdth' 100, 'wght' 560; }
.top a { text-decoration: none; }
.top a:hover { text-decoration: underline; text-underline-offset: 5px; }
.top-mark { font-variation-settings: 'wdth' 125, 'wght' 800; font-size: 17px; }
.top ul { display: flex; gap: clamp(14px, 2.4vw, 34px); margin: 0; padding: 0; list-style: none; }
.top li.open > a { text-decoration: underline; text-underline-offset: 5px; }

/* 위 메뉴 펼침 목록(nav.js): 어두운 판이 위에서 아래로 펼쳐지고, 고른 줄은 글자가 넓어진다 */
.menu-panel { position: fixed; z-index: 21; min-width: 300px; max-width: calc(100vw - 24px); background: var(--basalt); color: var(--snow);
  visibility: hidden; clip-path: inset(0 0 100% 0); transition: clip-path .32s var(--ease-out), visibility 0s linear .32s; }
.menu-panel.on { visibility: visible; clip-path: inset(0 0 -2px 0); transition: clip-path .38s var(--ease-out); }
.menu-panel ul { margin: 0; padding: 6px 0; list-style: none; }
.menu-panel li + li { border-top: 1px solid rgba(246, 247, 244, .14); }
.menu-panel a { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 15px 22px 16px; text-decoration: none; }
.mp-name { font: 400 19px/1.15 var(--display); --wd: 104; --wg: 640; font-variation-settings: 'wdth' var(--wd), 'wght' var(--wg);
  transition: --wd .3s var(--ease-out), --wg .3s var(--ease-out); white-space: nowrap; }
.menu-panel a:hover .mp-name, .menu-panel a:focus-visible .mp-name { --wd: 125; --wg: 780; }
.mp-note { font: 500 12px/1 var(--display); font-variation-settings: 'wdth' 100, 'wght' 520; color: #9BA29D; white-space: nowrap; }
.menu-panel :focus-visible { outline-offset: -4px; }

/* ───────── 두 단: 왼쪽 사진, 오른쪽 글 ───────── */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); position: relative; }
.pane { position: relative; }
.pane-stack { position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--basalt); }
.pf { position: absolute; inset: 0; margin: 0; overflow: hidden; clip-path: inset(100% 0 0 0); transition: clip-path 1.15s var(--ease-io); }
.pf.on { clip-path: inset(0 0 0 0); }
.pf img { position: absolute; left: 0; top: -6%; width: 100%; height: 112%; object-fit: cover;
  transform: translate3d(0, var(--py, 0px), 0) scale(var(--sc, 1.14)); transition: transform 1.6s var(--ease-out); }
.pf.on img { --sc: 1; }
.pf .place, .chap-photo .place { position: absolute; right: 20px; bottom: 18px; z-index: 2; text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
.pf .place .ch, .chap-photo .place .ch { transform: translateY(120%); opacity: 0; transition: transform .7s var(--ease-out), opacity .4s; transition-delay: calc(.45s + var(--i) * 18ms); }
.pf .place, .chap-photo .place { overflow: hidden; padding-top: 2px; }
.pf.on .place .ch, .chap-photo.on .place .ch { transform: none; opacity: 1; }
.pf::after, .chap-photo::after { content: ''; position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(to top, rgba(20, 24, 22, .45), transparent); pointer-events: none; }

.flow { min-width: 0; }
.chap { min-height: 100svh; display: flex; align-items: center; padding: 16vh clamp(24px, 5.5vw, 96px); position: relative; }
.chap + .chap { border-top: 1px solid var(--rule); }
.chap-in { width: 100%; max-width: 36rem; }
.chap-photo { display: none; }
.chap-h { margin: 0 0 .62em; font-family: var(--display); font-weight: 400; font-size: clamp(50px, 6.4vw, 118px); line-height: .88; letter-spacing: -.025em; --wd: 75; --wg: 220; }
.chap-h .ch { transform-origin: 0 100%; }

.chap-body p { margin: 0 0 1em; }
.chap-body .lead { font: 400 clamp(19px, 1.55vw, 23px)/1.55 var(--display); font-variation-settings: 'wdth' 100, 'wght' 430; letter-spacing: -.005em; text-wrap: pretty; }
.svc { margin-top: 40px !important; }
.chap-body .more { margin-top: 30px; }
.more a { display: inline-block; padding-bottom: 6px; border-bottom: 1px solid var(--basalt); text-decoration: none;
  font: 400 20px/1 var(--display); --wd: 108; --wg: 680; font-variation-settings: 'wdth' var(--wd), 'wght' var(--wg); transition: --wd .35s var(--ease-out), --wg .35s var(--ease-out); }
.more a:hover, .more a:focus-visible { --wd: 125; --wg: 800; }
.chap-body > *, .svc > li, .mail { clip-path: inset(0 0 100% 0); transform: translateY(.9em); transition: clip-path .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: calc(.25s + var(--n, 0) * 90ms); }
.chap.in .chap-body > *, .chap.in .svc > li, .chap.in .mail { clip-path: inset(0 0 -10% 0); transform: none; }

/* 서비스 목록 */
.svc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--basalt); }
.svc > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.svc-name { margin: 0; font: 400 clamp(28px, 2.6vw, 40px)/1 var(--display); font-variation-settings: 'wdth' 112, 'wght' 720; }
.svc-name a { text-decoration: none; }
.svc-name a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.svc-desc { grid-column: 1 / -1; margin: 0; color: var(--basalt); max-width: 32em; }
.svc-state { align-self: center; font: 500 14px/1 var(--text); color: var(--scree); }
.svc > li.svc-empty { display: block; color: var(--scree); }
.mail { margin: 28px 0 0; font: 400 clamp(22px, 2.2vw, 30px)/1.2 var(--display); font-variation-settings: 'wdth' 96, 'wght' 560; }

/* 문의 양식: 밑줄만 있는 입력칸, 주제는 고르는 칸, 보내기 단추는 글자가 넓어진다 */
.enq { margin-top: 48px; clip-path: inset(0 0 100% 0); transform: translateY(.9em); transition: clip-path .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: .45s; }
.chap.in .enq { clip-path: inset(-16px); transform: none; }
.enq fieldset { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 30px; padding: 0; border: 0; }
.enq legend, .fld-l { display: block; padding: 0; font: 500 14px/1.3 var(--display); font-variation-settings: 'wdth' 100, 'wght' 560; color: var(--scree); }
.enq legend { width: 100%; margin-bottom: 12px; }
.fld-l i { margin-left: 6px; font-style: normal; font-variation-settings: 'wdth' 100, 'wght' 400; color: #858B86; }
.enq-topic label { position: relative; cursor: pointer; }
.enq-topic input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.enq-topic span { display: block; padding: 10px 16px 11px; border: 1px solid var(--rule); font: 500 15px/1 var(--display); font-variation-settings: 'wdth' 100, 'wght' 520;
  transition: background-color .2s, color .2s, border-color .2s; }
.enq-topic label:hover span { border-color: var(--basalt); }
.enq-topic input:checked + span { background: var(--basalt); border-color: var(--basalt); color: var(--snow); }
.enq-topic input:focus-visible + span { outline: 2px solid var(--melt-deep); outline-offset: 3px; }
.enq-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; }
.fld { display: block; margin: 0 0 22px; }
.fld input, .fld textarea { display: block; width: 100%; margin: 0; padding: 8px 0 10px; border: 0; border-bottom: 1px solid var(--basalt); border-radius: 0;
  background: transparent; color: var(--basalt); font: 400 18px/1.5 var(--text); outline: none; transition: box-shadow .2s, border-color .2s; }
.fld textarea { min-height: 9.5em; resize: vertical; }
.fld input:focus, .fld textarea:focus { border-bottom-color: var(--melt-deep); box-shadow: 0 1px 0 var(--melt-deep); }
.fld[data-bad] input, .fld[data-bad] textarea { border-bottom-color: var(--iron); box-shadow: 0 1px 0 var(--iron); }
.fld-err { display: block; margin-top: 7px; font: 500 14px/1.4 var(--text); color: var(--iron); }
.enq-reach { margin: -8px 0 26px; font: 400 14px/1.5 var(--text); color: var(--scree); }
.enq-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.enq-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 8px; }
.enq-send { padding: 18px 30px 19px; border: 0; border-radius: 0; background: var(--basalt); color: var(--snow); cursor: pointer;
  font: 500 17px/1 var(--display); --wd: 108; --wg: 640; font-variation-settings: 'wdth' var(--wd), 'wght' var(--wg); transition: --wd .35s var(--ease-out), --wg .35s var(--ease-out); }
.enq-send:hover, .enq-send:focus-visible { --wd: 125; --wg: 780; }
.enq-send:disabled { opacity: .55; cursor: progress; }
.enq-status { flex: 1 1 16rem; margin: 0; font: 400 15px/1.5 var(--text); color: var(--scree); }
.enq-status.ok { color: var(--basalt); }
.enq-status.bad { color: var(--iron); }
.enq-status button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
@media (max-width: 560px) { .enq-grid { grid-template-columns: minmax(0, 1fr); } }

/* ───────── 바닥 ───────── */
.foot { background: var(--basalt); color: var(--flour); padding: 12vh var(--gut) 28px; overflow: hidden; }
.foot-mark { margin: 0 0 6vh; font-family: var(--display); font-size: 20vw; line-height: .8; white-space: nowrap; letter-spacing: -.025em;
  color: var(--flour); --wd: 75; --wg: 200; clip-path: inset(-30% -5% -6% -5%); }
.foot-mark .ch { transform: translateY(115%); transition: transform 1.1s var(--ease-out), --wd 1.3s var(--ease-out), --wg 1.3s var(--ease-out);
  transition-delay: calc(var(--i) * 70ms); }
.foot-mark.in .ch { transform: none; --wd: 125; --wg: 800; }
.measuring .ch { transition: none !important; }
.foot-meta { margin: 0; font: 500 13px/1.6 var(--display); color: #A9B0AA; }

/* ───────── 좁은 화면: 장마다 사진이 글 위로 ───────── */
@media (max-width: 860px) {
  .split { display: block; }
  .pane { display: none; }
  .chap { display: block; min-height: 0; padding: 0 0 14vh; }
  .chap + .chap { border-top: 0; }
  .chap-in { padding: 0 var(--gut); }
  .chap-photo { display: block; position: relative; height: 64svh; margin: 0 0 7vh; overflow: hidden; clip-path: inset(18% 0 0 0); transition: clip-path 1.1s var(--ease-io); }
  .chap-photo.on { clip-path: inset(0 0 0 0); }
  .chap-photo img { position: absolute; inset: -6% 0 auto; width: 100%; height: 112%; object-fit: cover; transform: translate3d(0, var(--py, 0px), 0) scale(var(--sc, 1.1)); transition: transform 1.5s var(--ease-out); }
  .chap-photo.on img { --sc: 1; }
  .act1 { font-size: 14.2vw; }
  .act2 { font-size: 12.4vw; }
  .act1 .ln:nth-child(2) { padding-left: .6em; }
  .hero-motto { flex-direction: column; gap: 4px; }
  .top ul { gap: 14px; font-size: 13px; }
  .top ul li:nth-child(3) a { font-size: 0; }
  .top ul li:nth-child(3) a::after { content: 'Contact'; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pf, .pf img, .chap-photo, .chap-photo img, .chap-body > *, .svc > li, .mail, .enq, .enq-send, .place .ch, .foot-mark .ch { transition: none !important; }
}
