/* ════════════════════════════════════
   08_roomD.css — Room D · 단일 작업물, 회색 테두리 → 홀로그램 호버
   ════════════════════════════════════ */
.room-d {
  background: var(--bg);
  padding: 0;
}
.room-d-hdr {
  padding: 3.5rem 2.5rem 2.5rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: flex-end;
   gap: 3rem;
}
.rd-info {
  flex: 1;
}

.rd-name {
    font-size: clamp(2.4rem, 7vw, 7rem);
  font-weight: 700;
  color: var(--ink);
}

/* 작품 스택 — 여러 작업물을 세로로 나열, 짝수 번째는 좌우 반전 */
.rd-stack {
  position: relative;
}
.rd-item {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 15vh 0;
  gap: 6rem;
  background: var(--bg);
  perspective: 1400px; /* 3D 공간 깊이 */
}
.rd-item:nth-of-type(2) {
  flex-direction: row-reverse;
}

/* 회색 테두리(기본) → 홀로그램 그라데이션(호버) */
.rd-artwork-wrap {
   position: relative;
  isolation: isolate;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: fit-content;
  padding: 10px;
  border-radius: 6px;
  background: rgba(26, 23, 20, 0.15);
  transform-style: preserve-3d;
  transform: rotateY(90deg); /* 시작: 옆면만 보이는 상태 */
  opacity: 0;
  transition:
    transform 0.9s cubic-bezier(0.34, 1.2, 0.64, 1),
    opacity 0.5s ease,
    background 0.4s ease,
    box-shadow 0.4s ease;
}
.rd-artwork-wrap:hover {
  transform: rotateY(0deg) translateY(-12px);
  background: linear-gradient(
    135deg,
    #e8d5ff,
    #c8e8ff,
    #c8f5e8,
    #fff5c8,
    #ffd5e8,
    #e8d5ff
  );
  background-size: 300% 300%;
  animation: holoFlow 3s ease infinite;
  box-shadow:
    0 36px 90px rgba(26, 23, 20, 0.38),
    0 12px 32px rgba(26, 23, 20, 0.28);
}

.rd-img {
  height: 60vh; /* Room A 작업물과 동일한 높이 */
  width: auto;
  aspect-ratio: 16 / 9; /* 실제 이미지 비율에 맞게 값 조정하세요 */
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg2);
  position: relative;
}
.rd-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.rd-artwork-wrap:hover .rd-img img {
  transform: scale(1.02);
}

/* 호버 시 어두워지며 작업물 버튼 노출 */
.rd-img-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 23, 20, 0.55);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.rd-artwork-wrap:hover .rd-img-overlay {
  opacity: 1;
  pointer-events: auto;
}
.rd-ov-btn {
  padding: 0.65rem 1.5rem;
  border: 1px solid #fff;
  color: #fff;
  background: transparent;
  border-radius: 5px;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}
.rd-ov-btn:hover {
  background: #fff;
  color: var(--ink);
}

/* 우측 캡션 카드 — 다른 룸 캡션과 동일 톤 */
.rd-cap {
  position: relative;
  box-sizing: border-box; /* width:100%에 padding까지 포함시켜 모바일에서 화면 밖으로 넘치는 것 방지 */
  flex: 0 0 auto;
  max-width: 340px;
  padding: 2.5rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  outline: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 15px 45px rgba(0, 0, 0, 0.15),
    inset 0 2px 2px rgba(255, 255, 255, 0.6),
    inset 0 -2px 3px rgba(0, 0, 0, 0.08);
}
.rd-cap-screw-tl,
.rd-cap-screw-tr,
.rd-cap-screw-bl,
.rd-cap-screw-br {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #cfcfcf 55%, #8b8b8b);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.rd-cap-screw-tl {
  top: 0.8rem;
  left: 0.8rem;
}
.rd-cap-screw-tr {
  top: 0.8rem;
  right: 0.8rem;
}
.rd-cap-screw-bl {
  bottom: 0.8rem;
  left: 0.8rem;
}
.rd-cap-screw-br {
  bottom: 0.8rem;
  right: 0.8rem;
}
.rd-no {
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a88bf8;
  margin-bottom: 1rem;
}
.rd-title {
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 0.3rem;
}
.rd-period {
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 1rem;
}
.rd-type {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink2);
  margin-top: 1.5rem;
}
.rd-project {
font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  color: var(--ink2);
}
.rd-divider {
  height: 1px;
  background: var(--rule);
  margin: 1rem 0;
}
.rd-tools {
  font-size: 1rem;
  color: var(--ink2);
  line-height: 1.5;
  margin-bottom: 2rem;
  letter-spacing: 0.04em;
}
.rd-item.lit .rd-artwork-wrap {
  transform: rotateY(0deg); /* 스크롤 도달 시 정면으로 회전 */
  opacity: 1;
}
/* 반응형 */

/* 세로가 긴 화면에서도 과도하게 안 넓어지게 안전장치 */
.rd-img {
  max-width: 55vw;
}

@media (max-width: 1200px) {
  .room-d-hdr {
    padding: 2.5rem 1.8rem 1.8rem;
    gap: 1.5rem;
  }
  .rd-stack {
    /* Room A(.v-stack)와 동일한 값으로 화면 양옆 여백을 맞춤 */
    padding: 0 1.8rem;
  }
  .rd-item,
  .rd-item:nth-of-type(2) {
    flex-direction: column; /* 세로 스택으로 통일 */
    align-items: center;
    gap: 2rem;
    margin: 6rem 0;
    min-height: 0;
  }
  .rd-artwork-wrap {
    /* align-items:center인 flex 컬럼에서는 자식이 자동으로 늘어나지 않아서
       .rd-img의 width:100%가 기준으로 삼을 너비가 없어짐 → 이미지가
       원본 비율대로 찌그러져 작게 나오는 원인. Room A(.v-artwork-wrap)와 동일하게 처리 */
    width: 100%;
    max-width: 600px;
  }
  .rd-img {
    height: auto;
    width: 100%;
    max-width: 600px;
  }
  .rd-cap {
    max-width: 600px;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .room-d-hdr {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .rd-item {
    margin: 4rem 0;
  }
  .rd-title {
    font-size: 1.4rem;
  }
  .rd-tools,
  .rd-project,
  .rd-type {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .room-d-hdr {
    padding: 2rem 1.2rem 1.2rem;
  }
  .rd-stack {
    padding: 0 1.2rem;
  }
  .rd-cap {
    padding: 1.4rem;
  }
}