:root {
  --ink: #f7f1e4;
  --muted: rgba(247, 241, 228, .72);
  --panel: rgba(18, 16, 13, .72);
  --panel-strong: rgba(19, 17, 14, .9);
  --line: rgba(247, 241, 228, .2);
  --gold: #d2ac58;
  --green: #2f6a61;
  --red: #7b3440;
  --blue: #415b8c;
  --leather: #3b2219;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #12100d;
  color: var(--ink);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

#libraryApp {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #12100d;
}

.scene-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: pointer;
  background: #12100d;
  transform: translateY(0) scale(1);
  transform-origin: 50% 52%;
  transition: transform 1.25s cubic-bezier(.2, .78, .18, 1);
}

#libraryApp.desk-looking-up .scene-stage {
  transform: translateY(8vh) scale(1.065);
}

.sequence-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}

.scene-stage.sequence-webgl-ready.is-playing .sequence-canvas {
  opacity: 1;
}

.scene-image {
  position: absolute;
  inset: -3%;
  z-index: 0;
  width: 106%;
  height: 106%;
  object-fit: cover;
  opacity: 0;
  transform:
    translate3d(var(--move-x, 0px), var(--move-y, 0px), 0)
    scale(var(--scale, 1.02));
  filter: saturate(1) contrast(1);
  transition:
    opacity 1.85s ease,
    transform 2.35s cubic-bezier(.18, .76, .2, 1),
    filter 1.85s ease;
  will-change: transform, opacity;
}

.scene-image.active {
  opacity: 1;
}

.scene-image.entering {
  --scale: 1.13;
  opacity: 0;
  filter: saturate(.94) contrast(.96) blur(1px);
}

.scene-image.leaving {
  --scale: 1.2;
  opacity: 0;
  filter: saturate(.92) contrast(.98) blur(2px);
}

.scene-stage.is-settled .scene-image.active {
  --scale: 1.03;
}

.scene-stage.is-zooming .scene-image.active {
  --scale: 1.12;
}

.scene-stage.is-playing .scene-image.active {
  --scale: 1.1;
}

.scene-stage.sequence-webgl-ready.is-playing .scene-image {
  opacity: 0 !important;
}

.scene-stage.sequence-handoff .scene-image.active {
  opacity: 1 !important;
  transition: none;
}

.scene-stage.sequence-handoff .sequence-canvas {
  transition: opacity .42s ease;
}

.scene-stage.is-playing .scene-image {
  transition: none;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 650px at 50% 48%, transparent 48%, rgba(0, 0, 0, .24) 78%, rgba(0, 0, 0, .62) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .34), transparent 24%, transparent 70%, rgba(0, 0, 0, .46));
  z-index: 2;
}

.category-overlay {
  position: absolute;
  inset: -3%;
  z-index: 3;
  width: 106%;
  height: 106%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transform:
    translate3d(var(--overlay-move-x, 0px), var(--overlay-move-y, 0px), 0)
    scale(var(--overlay-scale, 1.03));
  transition: opacity 1.2s ease, transform 1.2s ease;
  will-change: opacity, transform;
}

.category-overlay.visible {
  opacity: 1;
}

#libraryApp.desk-looking-up .category-overlay {
  opacity: .26;
  transform:
    translate3d(var(--overlay-move-x, 0px), calc(var(--overlay-move-y, 0px) + 10vh), 0)
    scale(1.08);
  transition: opacity 1.05s ease, transform 1.25s cubic-bezier(.2, .78, .18, 1);
}

.corridor-scene {
  position: fixed;
  inset: 0;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  background: #100d0a;
  transition: opacity .55s ease;
}

.corridor-scene.visible {
  opacity: 1;
  pointer-events: auto;
}

.corridor-scene.transition-preview {
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.25s ease;
}

.corridor-scene.transition-preview.visible {
  opacity: 1;
  pointer-events: none;
}

.corridor-image {
  position: absolute;
  inset: -3%;
  width: 106%;
  height: 106%;
  object-fit: cover;
  transform: scale(1.02);
  transition: filter .65s ease, transform .65s ease;
  will-change: filter, transform;
}

.corridor-scene.transition-preview .corridor-image {
  transform: translateY(-5vh) scale(1.08);
  transition: transform 1.25s cubic-bezier(.2, .78, .18, 1), filter 1.25s ease;
}

.corridor-scene.transition-preview.visible .corridor-image {
  transform: translateY(0) scale(1.02);
}

