html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: "Monaco", monospace;
}

:root {
  --floor-h: 210px;
  --accent: #cc99ff;
  --accent-dim: rgba(204, 153, 255, 0.22);
}

.category-label {
  position: fixed;
  top: 0;
  z-index: 30;
  padding: 8px 14px;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  background: #000;
  white-space: nowrap;
  transition: opacity 0.25s ease;
}

.category-label {
  width: 100%;
  text-align: center;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}
.category-label.fading { opacity: 0; }


.bookshelf {
  position: fixed;
  top: 30px;
  left: 0;
  right: 0;
  bottom: var(--floor-h);
  overflow: hidden;
}

.shelf-track {
  display: flex;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.77, 0, 0.175, 1);
}

.shelf-section {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.shelf-row {
  min-height: 33%;
  display: flex;
  align-items: flex-end;
  padding: 0 20px;
  gap: 5px;
  border-bottom: 2px solid #fff;
}

.book {
  width:  var(--bw, 36px);
  height: var(--bh, 80%);
  min-height: 50px;

  background: #000;
  border-left:  3px double #bbbbbb;
  border-right: 3px double #bbbbbb;
  border-top:   3px double #bbbbbb;

  display: flex;
  justify-content: center;
  align-items: flex-start;

  text-decoration: none;
  color: #fff;
  cursor: pointer;
  position: relative;

  transition:
    transform      0.18s ease,
    border-color   0.22s ease,
    box-shadow     0.22s ease;
}

.book:hover {
  transform: translateY(-12px);
  border-color: var(--accent);
  box-shadow:
    0  0  18px var(--accent-dim),
    0 -4px 30px var(--accent-dim);
}

.book:hover .spine {
  color: #ffffff;
}

.spine {
  writing-mode: vertical-rl;
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  line-height: 1.4;
  color: #bbbbbb;
  padding-top: 9px;
  max-height: 100%;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  transition: color 0.22s ease;
}

.floor {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--floor-h);
  background: #000;
  overflow: hidden;
}

.floor-plane {
  position: absolute;
  inset: 0;
  transform-origin: center bottom;
  transform: perspective(420px) rotateX(52deg);
}

.floor-grid {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 39px,
      rgba(255, 255, 255, 0.28) 39px,
      rgba(255, 255, 255, 0.28) 40px
    ),
    repeating-linear-gradient(
      to right,
      transparent,
      transparent 79px,
      rgba(255, 255, 255, 0.28) 79px,
      rgba(255, 255, 255, 0.28) 80px
    );
}

.floor-nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12%;
}

.floor-arrow {
  background: none;
  border: none;
  color: #fff;
  font-size: 5rem;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.18s;
}

.floor-arrow:disabled          { opacity: 0.12; cursor: default; }
.floor-arrow:not(:disabled):hover { opacity: 0.5; }

.floor-dots {
  display: flex;
  align-items: center;
  gap: 14px;
}

.floor-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid #fff;
  background: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.18s;
}

.floor-dot.active                   { background: #fff; }
.floor-dot:not(.active):hover       { background: rgba(255, 255, 255, 0.3); }
