/* ============ tiny encyclopedia of rock n' roll ============ */
/* palette: deep purple night (#130031) + the warm clouds from images/background (sunset recoloured purple) */
:root {
  --sky: #3f6aa3;
  --dusk: #6e6a9a;
  --yellow: #feff9f;
  --coral: #e07a68;
  --rose: #ad6f78;
  --plum: #4a2a74;
  --night: #130031;
  --night-2: #22094a;
  --night-3: #33175f;
  --paper: #fdf6e7;
  --paper-2: #f4e8cf;
  --ink: #0d0021;
  --pen: #2b3a8c;
  --marker: #8a2f9a;
  --heart: #e24666;
  --lime: #a3c100;
  --mint: #50c878;
  --drop: rgba(8, 0, 24, 0.5);
  --px: 4px;

  --f-pixel: "Press Start 2P", monospace;
  --f-ui: "Pixelify Sans", system-ui, sans-serif;
  --f-hand: "Gochi Hand", "Comic Sans MS", cursive;
  --f-stencil:
    "Sirin Stencil", "Trebuchet MS", sans-serif; /* section titles + subtitles */

  --nav-h: 64px;
  --gutter: 40px; /* side padding on every page */
  --band: var(--yellow);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}
body {
  font-family: var(--f-ui);
  font-size: 18px;
  line-height: 1.5;
  color: var(--paper);
  background: var(--night);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
:focus-visible {
  outline: 3px dashed var(--lime);
  outline-offset: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.pixelated {
  image-rendering: pixelated;
}

/* ---------- pixel frame: 4 hard shadows = border with notched corners ---------- */
.px {
  --bd: var(--ink);
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--bd),
    0 var(--px) 0 0 var(--bd),
    calc(-1 * var(--px)) 0 0 0 var(--bd),
    var(--px) 0 0 0 var(--bd),
    0 calc(3 * var(--px)) 0 0 var(--drop),
    var(--px) calc(2 * var(--px)) 0 0 var(--drop),
    calc(2 * var(--px)) var(--px) 0 0 var(--drop);
}

/* ---------- buttons ---------- */
.btn {
  --bg: var(--paper);
  --fg: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.55em 1.1em;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.08s steps(2),
    filter 0.15s;
}
.btn:hover {
  filter: brightness(1.07);
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(3px);
}
.btn--hot {
  --bg: var(--coral);
  --fg: #fff;
}
.btn--lime {
  --bg: var(--lime);
}
.btn--ghost {
  --bg: var(--night-3);
  --fg: var(--paper);
}
.btn--big {
  font-size: 1.15rem;
  padding: 0.8em 1.5em;
}
.btn svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  text-decoration: none; /* play buttons are links */
  width: 40px;
  height: 40px;
  background: var(--paper);
  color: var(--ink);
  transition: transform 0.08s steps(2);
}
.icon-btn:hover {
  transform: translateY(-2px);
}
.icon-btn:active {
  transform: translateY(2px);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- navbar ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--gutter);
  background: rgba(19, 0, 49, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 4px solid var(--ink);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-pixel);
  font-size: 11px;
  line-height: 1.5;
  text-decoration: none;
  color: var(--paper);
}
.nav__brand svg {
  width: 30px;
  height: 30px;
  flex: none;
}
.nav__links {
  display: flex;
  gap: 6px;
  list-style: none;
}
.nav__links a {
  display: block;
  padding: 6px 12px;
  text-decoration: none;
  font-weight: 600;
  color: var(--paper);
}
.nav__links a:hover {
  color: var(--lime);
}
.nav__links a[aria-current="page"] {
  background: var(--paper);
  color: var(--ink);
}

.search {
  position: relative;
  margin-left: auto;
  width: min(340px, 100%);
}
.search__box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 10px;
}
.search__box svg {
  width: 18px;
  height: 18px;
  flex: none;
  opacity: 0.7;
}
.search input {
  width: 100%;
  padding: 8px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}