.corridor-scene.subcategories-open .corridor-image {
  filter: blur(8px) brightness(.56) saturate(.92);
  transform: scale(1.07);
}

.corridor-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 640px at 50% 48%, transparent 45%, rgba(0, 0, 0, .28) 78%, rgba(0, 0, 0, .68) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .18), transparent 28%, rgba(0, 0, 0, .38));
  pointer-events: none;
}

.corridor-back {
  position: fixed;
  z-index: 7;
  left: 18px;
  top: 82px;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, .09);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.corridor-back:hover {
  background: rgba(255, 255, 255, .15);
}

.carousel-controls {
  position: fixed;
  z-index: 7;
  left: 50%;
  bottom: 12vh;
  display: flex;
  flex-direction: row;
  gap: min(46vw, 540px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity .45s ease;
}

.corridor-scene.subcategories-open .carousel-controls {
  opacity: 1;
  pointer-events: auto;
}

.carousel-spin-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(210, 172, 88, .42);
  color: #f3cf83;
  background: rgba(20, 14, 9, .46);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .36);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 22px;
  font-weight: 800;
}

.carousel-spin-btn:hover,
.carousel-spin-btn:focus-visible {
  color: #ffe29a;
  background: rgba(20, 14, 9, .62);
  outline: none;
}

.floating-category-grid {
  position: fixed;
  z-index: 6;
  left: 50%;
  top: 50%;
  width: min(560px, calc(100vw - 42px));
  height: min(720px, 84vh);
  opacity: 0;
  transform: translate(-50%, -46%) scale(.96);
  transform-style: preserve-3d;
  perspective: 1100px;
  pointer-events: none;
  cursor: grab;
  user-select: none;
  transition: opacity .55s ease, transform .55s ease;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(117, 62, 28, .58), rgba(45, 24, 14, .78) 48%, transparent 70%);
  box-shadow:
    0 34px 86px rgba(0, 0, 0, .54);
}

.floating-category-grid::before,
.floating-category-grid::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  height: 34px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 4;
}

.floating-category-grid::before {
  top: 24px;
  border: 2px solid rgba(232, 196, 112, .68);
  background:
    radial-gradient(ellipse at 50% 42%, rgba(8, 7, 6, .74), rgba(35, 20, 12, .9) 58%, rgba(219, 178, 95, .36) 62%, transparent 70%);
}

.floating-category-grid::after {
  bottom: 24px;
  border: 2px solid rgba(232, 196, 112, .5);
  background:
    radial-gradient(ellipse at 50% 54%, rgba(255, 232, 164, .32), rgba(70, 36, 18, .72) 56%, rgba(6, 5, 4, .55) 72%);
}

.floating-category-grid.dragging {
  cursor: grabbing;
}

