/* ============================================
   pic.soo.zip — Virtual Gallery Exhibition
   Walkthrough corridor-style immersive gallery
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Space+Mono:wght@400;700&family=Noto+Sans+KR:wght@100;300;400;500;700&display=swap');

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

:root {
  --bg: #0a0a0a;
  --wall: #e8e2d8;
  --wall-dark: #d4cec4;
  --floor-color: #2a2520;
  --ceiling: #1a1815;
  --text: #f0ede8;
  --text-dim: #8a8580;
  --text-muted: #5a5550;
  --accent: #c9a96e;
  --gold: #b8963e;
  --cyan: #00f5d4;
  --frame: #2c1e10;
  --frame-gold: #8a7448;
  --serif: 'Cormorant Garamond', 'Noto Sans KR', serif;
  --mono: 'Space Mono', monospace;
  --sans: 'Noto Sans KR', sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--serif);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 0; height: 0; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════
   ENTRANCE
   ═══════════════════════════════════════════ */
#entrance {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 1.5s ease, transform 1.5s ease;
}

#entrance.leaving {
  opacity: 0;
  transform: scale(1.1);
}

.entrance-bg {
  position: absolute;
  inset: 0;
  opacity: 0.85;
}

.entrance-bg canvas {
  width: 100%;
  height: 100%;
}

.entrance-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.entrance-door {
  width: 180px;
  height: 260px;
  margin-bottom: 2rem;
  perspective: 600px;
}

.door-frame {
  width: 100%;
  height: 100%;
  border: 2px solid var(--text-muted);
  position: relative;
  display: flex;
  overflow: hidden;
}

.door-left, .door-right {
  width: 50%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 1px solid var(--text-muted);
  transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left center;
}

.door-right { transform-origin: right center; }

#entrance.leaving .door-left {
  transform: perspective(600px) rotateY(-110deg);
}

#entrance.leaving .door-right {
  transform: perspective(600px) rotateY(110deg);
}

.entrance-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.5em;
  color: var(--cyan);
  text-transform: uppercase;
}

.entrance-title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.entrance-subtitle {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-dim);
}

.entrance-date {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
}

.entrance-btn {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--bg);
  background: var(--text);
  border: none;
  padding: 1rem 3rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: all 0.4s ease;
  margin-top: 1rem;
}

.entrance-btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(201, 169, 110, 0.3);
}

.entrance-btn .btn-icon { transition: transform 0.3s ease; }
.entrance-btn:hover .btn-icon { transform: translateX(5px); }

.entrance-hint {
  font-family: var(--mono);
  font-size: 0.5rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  margin-top: 0.5rem;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ═══════════════════════════════════════════
   GALLERY UI OVERLAY
   ═══════════════════════════════════════════ */
#gallery-ui {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

#gallery-ui > * {
  pointer-events: auto;
}

.gallery-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  background: linear-gradient(to bottom, rgba(10,10,10,0.85) 0%, transparent 100%);
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.exit-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.exit-btn:hover {
  border-color: var(--text);
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.gallery-logo {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
}

.gallery-logo em {
  font-style: normal;
  color: var(--cyan);
}

.floor-indicator {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.floor-number {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.05em;
}

.floor-divider {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.floor-name {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text);
}

.header-actions {
  display: flex;
  gap: 0.6rem;
}

.header-action-btn {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.header-action-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ── Floor Navigation Sidebar ── */
.floor-nav {
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  z-index: 10;
}

.floor-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(10,10,10,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.floor-nav-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(10,10,10,0.8);
}

.floor-nav-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 245, 212, 0.08);
}

.fnb-floor {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ── Walk Progress Bar ── */
.walk-progress {
  position: absolute;
  bottom: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 10;
}

.walk-progress-track {
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  position: relative;
  border-radius: 1px;
}

.walk-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--cyan);
  border-radius: 1px;
  transition: width 0.3s ease;
}

.walk-progress-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 245, 212, 0.5);
  transition: left 0.3s ease;
}

.walk-progress-label {
  font-family: var(--mono);
  font-size: 0.5rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* ── Walk hint arrows ── */
.walk-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 1rem;
  transition: all 0.4s ease;
  z-index: 10;
  background: rgba(10,10,10,0.3);
  border: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(5px);
}

