/* 공통 애니메이션 — 클래스만 붙이면 동작 */

/* 스크롤하면 떠오르기 (motion.js가 .on 을 붙임) */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.2,1); }
.reveal.on { opacity: 1; transform: none; }

/* 첫 화면: 자식 요소가 차례로 떠오르기 */
.hero-in > * { opacity: 0; animation: up .9s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-in > *:nth-child(1) { animation-delay: .1s; }
.hero-in > *:nth-child(2) { animation-delay: .25s; }
.hero-in > *:nth-child(3) { animation-delay: .4s; }
.hero-in > *:nth-child(4) { animation-delay: .55s; }
.hero-in > *:nth-child(5) { animation-delay: .7s; }
.hero-in > *:nth-child(6) { animation-delay: .85s; }
@keyframes up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* 옆에서 미끄러져 들어오기 */
.slide-in { animation: slide 1.2s cubic-bezier(.2,.7,.2,1) .3s both; }
@keyframes slide { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }

/* 둥실 떠 있기 */
.float { animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* 배경 사진 천천히 줌아웃 */
.kenburns { animation: kb 16s ease-out both; }
@keyframes kb { from { transform: scale(1.12); } to { transform: scale(1); } }

/* 그림 선 그리기 (.draw 안의 선이 화면에 들어오면 그려짐) */
.draw :is(path, line, ellipse, circle, rect):not([stroke-dasharray]) { stroke-dasharray: var(--len, 700); stroke-dashoffset: var(--len, 700); }
.draw.on :is(path, line, ellipse, circle, rect) { animation: draw 1.8s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* 옆으로 흐르는 태그 띠 */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee > div { display: flex; gap: .5rem; width: max-content; animation: mq 28s linear infinite; }
.marquee:hover > div { animation-play-state: paused; }
@keyframes mq { to { transform: translateX(-50%); } }

/* 마우스 올리면 떠오르기 / 사진 확대 */
.lift { transition: transform .3s ease, box-shadow .3s ease; }
.lift:hover { transform: translateY(-6px); box-shadow: 0 20px 40px -20px rgba(0,0,0,.28); }
.zoom { overflow: hidden; }
.zoom img { transition: transform .7s ease; }
.zoom:hover img { transform: scale(1.06); }

/* 사진 왼쪽 끝을 배경으로 자연스럽게 흐리기 */
.fade-left { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24%); mask-image: linear-gradient(to right, transparent 0, #000 24%); }
.fade-x { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24%, #000 80%, transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 24%, #000 80%, transparent 100%); }

/* 크게 보기 창 */
.zoom-dlg { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.zoom-dlg::backdrop { background: rgba(20,24,26,.85); }
.zoom-dlg img { display: block; max-width: 96vw; max-height: 90vh; border-radius: 12px; background: #fff; }
.zoom-dlg button { position: fixed; top: 14px; right: 18px; color: #fff; font-size: 28px; background: none; border: 0; cursor: pointer; }

/* 스크롤 시 고정 메뉴 그림자 */
header { transition: box-shadow .3s; }
header.scrolled { box-shadow: 0 6px 24px -12px rgba(0,0,0,.25); }

/* 움직임 줄이기 설정을 켠 사람에겐 정지 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .hero-in > * { opacity: 1; transform: none; }
  .draw :is(path, line, ellipse, circle, rect):not([stroke-dasharray]) { stroke-dashoffset: 0; }
}
