/* ============ JACO — the four acts ============ */

.view { position: relative; min-height: 100vh; min-height: 100dvh; }

/* ---- ACT 1 · LANDING ---- */
.view--landing {
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.corner-tl { position: absolute; top: 24px; left: 28px; color: var(--muted); }
.name-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-name);
  line-height: .9;
  letter-spacing: -.015em;
  color: var(--ink);
  transition: letter-spacing .5s var(--ease-out);
  user-select: none;
  padding: 0 2vw;
}
.name:hover, .name:focus-visible { letter-spacing: .01em; }
.enter-hint {
  color: var(--muted);
  opacity: 0; translate: 0 6px;
  transition: opacity .4s var(--ease-out), translate .4s var(--ease-out);
}
.name-wrap:hover .enter-hint, .name:focus-visible ~ .enter-hint { opacity: 1; translate: 0 0; }

/* ---- ACT 2 · SONG SELECT ---- */
/* full-bleed WebGL stage (reference-style); labels overlay the canvas */
.view--songs {
  position: relative;
  height: 100vh; height: 100dvh;
  overflow: hidden;
}
.songs-top {
  position: absolute; top: 24px; left: 0; right: 0;
  z-index: 2; text-align: center; color: var(--muted);
  pointer-events: none;
}
.disc-stage {
  position: absolute; inset: 0;
  cursor: grab;
  touch-action: none;
  outline: none;
}
.disc-stage.is-dragging, .disc-stage.is-pressed { cursor: grabbing; }
.disc-canvas {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important;
  display: block;
}
/* flat fallback (no WebGL): horizontal row of round covers */
.disc-flat-row {
  position: absolute; inset: 0;
  display: flex; align-items: center; gap: 20px;
  overflow-x: auto; padding: 0 24px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.disc-flat-row::-webkit-scrollbar { display: none; }
.disc-flat {
  flex: 0 0 auto; width: min(46vw, 240px); aspect-ratio: 1;
  border-radius: 50%; overflow: hidden; padding: 0;
  border: 0; cursor: pointer; scroll-snap-align: center;
  box-shadow: 0 0 0 2px #c9c9c9, 0 18px 40px rgb(0 0 0 / .18);
  opacity: .55; transition: opacity .3s var(--ease-out);
}
.disc-flat.is-active { opacity: 1; }
.disc-flat img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* song info pinned to the top-left corner, clear of the disc stage */
.song-meta {
  position: absolute; top: 22px; left: 28px;
  z-index: 2; text-align: left;
  pointer-events: none;
}
.song-title {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(56px, 8vw, 108px); line-height: 1.05;
}
.song-line { margin-top: 7px; font-size: 24px; }
.song-label { color: var(--muted); }
.song-label::after { content: " — "; }
/* same masked reveal the show caption uses, fired by _syncActive on disc change */
.song-meta.swap { animation: cap-in .9s var(--ease-out); }
/* track counter back under the disc, centered */
.song-count {
  position: absolute; left: 0; right: 0; bottom: 88px;
  z-index: 2; text-align: center; color: var(--muted);
  letter-spacing: .18em; pointer-events: none;
}

/* ---- ACT 3 · SHOW ---- */
/* page background like every other act; photo centered, info on the left margin */
.view--show {
  position: fixed; inset: 0;
  background: var(--paper); color: var(--ink);
  overflow: hidden;
  min-height: 0;
}
.layer {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s var(--ease-out);
}
.layer.is-active { opacity: 1; }
.layer img {
  width: auto; height: auto;
  max-width: min(56vw, 1040px);
  max-height: 72vh;
  object-fit: contain;
  box-shadow: 0 30px 90px rgb(0 0 0 / .18);
}

.show-skip { position: absolute; top: 22px; right: 26px; opacity: .75; }
.show-skip:hover { opacity: 1; }
/* photo info on the page background, left of the photo, left-aligned, vertically centered */
.show-caption {
  position: absolute;
  left: clamp(24px, 4vw, 72px);
  top: 50%; translate: 0 -50%;
  width: min(24vw, 360px);
}
.show-title {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(36px, 4.2vw, 72px); line-height: 1.05;
}
.show-line { margin-top: 7px; font-size: 24px; }
.show-label { color: var(--muted); }
.show-label::after { content: " — "; }
.show-caption.swap { animation: cap-in .9s var(--ease-out); }
@keyframes cap-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.show-progress {
  position: absolute; left: 50%; bottom: 26px; translate: -50% 0;
  width: min(560px, 62vw);
  display: flex; gap: 6px;
}
.tick { flex: 1; height: 2px; background: rgb(0 0 0 / .14); overflow: hidden; }
.tick i { display: block; height: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }

/* ---- ACT 4 · ARCHIVE ---- */
.view--archive { padding: clamp(24px, 5vw, 72px) clamp(20px, 5vw, 72px) 120px; }
.archive-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 36px;
}
.archive-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(40px, 6vw, 84px); line-height: 1; }
.archive-count { color: var(--muted); margin-top: 10px; }
.replay-btn { color: var(--muted); padding: 6px 0; }
.replay-btn:hover { color: var(--ink); }

