/* Digital Shelf Vignette Styles */
:root {
  --shelf-bg: #f3f3f1;
  --shelf-hover-shadow: rgba(0, 0, 0, 0.18);
}

.shelf-vignette {
  background-color: var(--shelf-bg);
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin: 4rem 0;
  border-radius: 20px;
}

/* ─── Bowl Clock ──────────────────────────────────────── */
.vignette-clock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

#bowl {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #F7F3E2 60%, #E8E3CC 100%);
  border: 8px solid #E0DAC2;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

#bowl::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(200, 194, 170, 0.4);
}

.hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  border-radius: 12px 12px 4.5px 4.5px;
}

#hour {
  width: 15px;
  height: 54px;
  margin-left: -7.5px;
  background: #4A4A58;
  opacity: 0.82;
  filter: blur(3px);
  transform-origin: 50% 100%;
  z-index: 2;
}

#minute {
  width: 10px;
  height: 40px;
  margin-left: -5px;
  margin-bottom: 21px;
  /* Scaled from 38px */
  background: #4A4A58;
  opacity: 0.72;
  filter: blur(2px);
  transform-origin: 50% calc(100% + 21px);
  z-index: 1;
}

#dot {
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #C0506A;
  opacity: 0.92;
  filter: blur(1px);
  transform: translate(-50%, -50%);
  z-index: 4;
}

#center {
  display: none;
  /* Removed in v6 design */
}

#time-label {
  margin-top: 15px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #888;
  letter-spacing: 0.15em;
  text-align: center;
}

/* ─── Shelf Structure ─────────────────────────────────── */
.shelf-system {
  position: relative;
  width: 100%;
  max-width: 700px;
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 0 auto;
}

.shelf-unit-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  pointer-events: none;
}

/* ─── Object Overlay ──────────────────────────────────── */
.vignette-objects {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/*
  Shelf tiers (measured from bottom):
    Top shelf plank  ≈ 64.2% (Corrected to sit on wood)
    Mid shelf plank  ≈ 46.5%
    Bot shelf plank  ≈ 27.5%
*/

.vignette-item {
  position: absolute;
  cursor: pointer;
  /* Spring easing for a satisfying pop */
  transition:
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 0.25s ease;
}

.vignette-item img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  object-fit: contain;
}

/* ── Top shelf ─────── */
.vignette-item[data-id="books"] {
  display: flex;
  gap: 2px;
  bottom: 64.2%;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: 16%;
  align-items: flex-end;
}

.vignette-item[data-id="books"] img {
  width: auto;
  height: 100%;
  border-radius: 2px;
  border-left: 2px solid rgba(0, 0, 0, 0.08);
}

/* ── Middle shelf ──── */
.vignette-item[data-id="frame"] {
  width: 12%;
  bottom: 46.5%;
  left: 32%;
  transform: translateX(-50%);
}

.vignette-item[data-id="gramophone"] {
  width: 28%;
  bottom: 46.5%;
  left: 50%;
  transform: translateX(-50%);
}

.vignette-item[data-id="plant"] {
  width: 14%;
  bottom: 46.5%;
  left: 68%;
  transform: translateX(-50%);
}

.vignette-item[data-id="plant"] img {
  mix-blend-mode: multiply;
}

/* ── Bottom shelf ──── */
.vignette-item[data-id="films"] {
  display: flex;
  gap: 6px;
  bottom: 27.5%;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: 18%;
  align-items: flex-end;
}

.vignette-item[data-id="films"] img {
  width: auto;
  height: 100%;
  border-radius: 4px;
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.2);
  border: none;
}

/* ─── Hover Effects ───────────────────────────────────── */

/* Items WITHOUT a centering translateX — just lift & scale */
.vignette-item[data-id="frame"]:hover,
.vignette-item[data-id="plant"]:hover {
  transform: translateY(-10px) scale(1.06);
  filter: drop-shadow(0 12px 16px var(--shelf-hover-shadow));
}

/* Items WITH a centering translateX — must preserve it */
.vignette-item[data-id="books"]:hover,
.vignette-item[data-id="gramophone"]:hover,
.vignette-item[data-id="films"]:hover {
  transform: translateX(-50%) translateY(-10px) scale(1.06);
  filter: drop-shadow(0 12px 16px var(--shelf-hover-shadow));
}

/* Individual book/film within a row: subtle tilt on hover */
.vignette-item[data-id="books"] img:hover,
.vignette-item[data-id="films"] img:hover {
  transform: translateY(-6px) rotate(-2deg) scale(1.07);
  filter: drop-shadow(0 8px 12px var(--shelf-hover-shadow));
  z-index: 10;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 0.25s ease;
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 800px) {
  .shelf-system {
    max-width: 90%;
  }
}