/* =========================================================
   project archive
   ========================================================= */

:root {
  --pj-rule: rgba(8, 8, 8, 0.16);
  --pj-rule-soft: rgba(8, 8, 8, 0.08);
}

body.pj-page {
  background: var(--paper);
  color: var(--ink);
}

.pj-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  min-height: 62px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--pj-rule);
  background: var(--paper);
}

.pj-back,
.pj-brand,
.pj-counter {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}

.pj-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  justify-self: start;
  min-height: 44px;
}

.pj-back span {
  display: inline-block;
  transition: transform var(--t-hover) var(--ease-out);
}

.pj-back:hover span {
  transform: translateX(-4px);
}

.pj-brand {
  justify-self: center;
  color: var(--muted);
  white-space: nowrap;
}

.pj-counter {
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

.pj-main {
  display: block;
  min-height: 60vh;
}

/* ---------- hero ---------- */

.pj-hero {
  padding-top: clamp(52px, 8vw, 116px);
  padding-bottom: clamp(44px, 6vw, 86px);
}

.pj-hero-top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
}

.pj-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1.4;
}

.pj-diamond {
  width: 7px;
  height: 7px;
  flex: none;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

.pj-index {
  margin-bottom: -0.12em;
  color: transparent;
  font-size: clamp(76px, 12vw, 190px);
  font-weight: 900;
  line-height: 0.72;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 1px rgba(8, 8, 8, 0.3);
}

.pj-title {
  max-width: 15ch;
  margin-top: clamp(18px, 2.6vw, 38px);
  font-size: clamp(46px, 8.2vw, 138px);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.055em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.pj-sub {
  max-width: 46ch;
  margin-top: clamp(18px, 2.2vw, 32px);
  color: var(--muted);
  font-size: clamp(16px, 1.45vw, 22px);
  line-height: 1.55;
}

.pj-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 48px);
  margin-top: clamp(40px, 5vw, 70px);
  padding-top: 16px;
  border-top: 1px solid var(--pj-rule);
}

.pj-meta div {
  display: grid;
  grid-template-columns: 4.4em 1fr;
  gap: 10px;
  align-items: baseline;
}

.pj-meta dt {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pj-meta dd {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

/* ---------- brief ---------- */

.pj-brief {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  border-top: 1px solid var(--ink);
  padding-top: clamp(46px, 6vw, 84px);
  padding-bottom: clamp(56px, 7vw, 104px);
}

.pj-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.5;
}

.pj-brief-body {
  max-width: 72ch;
}

.pj-desc p {
  max-width: 64ch;
  color: #2b2b28;
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.8;
}

.pj-desc p + p {
  margin-top: 1.1em;
}

.pj-award {
  display: inline-block;
  margin-top: 28px;
  padding: 9px 13px;
  border: 1px solid var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* ---------- gallery ---------- */

.pj-gallery-section {
  padding-bottom: clamp(40px, 5vw, 72px);
}

.pj-gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}

.pj-count {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.pj-gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 3.6vw, 64px);
  padding-top: clamp(28px, 3.6vw, 52px);
}

.pj-figure {
  width: 100%;
  min-width: 0;
}

.pj-figure-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  text-align: left;
}

.pj-figure img {
  width: 100%;
  height: auto;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--pj-rule-soft);
  filter: grayscale(1) contrast(1.03);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out),
    filter 500ms var(--ease-out);
}

.pj-figure.is-in img {
  opacity: 1;
  transform: none;
}

.pj-figure:hover img,
.pj-figure:focus-within img {
  filter: grayscale(0) contrast(1);
}

.pj-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* ---------- next ---------- */

.pj-next {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  margin-top: clamp(52px, 7vw, 104px);
  padding-top: clamp(24px, 3vw, 40px);
  padding-bottom: clamp(80px, 10vw, 150px);
  border-top: 1px solid var(--ink);
}

.pj-next a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
}