/* filter rail on the left, photos on the right, a floating hairline between */
.archive-body {
  position: relative;
  --rail-w: clamp(200px, 17vw, 248px);
  --rail-gap: clamp(32px, 4vw, 64px);
  display: flex; align-items: flex-start; gap: var(--rail-gap);
}
/* inset at both ends so the line never touches the page edges */
.archive-body::before {
  content: ''; position: absolute;
  left: calc(var(--rail-w) + var(--rail-gap) / 2);
  top: 10px; bottom: 56px;
  width: 1px; background: var(--line);
}
.filters {
  flex: none; width: var(--rail-w);
  display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 28px;
}
.archive-main { flex: 1; min-width: 0; }
.filter-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.filter-label { color: var(--muted); width: 56px; flex: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: var(--fs-micro); font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; color: var(--ink);
  transition: border-color .25s, background-color .25s, color .25s;
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .count { opacity: .55; }

.grid { columns: 3; column-gap: 24px; }
.cell {
  display: block; width: 100%;
  break-inside: avoid; margin-bottom: 24px;
  position: relative; overflow: hidden;
  text-align: left; background: #e7e7e7;
  padding: 0;
}
.cell img {
  width: 100%; height: auto;
  transition: transform .8s var(--ease-out);
}
.cell:hover img, .cell:focus-visible img { transform: scale(1.03); }
.cell-caption {
  position: absolute; inset: auto 0 0 0;
  padding: 40px 16px 14px;
  background: linear-gradient(to top, rgb(0 0 0 / .55), transparent);
  color: #f2f2f2;
  display: flex; flex-direction: column; gap: 4px;
  opacity: 0; translate: 0 8px;
  transition: opacity .4s var(--ease-out), translate .4s var(--ease-out);
  pointer-events: none;
}
.cell:hover .cell-caption, .cell:focus-visible .cell-caption { opacity: 1; translate: 0 0; }
.cell-title { font-family: var(--font-serif); font-weight: 400; font-size: 20px; line-height: 1.05; }
.cell-sub { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 80px 0; color: var(--muted);
}
.reset-btn { border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; color: var(--ink); }
.reset-btn:hover { border-color: var(--ink); }

@media (max-width: 1100px) { .grid { columns: 2; } }
/* the centered label would collide with the enlarged corner title on small screens */
@media (max-width: 960px) { .songs-top { display: none; } }
/* narrow screens: side columns too narrow for the info, stack it above the photo */
@media (max-width: 820px) {
  .layer { align-items: flex-end; padding-bottom: 14vh; }
  .layer img { max-width: 88vw; max-height: min(56vh, calc(100dvh - 240px - 14vh)); }
  .show-caption { left: 20px; right: 20px; top: 96px; width: auto; translate: 0 0; }
  .show-title { font-size: clamp(40px, 9vw, 64px); }
  .show-line { font-size: 16px; }
  .show-skip { top: auto; bottom: 72px; right: 18px; }
  .lb-figure img { max-width: 80vw; max-height: 62vh; }
  /* narrow screens: the rail collapses back above the grid */
  .archive-body { display: block; }
  .archive-body::before { content: none; }
  .filters { position: static; width: auto; margin-bottom: 40px; }
}
@media (max-width: 640px) {
  .grid { columns: 1; }
  .song-meta { top: 16px; left: 20px; }
  .song-count { bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .layer { transition-duration: .3s; }
  .name, .cell img, .cell-caption, .enter-hint { transition: none; }
  .show-caption.swap, .song-meta.swap { animation: none; }
  .lb-fade { animation: none; }
  .lb-wash { transition-duration: .15s; }
  .lightbox.ui-enter .lb-close, .lightbox.ui-enter .lb-nav { animation: none; }
}