* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

/* ===========================
   메인 화면
   =========================== */

.hero {
  min-height: 100vh;
  padding: 35px 5%;
  text-align: center;
}

.museum {
  font-size: 11px;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(65px, 12vw, 180px);
  font-weight: 400;
  letter-spacing: -0.085em;
  line-height: 1.1;
  white-space: nowrap;
}

.hero-info {
  display: flex;
  justify-content: space-between;
  text-align: left;
  font-size: 11px;
  margin: 15px 0 75px;
}

.hero-info p:last-child {
  text-align: right;
}

.small-button {
  display: table;
  margin: 0 auto;
  padding: 9px 20px;
  border: 1px solid #999;
  background: white;
  color: #111;
  font-size: 11px;
  text-decoration: none;
  font-weight: 400;
}

/* 메인 작품 영역 */

.hero-art-container {
  position: relative;
  width: min(80%, 850px);
  margin: 40px auto 0;
  cursor: pointer;
}

.hero-art-container .hero-art {
  width: 100%;
  margin: 0;
  display: block;
}

/* 걷는 사람 */

.walking-person {
  position: absolute;
  left: 49%;
  top: 48%;
  width: 3%;
  height: auto;
  transform: translate(-50%, -50%);
  transform-origin: center bottom;
  pointer-events: none;
}

.walking-person.walking {
  animation: walkToHome 3s linear forwards;
}

@keyframes walkToHome {
  0% {
    left: 49%;
    top: 48%;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    left: 57%;
    top: 43%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 1;
  }
  85% {
    left: 65%;
    top: 37%;
    transform: translate(-50%, -50%) scale(0.75);
    opacity: 1;
  }
  100% {
    left: 67%;
    top: 35%;
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
  }
}

/* ===========================
   공간 줌인 인터랙션
   =========================== */

.space-section {
  width: 100%;
  padding: 100px 0 160px;
}

.space-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  cursor: zoom-in;
  background: white;
}

#spaceImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 0.45s ease,
    transform 0.7s ease,
    filter 0.45s ease;
}

#spaceImage.zooming {
  opacity: 0.35;
  transform: scale(1.12);
  filter: blur(3px);
}

.space-guide {
  position: absolute;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #555;
  pointer-events: none;
}

/* ===========================
   작가 소개 (Welcome to my home & house1 배치)
   =========================== */

.artist-section {
  position: relative;
  padding: 100px 0 160px;
  text-align: center;
}

.welcome-box {
  display: inline-block;
  border: 1px solid #111;
  padding: 10px 32px;
  font-size: 13px;
  letter-spacing: 0.04em;
  background: #fff;
  color: #111;
  margin: 0 auto 50px;
  font-weight: 400;
}

.artist-stage {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  min-height: 590px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

/* 좌측 액자 속 house1.png */
.house-frame {
  position: absolute;
  left: 4%;
  top: 0;
  width: 380px;
  border: 1px solid #111;
  background: #fff;
  padding: 24px 20px 28px;
  z-index: 1;
  box-sizing: border-box;
}

.house-frame img {
  width: 100%;
  height: auto;
  display: block;
}

/* 우측 앉아있는 서도호 작가 사진 */
.artist-photo {
  width: 375px;
  max-width: 55%;
  height: auto;
  display: block;
  position: relative;
  z-index: 2;
  margin-right: 0%;
}

/* 하단 설명 박스 (좌측 정렬 및 중첩 배치) */
.artist-description {
  position: absolute;
  left: -2%;
  bottom: -25px;
  width: 540px;
  max-width: 74%;
  padding: 20px 24px;
  background: white;
  border: 1px solid #111;
  text-align: left;
  z-index: 3;
  box-sizing: border-box;
}

.artist-description h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #111;
}

.artist-description .artist-meta {
  font-size: 10px;
  color: #555;
  margin-bottom: 14px;
  font-weight: 400;
}

.artist-description p {
  font-size: 10.5px;
  line-height: 1.75;
  color: #222;
  word-break: keep-all;
  letter-spacing: -0.015em;
}

/* ===========================
   문고리 섹션
   =========================== */

.door-section {
  padding-top: 100px;
  background: #fff;
  text-align: center;
}

.door-gallery {
  position: relative;
  width: 100%;
  max-width: 1100px;
  height: 3500px;
  margin: 80px auto 0;
  overflow: hidden;
}

/* --- 배경 오브제 (back): 클릭 불가 --- */

.back {
  position: absolute;
  height: auto;
  object-fit: contain;
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
  cursor: default;
  user-select: none;
}

