/* Layout for the releases pages on top of amplib-ui. Values are tokens. */
[hidden] {
  display: none !important;
}
body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ht-flow);
  padding: var(--ht-space-6);
}
section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ht-space-3);
  width: 100%;
}
h1 a {
  text-decoration: none;
}
h2 {
  margin: 0;
}
p {
  margin: 0;
}

/* index: one card per release */
.covers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: var(--ht-space-6);
  width: 100%;
  max-width: var(--ht-page-max);
}
.covers a {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-2);
  text-decoration: none;
  min-width: 0;
}
/* Block cards, not inline links: keep the system's ink-inversion hover off
   them (it paints the whole grid cell) and mark hover like a selected thumb —
   an outline on the image, an underline on the name. */
.covers a:hover {
  background: none;
  color: inherit;
}
.covers a:hover img {
  outline: 2px solid var(--ht-ink);
  outline-offset: 2px;
}
.covers a:hover .covers__name {
  text-decoration: underline;
}
/* One square per release, whatever shape the artwork is. The releases run
   from 16:9 video stills to portrait scans, so a natural-ratio grid steps
   every row; contain keeps each piece whole inside its square instead. */
.covers img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
}
/* the album cover: encoded by default, toggling to the decoded artwork */
.cover-art {
  display: block;
  width: 100%;
  max-width: 18rem;
}
.linklike {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: var(--ht-text-small);
  color: var(--ht-ink-faint);
  text-decoration: underline;
  cursor: pointer;
}
.linklike:hover {
  color: var(--ht-ink);
}

/* the cover block: below the player, above the track grid */
.cover-block {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-2);
}

/* release pages: the tappable grid of encoded images */
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: var(--ht-space-5);
  width: 100%;
  max-width: var(--ht-page-max);
}
.thumb {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-2);
  /* Grid and flex items floor at min-content by default, so the longest
     caption widens its own track and the image overhangs the column. */
  min-width: 0;
  /* the row stretches every cell to its tallest, so pin the size line to the
     bottom and the captions read along one line instead of stepping */
  justify-content: space-between;
}
/* the face is the tappable part; the meta line under it stays outside the
   button so it can carry a real link */
.thumb__face {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-2);
  /* A button shrink-to-fits rather than stretching, so the longest caption
     sets its width and the image — sized at 100% of the button — overhangs
     the grid track. Fill the cell instead, and let the caption wrap. */
  width: 100%;
  min-width: 0;
}
.thumb img {
  width: 100%;
  display: block;
}
.thumb__face:hover {
  background: none;
  color: inherit;
}
.thumb__face:hover img,
.thumb__face[aria-pressed="true"] img {
  outline: 2px solid var(--ht-ink);
  outline-offset: 2px;
}
.thumb__face:hover .thumb__name {
  text-decoration: underline;
}
.thumb__name {
  overflow-wrap: anywhere;
}

/* documentation: the data-only stegassettes, below the track grid. The
   calendar covers are twice as tall as they are wide, so the picture takes a
   narrow column of its own and the decoded text reads beside it. */
.docs {
  display: flex;
  flex-direction: column;
  gap: var(--ht-flow);
  width: 100%;
  max-width: var(--ht-page-max);
}
.doc {
  display: grid;
  grid-template-columns: minmax(0, 8rem) minmax(0, 1fr);
  gap: var(--ht-space-5);
  align-items: start;
}
@media (max-width: 30rem) {
  .doc {
    grid-template-columns: minmax(0, 1fr);
  }
}
.doc__face {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-2);
  width: 100%;
  min-width: 0;
}
.doc__face img {
  width: 100%;
  display: block;
}
.doc__face:hover {
  background: none;
  color: inherit;
}
.doc__face:hover img,
.doc__face[aria-expanded="true"] img {
  outline: 2px solid var(--ht-ink);
  outline-offset: 2px;
}
.doc__face:hover .doc__name {
  text-decoration: underline;
}
.doc__body {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-3);
  min-width: 0;
}
.doc__texts {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-2);
}
/* each label sits tight above the block it names, not evenly among them */
.doc__texts .doc__label {
  margin-top: var(--ht-space-3);
}
.doc__texts .doc__label:first-child {
  margin-top: 0;
}
.doc__text {
  max-width: var(--ht-measure);
  white-space: pre-wrap; /* decoded text entries carry real newlines */
}

/* player */
#np {
  border-top: var(--ht-hairline) solid var(--ht-line);
  padding-top: var(--ht-flow);
}
#npCtrls {
  display: flex;
  align-items: center;
  gap: var(--ht-space-4);
  width: 100%;
  max-width: var(--ht-measure);
}
#npSeek {
  flex: 1;
  min-width: 8rem;
  touch-action: none; /* keep touch drags on the slider from becoming page scrolls */
}
#npTime {
  white-space: nowrap;
}
progress {
  width: 100%;
  max-width: var(--ht-measure);
}
/* frames canvas and live develop sit side by side when there is room */
#npReveal {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--ht-space-5);
  width: 100%;
}

/* video cartridge frames, drawn at native resolution and scaled up hard */
#npReveal canvas.np-frames {
  display: block;
  flex: 1 1 26rem;
  min-width: min(100%, 18rem);
  max-width: 42rem;
  height: auto;
  border: 0;
  background: none;
  image-rendering: pixelated;
}

/* the live decode: reconstruction beneath, encoded pixels erased on top */
#npReveal .np-reveal {
  position: relative;
  flex: 1 1 16rem;
  min-width: min(100%, 12rem);
  max-width: 24rem;
}
#npReveal .np-reveal canvas {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  /* Display-only surface, always heavily downscaled: smoothing averages the
     per-pixel checkerboard instead of nearest-neighbor phase-aliasing it,
     which is what made the encode look like zoom-dependent blocks. */
  image-rendering: auto;
}
#npReveal .np-reveal canvas.overlay {
  position: absolute;
  inset: 0;
}

/* past the cap: encoded and decoded side by side instead of the animation */
#npReveal .np-pair {
  flex: 1 1 26rem;
  min-width: min(100%, 18rem);
  max-width: 48rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ht-space-2) var(--ht-space-3);
  align-items: start;
}
#npReveal .np-pair canvas {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  image-rendering: auto; /* pre-filtered to display size; same story as above */
}
#npReveal .np-pair p {
  grid-column: 1 / -1;
}

#npLyrics {
  white-space: pre-wrap;
  max-height: 18rem;
  overflow: auto;
  max-width: var(--ht-measure);
}
#npLyrics.lyrics--timed {
  white-space: normal;
  color: var(--ht-ink-faint);
}
#npLyrics.lyrics--timed div.on {
  color: var(--ht-ink);
}
#npLyrics.lyrics--timed span {
  color: var(--ht-ink-faint);
}
#npLyrics.lyrics--timed div.on span.on {
  color: var(--ht-ink);
}
#npTexts p,
#metaBody p {
  max-width: var(--ht-measure);
  white-space: pre-wrap; /* decoded text entries carry real newlines */
}
/* Prose written into the page, not decoded out of an image: pre-wrap would
   render its source indentation as a real indent and first line break. */
#metaBody p.release-note {
  white-space: normal;
}

footer {
  margin-top: var(--ht-flow-section);
}