.search input::placeholder {
  color: #8a86a8;
}
.search__results {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  background: var(--paper);
  color: var(--ink);
  list-style: none;
  max-height: 60vh;
  overflow-y: auto;
  display: none;
}
.search.is-open .search__results {
  display: block;
}
.search__results li a,
.search__results li.empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  text-decoration: none;
}
.search__results li a:hover,
.search__results li a.is-active {
  background: var(--yellow);
}
.search__results .tag {
  font-family: var(--f-pixel);
  font-size: 8px;
  padding: 4px 6px;
  background: var(--night);
  color: var(--paper);
  flex: none;
}
.search__results .tag--song {
  background: var(--rose);
}
.search__results small {
  margin-left: auto;
  opacity: 0.6;
  white-space: nowrap;
}
.search__results mark {
  background: var(--lime);
  color: inherit;
}
.search.shake {
  animation: shake 0.3s steps(4);
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

/* ---------- pixel heart loader (from the Pixel Heart design asset) ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 24px;
  background: var(--night);
  transition:
    opacity 0.4s,
    visibility 0.4s;
}
.loader.is-done {
  opacity: 0;
  visibility: hidden;
}
.loader p {
  font-family: var(--f-pixel);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--yellow);
}
.loader p::after {
  content: "";
  animation: dots 1.2s steps(4) infinite;
}
@keyframes dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
}

.px-heart {
  --cell: 18px;
  display: grid;
  grid-template-columns: repeat(9, var(--cell));
  grid-auto-rows: var(--cell);
  gap: calc(var(--cell) / 4);
}
.px-heart i {
  display: block;
  opacity: 0;
  transform: scale(0);
}
.px-heart i.on {
  animation:
    pop 0.5s forwards,
    beat 1.6s 1.4s ease-in-out infinite;
}
.px-heart--sm {
  --cell: 8px;
}
@keyframes pop {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes beat {
  0%,
  100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.15);
  }
  30% {
    transform: scale(0.95);
  }
}
.inline-loader {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 40px 0;
  font-family: var(--f-pixel);
  font-size: 10px;
  color: var(--marker);
}

/* ---------- sky (parallax layers from images/background) ---------- */
.sky {
  position: relative;
  overflow: hidden;
  overflow: clip; /* clip (not hidden) so position: sticky still works inside */
  min-height: min(100vh, 1000px);
  display: grid;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) var(--gutter) 120px;
  background: #3d1592;
  isolation: isolate;
}
.sky--short {
  min-height: min(78vh, 780px);
}
.sky__layer {
  position: absolute;
  inset: -6% -4% -2%;
  z-index: -1;
  will-change: transform;
}
.sky__layer > div {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.sky__layer--1 > div {
  background-image: url("../images/background/1.png");
}
.sky__layer--2 > div {
  background-image: url("../images/background/2.png");
}
.sky__layer--2 {
  animation: twinkle 4s steps(4) infinite;
}
.sky__layer--3 > div {
  background-image: url("../images/background/3.png");
}
.sky__layer--4 > div {
  background-image: url("../images/background/4.png");
}
.sky::after {
  /* fade the bottom of the scene into the page */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 140px;
  z-index: -1;
  background: linear-gradient(to bottom, transparent, var(--night));
}
@keyframes twinkle {
  50% {
    opacity: 0.55;
  }
}

.bat-flyer {
  position: absolute;
  z-index: 0;
  left: 0;
  top: 18%;
  width: 64px;
  height: 64px;
  animation: fly 22s linear infinite;
  pointer-events: none;
}
/* the sprite faces left but flies right, so mirror it (origin = centre of its 64px drawing) */
.bat-flyer .pixel-bat {
  transform: scale(-1.4, 1.4);
  transform-origin: 32px 32px;
}
.bat-flyer--2 {
  top: 34%;
  animation-duration: 31s;
  animation-delay: -12s;
}
.bat-flyer--2 .pixel-bat {
  transform: scale(-0.9, 0.9);
}
/* bats that roam over any page (spawned by startBats in app.js) */
.roaming-bat {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 45;
  width: 64px;
  height: 64px;
  pointer-events: none;
}
.roaming-bat .pixel-bat {
  transform-origin: 32px 32px;
}
@keyframes fly {
  0% {
    transform: translate(-120px, 0);
  }
  25% {
    transform: translate(25vw, -40px);
  }
  50% {
    transform: translate(50vw, 30px);
  }
  75% {
    transform: translate(75vw, -20px);
  }
  100% {
    transform: translate(calc(100vw + 120px), 10px);
  }
}

/* ---------- landing hero ---------- */
.hero {
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
}
.hero__kicker {
  display: inline-block;
  margin-bottom: 26px;
  font-family: var(--f-pixel);
  font-size: 10px;
  letter-spacing: 2px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 14px;
  transform: rotate(-2deg);
}
.hero h1 {
  font-family: var(--f-pixel);
  font-size: clamp(18px, 5.4vw, 62px);
  line-height: 1.35;
  color: var(--paper);
  text-shadow:
    4px 4px 0 var(--ink),
    8px 8px 0 rgba(19, 0, 49, 0.35);
}
.hero h1 .amp {
  color: var(--lime);
}
.hero h1 .roll {
  color: var(--yellow);
}
.hero__sub {
  margin: 26px auto 34px;
  max-width: 34ch;
  font-family: var(--f-stencil);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.35;
  color: #fff;
  text-shadow: 2px 2px 0 var(--plum);
}
.hero__actions {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  font-family: var(--f-pixel);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--paper);
  animation: bob 1.4s steps(2) infinite;
  text-decoration: none;
}
@keyframes bob {
  50% {
    transform: translate(-50%, 6px);
  }
}