.corridor-scene.subcategories-open .floating-category-grid {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.floating-subcategory {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: min(520px, 72vh);
  display: grid;
  place-items: center;
  padding: 12px 6px;
  border: 1px solid rgba(244, 196, 96, .34);
  border-radius: 4px;
  color: #f3cf83;
  background:
    linear-gradient(90deg, rgba(255, 218, 128, .18), transparent 12%, rgba(0, 0, 0, .24) 50%, rgba(255, 218, 128, .12)),
    linear-gradient(180deg, rgba(115, 47, 28, .94), rgba(65, 24, 18, .96));
  box-shadow:
    0 10px 28px rgba(0, 0, 0, .28),
    inset 8px 0 16px rgba(255, 216, 128, .12),
    inset -8px 0 16px rgba(0, 0, 0, .36);
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(12px, 1.05vw, 15px);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-shadow:
    0 1px 0 rgba(255, 248, 196, .38),
    0 2px 0 rgba(74, 40, 10, .94),
    0 0 18px rgba(235, 189, 93, .34);
  transform:
    translate(-50%, -50%)
    rotateY(calc(var(--card-angle) * 1deg))
    translateZ(min(220px, 28vw))
    rotateY(calc(var(--card-angle) * -1deg))
    scale(var(--card-scale, 1));
  opacity: var(--card-opacity, .45);
  transition:
    transform .72s cubic-bezier(.2, .82, .2, 1),
    opacity .72s ease,
    background .18s ease,
    color .18s ease;
}

.floating-subcategory:hover,
.floating-subcategory:focus-visible {
  color: #ffe29a;
  background:
    linear-gradient(90deg, rgba(255, 225, 142, .24), transparent 12%, rgba(0, 0, 0, .22) 50%, rgba(255, 225, 142, .18)),
    linear-gradient(180deg, rgba(142, 58, 31, .96), rgba(75, 27, 18, .98));
  outline: none;
}

.floating-subcategory[data-spine-tone="1"] {
  background:
    linear-gradient(90deg, rgba(255, 218, 128, .18), transparent 12%, rgba(0, 0, 0, .24) 50%, rgba(255, 218, 128, .12)),
    linear-gradient(180deg, rgba(126, 50, 28, .96), rgba(59, 22, 17, .98));
}

.floating-subcategory[data-spine-tone="2"] {
  background:
    linear-gradient(90deg, rgba(255, 218, 128, .18), transparent 12%, rgba(0, 0, 0, .24) 50%, rgba(255, 218, 128, .12)),
    linear-gradient(180deg, rgba(58, 34, 28, .96), rgba(22, 18, 17, .98));
}

.floating-subcategory[data-spine-tone="3"] {
  background:
    linear-gradient(90deg, rgba(255, 218, 128, .18), transparent 12%, rgba(0, 0, 0, .24) 50%, rgba(255, 218, 128, .12)),
    linear-gradient(180deg, rgba(138, 78, 30, .96), rgba(72, 35, 18, .98));
}

.floating-subcategory[data-spine-tone="4"] {
  background:
    linear-gradient(90deg, rgba(255, 218, 128, .18), transparent 12%, rgba(0, 0, 0, .24) 50%, rgba(255, 218, 128, .12)),
    linear-gradient(180deg, rgba(105, 25, 35, .96), rgba(52, 18, 23, .98));
}

.floating-subcategory[data-spine-tone="5"] {
  background:
    linear-gradient(90deg, rgba(255, 218, 128, .18), transparent 12%, rgba(0, 0, 0, .24) 50%, rgba(255, 218, 128, .12)),
    linear-gradient(180deg, rgba(112, 63, 24, .96), rgba(54, 29, 14, .98));
}

.floating-subcategory[data-spine-tone="6"] {
  background:
    linear-gradient(90deg, rgba(255, 218, 128, .18), transparent 12%, rgba(0, 0, 0, .24) 50%, rgba(255, 218, 128, .12)),
    linear-gradient(180deg, rgba(45, 48, 58, .96), rgba(18, 19, 24, .98));
}

.transition-fade {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 4, 3, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}

.transition-fade.visible {
  opacity: 1;
  pointer-events: auto;
}

.bookshelf-scene {
  position: fixed;
  inset: 0;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  background: #100d0a;
  transition: opacity .55s ease;
}

.bookshelf-scene.visible {
  opacity: 1;
  pointer-events: auto;
}

.bookshelf-background {
  position: absolute;
  inset: -3%;
  width: 106%;
  height: 106%;
  object-fit: cover;
  filter: blur(7px) brightness(.48) saturate(.9);
  transform: scale(1.06);
}

.bookshelf-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 640px at 50% 50%, transparent 42%, rgba(0, 0, 0, .34) 78%, rgba(0, 0, 0, .74) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .25), transparent 34%, rgba(0, 0, 0, .52));
  pointer-events: none;
}

.bookshelf-toolbar {
  position: fixed;
  z-index: 10;
  left: 18px;
  right: 18px;
  top: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 16, 13, .72);
  box-shadow: 0 18px 52px rgba(0, 0, 0, .34);
  backdrop-filter: blur(12px);
}

.bookshelf-toolbar h2 {
  margin: 0;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.sort-control select {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(0, 0, 0, .34);
  padding: 0 10px;
}

.bookshelf-viewport {
  position: fixed;
  z-index: 9;
  left: 0;
  right: 0;
  bottom: 8vh;
  height: min(560px, 62vh);
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  padding: 0 8vw 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(210, 172, 88, .6) rgba(0, 0, 0, .28);
}

.bookshelf-viewport.dragging {
  cursor: grabbing;
}

.bookshelf-track {
  min-width: max-content;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding-top: 90px;
  position: relative;
}

.bookshelf-track::before,
.bookshelf-track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 18px;
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(183, 108, 47, .95), rgba(70, 33, 17, .98));
  box-shadow:
    0 12px 24px rgba(0, 0, 0, .45),
    inset 0 1px 0 rgba(255, 228, 159, .25);
}

