/* Gallery pages: Photoshop & illustration */
.set { padding: 96px 0; border-top: 1px solid var(--line); scroll-margin-top: 72px; }
.set-head { display: flex; flex-wrap: wrap; gap: 24px 56px; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; }
.set-head .ruled { max-width: 620px; }
.set-head h2 { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.2; }
.count { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* Hover captions */
.tile .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 32px 14px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  color: #fff; font-size: 13px; font-weight: 400; line-height: 1.4;
  opacity: 0; transform: translateY(8px); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  pointer-events: none;
}
.tile:hover .cap, .tile:focus-within .cap { opacity: 1; transform: none; }
@media (hover: none) { .tile .cap { opacity: 1; transform: none; } }

/* Key visuals: feature + grid */
.kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kv-grid > .feature { grid-column: span 2; grid-row: span 2; }
.kv-grid .tile { aspect-ratio: 1; }

/* Comps: masonry keeps each composition's real shape */
.masonry { columns: 3 260px; column-gap: 14px; }
.masonry > * { break-inside: avoid; margin-bottom: 14px; }
.masonry .tile img { height: auto; }

/* Illustration: tinted square tiles */
.ill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.ill-grid .tile { aspect-ratio: 1; }
.ill-grid .tile:nth-child(4n+1) { background: #dce9f2; }
.ill-grid .tile:nth-child(4n+2) { background: #f6efe3; }
.ill-grid .tile:nth-child(4n+3) { background: #e9ebf7; }
.ill-grid .tile:nth-child(4n+4) { background: #f7e7e2; }
.ill-grid .tile.wide { grid-column: span 2; aspect-ratio: 2 / 1; }
.ill-grid .zoom img { transition: transform 0.6s var(--ease); }
.ill-grid .zoom:hover img { transform: scale(1.06) rotate(-1deg); }

.set-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 720px) {
  .set { padding: 64px 0; }
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv-grid > .feature { grid-column: span 2; grid-row: span 1; }
  .set-index { grid-template-columns: 1fr; }
  .ill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .tile .cap, .ill-grid .zoom img { transition: none; }
}
.ill-grid .tile.contain { padding: 18px; }
.ill-grid .tile.contain img { object-fit: contain; }

/* Illustration projects (rebuild) */
.set-index { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.set-index a:last-child:nth-child(4n+3) { grid-column: span 2; }
.set-index.idx5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ill-grid.ill3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.set-index.idx6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wr-cast { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.wr-cast .tile { aspect-ratio: 1; background: #0f0e35; padding: 12%; }
.wr-cast .tile img { object-fit: contain; }
.tile.wr-k { margin-top: 14px; aspect-ratio: 16 / 9; }
.tile.wr-k img { object-fit: cover; }
.wr-link { margin: 20px 0 0; }
.ill-grid.ill3 .tile.wide { grid-column: auto; aspect-ratio: 1; }
.pg { display: grid; gap: 14px; }
.pg2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pg3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pg4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pg.r54 .tile { aspect-ratio: 5 / 4; }
.pg.r11 .tile { aspect-ratio: 1; }
.pg.r65 .tile { aspect-ratio: 6 / 5; }
.pg .tile.tall { grid-row: span 2; aspect-ratio: auto; }
.pg .tile.f2 { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.tile.mult { background: #e9ebf7; }
.tile.mult img { mix-blend-mode: multiply; }
.pg .tile.contain img, .ill-grid .tile.contain img { object-fit: contain; }
.pg .tile.contain { padding: 24px; }
.boards { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 14px; margin-bottom: 14px; align-items: start; }
.boards .tile { background: #fff; border: 1px solid var(--line); padding: 14px; }
.boards .tile img { height: auto; object-fit: contain; }
@media (max-width: 900px) {
  .pg4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .boards { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .pg3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg3 .tile.tall { grid-row: auto; grid-column: span 2; aspect-ratio: 4 / 5; }
  .pg2 { grid-template-columns: 1fr; }
  .pg3 .tile.mlast { grid-column: span 2; aspect-ratio: 4 / 3; }
  .set-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .set-index.idx5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .set-index.idx5 a:last-child { grid-column: span 2; }
  .ill-grid.ill3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .set-index.idx6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wr-cast { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wr-cast .tile:first-child { grid-column: span 2; aspect-ratio: 2 / 1.2; }
}
.kv-grid > .tile.tall { grid-row: span 2; aspect-ratio: auto; }
/* key visuals: third tall tile is desktop-only */
@media (max-width: 720px) {
  .kv-grid > .tile.tall-d { grid-row: auto; aspect-ratio: 1; }
  .kv-grid > .tile.tall-d img { object-position: 50% 45%; }
}
