/* ============================================================
   MEMORIES
   The gallery, fed from the Discord channel. Photos keep their
   real proportions and every one of them can name its author.
   ============================================================ */

:root {
  --mm-ink: #08060A;
  --mm-plinth: #131017;
  --mm-edge: rgba(240, 234, 232, 0.08);
  --mm-red: #B0003A;
  --mm-rose: #D4406A;
  --mm-text: #F0EAE8;
  --mm-dim: rgba(240, 234, 232, 0.46);
  --mm-faint: rgba(240, 234, 232, 0.24);
  --mm-sign: 'Big Shoulders Display', 'Outfit', sans-serif;
  --mm-read: 'Inter', sans-serif;
  --mm-wide: 1560px;
}

.mm {
  position: relative;
  background: var(--mm-ink);
  min-height: 100vh;
  overflow: hidden;
}

/* ── the room ─────────────────────────────────────────────── */
.mm-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 40% at 50% -5%, rgba(176, 0, 58, 0.16), transparent 70%),
    radial-gradient(ellipse 45% 35% at 8% 40%, rgba(176, 0, 58, 0.06), transparent 72%),
    radial-gradient(ellipse 45% 35% at 92% 72%, rgba(201, 162, 39, 0.045), transparent 72%),
    repeating-linear-gradient(115deg, rgba(240, 234, 232, 0.016) 0 1px, transparent 1px 74px);
}

/* Line art up in the masthead, the one band of the page the grid never
   reaches. An aperture and a camera, faint enough that the photographs below
   are always the loudest thing on screen. */
.mm-art {
  position: absolute;
  pointer-events: none;
  color: rgba(240, 234, 232, 0.09);
}

.mm-art-iris {
  width: 232px;
  height: 232px;
  top: -34px;
  right: 3.5%;
  color: rgba(212, 64, 106, 0.16);
  animation: mmTurn 160s linear infinite;
}

.mm-art-cam {
  width: 262px;
  height: 183px;
  top: 30px;
  right: calc(3.5% + 196px);
  transform: rotate(-7deg);
}


@keyframes mmTurn { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .mm-art-iris { animation: none; }
}

@media (max-width: 950px) {
  .mm-art-cam { display: none; }
  .mm-art-iris { width: 180px; height: 180px; top: 30px; right: 5%; }
}

/* ── masthead ─────────────────────────────────────────────── */
.mm-head {
  position: relative;
  max-width: var(--mm-wide);
  margin: 0 auto;
  padding: 5rem 2rem 2rem;
}

.mm-eyebrow {
  font-family: var(--mm-read);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--mm-rose);
  margin-bottom: 0.7rem;
}

.mm-title {
  font-family: var(--mm-sign);
  font-weight: 700;
  font-size: clamp(3.2rem, 10vw, 7rem);
  line-height: 0.82;
  text-transform: uppercase;
  color: var(--mm-text);
  margin: 0;
}

.mm-wrap { position: relative; padding: 0 2rem 8rem; }

.mm-bar {
  max-width: var(--mm-wide);
  margin: 0 auto 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--mm-edge);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--mm-read);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mm-faint);
}

.mm-bar b { color: var(--mm-text); font-weight: 600; }

.mm-bar .mm-here { color: var(--mm-text); font-weight: 600; }

.mm-back {
  background: none;
  border: 0;
  padding: 0 0.9rem 0 0;
  margin-right: 0.9rem;
  border-right: 1px solid var(--mm-edge);
  color: var(--mm-faint);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color 0.15s;
}

.mm-back:hover { color: var(--mm-rose); }

.mm-loading {
  grid-column: 1 / -1;
  padding: 4rem 0;
  text-align: center;
  font-family: var(--mm-read);
  font-size: 0.82rem;
  color: var(--mm-faint);
}

/* ── the wall of nights ───────────────────────────────────── */
.mm-nights {
  max-width: var(--mm-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.4rem;
}

.mm-night {
  display: block;
  text-align: left;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.mm-night-flyer {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: var(--mm-plinth);
  border: 1px solid var(--mm-edge);
  transition: border-color 0.25s, transform 0.35s cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 0.3s;
}

.mm-night-flyer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1), filter 0.3s;
  filter: saturate(0.85) brightness(0.82);
}

.mm-night:hover .mm-night-flyer {
  border-color: var(--mm-red);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -22px var(--mm-red);
}

.mm-night:hover .mm-night-flyer img { transform: scale(1.05); filter: none; }

.mm-night-blank {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: var(--mm-faint);
}

.mm-night-name {
  display: block;
  margin-top: 0.8rem;
  font-family: 'Big Shoulders Display', 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  text-transform: uppercase;
  color: var(--mm-text);
}

.mm-night-meta {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--mm-read);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mm-faint);
}

