/* Photo and Design pages: tiles, genre list, project layout, photo viewer. */

/* Tiles on the Photo and Design index pages */
.tile { position: relative; display: block; overflow: hidden; color: var(--white); animation: rise-in .7s var(--ease) backwards; }
.tile__cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.tile:hover .tile__cover { transform: scale(1.05); }
.more {
  flex: none; padding-bottom: 3px; font-size: 13px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase;
  background: linear-gradient(currentColor, currentColor) 100% 100% / 0 1px no-repeat;
  transition: background-size .35s var(--ease);
}
.tile:hover .more, .tile:focus-visible .more, .next-project:hover .more { background-position-x: 0; background-size: 100% 1px; }
.tile:nth-child(2) { animation-delay: .06s } .tile:nth-child(3) { animation-delay: .12s }
.tile:nth-child(4) { animation-delay: .18s } .tile:nth-child(5) { animation-delay: .24s }
.tile:nth-child(6) { animation-delay: .3s }  .tile:nth-child(7) { animation-delay: .36s }
.tile:nth-child(8) { animation-delay: .42s } .tile:nth-child(9) { animation-delay: .48s }
.tile:nth-child(10) { animation-delay: .54s }

/* Photo index: tall genre tiles */
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 4px; padding-right: 4px; }
.genre-tile { aspect-ratio: 4 / 5; }
.genre-tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,20,20,.35) 0%, rgba(20,20,20,0) 30%, rgba(20,20,20,0) 55%, rgba(20,20,20,.75) 100%);
}
.genre-tile__num { position: absolute; z-index: 1; top: 16px; left: 18px; font-size: 13px; font-weight: 400; letter-spacing: .14em; }
.genre-tile__foot {
  position: absolute; z-index: 1; left: 18px; right: 18px; bottom: 18px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.genre-tile__name { font-size: clamp(20px, 2vw, 28px); font-weight: 300; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; }
@media (max-width: 700px) {
  /* Phones show one genre at a time, chosen from the dropdown. */
  .genre-grid { padding: 0 16px 0 7px; }
  .genre-grid .genre-tile:not(.is-picked) { display: none; }
}

/* Design index: project cards */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 40px 16px; padding: 0 clamp(16px, 4vw, 56px) 0 7px;
}
.project-card { display: flex; flex-direction: column; gap: 14px; overflow: visible; }
.project-card__image { position: relative; display: block; overflow: hidden; aspect-ratio: 688 / 540; background: #000; }
.project-card__info { display: flex; align-items: baseline; gap: 14px; padding: 0 4px 12px; border-bottom: 1px solid var(--line); }
.project-card__num { font-size: 13px; letter-spacing: .14em; color: var(--mid); }
.project-card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.project-card__name { font-size: 20px; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; }
.project-card__roles { font-size: 13px; letter-spacing: .06em; color: var(--grey); }
.load-more { display: none; padding: 32px 16px 0 7px; }
.load-more .btn { width: 100%; min-height: 52px; }
@media (max-width: 700px) {
  /* Phones show 4 projects until "Load more" is pressed. */
  .project-grid:not(.show-all) .project-card:nth-child(n+5) { display: none; }
  .project-grid:not(.show-all) + .load-more { display: flex; }
}

/* Genre page: joined list of genres with a white block that follows the pointer */
.genre-list-wrap { padding: 0 clamp(16px, 4vw, 56px) 24px 7px; }
.genre-list { overflow-x: auto; scrollbar-width: none; }
.genre-list__row { position: relative; display: inline-flex; min-width: 100%; border-bottom: 1px solid var(--fg); }
.genre-list__block {
  position: absolute; top: 0; bottom: 0; left: 0; width: 0; opacity: 0; background: var(--fg); pointer-events: none;
  transition: transform .45s var(--ease), width .45s var(--ease), opacity .25s;
}
.genre-list a {
  position: relative; flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  font-size: 15px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; transition: color .3s, background-color .3s;
}
.genre-list a[aria-current="page"] { background: var(--fg); color: var(--bg); }
.genre-list a.is-hovered { color: var(--bg); }
@media (max-width: 700px) { .genre-list { display: none; } }

.prev-next { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-right: 12px; }
@media (max-width: 700px) { .prev-next a { white-space: normal; } }

/* Genre page: masonry of photos */
.photo-grid { column-width: clamp(160px, 22vw, 320px); column-gap: 10px; padding: 0 clamp(8px, 1vw, 10px); }
.photo-grid button {
  display: flex; align-items: flex-end; width: 100%; margin: 0 0 10px; padding: 12px; border: 0; border-radius: 0;
  font: inherit; font-size: 13px; font-weight: 500; text-align: left; cursor: zoom-in; break-inside: avoid;
  position: relative; overflow: hidden; transition: transform .5s var(--ease), filter .5s;
  animation: rise-in-blur .8s var(--ease) backwards;
}
.photo-grid button img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-grid:hover button:not(:hover) { filter: brightness(.5); }
.photo-grid button:hover { transform: scale(1.02); }

/* Design project page */
.project-hero { display: flex; flex-wrap: wrap; gap: 4px; padding-right: 4px; }
.project-hero__logo { flex: 2 1 520px; position: relative; aspect-ratio: 688 / 540; max-height: 76vh; overflow: hidden; }
.project-hero__logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.brief {
  flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 20px;
  padding: clamp(20px, 3vw, 40px) clamp(16px, 2.4vw, 32px); background: var(--panel);
}
.brief__label { font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--mid); }
.brief__text { font-size: 18px; line-height: 1.6; }
.brief__roles { border-top: 1px solid var(--line); }
.brief__roles div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.brief__roles span:first-child { color: var(--mid); }
.brief [data-ul] { align-self: flex-start; }
.brief .push-down { margin-top: auto; }
.role-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.role-tags span { padding: 8px 12px; border: 1px solid var(--line); font-size: 13px; line-height: 1; letter-spacing: .1em; text-transform: uppercase; }
.project-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 4px; padding: 4px 4px 0 0; }
.project-images > * { aspect-ratio: 4 / 3; display: flex; align-items: flex-end; padding: 16px; font-size: 14px; font-weight: 400; background: var(--panel); position: relative; overflow: hidden; }
.project-images img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.next-project {
  position: relative; display: flex; width: 100%; min-height: clamp(220px, 26vw, 340px); overflow: hidden; background: var(--charcoal); color: var(--white);
}
.next-project img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; transition: opacity .6s, transform .9s var(--ease); }
.next-project:hover img { opacity: .6; transform: scale(1.04); }
.next-project__text { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; width: 100%; padding: clamp(20px, 3vw, 40px); }
.next-project__label { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }
.next-project__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.next-project__name { font-size: clamp(28px, 4vw, 56px); font-weight: 300; line-height: 1; text-transform: uppercase; }

