/* Community Memories (src/memories.html, js/pg-memories.js): five chapters, each with its own motion, a closing photo
   wall, and one gallery for every photo (photos are cropped as tiles on the page, always whole in the gallery). */
.mm-ph { position: relative; display: block; overflow: hidden; border-radius: 14px; cursor: zoom-in; background: rgba(255,255,255,.06); }
.mm-ph img { width: 100%; height: 100%; object-fit: cover; transition: scale .8s var(--ease); }
.mm-ph[hidden] { display: none; }
.pg-mem .h2 { text-wrap: balance; }

/* ---------- hero ---------- */
.mm-hero { overflow: hidden; }
.mm-hero .hero-in { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 860px; }
.mm-hero .h1 .ln > span { white-space: normal; }
.mm-intro { margin-top: 18px; font-size: clamp(19px, 1.8vw, 26px); font-weight: 500; line-height: 1.35; letter-spacing: -.01em; text-wrap: balance; }
.mm-intro em, .mm-statement em { background: linear-gradient(90deg, var(--lcyan), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mm-hero .lead { margin-top: 16px; max-width: 640px; }
.mm-small { margin-top: 10px; font-size: 14.5px; color: var(--muted); }
.mm-cue { position: relative; display: block; width: 26px; height: 42px; margin-top: 34px; border-radius: 14px; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.mm-cue i { position: absolute; left: 50%; top: 9px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: #fff; animation: mmCue 1.8s ease-in-out infinite; }
@keyframes mmCue { 0% { opacity: 0; translate: 0 -2px; } 30% { opacity: 1; } 100% { opacity: 0; translate: 0 14px; } }
.mm-prints { position: absolute; inset: 0; pointer-events: none; }
.mm-print { position: absolute; margin: 0; padding: 7px; border-radius: 14px; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3), 0 30px 50px -20px rgba(1,6,26,.8); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.mm-print img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.mp-1 { width: 160px; left: 5%; top: 17%; }
.mp-2 { width: 150px; left: 9%; top: 60%; }
.mp-3 { width: 132px; right: 6%; top: 15%; }
.mp-4 { width: 190px; right: 6%; top: 62%; }

/* shared: thumb rows and "+N" tiles */
.mm-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 26px; max-width: 520px; }
.mm-row .mm-ph { aspect-ratio: 1; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); transition: translate .45s var(--ease), box-shadow .45s; }
.mm-row .mm-ph:hover { translate: 0 -4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 16px 30px -14px rgba(1,6,26,.9); }
.mm-ph:hover img { scale: 1.06; }
.mm-more img { filter: blur(10px); opacity: .55; scale: 1.15; }
.mm-more:hover img { opacity: .75; scale: 1.2; }
.mm-more b { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(22px, 2vw, 28px); font-weight: 500; }
.mm-more:hover { box-shadow: inset 0 0 0 1px var(--lcyan) !important; }

/* ---------- 1 birthday ---------- */
.mm-feature { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; column-gap: clamp(28px, 4vw, 64px); }
.mm-fcopy .lead { margin-top: 14px; max-width: 460px; }
.mm-fvis { position: relative; padding-bottom: 12%; }
.mm-main { aspect-ratio: 1232 / 760; border-radius: 20px; box-shadow: 0 30px 60px -30px rgba(1,6,26,.9); }
.mm-phone { position: absolute; left: -6%; bottom: 0; width: 26%; aspect-ratio: 574 / 986; border-radius: 22px; box-shadow: 0 0 0 6px rgba(255,255,255,.16), 0 0 0 7px rgba(255,255,255,.3), 0 30px 50px -16px rgba(1,6,26,.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* ---------- 2 halloween ---------- */
.mm-band { position: relative; overflow: hidden; isolation: isolate; height: clamp(360px, 44vw, 600px); border-radius: var(--pr); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 44px 90px -44px rgba(1,6,26,.9); }
.mm-bandimg { position: absolute; inset: 0; z-index: -1; border-radius: 0; background: none; }
.mm-bandimg img { transform-origin: 50% 40%; }
.mm-band::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(180deg, rgba(2,9,35,0) 40%, rgba(2,9,35,.85)), linear-gradient(90deg, rgba(2,9,35,.55), rgba(2,9,35,0) 60%); }
.mm-bandtxt { position: absolute; left: var(--px); bottom: clamp(28px, 4vw, 52px); z-index: 1; pointer-events: none; }
.mm-under { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: clamp(28px, 4vw, 64px); margin-top: 34px; }
.mm-under .mm-row { margin-top: 0; justify-self: end; width: 100%; }

/* ---------- 3 magazine ---------- */
.mm-mag { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: clamp(28px, 4vw, 64px); overflow: hidden; }
.mm-mcopy .lead { margin-top: 16px; }
.mm-fan { position: relative; height: clamp(380px, 34vw, 480px); }
.mm-cover { --w: clamp(160px, 14vw, 206px); position: absolute; left: 50%; top: 50%; width: var(--w); margin: calc(var(--w) * -.629) 0 0 calc(var(--w) / -2); aspect-ratio: 984 / 1238; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 30px 50px -20px rgba(1,6,26,.9); }
.mm-cover.c3 { margin-top: calc(var(--w) * -.698); aspect-ratio: 890 / 1242; transform: rotate(-1.5deg); }
.mm-cover.c1 { transform: translate(-120px, 20px) rotate(-11deg); }
.mm-cover.c2 { transform: translate(120px, -10px) rotate(9deg); }
.mm-badge { position: absolute; left: 50%; top: 50%; z-index: 3; display: grid; place-items: center; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 50%; overflow: visible; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 14px 30px -10px rgba(1,6,26,.8); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: scale .35s var(--ease), box-shadow .35s, background .3s; }
.mm-badge img { display: none; }
.mm-badge b { font-size: 22px; font-weight: 500; }
.mm-badge:hover { scale: 1.08; background: rgba(0,168,232,.55); box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 0 30px rgba(0,168,232,.7); }
.mm-fan .mm-badge { left: 70%; top: 80%; }

/* ---------- 4 summer: the clothesline ---------- */
.mm-line { --cw: 250px; position: relative; height: calc(var(--cw) * 1.45 + 130px); margin-top: 10px; overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.mm-line.drag { cursor: grabbing; }
.mm-wire { position: absolute; left: 0; top: 0; width: 100%; height: 200px; overflow: visible; }
.mm-wire path { fill: none; stroke: rgba(212,242,255,.55); stroke-width: 1.5; filter: drop-shadow(0 0 4px rgba(0,168,232,.6)); }
.mm-card { position: absolute; left: 0; top: 0; width: var(--cw); padding: 10px 10px 30px; border-radius: 12px; transform-origin: 50% 0; will-change: transform; background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3), 0 30px 50px -20px rgba(1,6,26,.9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.mm-card .mm-ph { aspect-ratio: 984 / 1238; border-radius: 6px; -webkit-user-drag: none; }
.mm-card img { pointer-events: none; -webkit-user-drag: none; }
.mm-clip { position: absolute; left: 50%; top: -14px; width: 14px; height: 30px; margin-left: -7px; border-radius: 4px; background: linear-gradient(180deg, var(--lcyan), var(--cyan)); box-shadow: 0 0 12px rgba(0,168,232,.7), inset 0 0 0 1px rgba(255,255,255,.4); }
.mm-ctrl { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 8px; }
.mm-arrow { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: background .3s, scale .3s var(--ease), box-shadow .3s; }
.mm-arrow:hover { background: rgba(0,168,232,.6); scale: 1.08; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 0 24px rgba(0,168,232,.6); }
.mm-arrow svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mm-dots { display: flex; gap: 8px; }
.mm-dot { width: 8px; height: 8px; border-radius: 8px; background: rgba(255,255,255,.3); transition: width .5s var(--ease), background .3s; }
.mm-dot.on { width: 26px; background: var(--lcyan); }

/* ---------- 5 pizza ---------- */
.mm-statement { margin-top: 12px; font-size: clamp(20px, 2vw, 28px); font-weight: 500; line-height: 1.35; letter-spacing: -.01em; text-wrap: balance; }
.mm-slices { position: relative; height: clamp(340px, 30vw, 420px); }
.mm-round, .mm-sq { position: absolute; left: 50%; top: 50%; width: var(--w); margin: calc(var(--w) / -2) 0 0 calc(var(--w) / -2); }
.mm-sq.l { transform: translate(-300px, 20px) rotate(6deg); }
.mm-sq.r { transform: translate(300px, -10px) rotate(-6deg); }
.mm-slices .mm-badge { transform: translate(140px, 120px); }
.mm-round { --w: clamp(200px, 21vw, 300px); z-index: 2; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 0 0 6px rgba(255,255,255,.16), 0 30px 60px -20px rgba(1,6,26,.9); }
.mm-sq { --w: clamp(140px, 16vw, 230px); aspect-ratio: 1; border-radius: 18px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 24px 44px -20px rgba(1,6,26,.9); }

/* ---------- close: the photo wall ---------- */
.mm-close { overflow: hidden; padding-bottom: var(--pad); }
.mm-wall { position: absolute; left: 0; right: 0; top: calc(var(--pad) - 40px); bottom: -40px; display: grid; align-content: center; gap: 14px; opacity: .22; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.mm-wrow { display: flex; gap: 14px; width: max-content; animation: marq 80s linear infinite; }
.mm-wrow.rev { animation-duration: 95s; animation-direction: reverse; }
.mm-wrow img { flex: none; width: 150px; height: 150px; border-radius: 14px; object-fit: cover; }
.mm-closecopy { position: relative; margin-top: 0; margin-bottom: 0; padding: clamp(80px, 9vw, 130px) 0; }
.mm-closecopy::before { content: ""; position: absolute; left: 50%; top: 50%; z-index: -1; width: 130%; height: 120%; translate: -50% -50%; background: radial-gradient(closest-side, rgba(2,9,35,.92), rgba(2,9,35,.4) 70%, rgba(2,9,35,0)); pointer-events: none; }
.pg-mem .mm-closecopy::after { display: none; }
.mm-closecopy .subline { margin-top: 10px; }
.mm-closecopy .lead { margin-top: 12px; }

/* ---------- gallery ---------- */
html.mm-lb-open { overflow: hidden; }
.mm-lb { position: fixed; inset: 0; z-index: 160; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(2,9,35,.84); -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2); }
.mm-lb[hidden] { display: none; }
.mm-lb-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; }
.mm-lb-count { font-size: 14px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.mm-lb-btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); transition: background .3s, scale .3s var(--ease); }
.mm-lb-btn:hover { background: rgba(0,168,232,.55); scale: 1.06; }
.mm-lb-btn svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mm-lb-stage { position: relative; min-height: 0; touch-action: pan-y; }
.mm-lb-img { position: absolute; inset: 0; margin: auto; max-width: calc(100% - 168px); max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 12px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.9); transition: opacity .18s, scale .3s var(--ease); }
.mm-lb-img.swap { opacity: 0; scale: .97; }
.mm-lb-prev, .mm-lb-next { position: absolute; top: 50%; translate: 0 -50%; }
.mm-lb-prev { left: 20px; } .mm-lb-next { right: 20px; }
.mm-lb-strip { display: flex; gap: 8px; overflow-x: auto; padding: 16px 20px 20px; scrollbar-width: none; justify-content: safe center; }
.mm-lb-strip::-webkit-scrollbar { display: none; }
.mm-lb-strip button { flex: none; width: 60px; height: 60px; border-radius: 10px; overflow: hidden; opacity: .5; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); transition: opacity .3s, box-shadow .3s; }
.mm-lb-strip button img { width: 100%; height: 100%; object-fit: cover; }
.mm-lb-strip button.on { opacity: 1; box-shadow: 0 0 0 2px var(--lcyan); }
.mm-lb-strip button:hover { opacity: .85; }

/* ---------- smaller screens ---------- */
@media (max-width: 1080px) {
  .mp-1 { width: 120px; } .mp-2 { width: 110px; } .mp-3 { width: 100px; } .mp-4 { width: 140px; }
}
@media (max-width: 900px) {
  .mm-feature, .mm-mag { grid-template-columns: 1fr; row-gap: 34px; }
  .mm-fvis { margin-left: 6%; }
  .mm-under { grid-template-columns: 1fr; row-gap: 22px; }
  .mm-under .mm-row { justify-self: start; }
}
@media (max-width: 760px) {
  .mm-hero { padding-top: 200px; padding-bottom: 160px; }
  .mp-1 { width: 78px; left: 4%; top: 92px; } .mp-2 { width: 70px; left: 7%; top: auto; bottom: 34px; }
  .mp-3 { width: 66px; right: 5%; top: 96px; } .mp-4 { width: 104px; right: 5%; top: auto; bottom: 40px; }
  .mm-cue { display: none; }
  .mm-row { gap: 8px; }
  .mm-phone { left: -5%; width: 30%; border-radius: 14px; }
  .mm-band { height: 420px; }
  .mm-line { --cw: 190px; }
  .mm-cover.c1 { transform: translate(-70px, 20px) rotate(-11deg); }
  .mm-cover.c2 { transform: translate(70px, -10px) rotate(9deg); }
  .mm-pizza { overflow: hidden; }
  .mm-round { --w: 180px; }
  .mm-sq { --w: 112px; }
  .mm-sq.l { transform: translate(-100px, 20px) rotate(6deg); }
  .mm-sq.r { transform: translate(100px, -10px) rotate(-6deg); }
  .mm-slices { height: 300px; }
  .mm-badge { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
  .mm-badge b { font-size: 18px; }
  .mm-slices .mm-badge { transform: translate(64px, 64px); }
  .mm-lb-stage { padding: 0; }
  .mm-lb-img { max-width: calc(100% - 24px); max-height: calc(100% - 60px); top: 0; bottom: 60px; }
  .mm-lb-prev, .mm-lb-next { top: auto; bottom: 8px; translate: none; width: 42px; height: 42px; }
  .mm-lb-top { padding: 12px 14px; }
  .mm-wrow img { width: 110px; height: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  .mm-wrow, .mm-cue i { animation: none; }
}