/* ---------- sections ---------- */
.section {
  padding: 90px var(--gutter);
  max-width: 1180px;
  margin: 0 auto;
}
.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  padding-bottom: 40px;
}
.section__title {
  font-family: var(--f-stencil);
  font-weight: 400;
  font-size: clamp(30px, 3.8vw, 44px);
  line-height: 1.1;
  letter-spacing: 0.5px;
  text-shadow: 3px 3px 0 var(--ink);
}
.section__title .ico {
  color: var(--heart);
  font-size: 0.7em;
  vertical-align: 0.15em;
}
.section__note {
  font-family: var(--f-stencil);
  font-size: 21px;
  color: var(--yellow);
}

/* ---------- random song machine ---------- */
.machine {
  background: var(--night-2);
  padding: 34px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}
.machine__screen {
  background: #0b001f;
  color: var(--mint);
  font-family: var(--f-pixel);
  font-size: clamp(11px, 1.6vw, 15px);
  line-height: 1.6;
  padding: 18px 20px;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-wrap: anywhere; /* long titles wrap instead of getting cut off */
}
.machine__screen::before {
  content: ">";
  flex: none;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.machine__controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.song-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  align-items: center;
  background: var(--paper);
  color: var(--ink);
  padding: 26px;
  animation: drop-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes drop-in {
  from {
    transform: translateY(-16px) rotate(-1deg);
    opacity: 0;
  }
}
.song-card__cover {
  position: relative;
  aspect-ratio: 1;
}
.song-card__cover img.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.song-card__band {
  font-family: var(--f-pixel);
  font-size: 10px;
  color: var(--rose);
  text-decoration: none;
}
.song-card__band:hover {
  text-decoration: underline;
}
.song-card h3 {
  font-family: var(--f-hand);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  margin: 8px 0 18px;
  color: var(--pen);
}
.song-card__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.song-card .realpage-peek {
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 70px;
  aspect-ratio: 3/4;
  object-fit: cover;
  transform: rotate(8deg);
  border: 4px solid #fff;
  box-shadow: 3px 3px 0 var(--drop);
  cursor: zoom-in;
}

/* ---------- like button ---------- */
.like {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 700;
  min-width: 74px;
  transition: transform 0.08s steps(2);
}
.like svg {
  width: 22px;
  height: 20px;
}
.like .heart-cell {
  fill: #c9c2b2;
  transition: fill 0.2s;
}
.like:hover .heart-cell {
  fill: #f3a3b5;
}
.like.is-liked .heart-cell {
  fill: var(--heart);
}
.like.is-liked {
  background: #ffe1e8;
}
.like.burst svg {
  animation: burst 0.45s steps(4);
}
@keyframes burst {
  40% {
    transform: scale(1.5) rotate(-8deg);
  }
}

/* ---------- band shelf / all bands: vinyl record sleeves ---------- */
.cards {
  display: grid;
  gap: 56px 40px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
/* --glitter stays "none" until a card is active, so the glitter only downloads on first hover/tap */
.record {
  --tilt: -2deg;
  --glitter: none;
  color: var(--paper);
}
.cards .record:nth-child(even) {
  --tilt: 2deg;
}
.cards .record:nth-child(3n) {
  --tilt: -1deg;
}

/* sleeve + disc area: the sleeve is 80% wide so the record has room to slide out.
   Only an animation (hover on PC, tap on phones); the band name below is the link. */
.record__art {
  position: relative;
  aspect-ratio: 1.25 / 1;
  -webkit-tap-highlight-color: transparent;
}
.record__disc {
  position: absolute;
  top: 4%;
  left: 20%;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      transparent 0 30%,
      rgba(255, 255, 255, 0.07) 31% 32%,
      transparent 33%
    ),
    conic-gradient(
      from 40deg,
      rgba(255, 255, 255, 0.12),
      transparent 12%,
      transparent 48%,
      rgba(255, 255, 255, 0.1),
      transparent 62%
    ),
    repeating-radial-gradient(circle, #151515 0 2px, #222 2px 4px);
  box-shadow: 4px 6px 0 var(--drop);
  transition: transform 0.6s cubic-bezier(0.2, 1.2, 0.4, 1);
  display: grid;
  place-items: center;
}
.record__label {
  position: relative;
  overflow: hidden;
  width: 36%;
  aspect-ratio: 1;
  border-radius: 50%;
  /* --label = most-used non-black colour of the cover, found by labelColors() in app.js */
  background: var(--label, var(--band));
  transition: background-color 0.4s;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.18);
}
.record__label::before {
  /* glitter on the label, only while the card is active */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glitter) center / 260% auto;
  mix-blend-mode: screen;
  opacity: var(--shine, 0);
  transition: opacity 0.35s;
}
.record__label::after {
  content: "";
  position: relative;
  width: 14%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--night);
}