/* Full-screen photo viewer */
.viewer {
  position: fixed; inset: 0; z-index: 1050; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 16px; background: rgba(0, 0, 0, .92);
}
.viewer[hidden] { display: none; }
.viewer__photo {
  position: relative; max-width: 100%; overflow: hidden; display: flex; align-items: flex-end; padding: 16px; font-size: 14px; font-weight: 500;
  transition: height .38s cubic-bezier(.22, 1, .36, 1), width .38s cubic-bezier(.22, 1, .36, 1), transform .38s cubic-bezier(.22, 1, .36, 1);
}
.viewer__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* Magnifier: the circle follows the pointer and replaces the cursor over the photo. */
.viewer__photo.is-zoomable { cursor: none; touch-action: none; }
.viewer__photo img { transition: none; }
.viewer__stage { position: relative; display: flex; align-items: flex-start; justify-content: center; gap: 0; max-width: 100%; }
/* Camera settings: a narrow column down the right side of the photo that expands in and pushes the image left. */
.viewer__exif {
  flex: none; width: 0; margin: 0; padding: 0; overflow: hidden;
  color: var(--white); font-size: 12px; line-height: 1.3; pointer-events: none;
  opacity: 0;
  transition: width .38s cubic-bezier(.22, 1, .36, 1), margin-left .38s cubic-bezier(.22, 1, .36, 1), opacity .28s ease;
}
.viewer__exif.is-open {
  width: 150px;
  margin-left: 18px;
  opacity: 1;
}
.viewer__exif-inner {
  width: 150px;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateX(16px);
  transition: transform .38s cubic-bezier(.22, 1, .36, 1);
}
.viewer__exif.is-open .viewer__exif-inner {
  transform: translateX(0);
}
.viewer__exif dt { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.viewer__exif dd { margin: 1px 0 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .viewer__exif, .viewer__exif.is-open {
    position: absolute; top: 8px; right: 8px; width: auto; max-width: 45%; margin-left: 0;
    padding: 8px 10px; background: rgba(0, 0, 0, .68); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transform: translateX(14px);
    transition: opacity .28s ease, transform .34s cubic-bezier(.22, 1, .36, 1);
  }
  .viewer__exif.is-open { transform: translateX(0); }
  .viewer__exif-inner { width: auto; padding: 0; gap: 6px; transform: none; }
}
.viewer__tools { position: absolute; top: 10px; left: 10px; z-index: 3; display: flex; gap: 8px; transition: opacity .25s; }
.viewer__tools button {
  width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .45); border-radius: 50%; cursor: pointer;
  background: rgba(0, 0, 0, .35); color: var(--white); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.viewer__tools button svg { width: 16px; height: 16px; }
.viewer__tools button:hover { background: rgba(0, 0, 0, .55); }
.viewer__tools button[aria-pressed="true"] { background: rgba(255, 255, 255, .6); color: var(--charcoal); border-color: transparent; }
.viewer__tools button[hidden] { display: none; }
.viewer__tools button:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
/* On a mouse the tools show only while the pointer is over the photo (or a tool has keyboard focus). */
@media (hover: hover) {
  .viewer__tools { opacity: 0; }
  .viewer__stage:hover .viewer__tools, .viewer__tools:has(:focus-visible) { opacity: 1; }
}
.viewer__lens {
  position: absolute; z-index: 2; border-radius: 50%; pointer-events: none;
  background-repeat: no-repeat; background-color: #000;
  border: 2px solid var(--white); box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 8px 28px rgba(0,0,0,.55);
}
.viewer__lens[hidden] { display: none; }
@media (hover: none) { .viewer__photo.is-zoomable { cursor: default; } }
.viewer__controls { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 400; }
.viewer__controls button {
  width: 48px; height: 48px; padding: 0; border: 1px solid var(--white); border-radius: 0; background: transparent; color: var(--white);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.viewer__controls .viewer__close { background: var(--white); color: var(--charcoal); }
.viewer__position { min-width: 150px; text-align: center; text-transform: uppercase; letter-spacing: .08em; font-size: 14px; }
