:root {
  color-scheme: dark;
  box-sizing: border-box;
  --fg: #ffffff;
  --mute: #9a9ba2;
  --g1: #d9dce2;
  --g2: #ffffff;
  --glow: #ffffff;
}
*,
*:before,
*:after {
  box-sizing: inherit;
}
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, sans-serif;
}
/* Colour glow retired (kept hidden in case bookcovers.js creates/updates it) */
.glow {
  display: none;
}

/* ---------- Page layout (one screen, no scroll) ---------- */
body.page-covers {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
}
body.page-covers main {
  flex: 1;
  min-height: 0;
}
.covers {
  position: relative;
  display: flex; /* new */
  flex-direction: column;
  height: 100%;
  padding: calc(var(--nav-h) + 0.5rem) 0 3.25rem;
  overflow: hidden;
  isolation: isolate;
}

.covers > .container-xl {
  flex: none; /* new: the header keeps its natural height */
}

#track {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  container-type: size;
  display: flex;
  align-items: center;
  gap: 56px;
  padding: 0 20vw 0 14vw;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  cursor: grab;
  touch-action: pan-x;
}
#track::-webkit-scrollbar {
  display: none;
}
#track.drag {
  cursor: grabbing;
}
.card {
  flex: none;
  perspective: 900px;
  transition:
    opacity 0.4s,
    filter 0.4s,
    transform 0.5s;
}
.card:nth-child(odd) {
  transform: translateY(-7cqh);
}
.card:nth-child(even) {
  transform: translateY(8cqh) scale(0.88);
}
.card:nth-child(3n) {
  --s: 1.1;
}
#track:hover .card {
  opacity: 0.45;
  filter: blur(1px);
}
#track .card:hover {
  opacity: 1;
  filter: none;
}
.cover {
  position: relative;
  width: min(250px, 56vw, 52vh); /* fallback for very old browsers */
  width: min(250px, 56vw, max(96px, 52cqh)); /* 52% of the track's own height */
  aspect-ratio: 2/3;
  border-radius: 4px 10px 10px 4px;
  overflow: hidden;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.8),
    inset 6px 0 8px -4px rgba(255, 255, 255, 0.25);
  transition:
    transform 0.15s ease-out,
    box-shadow 0.3s;
  transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 7% 8%;
  user-select: none;
}
.card:hover .cover {
  box-shadow:
    0 40px 80px -20px var(--c, #000),
    inset 6px 0 8px -4px rgba(255, 255, 255, 0.25);
}
.cover .t {
  position: relative;
  z-index: 2;
  font-weight: 600;
  line-height: 1.02;
  font-size: clamp(22px, 2.1vw, 31px);
  letter-spacing: -0.02em;
}
.cover .a {
  position: relative;
  z-index: 2;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 10px;
  opacity: 0.8;
}
.art {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.serif .t {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-weight: 500;
}

.img {
  background: linear-gradient(#0b2a33, #041014);
}

.label {
  position: relative;
  z-index: 5;
  pointer-events: none;
}
.label h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.15rem, 1.9vw, 1.6rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1.1;
  letter-spacing: -0.005em;
  text-transform: uppercase;
}
.label p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 600;
  font-stretch: 110%;
  line-height: 1.9;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.covers__bar {
  position: absolute;
  inset: auto 0 0.9rem 0;
  margin-inline: auto;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 1.5rem;
  width: var(--stage-w);
  margin-top: 0.75rem;
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.prog {
  width: 140px;
  margin-left: auto;
  font-family: var(--display);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--mute);
  text-align: right;
  pointer-events: none;
}
.prog div {
  height: 2px;
  background: rgba(255, 255, 255, 0.16);
  margin-top: 8px;
  border-radius: 2px;
}
.prog b {
  display: block;
  height: 100%;
  width: 0;
  background: var(--chrome);
  border-radius: 2px;
}

#view {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 64px;
  padding: 24px;
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(14px);
  flex-wrap: wrap;
}
#view.on {
  display: flex;
  animation: in 0.4s;
}
@keyframes in {
  from {
    opacity: 0;
  }
}
#view .cover {
  width: min(330px, 70vw);
  transform: none !important;
}
#view .info {
  max-width: 340px;
}
#view small {
  color: var(--muted);
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.64rem;
}
#view h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  margin: 12px 0;
  line-height: 1.12;
}
#view p {
  color: var(--mute);
  line-height: 1.6;
}
#view .btn-obz {
  margin: 8px 8px 0 0;
}
.cover.img {
  background: #000;
  padding: 0;
}
.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
/* keeps the spine highlight, which the image would otherwise cover */
.cover.img::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 6px 0 8px -4px rgba(255, 255, 255, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
/* ---------- Footer: copyright only, bottom-left ---------- */
.footer--slim {
  padding: 1.25rem 0;
}
.footer--slim .footer__bottom {
  margin: 0;
  padding: 0;
  border: 0;
  justify-content: flex-start;
}

@media (max-width: 700px) {
  .prog {
    width: 90px;
  }
  #view {
    gap: 20px;
  }
}