.walk-hint:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
  background: rgba(10,10,10,0.6);
}

.walk-hint-left {
  left: 1rem;
}

.walk-hint-right {
  right: 4.5rem;
}

.walk-hint svg {
  flex-shrink: 0;
}

.walk-hint-label {
  font-size: 0.6rem;
  letter-spacing: 0.05em;
}

/* Footer */
.gallery-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: linear-gradient(to top, rgba(10,10,10,0.8) 0%, transparent 100%);
}

.artwork-counter {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
}

.gallery-instruction {
  font-family: var(--sans);
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.gallery-credit {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
}

/* ═══════════════════════════════════════════
   OVERLAY PANELS
   ═══════════════════════════════════════════ */
.overlay-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 10, 10, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.panel-content {
  text-align: center;
  position: relative;
  padding: 3rem;
  max-height: 85vh;
  overflow-y: auto;
}

.panel-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  background: none;
  border: 1px solid var(--text-muted);
  color: var(--text-dim);
  width: 40px;
  height: 40px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-close:hover {
  border-color: var(--text);
  color: var(--text);
}

.panel-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 0.3rem;
}

.panel-subtitle {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.3em;
  margin-bottom: 2.5rem;
}

/* ── Map ── */
.map-floors {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.map-room {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.2rem 2rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--text-muted);
  cursor: pointer;
  transition: all 0.4s ease;
  min-width: 320px;
  text-align: left;
}

.map-room:hover {
  border-color: var(--accent);
  background: rgba(201, 169, 110, 0.05);
}

.map-room.active {
  border-color: var(--cyan);
  background: rgba(0, 245, 212, 0.05);
}

.map-room-number {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 36px;
}

.map-room.active .map-room-number { color: var(--cyan); }

.map-room-name {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text);
}

.map-room-en {
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.map-room-count {
  font-family: var(--mono);
  font-size: 0.5rem;
  color: var(--text-muted);
  margin-left: auto;
}

.map-corridor {
  font-family: var(--mono);
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* ── Category Panel ── */
.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  max-width: 600px;
}

.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 2rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--text-muted);
  cursor: pointer;
  transition: all 0.4s ease;
  min-width: 120px;
  color: var(--text);
}

.category-btn:hover {
  border-color: var(--accent);
  background: rgba(201, 169, 110, 0.05);
}

.category-btn.active {
  border-color: var(--cyan);
  background: rgba(0, 245, 212, 0.05);
}

.cat-icon { font-size: 1.5rem; opacity: 0.6; }

.cat-name {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 400;
}

.cat-en {
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.cat-count {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 0.15rem 0.5rem;
}

/* ═══════════════════════════════════════════
   UPLOAD PANEL
   ═══════════════════════════════════════════ */
.upload-panel {
  max-width: 600px;
  width: 90vw;
}

.upload-dropzone {
  border: 2px dashed rgba(255,255,255,0.15);
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--cyan);
  background: rgba(0, 245, 212, 0.03);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-dim);
}

.dropzone-inner p {
  font-family: var(--sans);
  font-size: 0.85rem;
}

.dropzone-formats {
  font-family: var(--mono);
  font-size: 0.5rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.upload-preview { display: none; }
.upload-preview.visible { display: block; }

.upload-images {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.upload-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.upload-thumb img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.1);
}

.upload-thumb span {
  font-family: var(--mono);
  font-size: 0.45rem;
  color: var(--text-muted);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-analysis {
  text-align: left;
  padding: 1.2rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 1.5rem;
}

.upload-analysis h3 {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.analysis-badge {
  font-family: var(--mono);
  font-size: 0.45rem;
  letter-spacing: 0.1em;
  color: var(--cyan);
  border: 1px solid rgba(0, 245, 212, 0.3);
  padding: 0.15rem 0.5rem;
}

.color-palette-result {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 0.2s;
}

.color-swatch:hover { transform: scale(1.15); }

.analysis-mood {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.wall-preview-label {
  font-family: var(--mono);
  font-size: 0.5rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.4rem;
}

.wall-color-swatch {
  display: flex;
  gap: 0.3rem;
}

.wall-swatch-item {
  width: 50px;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.1);
}

.upload-floor-name {
  margin-bottom: 1.2rem;
  text-align: left;
}

.upload-floor-name label {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.4rem;
}

.upload-floor-name input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 0.7rem 1rem;
  outline: none;
  transition: border-color 0.3s;
}

.upload-floor-name input:focus { border-color: var(--cyan); }

.upload-confirm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: 100%;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--bg);
  background: var(--cyan);
  border: none;
  padding: 1rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.3s;
}

