/* =========================================================
   main-motion.css — 메인 페이지 모션 개선 (main.css 다음에 로드)
   - top/left 애니메이션 → transform/opacity (GPU 합성, 60fps)
   - 튕김(bounce)·떨림(shake) 키프레임 제거 → 부드러운 ease-out 등장
   - 등장 시 순차(stagger) 노출, 퇴장은 빠르게
   - prefers-reduced-motion 사용자 배려
   ========================================================= */

:root {
	--ease-out: cubic-bezier(0.22, 1, 0.36, 1);      /* easeOutQuint */
	--ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
	--reveal-dur: 1000ms;
}

/* 접근성: 화면에는 숨기고 스크린리더·크롤러는 읽는 텍스트 */
.sr-only {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

/* ---------- 섹션 컨테이너 ---------- */
.visual-wrapper {
	top: 0 !important;                 /* 이동은 transform으로 (wheel-contents.js) */
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

/* ---------- 공통 텍스트 등장 ---------- */
.visual-section .item-section span {
	opacity: 0;
	transform: translate3d(0, 0.6em, 0);
	transition-property: opacity, transform;
	transition-duration: 350ms;          /* 퇴장은 빠르게 */
	transition-timing-function: ease-in;
	transition-delay: 0ms !important;    /* 퇴장 시 지연 없음 */
}
.visual-section.on .item-section span {
	opacity: 1;
	transform: none;
	transition-duration: var(--reveal-dur);
	transition-timing-function: var(--ease-out);
}
/* 등장할 때만 trs-delay 지연 적용 */
.visual-section.on .trs-delay-100 { transition-delay: 100ms !important; }
.visual-section.on .trs-delay-200 { transition-delay: 200ms !important; }
.visual-section.on .trs-delay-300 { transition-delay: 300ms !important; }
.visual-section.on .trs-delay-400 { transition-delay: 400ms !important; }
.visual-section.on .trs-delay-500 { transition-delay: 500ms !important; }
.visual-section.on .trs-delay-600 { transition-delay: 600ms !important; }
.visual-section.on .trs-delay-700 { transition-delay: 700ms !important; }
.visual-section.on .trs-delay-800 { transition-delay: 800ms !important; }
.visual-section.on .trs-delay-900 { transition-delay: 900ms !important; }
.visual-section.on .trs-delay-1000 { transition-delay: 1000ms !important; }

/* 중첩 span(.dot 등)은 부모와 함께 움직이도록 */
.visual-section .item-section span span,
.visual-section.on .item-section span span {
	transform: none;
	opacity: 1;
	transition: none;
}

/* ---------- pg2 : creating a unique future ---------- */
.visual-section.pg2 .item-section span,
.visual-section.pg2.on .item-section span {
	top: 0;                               /* 100vh → 0 이동 제거 */
}
.visual-section.pg2 .item-section .desc1 > span,
.visual-section.pg2 .item-section .desc2 > span {
	transform: translate3d(0, 0.5em, 0);
	clip-path: inset(0 0 100% 0);         /* 아래에서 위로 마스크 리빌 */
	-webkit-clip-path: inset(0 0 100% 0);
	transition-property: opacity, transform, clip-path, -webkit-clip-path;
}
.visual-section.pg2.on .item-section .desc1 > span,
.visual-section.pg2.on .item-section .desc2 > span {
	animation: none !important;           /* bounce(pg2-left) 제거 */
	-webkit-animation: none !important;
	transform: none;
	clip-path: inset(-0.2em -0.2em -0.2em -0.2em);
	-webkit-clip-path: inset(-0.2em -0.2em -0.2em -0.2em);
}

/* ---------- pg3 : our moments (Instagram) ---------- */
.visual-section.pg3 .item-section .desc1 span,
.visual-section.on.pg3 .item-section .desc1 span {
	left: 0;
}
.visual-section.pg3 .item-section .desc1 > span {
	transform: translate3d(12%, 0, 0);
}
.visual-section.on.pg3 .item-section .desc1 > span {
	transform: none;
}

.visual-section.pg3 .item-section .image-list ul li,
.visual-section.pg3.on.ani-start .item-section .image-list ul li,
.visual-section.pg3.on.ani-end .item-section .image-list ul li {
	left: 0;
	animation: none !important;           /* insta-last 떨림 제거 */
	-webkit-animation: none !important;
}
.visual-section.pg3 .item-section .image-list ul li {
	opacity: 0;
	transform: translate3d(80px, 0, 0);
	transition: opacity 300ms ease-in, transform 300ms ease-in;
	transition-delay: 0ms !important;
}
.visual-section.pg3.on .item-section .image-list ul li {
	opacity: 1;
	transform: none;
	transition: opacity 900ms var(--ease-out), transform 1100ms var(--ease-out);
}
.visual-section.pg3.on .item-section .image-list ul li:nth-child(1) { transition-delay: 350ms !important; }
.visual-section.pg3.on .item-section .image-list ul li:nth-child(2) { transition-delay: 480ms !important; }
.visual-section.pg3.on .item-section .image-list ul li:nth-child(3) { transition-delay: 610ms !important; }
.visual-section.pg3.on .item-section .image-list ul li:nth-child(n+4) { transition-delay: 740ms !important; }

/* 호버: 즉각적이지만 부드럽게 */
.visual-section.pg3 .item-section .image-list ul li img {
	transition: transform 600ms var(--ease-out) !important;
	will-change: transform;
}
.visual-section.pg3.hover-ready .item-section .image-list ul li:hover img {
	transform: translate3d(0, -6rem, 0);
}

/* ---------- pg4 : 문의 ---------- */
.visual-section.pg4.on .item-section .desc1 span.question {
	animation: q-nod 900ms var(--ease-out) 1500ms 1 both;
	-webkit-animation: q-nod 900ms var(--ease-out) 1500ms 1 both;
}
@keyframes q-nod {
	0%   { transform: rotate(0); }
	35%  { transform: rotate(-8deg); }
	70%  { transform: rotate(3deg); }
	100% { transform: rotate(0); }
}
/* 링크 떨림(inquiry-link) → 밑줄이 그려지는 효과 */
.visual-section.pg4 .item-section .desc1 .link {
	border-bottom-color: transparent !important;
	background: linear-gradient(currentColor, currentColor) left bottom / 0 2px no-repeat;
	transition-property: opacity, transform, background-size;
}
.visual-section.pg4.on .item-section .desc1 .link {
	animation: none !important;
	-webkit-animation: none !important;
	background-size: 100% 2px;
	transition-duration: 1000ms, 1000ms, 800ms;
	transition-delay: 1000ms, 1000ms, 1700ms !important;
}
.visual-section.pg4.on .item-section .desc1 .link:hover {
	background-size: 0 2px;
	transition-duration: 400ms;
	transition-delay: 0ms !important;
}
@media (min-width: 768px) {
	.visual-section.pg4 > img {
		transform: translateX(-50%) scale(1.08);
		transition: transform 2400ms var(--ease-out);
	}
	.visual-section.pg4.on > img {
		transform: translateX(-50%) scale(1);
	}
}

/* ---------- 하단 링크 / 회사소개서 레이어 ---------- */
.visual-section .bottom-link a .mid-dot {
	transition: transform 400ms var(--ease-out);
}
.visual-section .bottom-link a:hover .mid-dot {
	transform: translateX(6px);
}
.manual-wrapper {
	transition: top 700ms var(--ease-in-out) !important;
}
.footer-wrapper {
	transition: transform 600ms var(--ease-out), opacity 600ms var(--ease-out);
}

/* ---------- 모바일 ---------- */
@media (max-width: 767px) {
	.visual-section .item-section span {
		transform: translate3d(0, 24px, 0);
	}
	.visual-section.pg3 .item-section .image-list ul li {
		transform: translate3d(0, 40px, 0);
	}
}

/* ---------- 모션 최소화 설정 사용자 ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 1ms !important;
		animation-delay: 0ms !important;
		transition-duration: 1ms !important;
		transition-delay: 0ms !important;
	}
}
