/* =========================================================
   Project page — project.html
   Builds on css/scroll.css (tokens, header, type).
   ========================================================= */

/* scroll.css locks the page for the works list — unlock it here */
html:has(.page-project),
.page-project {
  height: auto;
  overflow: visible;
}
.page-project { overflow-x: clip; }

/* header becomes a white bar with a hairline, like the reference */
.top--bar {
  position: sticky;
  background: var(--bg);
  border-bottom: 1px solid #e4e4e4;
  pointer-events: auto;
}

.pj { padding: 0 var(--edge); }

.pj__label,
.pj dt {
  display: block;
  margin: 0 0 3px;
  font-size: 9px;
  color: var(--mute);
}

/* ---------- intro ---------- */
.pj__intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--edge);
  padding: 46px 0 52px;
  min-height: 56vh;
}

.pj__arrow {
  display: block;
  width: 22px;
  height: 22px;
  color: var(--mute);
  margin-bottom: 16px;
}
.pj__count { margin: 0 0 8px; font-size: 9px; color: var(--mute); }

.pj__title {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 52px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.035em;
  max-width: 11ch;
}

.pj__info {
  padding-top: 52px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.pj__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--edge);
}
.pj__meta dl { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.pj__meta dd { margin: 0; line-height: 1.32; }
.pj__meta dd span { display: block; }

.pj__desc { max-width: 74%; }
.pj__desc p:not(.pj__label) {
  margin: 0 0 1.2em;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
}
.pj__ext {
  display: inline-block;
  margin-top: 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.pj__ext:hover { color: var(--mute); }

/* ---------- images: two balanced columns, one even 12px gap everywhere ---------- */
.pj__images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
.pj__col { display: flex; flex-direction: column; gap: 12px; }

.pj__fig { margin: 0; }
.pj__fig img {
  display: block;
  width: 100%;
  height: auto;
  background: #f1f1f1;
}

.pj__zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

/* fade images up as they enter */
.pj__fig { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.pj__fig.is-in { opacity: 1; transform: none; }

/* ---------- image viewer ---------- */
.lb-lock, .lb-lock body { overflow: hidden; }

.lb {
  position: fixed;
  inset: 0;
  z-index: 200;                     /* under the cursor dot (250) */
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease), visibility 0s linear .35s;
}
.lb.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .35s var(--ease), visibility 0s;
}
.lb__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--edge);
}
.lb__bar button:hover { color: var(--mute); }
.lb__stage {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--edge);
  cursor: zoom-out;
}
.lb__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: pointer;
  transform: scale(.97);
  transition: transform .5s var(--ease), opacity .25s var(--ease);
}
.lb.is-open .lb__img { transform: none; }
.lb__img.is-swap { opacity: 0; }

/* ---------- next project ---------- */
.pj__next {
  margin-top: 120px;
  border-top: 1px solid #e4e4e4;
}
.pj__next-link {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 8px var(--edge);
  padding: 22px 0 60px;
  text-decoration: none;
}
.pj__next-link .pj__label { grid-column: 1; }
.pj__next-title {
  grid-column: 1;
  font-size: clamp(26px, 3.6vw, 52px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.035em;
  transition: color .35s var(--ease);
}
.pj__next-title::after { content: " →"; font-weight: 400; }
.pj__next-img {
  grid-column: 2;
  grid-row: 1 / span 2;
  overflow: hidden;
  background: #f1f1f1;
  aspect-ratio: 2 / 1;
  width: 66%;
}
.pj__next-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease);
}
.pj__next-link:hover .pj__next-title { color: var(--mute); }
.pj__next-link:hover .pj__next-img img { transform: scale(1.04); }

.pj__foot {
  display: flex;
  justify-content: space-between;
  gap: var(--edge);
  padding: var(--edge) 0;
  border-top: 1px solid #e4e4e4;
}
.pj__foot a { text-decoration: none; }
.pj__foot a:hover { color: var(--mute); }

/* ---------- page enter ---------- */
.pj__head > *, .pj__info > * {
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.is-entering .pj__head > *, .is-entering .pj__info > * {
  opacity: 0;
  transform: translateY(14px);
}
.pj__head > :nth-child(2) { transition-delay: .05s; }
.pj__head > :nth-child(3) { transition-delay: .1s; }
.pj__info > :nth-child(1) { transition-delay: .18s; }
.pj__info > :nth-child(2) { transition-delay: .26s; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .pj__intro { grid-template-columns: 1fr; min-height: 0; padding-top: 32px; }
  .pj__info { padding-top: 36px; gap: 40px; }
  .pj__desc { max-width: none; }
  .pj__images { grid-template-columns: 1fr; }
  .pj__next-link { grid-template-columns: 1fr; }
  .pj__next-img { grid-column: 1; grid-row: auto; width: 100%; margin-top: 12px; }
  .pj__foot > a { display: none; }   /* phones: only Email, Instagram, Behance */
}

@media (prefers-reduced-motion: reduce) {
  .pj__fig, .pj__head > *, .pj__info > * { transition: none; opacity: 1; transform: none; }
}

/* project pages have no arrow: line the info column up with the (01/05) number */
@media (min-width: 721px) {
  .page-project:not(.page-about) .pj__info { padding-top: 0; }
}