.pj-next-title {
  font-size: clamp(30px, 3.6vw, 58px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.pj-next-arrow {
  flex: none;
  font-size: clamp(28px, 3vw, 46px);
  transition: transform var(--t-ui) var(--ease-out);
}

.pj-next a:hover .pj-next-arrow {
  transform: translateX(8px);
}

/* ---------- footer ---------- */

.pj-footer {
  padding-top: clamp(56px, 7vw, 96px);
  padding-bottom: 28px;
  background: var(--ink);
  color: var(--paper);
}

.pj-footer-cta {
  max-width: 11ch;
  font-size: clamp(44px, 6.4vw, 104px);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.pj-footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-top: clamp(40px, 5vw, 72px);
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(241, 241, 239, 0.22);
}

.pj-footer-mail {
  font-size: clamp(17px, 1.6vw, 24px);
  font-weight: 600;
  line-height: 1.4;
}

.pj-footer-mail:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.pj-footer-grid p {
  color: var(--muted-dark);
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.pj-footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  color: var(--muted-dark);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.pj-footer-bottom a:hover {
  color: var(--paper);
}

/* ---------- empty ---------- */

.pj-empty {
  padding-top: clamp(80px, 12vw, 160px);
  padding-bottom: clamp(100px, 14vw, 200px);
}

.pj-empty h1 {
  max-width: 12ch;
  margin-top: 28px;
  font-size: clamp(44px, 7vw, 104px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.pj-empty > p:not(.pj-kicker) {
  max-width: 40ch;
  margin-top: 24px;
  color: var(--muted);
}

.pj-empty-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding-bottom: 6px;
  border-bottom: 1px solid currentColor;
  font-size: 14px;
  font-weight: 600;
}

.pj-empty-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--pj-rule);
  font-size: 13px;
}

.pj-empty-list a {
  color: var(--muted);
}

.pj-empty-list a:hover {
  color: var(--ink);
}

/* ---------- lightbox ---------- */

.pj-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 12px;
  padding: 64px 28px 56px;
  background: rgba(8, 8, 8, 0.97);
  color: var(--paper);
}

.pj-lightbox[hidden] {
  display: none;
}

.pj-lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 0;
  height: 100%;
  justify-content: center;
}

.pj-lightbox-figure img {
  max-width: 100%;
  max-height: calc(100dvh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.pj-lightbox-figure figcaption {
  max-width: 70ch;
  color: var(--muted-dark);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.pj-lightbox-close {
  position: absolute;
  top: 18px;
  right: var(--pad);
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.pj-lightbox-nav {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(241, 241, 239, 0.32);
  border-radius: 50%;
  background: none;
  color: var(--paper);
  font-size: 20px;
  cursor: pointer;
  transition: background var(--t-hover) ease, border-color var(--t-hover) ease;
}

.pj-lightbox-nav:hover {
  background: rgba(241, 241, 239, 0.1);
  border-color: var(--paper);
}

.pj-lightbox-nav.is-prev {
  justify-self: start;
}

.pj-lightbox-nav.is-next {
  justify-self: end;
}

.pj-lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted-dark);
  font-size: 11px;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

body.pj-lock {
  overflow: hidden;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .pj-brief,
  .pj-next {
    grid-template-columns: 160px minmax(0, 1fr);
  }

  .pj-meta div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 900px) {
  .pj-brand {
    display: none;
  }

  .pj-bar {
    grid-template-columns: 1fr auto;
  }

  .pj-brief,
  .pj-next {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

@media (max-width: 640px) {
  .pj-bar {
    min-height: 56px;
    padding-inline: 20px;
  }

  .pj-hero {
    padding-top: 40px;
  }

  .pj-hero-top {
    gap: 12px;
  }

  .pj-index {
    font-size: clamp(64px, 22vw, 100px);
  }

  .pj-title {
    margin-top: 14px;
    font-size: clamp(40px, 12.6vw, 64px);
    letter-spacing: -0.045em;
  }

  .pj-sub {
    font-size: 16px;
  }

  .pj-meta {
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
  }

  .pj-meta div {
    display: block;
  }

  .pj-meta div:last-child {
    grid-column: span 2;
  }

  .pj-meta dd {
    margin-top: 2px;
  }

  .pj-divider {
    font-size: 10px;
  }

  .pj-brief {
    padding-top: 38px;
    padding-bottom: 48px;
  }

  .pj-desc p {
    font-size: 16px;
    line-height: 1.75;
  }

  .pj-gallery {
    gap: 26px;
  }

  .pj-figure figcaption {
    margin-top: 8px;
  }

  .pj-next {
    margin-top: 48px;
    padding-bottom: 80px;
  }

  .pj-next-title {
    font-size: 30px;
  }

  .pj-footer-grid {
    display: block;
  }

  .pj-footer-grid p {
    margin-top: 18px;
    text-align: left;
  }

  .pj-footer-bottom {
    font-size: 10px;
  }

  .pj-lightbox {
    grid-template-columns: 1fr;
    padding: 60px 16px 72px;
  }

  .pj-lightbox-figure {
    grid-row: 1;
  }

  .pj-lightbox-figure img {
    max-height: calc(100dvh - 180px);
  }

  .pj-lightbox-nav {
    position: absolute;
    bottom: 16px;
    width: 46px;
    height: 46px;
  }

  .pj-lightbox-nav.is-prev {
    left: 20px;
  }

  .pj-lightbox-nav.is-next {
    right: 20px;
  }

  .pj-lightbox-counter {
    bottom: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pj-figure img {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .pj-next-arrow,
  .pj-back span {
    transition: none;
  }
}