.record__sleeve {
  position: absolute;
  top: 0;
  left: 0;
  width: 80%;
  aspect-ratio: 1;
  background: var(--band);
  transform: rotate(var(--tilt));
  transition: transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.record__sleeve > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* holographic foil: the glitter (animated webp), screen-blended so only the sparkles show; invisible until active */
.record__glitter {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
        115deg,
        transparent 20%,
        rgba(242, 163, 179, 0.35) 40%,
        rgba(155, 127, 209, 0.35) 52%,
        rgba(127, 200, 209, 0.3) 62%,
        transparent 80%
      )
      100% 0 / 300% 100% no-repeat,
    var(--glitter) center / 130% auto;
  mix-blend-mode: screen;
  opacity: var(--shine, 0); /* --shine is scrubbed by scroll on phones */
  transition:
    opacity 0.35s,
    background-position 0.9s ease;
}
.record__sticker {
  position: absolute;
  left: -10px;
  bottom: 14px;
  width: 64%;
  height: 26%;
  background: var(--paper);
  transform: rotate(-4deg);
  box-shadow: 3px 3px 0 var(--drop);
}
.record__sticker img {
  position: absolute;
  inset: 6px 10px;
  width: calc(100% - 20px);
  height: calc(100% - 12px);
  object-fit: contain;
  mix-blend-mode: multiply;
}
.record__sticker::before {
  /* a bit of pink washi tape holding the sticker on */
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 46px;
  height: 16px;
  transform: translateX(-50%) rotate(3deg);
  background: repeating-linear-gradient(
    45deg,
    rgba(242, 163, 179, 0.9) 0 6px,
    rgba(255, 214, 224, 0.9) 6px 12px
  );
}
.record .pages-badge {
  position: absolute;
  top: -12px;
  right: -14px;
  transform: rotate(8deg);
  background: var(--coral);
  color: #fff;
  padding: 6px 8px;
  font-family: var(--f-pixel);
  font-size: 8px;
  box-shadow: 3px 3px 0 var(--drop);
}