.bookshelf-track::before {
  bottom: 0;
}

.bookshelf-track::after {
  top: 86px;
}

.shelf-book {
  position: relative;
  width: var(--book-width, 48px);
  height: var(--book-height, 360px);
  margin-bottom: 18px;
  border: 1px solid rgba(255, 225, 148, .22);
  border-radius: 3px;
  background: var(--spine-bg, linear-gradient(180deg, #7b321f, #391512));
  box-shadow:
    inset 7px 0 12px rgba(255, 222, 145, .12),
    inset -8px 0 14px rgba(0, 0, 0, .36),
    0 16px 30px rgba(0, 0, 0, .3);
  color: #f2d187;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(255, 248, 196, .32),
    0 2px 0 rgba(74, 40, 10, .94),
    0 0 14px rgba(235, 189, 93, .3);
  user-select: none;
  overflow: hidden;
  transition: transform .16s ease, filter .16s ease;
}

.shelf-book::before,
.shelf-book::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shelf-book::before {
  background-image: var(--spine-image);
  background-position: center;
  background-size: cover;
  opacity: .88;
}

.shelf-book::after {
  background:
    linear-gradient(90deg, rgba(255, 235, 166, .22), rgba(0, 0, 0, .08) 18%, rgba(0, 0, 0, .28) 50%, rgba(255, 235, 166, .12)),
    linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 28%, rgba(0, 0, 0, .22));
  box-shadow:
    inset 5px 0 9px rgba(255, 222, 145, .14),
    inset -7px 0 12px rgba(0, 0, 0, .38);
}

.shelf-book span {
  position: relative;
  z-index: 1;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  max-height: calc(100% - 22px);
  overflow: hidden;
}

.shelf-book:hover,
.shelf-book:focus-visible {
  transform: translateY(-10px);
  filter: brightness(1.12);
  outline: 1px solid rgba(239, 197, 96, .44);
}

.entrance-hotspots {
  position: fixed;
  inset: 0;
  z-index: 13;
  pointer-events: none;
  opacity: 0;
  transition: opacity .28s ease;
}

#libraryApp.is-entrance .entrance-hotspots {
  opacity: 1;
  pointer-events: auto;
}

.entrance-hotspot {
  position: absolute;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 210, 108, 0);
  color: transparent;
  cursor: pointer;
  overflow: hidden;
}

.entrance-hotspot::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
  mix-blend-mode: screen;
}

.entrance-hotspot:hover,
.entrance-hotspot:focus-visible {
  background: transparent;
  outline: none;
}

.entrance-hotspot:hover::after,
.entrance-hotspot:focus-visible::after {
  opacity: 1;
}

.hotspot-shakespeare {
  left: 8%;
  top: 13%;
  width: 22%;
  height: 75%;
}

.hotspot-shakespeare::after {
  background:
    radial-gradient(ellipse at 52% 42%, rgba(255, 231, 159, .34), rgba(218, 160, 60, .18) 38%, transparent 68%);
  filter: blur(8px);
}

.hotspot-door {
  left: 39%;
  top: 28%;
  width: 22%;
  height: 62%;
  border-radius: 18px;
}

.hotspot-door::after {
  background:
    radial-gradient(ellipse at 50% 55%, rgba(255, 214, 112, .28), rgba(218, 160, 60, .13) 42%, transparent 72%);
  filter: blur(10px);
}

.hotspot-austen {
  right: 8%;
  top: 14%;
  width: 23%;
  height: 74%;
}

.hotspot-austen::after {
  background:
    radial-gradient(ellipse at 48% 44%, rgba(255, 231, 159, .32), rgba(218, 160, 60, .17) 38%, transparent 68%);
  filter: blur(8px);
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(8, 6, 5, .78), rgba(8, 6, 5, .08));
  pointer-events: none;
}

.brand,
.topnav {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .34);
  background:
    conic-gradient(from 0deg, var(--red), var(--green), var(--blue), var(--gold), var(--red));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn,
.ghost-btn,
.primary-link,
.ghost-link,
.direction-form button,
.carousel-btn,
.drawer-close,
.scene-command {
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, .08);
  text-decoration: none;
  cursor: pointer;
}

.nav-btn,
.ghost-btn,
.direction-form button,
.scene-command {
  min-height: 40px;
  padding: 9px 12px;
}