.upload-confirm-btn:hover {
  background: #33f7dd;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 245, 212, 0.3);
}

/* ═══════════════════════════════════════════
   3D CORRIDOR GALLERY
   ═══════════════════════════════════════════ */
#gallery-world {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  background: var(--bg);
}

.corridor-viewport {
  width: 100%;
  height: 100%;
  perspective: 800px;
  perspective-origin: 50% 48%;
  overflow: hidden;
}

.corridor-scene {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

/* The long corridor floor */
.corridor-floor {
  position: absolute;
  bottom: 0;
  left: -200%;
  width: 500%;
  height: 100%;
  background:
    repeating-linear-gradient(
      90deg,
      #2a2520 0px, #2a2520 120px,
      #272220 120px, #272220 240px
    );
  transform: rotateX(70deg);
  transform-origin: bottom center;
}

.corridor-ceiling {
  position: absolute;
  top: 0;
  left: -200%;
  width: 500%;
  height: 100%;
  background: #1a1815;
  transform: rotateX(-70deg);
  transform-origin: top center;
}

/* Track lights on ceiling */
.corridor-ceiling::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255,248,230,0.3) 0px, rgba(255,248,230,0.3) 4px,
    transparent 4px, transparent 300px
  );
}

/* The scrollable artwork wall */
.corridor-wall {
  position: absolute;
  top: 8%;
  left: 0;
  height: 80%;
  display: flex;
  align-items: center;
  gap: 0;
  will-change: transform;
}

/* Wall background panels */
.wall-segment {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--wall);
}

/* Wall panel border lines */
.wall-segment::before {
  content: '';
  position: absolute;
  top: 4%;
  bottom: 4%;
  right: 0;
  width: 1px;
  background: rgba(0,0,0,0.06);
}

/* Dado rail */
.wall-segment::after {
  content: '';
  position: absolute;
  bottom: 15%;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.06), rgba(0,0,0,0.02));
}

/* Crown molding */
.wall-molding-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.08) 0%,
    rgba(0,0,0,0.03) 40%,
    rgba(0,0,0,0.06) 60%,
    transparent 100%
  );
  z-index: 5;
  pointer-events: none;
}

/* Baseboard */
.wall-molding-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to top,
    #3a3530 0%,
    #4a4540 60%,
    var(--wall) 100%
  );
  z-index: 5;
  pointer-events: none;
}

/* ── Artwork on corridor wall ── */
.corridor-artwork {
  position: relative;
  cursor: pointer;
  transition: transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 1.2s cubic-bezier(0.22, 0.61, 0.36, 1),
              filter 1.2s ease;
  flex-shrink: 0;
  z-index: 2;
  filter: brightness(0.92);
}

.corridor-artwork:hover {
  transform: scale(1.05) translateY(-8px);
  filter: brightness(1.05);
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}

