/* 세 페이지(홈 · 포트폴리오 · 소개)가 함께 쓰는 움직임 효과
   레퍼런스(studiofnt)처럼: 사진은 아래에서 위로 걷히며 나타나고, 제목은 줄마다 밀려 올라옴 */
:root { --fx-ease: cubic-bezier(.19, 1, .22, 1); }
html { scroll-behavior: smooth; }

/* 1. 사진: 막이 아래에서 위로 걷히고, 안의 사진은 살짝 크게 있다가 제자리로 */
.fx .fx-img { clip-path: inset(100% 0 0 0); transition: clip-path 1.3s var(--fx-ease); transition-delay: var(--d, 0s); }
.fx .fx-img img { scale: 1.18; transition: scale 1.8s var(--fx-ease), transform 1.2s cubic-bezier(.22,.61,.21,1), opacity .5s ease, filter .5s ease; transition-delay: var(--d, 0s), 0s, 0s, 0s; }
.fx .fx-img.fx-in { clip-path: inset(0 0 0 0); }
.fx .fx-img.fx-in img { scale: 1; }

/* 2. 제목: 줄마다 아래에서 밀려 올라옴 */
.ln { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.ln > span { display: inline-block; }
.fx .fx-head .ln > span { translate: 0 110%; transition: translate 1.1s var(--fx-ease); transition-delay: calc(var(--l, 0) * .12s); }
.fx .fx-head.fx-in .ln > span { translate: 0 0; }

/* 3. 작은 이름표 · 설명 글: 살짝 떠오름 */
.fx .fx-up { opacity: 0; translate: 0 18px; transition: opacity 1s ease, translate 1.1s var(--fx-ease); transition-delay: var(--d, 0s); }
.fx .fx-up.fx-in { opacity: 1; translate: 0 0; }

/* 4. 큰 사진은 스크롤보다 조금 느리게 움직여 깊이감 (패럴랙스, parallax) */
.fx .px img { scale: 1.32; }
.fx .px.fx-in img { scale: 1.16; }
.px img { translate: 0 var(--py, 0px); will-change: translate; }

/* 5. 메뉴 글자: 밑줄이 왼쪽에서 그어짐 */
.menu a:not([aria-label]) {
  text-decoration: none !important;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 3px; transition: background-size .45s var(--fx-ease), opacity .3s;
}
.menu a:not([aria-label]):hover, .menu a[aria-current="page"] { background-size: 100% 1px; }

/* 6. 상담 버튼: 색이 왼쪽에서 차오름 */
.consult { position: relative; overflow: hidden; isolation: isolate; }
.consult::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fill, #2e2a25);
  transform: scaleX(0); transform-origin: right; transition: transform .55s var(--fx-ease);
}
.consult:hover { background: transparent !important; }
.consult:hover::before { transform: scaleX(1); transform-origin: left; }
/* 어두운 바탕 위 버튼은 밝은 색으로 차오름 */
.flow .consult, .contact .consult, .ask .consult { --fill: #ece7df; }

/* 7. 첫 화면: 보이는 작품은 천천히 다가오고(켄 번스, Ken Burns), 넘김 막대는 시간만큼 차오름 */
.slide img { scale: 1; transition: scale 0s .8s; }
.slide.on img { scale: 1.07; transition: scale 6s linear; }
.dots button { position: relative; overflow: hidden; }
.dots button[aria-current="true"] { background: rgba(255,255,255,.4) !important; }
.dots button::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: left; }
.dots button[aria-current="true"]::after { animation: fx-fill 3.5s linear forwards; }
@keyframes fx-fill { to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fx .fx-img, .fx .fx-head .ln > span, .fx .fx-up { clip-path: none; translate: none; opacity: 1; transition: none; }
  .fx .fx-img img, .slide img, .slide.on img { scale: 1; transition: none; }
  .px img { translate: none; }
  .dots button[aria-current="true"]::after { animation: none; transform: scaleX(1); }
}