.nav-btn:hover,
.ghost-btn:hover,
.ghost-link:hover,
.carousel-btn:hover,
.direction-form button:hover,
.drawer-close:hover,
.scene-command:hover {
  background: rgba(255, 255, 255, .14);
}

.scene-command.primary {
  background: var(--gold);
  color: #1d160b;
  border-color: rgba(255, 255, 255, .2);
  font-weight: 760;
}

.scene-command.primary:hover {
  background: #e0bd67;
}

.journey-controls {
  position: fixed;
  z-index: 18;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.journey-controls.is-final {
  display: none;
}

.journey-controls.is-playing {
  pointer-events: none;
}

.journey-controls.is-playing .scene-command,
.journey-controls.is-playing .scene-counter {
  opacity: .7;
}

.scene-command[disabled] {
  opacity: .45;
  cursor: default;
}

.scene-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 58px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(0, 0, 0, .34);
  font-size: 13px;
  font-weight: 760;
}

.library-ui {
  position: fixed;
  z-index: 12;
  inset: 76px 18px 18px;
  pointer-events: none;
}

.panel {
  pointer-events: auto;
  width: min(620px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .42);
  backdrop-filter: blur(12px);
  transition: opacity .24s ease, transform .28s ease;
}

.panel[hidden],
.book-drawer[hidden] {
  display: block;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
}

.panel-reception {
  position: absolute;
  inset: 0;
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transform: none;
}

.panel-reception[hidden] {
  transform: none;
}

.panel-reception .eyebrow,
.panel-reception h1,
.panel-reception .direction-form {
  display: none;
}

.panel-section,
.panel-topics {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 18px;
}

.panel-topics {
  width: min(780px, calc(100vw - 36px));
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.panel-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.direction-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.direction-form input {
  min-width: 0;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--ink);
  background: rgba(0, 0, 0, .28);
  outline: none;
}

.direction-form input:focus {
  border-color: rgba(209, 170, 88, .78);
  box-shadow: 0 0 0 3px rgba(209, 170, 88, .12);
}

.collection-grid {
  position: fixed;
  inset: -3%;
  width: 106%;
  height: 106%;
  display: block;
  margin: 0;
  opacity: 0;
  transform:
    translate3d(var(--overlay-move-x, 0px), var(--overlay-move-y, 0px), 0)
    scale(var(--overlay-scale, 1.03));
  transform-origin: center center;
  transition: opacity 1.25s ease .45s, transform 1.25s ease .45s;
}

.panel-reception:not([hidden]) .collection-grid {
  opacity: 1;
  transform:
    translate3d(var(--overlay-move-x, 0px), var(--overlay-move-y, 0px), 0)
    scale(var(--overlay-scale, 1.03));
}

#libraryApp.desk-looking-up .collection-grid {
  opacity: .18;
  transform:
    translate3d(var(--overlay-move-x, 0px), calc(var(--overlay-move-y, 0px) + 10vh), 0)
    scale(1.08);
  transition: opacity 1.05s ease, transform 1.25s cubic-bezier(.2, .78, .18, 1);
  pointer-events: none;
}

.collection-card,
.category-card,
.topic-card,
.book-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: var(--ink);
  text-align: left;
}

.collection-card,
.category-card,
.topic-card {
  cursor: pointer;
}

.collection-card {
  position: absolute;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(255, 238, 174, .28),
    0 2px 0 rgba(74, 40, 10, .95),
    0 0 14px rgba(218, 170, 75, .26);
}

.collection-card::before {
  display: none;
}

.collection-card strong,
.category-card strong,
.topic-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 19px;
  line-height: 1.16;
  letter-spacing: 0;
}

.collection-card strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.collection-card span,
.category-card span,
.topic-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.collection-card span {
  display: none;
}

.collection-card:hover,
.category-card:hover,
.topic-card:hover,
.book-card:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(209, 170, 88, .5);
}

.panel-reception .collection-card:hover {
  background: transparent;
}

.collection-card:hover strong {
  color: transparent;
}

.desk-hotspot {
  background: rgba(255, 210, 108, 0);
  outline: 1px solid transparent;
  transition: background .18s ease, outline-color .18s ease;
}

.desk-hotspot:hover,
.desk-hotspot:focus-visible {
  background: rgba(255, 210, 108, .08);
  outline-color: rgba(239, 197, 96, .34);
}

.desk-hotspot-1 {
  left: 15%;
  top: 41.5%;
  width: 26%;
  height: 17%;
}

