:root {
  --bg-dark: #0a0503;
  --accent-gold: #d6af74;
  --text-light: #f4efeb;
  --text-muted: #bfafa6;
  --font-serif: "Cormorant Garamond", serif;
  --font-sans: "Montserrat", sans-serif;
}

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

body,
html {
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: var(--font-sans);
  height: 100%;
  overflow: hidden;
}

.stage-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.parallax-wrapper {
  position: absolute;
  width: 110%;
  height: 110%;
  top: -5%;
  left: -5%;
  transform-style: preserve-3d;
  will-change: transform;
}

.layer {
  position: absolute;
  width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}

.layer-bg {
  background-image: url("https://images.unsplash.com/photo-1507221376182-70b55de17e92?q=80&w=2000&auto=format&fit=crop");
  filter: brightness(0.22) contrast(110%) sepia(25%) saturate(75%);
  z-index: 10;
}

.layer-bg::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(0, 0, 0, 0) 30%,
    rgba(10, 5, 3, 0.95) 95%
  );
  pointer-events: none;
}

.layer-midground {
  z-index: 20;
  transform: translateZ(30px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 18vh;
}

/* Chain sits above the frame, centered */
.painting-chain {
  width: 4px;
  height: 22vh;
  background: linear-gradient(to right, #4a341b, #8c6a3f, #33210f);
  position: absolute;
  /* Position chain tip at top of the midground layer center */
  top: 0;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.painting-chain::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: -6px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--accent-gold);
  border-radius: 50%;
  background: #1a0d0d;
}

/* ── FRAME: no fixed aspect-ratio, wraps content ── */
.castle-frame {
  position: relative;
  width: fit-content;
  max-width: min(500px, 80vw);
  max-height: 55vh;
  background-color: #120705;
  padding: 18px;
  border: 14px solid #23120b;
  box-shadow:
    inset 0 0 50px rgba(0, 0, 0, 0.95),
    0 40px 90px rgba(0, 0, 0, 0.95),
    0 0 100px rgba(214, 175, 116, 0.02);
  outline: 2px solid var(--accent-gold);
  outline-offset: -14px;
  display: inline-flex;
  overflow: hidden;
  margin-top: 15vh;
  transition: all 0.3s ease;
}

.castle-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 4px solid var(--accent-gold);
  pointer-events: none;
  z-index: 1;
}

.framed-artwork {
  display: block;
  width: auto;
  height: auto;
  /* Subtract padding + border from both axes so image never escapes the frame */
  max-width: calc(min(500px, 80vw) - 64px);
  max-height: calc(45vh - 64px);
  object-fit: contain;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
  filter: contrast(102%) saturate(92%);
  position: relative;
  transition: opacity 0.25s ease-in-out;
  z-index: 0;
}

/* Varnish overlay on top of the img */
.frame-glaze {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  bottom: 18px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0) 60%,
    rgba(0, 0, 0, 0.2) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.layer-foreground {
  z-index: 30;
  pointer-events: none;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 5%;
  transform: translateZ(90px) scale(0.9);
}

.foreground-silhouette {
  height: 65vh;
  max-height: 550px;
  opacity: 0.1;
  filter: brightness(3%) blur(2px);
}

.layer-light-leak {
  z-index: 40;
  pointer-events: none;
  background: radial-gradient(
    circle at 10% 85%,
    rgba(214, 150, 70, 0.15) 0%,
    rgba(0, 0, 0, 0) 70%
  );
  mix-blend-mode: screen;
  animation: flame-flicker 7s infinite alternate ease-in-out;
}

@keyframes flame-flicker {
  0% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.85;
  }
}

/* ── INTERFACE HUD ── */
.salon-interface {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
}

.salon-header,
.salon-footer,
.art-selector {
  pointer-events: auto;
}

.salon-header h1 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 300;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.salon-header p {
  font-size: 0.8rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 0.3rem;
}

/* ── BOTTOM BLOCK: selector + footer stacked ── */
.bottom-block {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  pointer-events: auto;
}

.art-selector {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap; /* wraps on narrow screens */
}

.art-option {
  background: rgba(10, 5, 3, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(214, 175, 116, 0.2);
  color: var(--text-muted);
  padding: 0.6rem 1.5rem;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.art-option.active,
.art-option:hover {
  border-color: var(--accent-gold);
  color: var(--text-light);
  background-color: rgba(10, 5, 3, 0.95);
  box-shadow: 0 0 15px rgba(214, 175, 116, 0.15);
}

.salon-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
}

.current-labels h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 300;
}

.current-labels p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.instruction-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  padding: 0.4rem 0.8rem;
  background-color: rgba(10, 5, 3, 0.5);
  animation: pulse-border 3s infinite ease-in-out;
}

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

@media (max-width: 768px) {
  .salon-interface {
    padding: 1.5rem;
  }
  .salon-header h1 {
    font-size: 1.3rem;
  }
  .castle-frame {
    max-width: min(310px, 85vw);
    max-height: 45vh;
    margin-top: 10vh;
  }
  .framed-artwork {
    max-width: calc(min(310px, 85vw) - 64px);
    max-height: calc(35vh - 64px);
  }
  .painting-chain {
    height: 18vh;
  }
  .layer-foreground {
    display: none;
  }
  .salon-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .art-selector {
    gap: 0.6rem;
  }
}