.mm-night:hover .mm-night-meta { color: var(--mm-rose); }

/* A night nobody photographed still hangs on the wall, just dimmed. */
.mm-night-empty .mm-night-flyer img { filter: saturate(0.15) brightness(0.4); }
.mm-night-empty .mm-night-name { color: var(--mm-dim); }
.mm-night-empty:hover .mm-night-flyer img { filter: saturate(0.5) brightness(0.65); }
.mm-night-empty:hover .mm-night-flyer { border-color: var(--mm-edge); box-shadow: none; }

/* Masonry by columns: the browser balances them and every photo keeps
   its own height, so nothing is cropped on the wall. */
.mm-grid {
  max-width: var(--mm-wide);
  margin: 0 auto;
  column-count: 4;
  column-gap: 14px;
}

@media (max-width: 1200px) { .mm-grid { column-count: 3; } }
@media (max-width: 800px)  { .mm-grid { column-count: 2; column-gap: 10px; } }
@media (max-width: 480px)  { .mm-grid { column-count: 1; } }

.mm-shot {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 14px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--mm-plinth);
  border: 1px solid var(--mm-edge);
  break-inside: avoid;
  cursor: zoom-in;
  opacity: 0;
  animation: mmIn 0.45s ease forwards;
}

@keyframes mmIn { to { opacity: 1; } }

.mm-shot img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.mm-shot:hover img { transform: scale(1.04); }

/* the photographer's name, only on hover */
.mm-tag {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2rem 0.85rem 0.7rem;
  background: linear-gradient(to top, rgba(8, 6, 10, 0.92), transparent);
  font-family: var(--mm-read);
  font-size: 0.74rem;
  color: var(--mm-text);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  opacity: 0;
  transition: opacity 0.25s;
}

.mm-shot:hover .mm-tag { opacity: 1; }
.mm-tag img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

.mm-more {
  max-width: var(--mm-wide);
  margin: 2.5rem auto 0;
  text-align: center;
  font-family: var(--mm-read);
  font-size: 0.78rem;
  color: var(--mm-faint);
  min-height: 2rem;
}

/* ── the lightbox ─────────────────────────────────────────── */
.mm-box {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  background: rgba(4, 3, 6, 0.94);
  backdrop-filter: blur(6px);
}

/* minmax(0, 1fr), not 1fr: a plain fr row keeps a min-content floor, which
   lets a tall photo push the row past the screen instead of being fitted. */
.mm-box.open { display: grid; grid-template-rows: minmax(0, 1fr) auto; }

.mm-stage {
  display: grid;
  place-items: center;
  padding: 2.5rem 2.5rem 1rem;
  min-height: 0;
  overflow: hidden;
}

.mm-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  /* A percentage height never resolves reliably on a centred grid item, so the
     ceiling is measured off the viewport: everything but the credit bar and the
     padding around it. dvh second, for the browsers that move their chrome. */
  max-height: calc(100vh - 180px);
  max-height: calc(100dvh - 180px);
  border-radius: 6px;
  object-fit: contain;
}

.mm-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 2.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  font-family: var(--mm-read);
}

/* the credit card: a staff portrait when we know who they are */
.mm-by {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
}

.mm-by-face {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--mm-plinth);
  border: 1px solid var(--mm-edge);
}

.mm-by-face img { width: 100%; height: 100%; object-fit: cover; display: block; }

.mm-by-role {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mm-rose);
}

.mm-by-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--mm-text);
  line-height: 1.2;
}

.mm-by-link { font-size: 0.7rem; color: var(--mm-dim); }
.mm-by:hover .mm-by-link { color: var(--mm-rose); }

.mm-said {
  flex: 1;
  min-width: 200px;
  text-align: right;
  font-size: 0.84rem;
  color: var(--mm-dim);
}

.mm-said .mm-date {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mm-faint);
  margin-top: 0.3rem;
}

.mm-x,
.mm-prev,
.mm-next {
  position: fixed;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--mm-edge);
  background: rgba(19, 16, 23, 0.85);
  color: var(--mm-text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s;
}

.mm-x:hover, .mm-prev:hover, .mm-next:hover { background: var(--mm-red); border-color: var(--mm-red); }

.mm-x { top: 1.4rem; right: 1.4rem; }
.mm-prev { top: 50%; left: 1.4rem; transform: translateY(-50%); }
.mm-next { top: 50%; right: 1.4rem; transform: translateY(-50%); }

@media (max-width: 700px) {
  .mm-stage { padding: 3.5rem 1rem 0.5rem; }
  .mm-foot { padding: 0.8rem 1.2rem 1.5rem; }
  .mm-said { text-align: left; }
  .mm-prev { left: 0.6rem; }
  .mm-next { right: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .mm-shot { animation: none; opacity: 1; }
  .mm-shot:hover img { transform: none; }
}
