body[data-page="portfolio"] .pf-main { padding-top: 92px; }
.gallery-head { padding-block: clamp(48px, 8vw, 108px) clamp(32px, 5vw, 68px); }
.gallery-head h1, .project-head h1 {
  font-size: clamp(3.2rem, 2rem + 5vw, 6.25rem);
  font-weight: 600;
  letter-spacing: -.065em;
  line-height: 1;
}
.gallery-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 36px);
  padding-bottom: clamp(72px, 10vw, 128px);
}
.gallery-entry { min-width: 0; scroll-margin-top: 94px; }
.gallery-link {
  position: relative;
  display: block;
  height: 100%;
  padding: 12px;
  border: 1px solid var(--light-14);
  border-radius: 16px;
  background: var(--panel);
}
.gallery-image {
  display: block;
  aspect-ratio: 1600 / 775;
  overflow: hidden;
  border-radius: 9px;
  background: var(--void);
}
.gallery-image img { width: 100%; height: 100%; object-fit: contain; }
.gallery-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 4px 16px;
  align-items: center;
  padding: clamp(16px, 2vw, 24px) 7px 8px;
}
.gallery-caption p { grid-column: 1; color: var(--light-70); line-height: 1.45; }
.gallery-caption h2 {
  grid-column: 1;
  font-size: clamp(1.24rem, 1rem + 1vw, 1.8rem);
  line-height: 1.13;
  letter-spacing: -.035em;
  font-weight: 600;
}
.gallery-caption .gallery-type {
  grid-column: 1;
  color: var(--light-55);
  font-size: .67rem;
  letter-spacing: .07em;
}
.gallery-arrow {
  display: grid;
  place-items: center;
  grid-area: 1 / 2 / span 3;
  width: 38px;
  height: 38px;
  border: 1px solid var(--light-14);
  border-radius: 50%;
  color: var(--light-70);
}
.gallery-arrow svg { width: 16px; height: 16px; }
.gallery-link:hover, .gallery-link:focus-visible { border-color: var(--light-38); }
.gallery-link:hover .gallery-arrow, .gallery-link:focus-visible .gallery-arrow {
  border-color: var(--light);
  background: var(--light);
  color: var(--void);
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .gallery-entry { perspective: 1100px; }
  .gallery-link {
    transform: rotateX(var(--gallery-x, 0deg)) rotateY(var(--gallery-y, 0deg));
    transition: transform .35s var(--ease), border-color .3s, box-shadow .35s;
  }
  .gallery-link:hover { box-shadow: 0 24px 42px -28px var(--preview-shadow); }
  .gallery-arrow { transition: color .25s, background-color .25s, border-color .25s; }
  .gallery-link:hover .gallery-arrow svg { animation: gallery-arrow .45s var(--ease); }
}
@keyframes gallery-arrow {
  45% { transform: translate(2px, -2px); }
}
@media (max-width: 760px) {
  .gallery-list { grid-template-columns: minmax(0, 1fr); }
}

.project-main { padding-bottom: clamp(60px, 10vw, 116px); }
.project-head { padding-block: clamp(37px, 7vw, 88px) clamp(24px, 5vw, 56px); }
.project-back {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--light-70);
  font-size: .92rem;
}
.project-back:hover { color: var(--light); }
.project-type { margin-bottom: 14px; color: var(--light-55); font-size: .74rem; letter-spacing: .08em; }
.project-intro { margin-top: 20px; max-width: 64ch; color: var(--light-70); line-height: 1.6; font-size: 1.05rem; }
.project-visit { margin-top: 24px; }
.project-images { display: grid; gap: 16px; }
.project-images img { width: 100%; height: auto; border: 1px solid var(--edge-strong); border-radius: 12px; }
.project-images figcaption { margin-top: 8px; color: var(--light-55); font-size: .8rem; }
.project-notes { margin-top: clamp(34px, 6vw, 70px); border-top: 1px solid var(--edge); padding-top: 28px; }
.project-notes h2 { font-size: 1.35rem; font-weight: 600; letter-spacing: -.03em; }
.project-notes ul { margin-top: 12px; padding-inline-start: 1.2em; color: var(--light-70); line-height: 1.75; }
