/* ==================== ARCHIVE WALL ========================================
   A living mosaic of the full catalogue. Dimmed image bands interleaved
   with solid content plates — each plate a full-contrast island carved into
   the wall fabric. Every ~14th image runs undimmed as a glint.
   All selectors scoped under .pg-archive-wall.
   ========================================================================== */

/* ---- Root / texture ground (visible when no images are present) ---------- */

.pg-archive-wall {
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 47px,
      color-mix(in srgb, var(--ink) 5%, transparent) 47px,
      color-mix(in srgb, var(--ink) 5%, transparent) 48px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 47px,
      color-mix(in srgb, var(--ink) 5%, transparent) 47px,
      color-mix(in srgb, var(--ink) 5%, transparent) 48px
    );
  color: var(--ink);
  overflow-x: hidden;
}

/* ---- Scroll-reveal: only active when the stage carries .animate ---------- */

.animate .pg-archive-wall > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
}
.animate .pg-archive-wall > *.in {
  opacity: 1;
  transform: none;
}

/* ---- Image wall bands ---------------------------------------------------- */

.pg-archive-wall .aw-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(60px, 9cqw, 140px), 1fr));
  grid-auto-rows: clamp(70px, 9.5cqw, 148px);
  grid-auto-flow: dense;
  gap: 3px;
  /* no margin — flush against adjacent plates for seamless wall effect */
}

/* All mosaic images are dimmed to a near-uniform tone */
.pg-archive-wall .aw-wall img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.3) saturate(.5);
  transition: filter .4s ease;
}

/* Occasional glint — every 14th image runs full contrast */
.pg-archive-wall .aw-wall .aw-glint {
  filter: brightness(.88) saturate(.9);
}

/* Grid-span classes applied per cell from JS */
.pg-archive-wall .aw-wall .aw-c1 { grid-column: span 1; }
.pg-archive-wall .aw-wall .aw-c2 { grid-column: span 2; }
.pg-archive-wall .aw-wall .aw-c3 { grid-column: span 3; }
.pg-archive-wall .aw-wall .aw-r1 { grid-row: span 1; }
.pg-archive-wall .aw-wall .aw-r2 { grid-row: span 2; }
.pg-archive-wall .aw-wall .aw-r3 { grid-row: span 3; }

/* ---- Content plates — solid islands in the image fabric ------------------ */

.pg-archive-wall .aw-plate {
  position: relative;
  background: var(--bg);
  color: var(--ink);
  padding: clamp(2.8rem, 8cqw, 5.2rem) clamp(1.4rem, 5cqw, 3.4rem);
}