/* --- 문고리 (door): 클릭 가능 --- */

.door {
  position: absolute;
  height: auto;
  object-fit: contain;
  cursor: pointer;
  opacity: 0.85;
  z-index: 2;
  user-select: none;
  transition:
    opacity 0.35s ease,
    filter 0.35s ease,
    transform 0.35s ease;
}

.door:hover {
  opacity: 1;
  filter: brightness(1.12);
  transform: scale(1.06);
  z-index: 10;
}

/* 클릭 효과 */

.door.clicked {
  animation: doorFlash 0.8s ease-in-out;
}

@keyframes doorFlash {
  0% {
    opacity: 0.85;
    filter: blur(0);
  }
  35% {
    opacity: 0.35;
    filter: blur(3px);
  }
  70% {
    opacity: 1;
    filter: blur(0) brightness(1.3);
  }
  100% {
    opacity: 0.85;
    filter: blur(0);
  }
}

/* --- 라벨 이미지 (door 바로 아래 배치되는 타이틀/작품명 이미지) --- */

.door-label {
  position: absolute;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.05));
  user-select: none;
}

/* ===========================
   그룹 1: 서울 집
   =========================== */

.back-1 {
  top: 0.5%;
  left: 8%;
  width: 190px;
}

.door-1 {
  top: 2.2%;
  left: 14%;
  width: 140px;
  z-index: 2;
}

.label-1 {
  top: 8.8%;
  left: 14.5%;
  width: 125px;
}

/* ===========================
   그룹 2: 미국 뉴욕 웨스트 22번가 NY10011
   =========================== */

.back-2 {
  top: 11%;
  left: 58%;
  width: 170px;
}

.back-3 {
  top: 17%;
  left: 38%;
  width: 150px;
}

.door-2 {
  top: 21%;
  left: 66%;
  width: 205px;
  z-index: 2;
}

.label-2 {
  top: 31%;
  left: 58%;
  width: 270px;
}

/* ===========================
   그룹 3: 완벽한 집 (back4 뒷배경 확장)
   =========================== */

.back-4 {
  top: 35%;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 980px;
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

.door-3 {
  top: 44%;
  left: 20%;
  width: 180px;
  z-index: 2;
}

.label-3 {
  top: 49.5%;
  left: 18%;
  width: 210px;
}

/* ===========================
   그룹 4: Who am we / 바닥
   =========================== */

.back-5 {
  top: 58%;
  left: 6%;
  width: 240px;
  z-index: 1;
}

.door-4 {
  top: 55%;
  left: 52%;
  width: 200px;
  z-index: 2;
}

.label-4 {
  top: 61.5%;
  left: 54%;
  width: 130px;
}

/* ===========================
   그룹 5: 동지/들 (back6 뒷배경 확장)
   =========================== */

.back-6 {
  top: 71%;
  left: 50%;
  transform: translateX(-50%);
  width: 94%;
  max-width: 1020px;
  opacity: 0.42;
  z-index: 0;
  pointer-events: none;
}

.door-5 {
  top: 76%;
  left: 47%;
  width: 165px;
  z-index: 2;
}

.label-5 {
  top: 84%;
  left: 50%;
  transform: translateX(-50%);
  width: 75px;
}

/* ===========================
   마지막 작품
   =========================== */

.ending-section {
  padding: 100px 0 0;
  text-align: center;
}

.ending-frame {
  width: 75%;
  max-width: 850px;
  margin: 40px auto 0;
  border: 1px solid #111;
  padding: 8px;
  background: #fff;
}

.ending-frame img {
  width: 100%;
  height: auto;
  display: block;
}

footer {
  display: flex;
  align-items: end;
  justify-content: center;
  height: 400px;
  padding-bottom: 50px;
  background: linear-gradient(
    to bottom,
    #ffffff 0%,
    #777777 45%,
    #000000 85%
  );
  color: white;
  font-size: 12px;
}

/* ==========================================================
   door1 클릭 시 나타나는 <러빙/러빙: 서울 집> 창 모달
   ========================================================== */

/* 모달 배경 딤 */
.exhibition-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.35s ease;
  padding: 20px;
  box-sizing: border-box;
}

.exhibition-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.modal-open {
  overflow: hidden;
}

/* 모달 창 본체 */
.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px 28px 0;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  color: #111;
  box-sizing: border-box;
}

.exhibition-modal.active .modal-dialog {
  transform: translateY(0) scale(1);
}