.corridor-artwork .frame-outer {
  padding: 12px;
  background: linear-gradient(135deg, #3a2a1a 0%, #2c1e10 50%, #3a2a1a 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    inset 0 0 0 2px rgba(0,0,0,0.3),
    0 8px 40px rgba(0,0,0,0.35),
    0 2px 10px rgba(0,0,0,0.2);
}

.corridor-artwork .frame-inner {
  padding: 4px;
  background: linear-gradient(135deg, var(--frame-gold) 0%, #6b5a3a 50%, var(--frame-gold) 100%);
}

.corridor-artwork .frame-mat {
  padding: 20px;
  background: #f5f0e8;
}

.corridor-artwork .artwork-canvas {
  display: block;
  background: #ddd;
}

/* Spotlight from above */
.corridor-artwork::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 10%;
  right: 10%;
  height: 50%;
  background: radial-gradient(ellipse at 50% 100%, rgba(255,248,230,0.20) 0%, transparent 75%);
  pointer-events: none;
  transition: opacity 1.2s ease;
  opacity: 0.6;
}

.corridor-artwork:hover::before {
  opacity: 1;
}

/* Light dot */
.corridor-artwork::after {
  content: '';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  background: rgba(255, 248, 230, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255,248,230,0.4), 0 0 25px rgba(255,248,230,0.15);
  pointer-events: none;
}

/* Museum plaque under artwork */
.corridor-plaque {
  position: absolute;
  bottom: -55px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,10,0.8);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 0.4rem 1rem;
  text-align: center;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
  transform: translateX(-50%) translateY(8px);
  z-index: 3;
}

.corridor-artwork:hover .corridor-plaque {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition: opacity 1s ease 0.3s, transform 1s ease 0.3s;
}

.plaque-title {
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text);
  display: block;
}

.plaque-artist {
  font-family: var(--mono);
  font-size: 0.45rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  margin-top: 0.15rem;
  display: block;
}

.plaque-category {
  font-family: var(--mono);
  font-size: 0.4rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  display: block;
  opacity: 0.7;
}

/* ── Floor title at corridor start ── */
.corridor-floor-title {
  flex-shrink: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--wall);
  padding: 0 5vw;
  text-align: center;
  position: relative;
}

.corridor-floor-title::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: rgba(0,0,0,0.1);
}

.cft-number {
  font-family: var(--mono);
  font-size: 3rem;
  font-weight: 700;
  color: rgba(0,0,0,0.06);
  letter-spacing: 0.1em;
  line-height: 1;
}

.cft-name {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 300;
  color: #5a5550;
  letter-spacing: 0.15em;
  margin-top: 0.5rem;
}

.cft-en {
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.3em;
  color: #8a8580;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

.room-mood-badge {
  font-family: var(--mono);
  font-size: 0.4rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  border: 1px solid rgba(201, 169, 110, 0.3);
  padding: 0.1rem 0.5rem;
  margin-top: 0.8rem;
  text-transform: uppercase;
}

/* ── Ambient lighting overlay ── */
.corridor-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255,248,230,0.04) 0%, transparent 60%),
    linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.25) 100%),
    linear-gradient(to top, transparent 0%, rgba(0,0,0,0.15) 100%);
}

/* Left/right vignette for depth */
.corridor-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    linear-gradient(to right, rgba(10,10,10,0.6) 0%, transparent 15%, transparent 85%, rgba(10,10,10,0.6) 100%);
}

/* ═══════════════════════════════════════════
   ARTWORK VIEWER
   ═══════════════════════════════════════════ */
.viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: viewerFadeIn 1.2s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.viewer-overlay.closing {
  animation: viewerFadeOut 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* Suppress default animation during navigation */
.viewer-content.nav-swapping {
  animation: none !important;
  opacity: 0 !important;
}

/* Viewer navigation transitions */
.viewer-content.nav-fade-out-left {
  animation: navFadeOutLeft 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) both !important;
}
.viewer-content.nav-fade-out-right {
  animation: navFadeOutRight 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) both !important;
}
.viewer-content.nav-fade-in-left {
  animation: navFadeInLeft 1.0s cubic-bezier(0.22, 0.61, 0.36, 1) both !important;
}
.viewer-content.nav-fade-in-right {
  animation: navFadeInRight 1.0s cubic-bezier(0.22, 0.61, 0.36, 1) both !important;
}