.record__meta {
  margin-top: 18px;
}
.record__name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-family: var(--f-pixel);
  font-size: 12px;
  line-height: 1.6;
  color: var(--paper);
  text-decoration: none;
}
.record__name::after {
  content: "→";
  font-family: var(--f-ui);
  font-size: 18px;
  transition: transform 0.2s steps(2);
}
.record__name:hover {
  color: var(--lime);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.record__name:hover::after {
  transform: translateX(4px);
}
.record__meta span {
  display: block;
  font-family: var(--f-hand);
  font-size: 19px;
  color: var(--yellow);
}

/* phones: the record rolls out/in with the scroll (GSAP scrub in app.js), so no CSS easing in the way */
.cards.scroll-driven .record__disc,
.cards.scroll-driven .record__sleeve,
.cards.scroll-driven .record__glitter,
.cards.scroll-driven .record__label::before {
  transition: none;
}
.record.glitter-ready {
  --glitter: url("../images/fx/glitter.webp");
}

/* active state: hover on PC, tap (.is-on) as a fallback, keyboard focus on the name */
.record.is-on,
.record:focus-within {
  --glitter: url("../images/fx/glitter.webp");
}
.record.is-on .record__sleeve,
.record:focus-within .record__sleeve {
  transform: rotate(0deg) translateY(-6px);
}
.record.is-on .record__disc,
.record:focus-within .record__disc {
  transform: translateX(44%) rotate(200deg);
}
.record.is-on .record__glitter,
.record:focus-within .record__glitter {
  opacity: 1;
  background-position:
    0 0,
    center;
}
.record.is-on .record__label::before,
.record:focus-within .record__label::before {
  opacity: 1;
}
@media (hover: hover) {
  .record__art:hover {
    --glitter: url("../images/fx/glitter.webp");
  }
  .record__art:hover .record__sleeve {
    transform: rotate(0deg) translateY(-6px);
  }
  .record__art:hover .record__disc {
    transform: translateX(44%) rotate(200deg);
  }
  .record__art:hover .record__glitter {
    opacity: 1;
    background-position:
      0 0,
      center;
  }
  .record__art:hover .record__label::before {
    opacity: 1;
  }
}

.filter {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
  width: min(320px, 100%);
}
.filter svg {
  width: 18px;
  height: 18px;
  flex: none;
  opacity: 0.7;
}
.filter input {
  border: 0;
  outline: 0;
  background: transparent;
  padding: 10px 0;
  font: inherit;
  width: 100%;
  color: var(--ink);
}
.empty-note {
  font-family: var(--f-hand);
  font-size: 26px;
  color: var(--yellow);
  text-align: center;
  padding: 40px 0;
}

/* ---------- the real book (landing) ---------- */
.book {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 50px;
  align-items: center;
}
.book__stack {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}
.book__page {
  position: absolute;
  width: 58%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 6px solid #fff;
  box-shadow: 6px 8px 0 var(--drop);
  background: var(--paper-2);
  cursor: zoom-in;
  transition:
    transform 0.35s cubic-bezier(0.2, 1.3, 0.4, 1),
    z-index 0s;
}
.book__page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book__page:nth-child(1) {
  left: 2%;
  top: 10%;
  transform: rotate(-9deg);
}
.book__page:nth-child(2) {
  left: 22%;
  top: 2%;
  transform: rotate(3deg);
  z-index: 2;
}
.book__page:nth-child(3) {
  left: 40%;
  top: 14%;
  transform: rotate(11deg);
  z-index: 3;
}
.book__page:hover {
  transform: rotate(0) scale(1.06) translateY(-10px);
  z-index: 5;
}
.book__copy p {
  font-family: var(--f-hand);
  font-size: 25px;
  line-height: 1.35;
  margin-bottom: 18px;
  color: #fff;
}
.book__copy p em {
  color: var(--lime);
  font-style: normal;
}

/* ---------- most loved ---------- */
.loved {
  list-style: none;
  display: grid;
  gap: 14px;
  counter-reset: loved;
}
.loved li,
.record {
  transition:
    opacity 0.6s ease,
    translate 0.6s ease;
}
.reveal-wait {
  opacity: 0;
  translate: 0 24px;
}
.loved li {
  counter-increment: loved;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--night-2);
  padding: 12px 16px;
}
.loved li::before {
  content: counter(loved);
  font-family: var(--f-pixel);
  font-size: 18px;
  color: var(--lime);
  text-align: center;
}
.loved a {
  text-decoration: none;
}
.loved a:hover strong {
  text-decoration: underline;
}
.loved strong {
  display: block;
  font-size: 20px;
}
.loved span {
  opacity: 0.7;
  font-size: 15px;
}

/* ---------- band page hero (GSAP overlap design asset) ---------- */
.band-hero {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}
.band-hero__text {
  grid-row: 1;
  grid-column: 1 / 4;
  z-index: 2;
  align-self: end;
  background: var(--paper);
  color: var(--ink);
  padding: 34px 34px 30px;
}
.band-hero__logo {
  height: 92px;
  width: auto;
  max-width: 100%;
  mix-blend-mode: multiply;
  margin-bottom: 18px;
  object-fit: contain;
  object-position: left;
}
.band-hero h1 {
  font-family: var(--f-pixel);
  font-size: clamp(18px, 2.6vw, 28px);
  line-height: 1.4;
  margin-bottom: 6px;
}
.band-hero__from {
  font-family: var(--f-pixel);
  font-size: 9px;
  color: var(--rose);
  margin-bottom: 16px;
}
.band-hero__blurb {
  font-family: var(--f-hand);
  font-size: 23px;
  line-height: 1.35;
  color: var(--pen);
  margin-bottom: 22px;
}
.band-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.band-hero__stats {
  font-family: var(--f-pixel);
  font-size: 9px;
  line-height: 1.8;
  color: var(--plum);
}
.band-hero__media {
  grid-row: 1;
  grid-column: 3 / -1;
  position: relative;
  display: grid;
  place-items: center;
  border: 8px solid var(--paper);
  background: var(--night);
  box-shadow: 10px 12px 0 var(--drop);
  transform: rotate(2deg);
}
.band-hero__media .clip {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3.4;
}
.band-hero__media .clip img {
  width: 100%;
  height: 120%;
  object-fit: cover;
}
.band-hero__media .play-big {
  position: absolute;
  width: 104px;
  height: 104px;
  transition: transform 0.2s steps(3);
}
.band-hero__media .play-big:hover {
  transform: scale(1.1) rotate(-6deg);
}
.band-hero__media .play-big svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(4px 4px 0 var(--drop));
}

