/* =========================================================
   shelf.css
   Tape hotspots + the TV (a live CSS screen positioned at the
   TV's measured coordinates in background.webp — the TV itself
   is baked into the photo, no separate frame asset).
   ========================================================= */

/* ---- VHS tape stack ---- */
.room__tapes {
  position: absolute;
  left: 20%;
  width: max(28%, 10.5rem); /* sized so 7 tapes exactly span
    from the shelf to the TV's top edge — see README */
  bottom: calc(100% - var(--shelf-y) + var(--shelf-setback));
  z-index: 3;

  display: flex;
  flex-direction: column;
}

.tape-hot {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
}

.tape-hot + .tape-hot,
.tape-static { margin-top: -1px; }

/* Slight natural misalignment — a real stack of physical
   objects never sits perfectly flush. Horizontal shift only
   (no rotation — rotation reads as vertical misalignment at
   the tape's edges, which isn't wanted here). Varied per tape
   so it doesn't read as a repeating pattern. */
.room__tapes > *:nth-child(1) { transform: translateX(2px); }
.room__tapes > *:nth-child(2) { transform: translateX(-3px); }
.room__tapes > *:nth-child(3) { transform: translateX(3px); }
.room__tapes > *:nth-child(4) { transform: translateX(-2px); }
.room__tapes > *:nth-child(5) { transform: translateX(3px); }
.room__tapes > *:nth-child(6) { transform: translateX(-3px); }
.room__tapes > *:nth-child(7) { transform: translateX(2px); }

/* Expand the tappable/clickable area beyond the thin visual
   spine without affecting layout or the stacked visual. */
.tape-hot::after {
  content: "";
  position: absolute;
  inset: -3px -6px;
}

.tape-hot img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35));
  transition: transform var(--duration-med) var(--ease-out),
              filter var(--duration-med) ease;
  pointer-events: none;
}

.tape-hot:hover img,
.tape-hot:focus-visible img,
.tape-hot.is-active img {
  transform: translate(4%, -3%) scale(1.05);
  filter: drop-shadow(10px 12px 14px rgba(0, 0, 0, 0.6)) brightness(1.08);
}

.tape-hot:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
  z-index: 4;
}

/* ---- Static tape: looks decorative, but it's a real link (an
   easter egg) — deliberately no hover-lift tell like .tape-hot
   gets, just the browser's native pointer cursor on hover, so
   it stays a quiet find rather than an obvious button. */
.tape-static {
  display: block;
  width: 100%;
}

.tape-static img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35));
}

.tape-static:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
  z-index: 4;
}

/* ---- TV ----
   The TV itself is baked into the background photo now (no
   separate frame asset). .tv is positioned directly at the
   screen's measured coordinates and IS the screen overlay —
   there's no outer housing to account for anymore. Idle state
   needs no overlay (the photo already shows "NO SIGNAL"); the
   overlay fades in on hover/focus/active, same as before. */
.tv {
  position: absolute;
  left: 55.7%;
  top: 17.05%;
  width: 31.66%;
  height: 46.39%;
  z-index: 2;
}

.tv__screen {
  position: absolute;
  inset: 0;
  z-index: 1;

  background: var(--color-screen);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  transition: opacity var(--duration-fast) ease;
}

.tv__screen.is-on {
  opacity: 1;
}

.tv__content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 6%;
}

/* ---- TV video preview (replaces the text readout entirely
   when the active tape has a clip) ---- */
.tv__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
  pointer-events: none;
}

.tv__screen.has-video .tv__video { opacity: 1; }
.tv__screen.has-video .tv__content { display: none; }

.tv__image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
  pointer-events: none;
}

.tv__screen.has-image .tv__image { opacity: 1; }
.tv__screen.has-image .tv__content { display: none; }

.tv__icon {
  font-family: var(--font-mono);
  font-size: clamp(7px, 0.9vw, 12px);
  letter-spacing: 0.12em;
  color: var(--color-screen-idle-icon);
  margin-bottom: 0.6em;
  transition: color var(--duration-med) ease;
}

.tv__project {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(11px, 1.6vw, 20px);
  letter-spacing: 0.02em;
  color: var(--color-screen-idle-text);
  text-transform: uppercase;
  transition: color var(--duration-med) ease;
}

.tv__sub {
  font-family: var(--font-mono);
  font-size: clamp(7px, 0.8vw, 10px);
  color: var(--color-screen-idle-sub);
  margin-top: 0.6em;
  letter-spacing: 0.05em;
  transition: color var(--duration-med) ease;
}

.tv__counter {
  position: absolute;
  bottom: 5%; right: 5%;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: clamp(7px, 0.8vw, 10px);
  color: #3a3226;
  letter-spacing: 0.05em;
  transition: color var(--duration-med) ease;
}

.tv__screen.is-on .tv__icon    { color: var(--color-screen-on-icon); }
.tv__screen.is-on .tv__project { color: var(--color-screen-on-text); }
.tv__screen.is-on .tv__sub     { color: var(--color-screen-on-sub); }
.tv__screen.is-on .tv__counter { color: var(--color-screen-on-icon); }
