/* =========================================================
   Project subpages — shared chrome + layout variants
========================================================= */

body.project { background: var(--bg); }

/* ---------- Subpage top bar ---------- */
#proj-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--edge);
  mix-blend-mode: difference;
}
#proj-top .back {
  display: flex; align-items: center; gap: 10px;
  font-size: .88rem; letter-spacing: .04em;
}
#proj-top .back svg { width: 16px; height: 16px; }
#proj-top .proj-tag {
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
}

/* ---------- Intro block (shared) ---------- */
.proj-intro {
  padding: calc(var(--nav-h) + 90px) var(--edge) 70px;
}
.proj-intro .proj-copy {
  max-width: 980px;
}
.proj-intro .proj-index { color: var(--muted); font-size: .85rem; margin: 0 0 8px; }
.proj-intro h1 {
  font-size: var(--display);
  font-weight: 700;
  line-height: .92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0 0 34px;
}
.proj-intro .proj-copy p {
  color: var(--muted);
  font-size: clamp(1.05rem, 1.5vw, 1.32rem);
  line-height: 1.65;
  max-width: 62ch;
  margin: 0 0 18px;
}
.proj-intro .proj-copy p strong { color: var(--fg); font-weight: 500; }

/* ================= Variant: editorial (vertical stack) ================= */
.stack-editorial .frame {
  width: 100%;
  overflow: hidden;
  background: #050505;
  display: flex;
  justify-content: center;
  align-items: center;
}
.stack-editorial .frame img {
  display: block;
  width: auto; height: auto;
  max-width: 100%;
  max-height: 92svh;
  object-fit: contain;
  opacity: 0; transform: scale(1.03);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease);
}
.stack-editorial .frame.in img { opacity: 1; transform: scale(1); }

.stack-editorial .frame.full { max-width: 100%; }
.stack-editorial .frame.inset {
  max-width: 920px;
  margin: 60px auto;
  padding: 0 var(--edge);
}
.stack-editorial .frame.inset img { border-radius: 2px; }
.stack-editorial .frame + .frame { margin-top: 3vh; }
.stack-editorial .frame.inset + .frame.inset { margin-top: 60px; }
.stack-editorial .row-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
}
.stack-editorial .caption {
  max-width: 920px; margin: 14px auto 90px; padding: 0 var(--edge);
  color: var(--muted); font-size: .85rem;
}
@media (max-width: 760px) {
  .stack-editorial .row-2 { grid-template-columns: 1fr; }
  .stack-editorial .frame.inset { margin: 50px auto; }
}

/* ================= Variant: leporello (horizontal scroll) ================= */
.stack-leporello {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  height: 88svh;
  gap: clamp(10px, 2vw, 28px);
  padding: 0 var(--edge) 30px;
  scrollbar-width: none;
}
.stack-leporello::-webkit-scrollbar { display: none; }
.stack-leporello .lp-frame {
  scroll-snap-align: center;
  flex: 0 0 auto;
  height: 100%;
  width: min(74vw, 640px);
  overflow: hidden;
  position: relative;
  border-radius: 2px;
  opacity: .45;
  transform: scale(.96);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.stack-leporello .lp-frame.active { opacity: 1; transform: scale(1); }
.stack-leporello .lp-frame img {
  width: 100%; height: 100%; object-fit: cover;
}
.stack-leporello .lp-frame .lp-num {
  position: absolute; left: 18px; bottom: 14px;
  font-size: .82rem; color: var(--fg);
  background: rgba(0,0,0,0.35);
  padding: 3px 9px; border-radius: 20px;
  backdrop-filter: blur(6px);
}
.lp-hint {
  padding: 0 var(--edge) 90px;
  color: var(--muted); font-size: .82rem;
  letter-spacing: .1em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.lp-hint .arrow { display: inline-block; animation: lp-slide 1.6s ease-in-out infinite; }
@keyframes lp-slide { 0%,100% { transform: translateX(0);} 50% { transform: translateX(6px);} }
@media (max-width: 760px) {
  .stack-leporello { height: 62svh; }
  .stack-leporello .lp-frame { width: 82vw; }
}

/* Landscape variant: frames follow the photo's own ratio instead of a tall crop */
.stack-leporello.landscape {
  align-items: center;
}
.stack-leporello.landscape .lp-frame {
  height: auto;
  aspect-ratio: 3 / 2;
  width: min(80vw, 960px);
}
@media (max-width: 760px) {
  /* A tall portrait-height strip leaves a landscape frame tiny and hard to read;
     size the strip to the frame's own (wider) proportions instead. */
  .stack-leporello.landscape {
    height: calc(88vw * 2 / 3 + 28px);
  }
  .stack-leporello.landscape .lp-frame {
    width: 88vw;
  }
}

/* Overlapping / semitransparent feel for "Huh?" */
.stack-leporello.overlap .lp-frame {
  margin-right: clamp(-60px, -6vw, -10px);
  mix-blend-mode: normal;
}
.stack-leporello.overlap .lp-frame:not(.active) { opacity: .3; filter: blur(1px); }

/* ================= Variant: video-feature ================= */
.video-feature {
  position: relative;
  height: 100svh;
  overflow: hidden;
  background: #000;
}
.video-feature video, .video-feature img.poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.video-feature::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,6,7,0.5) 0%, rgba(6,6,7,0.1) 40%, rgba(6,6,7,0.85) 100%);
}
.video-feature .vf-title {
  position: absolute; left: var(--edge); right: var(--edge); bottom: 56px;
  z-index: 2;
}
.video-feature .vf-title .tape {
  display: inline-block;
  background: var(--fg);
  color: #0b0b0c;
  padding: 6px 16px;
  transform: rotate(-1.4deg);
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.video-feature h1 {
  font-size: var(--display);
  font-weight: 700; line-height: .9; letter-spacing: -.02em;
  text-transform: uppercase; margin: 0; color: var(--fg);
}

/* ---------- Next project / footer nav ---------- */
#proj-next {
  border-top: 1px solid var(--line);
  padding: 90px var(--edge) 110px;
  display: flex; flex-direction: column; gap: 18px;
}
#proj-next .eyebrow { margin-bottom: 6px; }
#proj-next a.next-title {
  font-size: var(--display-md);
  font-weight: 700; letter-spacing: -0.01em;
  text-transform: uppercase; line-height: 1;
  transition: color .3s ease;
}
#proj-next a.next-title:hover { color: var(--accent); }