/* Mono micro-kicker used across all plates */
.pg-archive-wall .aw-kicker {
  display: block;
  margin-bottom: clamp(1.2rem, 3cqw, 2rem);
  font: 600 10px/1.5 var(--font-mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---- Nameplate — huge inverted type -------------------------------------- */

.pg-archive-wall .aw-nameplate {
  background: var(--ink);
  color: var(--bg);
  padding: clamp(3.4rem, 9cqw, 7rem) clamp(1.4rem, 5cqw, 3.4rem) clamp(2.8rem, 7cqw, 5.6rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.5cqw, 1.6rem);
}

.pg-archive-wall .aw-logo {
  max-height: 44px;
  width: auto;
  margin-bottom: clamp(.8rem, 2cqw, 1.4rem);
  filter: invert(1);
}

.pg-archive-wall .aw-nameplate h1 {
  font: 400 clamp(3.6rem, 16cqw, 12rem) / .82 var(--font-black);
  text-transform: uppercase;
  letter-spacing: -.02em;
  color: var(--bg);
  text-wrap: balance;
}

.pg-archive-wall .aw-tagline {
  font: 400 clamp(.95rem, 2.2cqw, 1.2rem) / 1.5 var(--font-serif);
  color: color-mix(in srgb, var(--bg) 68%, transparent);
  max-width: 52ch;
}

/* ---- Stats plate --------------------------------------------------------- */

.pg-archive-wall .aw-statsplate {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pg-archive-wall .aw-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(2rem, 6cqw, 4rem);
}

.pg-archive-wall .aw-stat {
  display: grid;
  gap: .45rem;
}

.pg-archive-wall .aw-stat b {
  font: 400 clamp(3rem, 9cqw, 6rem) / 1 var(--font-serif);
  color: var(--accent);
}

.pg-archive-wall .aw-stat span {
  font: 500 9px / 1.5 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Bio plate ----------------------------------------------------------- */

.pg-archive-wall .aw-bioplate {
  max-width: none;
  border-left: 3px solid var(--accent);
}

.pg-archive-wall .aw-bio {
  max-width: 72ch;
  font: 400 clamp(1.05rem, 2.4cqw, 1.3rem) / 1.7 var(--font-serif);
  color: var(--ink);
}

/* ---- Productions ledger -------------------------------------------------- */

.pg-archive-wall .aw-prodplate {
  background: var(--surface);
}

.pg-archive-wall .aw-ledger {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(160px, 26cqw, 280px), 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.pg-archive-wall .aw-ledger li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-height: 52px;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
  font: 500 clamp(.88rem, 1.9cqw, 1.05rem) / 1.35 var(--font-sans);
}

.pg-archive-wall .aw-num {
  flex-shrink: 0;
  font: 400 9px / 1 var(--font-mono);
  letter-spacing: .1em;
  color: var(--accent);
}

.pg-archive-wall .aw-more {
  margin-top: clamp(.9rem, 2cqw, 1.4rem);
  font: 400 9px / 1 var(--font-mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Tracks plate -------------------------------------------------------- */

.pg-archive-wall .aw-tracksplate {
  border-top: 1px solid var(--line);
}

/* The shared .tracks / .track-row styles from templates.css take over here.
   We only need to adjust chrome within our plate context. */
.pg-archive-wall .aw-tracksplate .tracks {
  margin-top: 0;
}

/* ---- Extra info plate (works / publishers / territories) ----------------- */

.pg-archive-wall .aw-extraplate {
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.pg-archive-wall .aw-cols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(160px, 28cqw, 260px), 1fr));
  gap: clamp(2rem, 5cqw, 3.4rem);
}

.pg-archive-wall .aw-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.pg-archive-wall .aw-col li {
  padding: .45rem 0;
  border-bottom: 1px solid var(--line);
  font: 400 clamp(.82rem, 1.8cqw, .95rem) / 1.45 var(--font-body);
}

/* ---- Archive note ("+N more in the archive") ----------------------------- */

.pg-archive-wall .aw-archive-note {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.4rem, 3cqw, 2rem);
  background: transparent;
}

.pg-archive-wall .aw-archive-note span {
  display: inline-block;
  padding: .55rem 1.4rem;
  font: 500 10px / 1 var(--font-mono);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* ---- YouTube reel -------------------------------------------------------- */

.pg-archive-wall .aw-reel {
  margin: 0;
  padding: 0;
}

.pg-archive-wall .aw-reel iframe {
  border: none;
}

/* ---- Footer -------------------------------------------------------------- */

.pg-archive-wall .aw-foot {
  background: var(--ink);
  color: var(--bg);
  padding: clamp(2.4rem, 7cqw, 4.8rem) clamp(1.4rem, 5cqw, 3.4rem) clamp(1.6rem, 4cqw, 2.6rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.5cqw, 1.6rem);
}

.pg-archive-wall .aw-contact {
  font-style: normal;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.pg-archive-wall .aw-contact a {
  font: 400 clamp(.9rem, 2cqw, 1rem) / 1 var(--font-mono);
  color: var(--bg);
  text-decoration: underline;
  text-underline-offset: 4px;
  opacity: .9;
}

.pg-archive-wall .aw-contact a:hover {
  color: var(--accent);
  opacity: 1;
}

.pg-archive-wall .aw-soc {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  padding-top: clamp(.8rem, 2cqw, 1.2rem);
  border-top: 1px solid color-mix(in srgb, var(--bg) 30%, transparent);
}

.pg-archive-wall .aw-soc .soc {
  color: color-mix(in srgb, var(--bg) 80%, transparent);
}

.pg-archive-wall .aw-soc .soc:hover {
  color: var(--accent);
}

.pg-archive-wall .colophon {
  margin-top: clamp(.8rem, 2cqw, 1.2rem);
  color: color-mix(in srgb, var(--bg) 45%, transparent);
}

/* ---- Responsive: 620px (tablet narrow) ----------------------------------- */

@container page (max-width: 620px) {
  .pg-archive-wall .aw-nameplate h1 {
    font-size: clamp(2.8rem, 17cqw, 5rem);
  }

  .pg-archive-wall .aw-stats {
    gap: 1.8rem;
  }

  .pg-archive-wall .aw-ledger {
    grid-template-columns: 1fr 1fr;
  }

  .pg-archive-wall .aw-cols {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- Responsive: 390px (small phone) ------------------------------------- */

@container page (max-width: 390px) {
  .pg-archive-wall .aw-nameplate h1 {
    font-size: clamp(2.2rem, 18cqw, 3.6rem);
    letter-spacing: -.01em;
  }

  .pg-archive-wall .aw-wall .aw-c2 { grid-column: span 1; }
  .pg-archive-wall .aw-wall .aw-c3 { grid-column: span 2; }
  .pg-archive-wall .aw-wall .aw-r2 { grid-row: span 1; }
  .pg-archive-wall .aw-wall .aw-r3 { grid-row: span 2; }

  .pg-archive-wall .aw-stats {
    flex-direction: column;
    gap: 1.2rem;
  }

  .pg-archive-wall .aw-stat b {
    font-size: clamp(2.4rem, 14cqw, 3.6rem);
  }

  .pg-archive-wall .aw-ledger {
    grid-template-columns: 1fr;
  }

  .pg-archive-wall .aw-cols {
    grid-template-columns: 1fr;
  }

  .pg-archive-wall .aw-foot {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ── Motion polish ─────────────────────────────────────────────────────────── */

/* Text selection */
.pg-archive-wall ::selection { background: var(--accent); color: var(--bg); }

/* Wall image hover: non-glints lift toward contrast; glints reveal fully.
   Extends the existing transition: filter .4s ease with transform. */
.pg-archive-wall .aw-wall img {
  transition: filter .4s ease, transform .5s ease;
}
.pg-archive-wall .aw-wall img:not(.aw-glint):hover {
  filter: brightness(.55) saturate(.75);
  transform: scale(1.03);
}
/* Glint hover: pause the ambient animation, override to full contrast */
.pg-archive-wall .aw-wall .aw-glint:hover {
  animation-play-state: paused;
  filter: brightness(1) saturate(1.05) !important;
  transform: scale(1.03);
}

/* Ambient loop: glints breathe between their normal bright state and near-dim.
   21 s period with 3 phase-offset groups creates a slow rolling shimmer across
   the wall without any two glints always lit at the same moment.
   One ambient loop per template. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes aw-glint-breathe {
    0%, 100% { filter: brightness(.88) saturate(.9); }
    40%, 60%  { filter: brightness(.28) saturate(.38); }
  }
  .pg-archive-wall .aw-wall .aw-glint {
    animation: aw-glint-breathe 21s ease-in-out infinite;
  }
  /* Negative delays phase-shift each group so the shimmer starts immediately */
  .pg-archive-wall .aw-wall .aw-glint:nth-child(3n+2) { animation-delay: -7s; }
  .pg-archive-wall .aw-wall .aw-glint:nth-child(3n)   { animation-delay: -14s; }
}