.desk-hotspot-2 {
  left: 51%;
  top: 41.5%;
  width: 29%;
  height: 17%;
}

.desk-hotspot-3 {
  left: 11.5%;
  top: 63%;
  width: 28%;
  height: 22%;
}

.desk-hotspot-4 {
  left: 54.5%;
  top: 62.5%;
  width: 29%;
  height: 22%;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-head.compact {
  align-items: center;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 46vh;
  overflow: auto;
  padding-right: 4px;
}

.category-card {
  min-height: 88px;
  padding: 12px;
}

.carousel-shell {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: stretch;
  gap: 8px;
}

.carousel-btn {
  width: 42px;
  min-height: 132px;
  font-size: 26px;
}

.topic-window {
  overflow: hidden;
  border-radius: 8px;
}

.topic-track {
  display: flex;
  gap: 10px;
  transition: transform .34s cubic-bezier(.2, .82, .2, 1);
}

.topic-card {
  flex: 0 0 min(220px, 56vw);
  min-height: 132px;
  padding: 14px;
}

.topic-card.active {
  border-color: rgba(209, 170, 88, .82);
  background: rgba(209, 170, 88, .18);
}

.book-shelf {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  background: rgba(0, 0, 0, .22);
}

.book-rail {
  display: flex;
  gap: 12px;
  min-height: 152px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.book-card {
  flex: 0 0 112px;
  padding: 8px;
  cursor: pointer;
}

.book-cover {
  width: 96px;
  height: 136px;
  display: block;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 12px 22px rgba(0, 0, 0, .38);
  background: linear-gradient(135deg, var(--red), var(--green));
}

.empty-shelf {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 138px;
  border: 1px dashed rgba(247, 241, 228, .2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  background: rgba(0, 0, 0, .16);
}

.book-drawer,
.person-drawer {
  position: fixed;
  z-index: 16;
  right: 18px;
  bottom: 18px;
  width: min(330px, calc(100vw - 36px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .48);
  backdrop-filter: blur(14px);
  transition: opacity .24s ease, transform .28s ease;
}

.person-drawer {
  left: 18px;
  right: auto;
  bottom: 18px;
}

.person-drawer.austen {
  left: auto;
  right: 7%;
  bottom: 9%;
}

.person-drawer.shakespeare {
  left: 7%;
  right: auto;
  bottom: 9%;
}

.drawer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 20px;
}

.drawer-cover-wrap {
  width: 118px;
  height: 168px;
  margin-bottom: 14px;
  perspective: 700px;
}

.drawer-cover {
  width: 118px;
  height: 168px;
  object-fit: cover;
  border-radius: 4px;
  transform: rotateY(-12deg);
  transform-origin: left center;
  box-shadow: 14px 16px 30px rgba(0, 0, 0, .44);
  background: linear-gradient(135deg, var(--red), var(--green));
}

.drawer-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.primary-link,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 12px;
  font-weight: 720;
}

.primary-link {
  background: var(--gold);
  color: #1b1710;
  border-color: rgba(255, 255, 255, .16);
}

.primary-link:hover {
  background: #e1bd69;
}

.route-status {
  position: fixed;
  z-index: 14;
  left: 18px;
  bottom: 18px;
  max-width: min(460px, calc(100vw - 36px));
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

@media (max-width: 920px) {
  .collection-grid {
    inset: -3%;
    width: 106%;
    height: 106%;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    align-items: flex-start;
    padding: 12px;
  }

  .brand {
    max-width: 190px;
  }

  .library-ui {
    inset: 82px 12px 12px;
  }

  h1 {
    font-size: 30px;
  }

  .panel-section,
  .panel-topics {
    padding: 14px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .panel-section,
  .panel-topics {
    bottom: 0;
  }

  .panel-reception {
    padding: 0;
  }

  .collection-grid {
    inset: -3%;
    width: 106%;
    height: 106%;
  }

  .journey-controls,
  .book-drawer {
    right: 12px;
    bottom: 12px;
  }

  .carousel-controls {
    left: 50%;
    right: auto;
    gap: min(44vw, 280px);
  }

  .floating-category-grid {
    width: min(420px, calc(100vw - 24px));
    height: min(520px, 68vh);
  }

  .floating-subcategory {
    height: min(390px, 58vh);
  }
}

@media (max-height: 720px) {
  .panel-section,
  .panel-topics {
    max-height: calc(100vh - 100px);
    overflow: auto;
  }
}