/* ---------- tracklist ---------- */
.tracklist {
  list-style: none;
  display: grid;
  gap: 14px;
}
.track {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--paper);
  color: var(--ink);
  transition:
    transform 0.15s steps(2),
    background 0.3s,
    opacity 0.6s ease,
    translate 0.6s ease;
}
.track:hover {
  transform: translateX(4px);
}
.track__num {
  font-family: var(--f-pixel);
  font-size: 13px;
  color: var(--rose);
  text-align: center;
}
.track__title {
  font-family: var(--f-hand);
  font-size: 26px;
  line-height: 1.1;
  color: var(--pen);
  overflow-wrap: anywhere;
}
.track__badge {
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
  font-family: var(--f-pixel);
  font-size: 7px;
  letter-spacing: 1px;
  padding: 5px 7px;
  background: var(--lime);
  color: var(--ink);
  transform: rotate(-3deg);
  cursor: zoom-in;
}
.track__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.track.flash {
  animation: flash 1.6s steps(6) 2;
}
@keyframes flash {
  50% {
    background: var(--lime);
  }
}

/* ---------- band page: real book pages (overlapping layout) ---------- */
.pages {
  display: grid;
  gap: 110px;
}
.page-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}
.page-row__img {
  grid-row: 1;
  grid-column: 2 / -1;
  overflow: hidden;
  border: 8px solid #fff;
  background: var(--paper-2);
  box-shadow: 10px 12px 0 var(--drop);
  transform: rotate(-1.5deg);
  cursor: zoom-in;
  max-height: 640px;
}
.page-row__img img {
  width: 100%;
  height: 115%;
  object-fit: cover;
  object-position: top;
}
.page-row__cap {
  grid-row: 1;
  grid-column: 1 / 3;
  z-index: 2;
  align-self: end;
  margin-bottom: 40px;
  background: var(--paper);
  color: var(--ink);
  padding: 22px 24px;
}
.page-row:nth-child(even) .page-row__img {
  grid-column: 1 / 5;
  transform: rotate(1.5deg);
}
.page-row:nth-child(even) .page-row__cap {
  grid-column: 4 / -1;
  align-self: center;
  margin-bottom: 0;
}
.page-row__cap small {
  font-family: var(--f-pixel);
  font-size: 8px;
  color: var(--rose);
}
.page-row__cap h3 {
  font-family: var(--f-hand);
  font-size: 34px;
  line-height: 1.1;
  color: var(--pen);
  margin: 8px 0 14px;
}