/* 커스텀 스크롤바 */
.modal-dialog::-webkit-scrollbar {
  width: 6px;
}

.modal-dialog::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.modal-dialog::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 3px;
}

.modal-dialog::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* 닫기 버튼 (X) */
.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  font-size: 28px;
  line-height: 32px;
  font-weight: 300;
  background: transparent;
  border: none;
  color: #222;
  cursor: pointer;
  z-index: 100;
  transition: transform 0.2s ease, color 0.2s ease;
  user-select: none;
}

.modal-close-btn:hover {
  transform: scale(1.15);
  color: #000;
}

/* 좌상단 붉은 실 오브제 */
.modal-thread-object {
  position: absolute;
  top: 8px;
  left: 14px;
  width: 80px;
  z-index: 10;
  pointer-events: none;
}

.modal-thread-object img {
  width: 100%;
  height: auto;
  display: block;
}

/* 4전시실 배지 */
.modal-badge-container {
  margin: 28px auto 12px;
}

.modal-badge {
  display: inline-block;
  height: 18px;
  width: auto;
  user-select: none;
}

/* 모달 메인 제목 */
.modal-title {
  font-size: 25px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.03em;
  margin-bottom: 34px;
}

/* 중앙 작품 사진 및 캡션 래퍼 */
.modal-artwork-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 36px;
}

.modal-artwork-img {
  width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* 좌상단 한글 캡션 */
.modal-caption-ko {
  position: absolute;
  top: -16px;
  left: -16px;
  width: 195px;
  height: auto;
  z-index: 5;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  pointer-events: none;
}

/* 우하단 영문 캡션 */
.modal-caption-en {
  position: absolute;
  bottom: -16px;
  right: -16px;
  width: 220px;
  height: auto;
  z-index: 5;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  pointer-events: none;
}

/* 본문 해설 텍스트 */
.modal-story-content {
  text-align: left;
  font-size: 11px;
  line-height: 1.75;
  color: #222;
  word-break: keep-all;
  letter-spacing: -0.015em;
  padding: 0 8px;
  margin-bottom: 35px;
}

.modal-story-content .story-highlight {
  font-weight: 600;
  color: #111;
  margin-bottom: 16px;
  font-size: 11.5px;
}

.modal-story-content p {
  margin-bottom: 16px;
}

.modal-story-content p:last-child {
  margin-bottom: 0;
}

/* 하단 그라데이션 페이드 & MMCA 로고 */
.modal-footer-fade {
  position: relative;
  width: calc(100% + 56px);
  margin-left: -28px;
  height: 180px;
  margin-top: 20px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(30, 30, 30, 0.55) 45%, rgba(5, 5, 5, 0.98) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
  box-sizing: border-box;
}

.modal-mmca-logo {
  width: 44px;
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
}

/* ===========================
   모바일 반응형
   =========================== */

@media (max-width: 768px) {
  .hero {
    padding: 25px 5%;
  }

  .hero h1 {
    font-size: 13vw;
  }

  .hero-info {
    margin-bottom: 60px;
  }

  .artist-stage {
    min-height: auto;
    flex-direction: column;
    align-items: center;
  }

  .house-frame {
    position: relative;
    left: auto;
    width: 85%;
    max-width: 320px;
    margin-bottom: 20px;
  }

  .artist-photo {
    width: 85%;
    max-width: 320px;
    margin: 0 auto;
  }

  .artist-description {
    position: relative;
    left: auto;
    bottom: auto;
    width: 90%;
    max-width: 100%;
    margin-top: -30px;
  }

  .door-gallery {
    height: 2600px;
  }

  .door,
  .back-1,
  .back-2,
  .back-3,
  .back-5 {
    max-width: 32%;
  }

  .back-4,
  .back-6 {
    width: 96%;
  }

  .door-label {
    max-width: 45%;
  }

  .space-container {
    height: 65vh;
  }

  .space-guide {
    bottom: 20px;
  }

  .ending-section img {
    width: 90%;
  }

  /* 모달 모바일 대응 */
  .modal-dialog {
    padding: 24px 18px 0;
    max-height: 94vh;
  }

  .modal-caption-ko {
    width: 145px;
    top: -12px;
    left: -8px;
  }

  .modal-caption-en {
    width: 165px;
    bottom: -12px;
    right: -8px;
  }

  .modal-title {
    font-size: 20px;
    margin-bottom: 26px;
  }

  .modal-footer-fade {
    width: calc(100% + 36px);
    margin-left: -18px;
    height: 140px;
  }
}