@keyframes navFadeOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-60px); }
}
@keyframes navFadeOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(60px); }
}
@keyframes navFadeInLeft {
  from { opacity: 0; transform: translateX(-60px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes navFadeInRight {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes viewerFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes viewerFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.97);
  backdrop-filter: blur(30px);
  transition: backdrop-filter 1.2s ease;
}

.viewer-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4rem;
  max-width: 1300px;
  padding: 2rem;
  animation: viewerContentIn 1.4s cubic-bezier(0.22, 0.61, 0.36, 1) 0.15s both;
}

@keyframes viewerContentIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.viewer-frame {
  flex-shrink: 0;
  padding: 16px;
  background: linear-gradient(135deg, #3a2a1a 0%, #2c1e10 50%, #3a2a1a 100%);
  box-shadow:
    0 20px 80px rgba(0,0,0,0.6),
    inset 0 0 0 1px rgba(255,255,255,0.05);
  animation: viewerFrameIn 1.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.3s both;
}

@keyframes viewerFrameIn {
  from {
    opacity: 0;
    transform: scale(0.85);
    box-shadow: 0 0 0 rgba(0,0,0,0);
  }
  to {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 20px 80px rgba(0,0,0,0.6);
  }
}

#viewer-canvas {
  display: block;
  max-width: 55vw;
  max-height: 70vh;
  background: #ddd;
}

.viewer-info {
  max-width: 350px;
  animation: viewerInfoIn 1.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.5s both;
}

@keyframes viewerInfoIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.viewer-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.viewer-artist {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.viewer-divider {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: 1.5rem 0;
}

.viewer-description {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-dim);
  line-height: 1.9;
  margin-bottom: 2rem;
}

.viewer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.viewer-meta-item {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.viewer-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--text-dim);
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: all 0.3s;
}

.viewer-close:hover {
  border-color: var(--text);
  color: var(--text);
}

.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--text-dim);
  background: rgba(10,10,10,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.viewer-nav:hover {
  border-color: var(--accent);
  color: var(--text);
}

.viewer-prev { left: 2rem; }
.viewer-next { right: 2rem; }
.viewer-nav-row { display: contents; }

/* ═══════════════════════════════════════════
   SOUND TOGGLE
   ═══════════════════════════════════════════ */
.sound-toggle {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 60;
  background: rgba(10,10,10,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-dim);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.sound-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ═══════════════════════════════════════════
   FLOOR TRANSITION
   ═══════════════════════════════════════════ */
.room-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  animation: fadeIn 0.4s ease;
}

.room-transition-overlay .transition-floor {
  font-family: var(--mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.1em;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease 0.2s forwards;
}

.room-transition-overlay .transition-text {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text);
  opacity: 0;
  animation: fadeSlideUp 0.8s ease 0.4s forwards;
}

.room-transition-overlay .transition-sub {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  text-transform: uppercase;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease 0.6s forwards;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .viewer-content {
    flex-direction: column;
    gap: 2rem;
  }

  #viewer-canvas {
    max-width: 80vw;
    max-height: 45vh;
  }

  .viewer-info {
    max-width: 80vw;
    text-align: center;
  }

  .viewer-divider { margin: 1rem auto; }

  .header-action-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.5rem;
  }
}

@media (max-width: 768px) {
  .gallery-header { padding: 0.8rem 1rem; }
  .floor-indicator { display: none; }
  .exit-btn span { display: none; }

  .floor-nav { right: 0.5rem; }
  .floor-nav-btn { width: 32px; height: 32px; }
  .fnb-floor { font-size: 0.5rem; }

  .gallery-footer { padding: 0.8rem 1rem; }
  .gallery-instruction, .gallery-credit { display: none; }

  .walk-hint-label { display: none; }

  .corridor-artwork .frame-mat { padding: 8px; }
  .corridor-artwork .frame-outer { padding: 6px; }
  .corridor-artwork .frame-inner { padding: 2px; }

  .entrance-door { width: 120px; height: 180px; }

  .walk-progress-track { width: 120px; }

  /* Viewer — scrollable on mobile, nav below */
  .viewer-overlay {
    flex-direction: column;
    overflow-y: auto;
    padding: 1rem 0;
  }
  .viewer-content {
    flex-shrink: 0;
    max-width: 90vw;
  }
  .viewer-nav-row {
    display: flex;
    gap: 0.8rem;
    width: 90vw;
    margin-top: 1rem;
    flex-shrink: 0;
  }
  .viewer-nav {
    position: static;
    transform: none;
    flex: 1;
  }
  .viewer-prev, .viewer-next {
    position: static;
  }
  .viewer-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
  }
}