.other-bands {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- modal: lyrics on graph paper ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(13, 0, 33, 0.75);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s,
    visibility 0.25s;
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
}
.modal__box {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background-color: #fbf8ef;
  color: var(--pen);
  background-image:
    linear-gradient(#d3dcec 1px, transparent 1px),
    linear-gradient(90deg, #d3dcec 1px, transparent 1px);
  background-size: 24px 24px;
  transform: translateY(20px) rotate(-1deg);
  transition: transform 0.3s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.modal.is-open .modal__box {
  transform: none;
}
.modal__content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.modal__head {
  padding: 26px 70px 10px 30px;
}
.modal__head small {
  font-family: var(--f-pixel);
  font-size: 9px;
  color: var(--rose);
}
.modal__head h2 {
  font-family: var(--f-hand);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.1;
  color: var(--marker);
  margin-top: 6px;
}
.modal__tabs {
  display: flex;
  gap: 8px;
  padding: 6px 30px 0;
  flex-wrap: wrap;
}
.modal__tabs button {
  font-family: var(--f-pixel);
  font-size: 9px;
  padding: 8px 10px;
  background: var(--paper-2);
  color: var(--ink);
}
.modal__tabs button[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}
.modal__body {
  overflow-y: auto;
  padding: 18px 30px 26px;
  flex: 1;
}
.modal__foot {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding: 14px 30px 22px;
  border-top: 2px dashed #c4cde0;
}
.modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
}
.lyrics {
  font-family: var(--f-hand);
  font-size: 22px;
  line-height: 24px;
  white-space: pre-wrap;
  padding-top: 2px;
}
.lyrics-source {
  font-size: 13px;
  color: #7b7fa0;
  margin-top: 18px;
  font-family: var(--f-ui);
}
.lyrics-missing {
  font-family: var(--f-hand);
  font-size: 24px;
  line-height: 1.4;
}
.lyrics-missing a {
  color: var(--marker);
}
.realpage-list {
  display: grid;
  gap: 20px;
}
.realpage-list img {
  width: 100%;
  border: 6px solid #fff;
  box-shadow: 4px 4px 0 var(--drop);
  cursor: zoom-in;
}

/* ---------- lightbox ---------- */
.lightbox {
  z-index: 85;
}
.lightbox .modal__box {
  width: auto;
  background: none;
  box-shadow: none;
  transform: none;
  max-height: none;
  align-items: center;
}
.lightbox img {
  max-height: calc(100vh - 120px);
  max-width: calc(100vw - 40px);
  width: auto;
  border: 8px solid #fff;
  box-shadow: 8px 8px 0 var(--drop);
}
.lightbox__nav {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
  font-family: var(--f-pixel);
  font-size: 10px;
  color: var(--paper);
}
.lightbox .modal__close {
  top: -14px;
  right: -14px;
}
.lightbox__frame {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  overflow: hidden;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--nav-h) + 18px);
  z-index: 90;
  transform: translate(-50%, -20px);
  opacity: 0;
  visibility: hidden;
  background: var(--lime);
  color: var(--ink);
  padding: 10px 16px;
  font-weight: 600;
  max-width: calc(100vw - 40px);
  transition: all 0.25s;
}
.toast.is-on {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}

/* ---------- footer ---------- */
.footer {
  text-align: center;
  padding: 60px var(--gutter) 50px;
  font-family: var(--f-pixel);
  font-size: 9px;
  line-height: 2;
  color: #9b88c9;
  border-top: 4px dashed var(--night-3);
  margin-top: 40px;
}
.footer .h {
  color: var(--heart);
}

