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

/* 스크롤하면 떠오르기 (motion.js가 .on 을 붙임) */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s 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%); }

/* 크게 보기 창 */
/* 창 자체를 화면 전체로 두고, 사진은 그 안에서 비율 그대로 최대한 크게 (vh 대신 % 사용 → 휴대폰 주소창에 가려 잘리지 않음) */
.zoom-dlg { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 56px 64px 64px; border: 0; background: rgba(16,18,20,.97); box-sizing: border-box; }
.zoom-dlg[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.zoom-dlg::backdrop { background: transparent; }
.zoom-dlg img { display: block; max-width: 100%; max-height: 100%; min-height: 0; width: auto; height: auto; object-fit: contain; border-radius: 10px; }
.zoom-dlg .cap { color: rgba(255,255,255,.75); font-size: 13px; margin-top: 12px; text-align: center; }
.zoom-dlg .x { outline: none; position: absolute; top: 12px; right: 18px; color: #fff; font-size: 28px; background: none; border: 0; cursor: pointer; }
.zoom-dlg .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 32px; line-height: 44px; border: 0; cursor: pointer; }
.zoom-dlg .nav:hover { background: rgba(255,255,255,.3); }
.zoom-dlg .prev { left: 10px; } .zoom-dlg .next { right: 10px; }
@media (max-width: 640px) { .zoom-dlg { padding: 52px 8px 56px; } .zoom-dlg .nav { top: auto; bottom: 10px; transform: none; } }

/* 스크롤 시 고정 메뉴 그림자 */
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; }
}