/* ---------- 404 ---------- */
.lost {
  text-align: center;
  display: grid;
  gap: 24px;
  justify-items: center;
}
.lost h1 {
  font-family: var(--f-pixel);
  font-size: clamp(18px, 3vw, 30px);
  text-shadow: 3px 3px 0 var(--ink);
  line-height: 1.5;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  :root {
    --nav-h: 112px;
  }
  body[data-page="allbands"] {
    --nav-h: 64px;
  } /* no search row on All bands (it has its own filter) */
  .nav {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--nav-h);
    padding: 10px var(--gutter);
    gap: 8px 14px;
    align-content: center;
  }
  .nav__brand span {
    display: none;
  }
  .search {
    width: 100%;
    order: 3;
    margin: 0;
  }
  .book {
    grid-template-columns: 1fr;
  }
  .band-hero,
  .page-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .band-hero__media,
  .page-row__img,
  .page-row:nth-child(even) .page-row__img {
    grid-column: 1;
    grid-row: 1;
    transform: none;
  }
  .band-hero__text,
  .page-row__cap,
  .page-row:nth-child(even) .page-row__cap {
    grid-column: 1;
    grid-row: 2;
    align-self: auto;
  }
  .section {
    padding: 64px var(--gutter);
  }

  /* sticky stacking on phones: the cover pins under the nav and the info card slides up over it */
  .band-hero__media {
    position: sticky;
    top: calc(var(--nav-h) + 12px);
    z-index: 1;
    transform-origin: 50% 0;
  }
  .band-hero__text {
    position: relative;
    z-index: 2;
    margin: 24px 0 0;
  }
  .sky--band {
    padding-bottom: 60px;
  }

  /* real book pages pile up on top of each other while scrolling */
  .pages {
    gap: 28px;
  }
  .page-row {
    position: sticky;
    top: calc(var(--nav-h) + 12px);
    transform-origin: 50% 0;
  }
  /* every stacked page is the same size so each one fully covers the one below */
  .page-row {
    background: var(--night);
    padding-bottom: 14px;
  }
  .page-row__img {
    height: 52vh;
    max-height: none;
  }
  .page-row__cap,
  .page-row:nth-child(even) .page-row__cap {
    min-height: 150px;
  }
  .page-row__img img {
    height: 100%;
  }
  .page-row__cap,
  .page-row:nth-child(even) .page-row__cap {
    margin: -30px 12px 0;
  }
}
@media (max-width: 600px) {
  body {
    font-size: 17px;
  }
  .btn {
    white-space: normal;
    text-align: left;
  }
  .btn--big {
    font-size: 1.05rem;
    padding: 0.7em 1.1em;
  }
  .hero__actions {
    flex-direction: column;
    align-items: center;
  }
  .hero__kicker {
    font-size: 8px;
  }
  .hero h1 {
    font-size: 6.6vw;
  }
  .section__head {
    margin-bottom: 28px;
  }
  .section__note {
    font-size: 19px;
  }
  .cards {
    grid-template-columns: 1fr;
    gap: 48px;
  } /* one big card per row on phones, so the record has room to roll out */
  .record__name {
    font-size: 10px;
  }
  /* leave room on the right so the slid-out record stays on screen */
  .record__art {
    margin-right: 24%;
  }
  .record__meta span {
    font-size: 17px;
  }
  .record .pages-badge {
    font-size: 7px;
    right: -8px;
  }
  .loved li {
    grid-template-columns: 34px 1fr;
  }
  .loved li::before {
    font-size: 14px;
  }
  .loved .track__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .song-card {
    padding: 20px;
    gap: 20px;
  }
  .song-card__actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .band-hero__text {
    padding: 24px 20px;
  }
  .band-hero__logo {
    height: 70px;
  }
  .band-hero__blurb {
    font-size: 21px;
  }
  .band-hero__media .play-big {
    width: 84px;
    height: 84px;
  }
  .track__title {
    font-size: 23px;
  }
  .track__badge {
    margin-left: 0;
    display: table;
    margin-top: 4px;
  }
  .page-row__cap h3 {
    font-size: 28px;
  }
  .book__copy p {
    font-size: 22px;
  }
  .lightbox img {
    max-width: calc(100vw - 40px);
  }
  .lightbox .modal__close {
    top: 8px;
    right: 8px;
  }
  .song-card {
    grid-template-columns: 1fr;
  }
  .song-card__cover {
    max-width: 180px;
  }
  .track {
    grid-template-columns: 36px 1fr;
    padding: 12px;
  }
  .track__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .machine {
    padding: 20px;
  }
  .machine__screen {
    min-height: 104px;
    padding: 16px;
  } /* room for 3 lines so it doesn't jump while spinning */
  .modal__head {
    padding: 22px 64px 8px 20px;
  }
  .modal__body,
  .modal__foot {
    padding-left: 20px;
    padding-right: 20px;
  }
  .modal__tabs {
    padding: 6px 20px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .bat-flyer {
    display: none;
  }
  .px-heart i {
    opacity: 1;
    transform: none;
  }
}

/* ---------- accessibility + crawlable fallback ---------- */
.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 200;
  background: var(--coral);
  color: #fff;
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 12px;
}
#app:focus {
  outline: none;
}
/* plain content baked into each HTML file by _dev/tools/build.js (for search engines and no-JS visitors);
   app.js replaces it with the full page */
.static {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 40px) var(--gutter) 60px;
}
.static h1 {
  font-family: var(--f-pixel);
  font-size: clamp(18px, 4vw, 30px);
  line-height: 1.5;
  margin-bottom: 16px;
}
.static h2 {
  font-family: var(--f-stencil);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
  margin: 30px 0 12px;
}
.static p,
.static li {
  margin-bottom: 8px;
}
.static ol,
.static ul {
  padding-left: 1.4em;
}
.static a {
  color: var(--yellow);
}

/* band card shelves (home + all bands): their own padding, on every screen size */
.section--cards {
  padding: 64px 20px 64px var(--gutter);
}

/* light/white transparent logos get a dark sticker (see logoContrast() in app.js) */
.record__sticker.on-dark { background: var(--night-2); }
.record__sticker.on-dark img, .band-hero__logo.on-dark { mix-blend-mode: normal; }
.band-hero__logo.on-dark { background: var(--night-2); padding: 10px 16px; box-shadow: 3px 3px 0 var(--drop); }
/* bands without a logo file: their name on the sticker / in the hero */
.record__sticker-text {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 4px 10px;
  font-family: var(--f-stencil); font-size: 20px; line-height: 1; text-align: center; color: var(--ink);
}
.band-hero__name { font-family: var(--f-stencil); font-weight: 400; font-size: clamp(34px, 5vw, 52px); line-height: 1.05; margin-bottom: 14px; }

/* text selection: pale pink highlight, dark text so it reads on both the purple page and the cream cards */
::selection { background: #ffd6e2; color: var(--ink); text-shadow: none; }
