body { background: #f4f1ea; color: #121216; font-family: 'Space Grotesk', system-ui, sans-serif; }

main { max-width: 1280px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 48px); }

.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 32px; }
h1 { margin: 0; font: 700 clamp(48px, 9vw, 120px)/0.9 'Space Grotesk', system-ui, sans-serif; letter-spacing: -0.05em; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  padding: 8px 16px; border: 1px solid #121216; border-radius: 999px;
  background: none; color: inherit; font: 500 15px 'Space Grotesk', system-ui, sans-serif; cursor: pointer;
}
.filters button[aria-pressed="true"] { background: #121216; color: #f4f1ea; }

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(12px, 2vw, 24px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}
.item.is-hidden { display: none; }
.item p { display: flex; justify-content: space-between; margin: 10px 0 0; font-weight: 500; }
.item p span { font: 500 12px ui-monospace, monospace; color: #8b8a94; text-transform: uppercase; letter-spacing: 0.08em; }

/* The button holds the space; the image inside can leave (into the viewer) without the grid collapsing. */
.thumb {
  display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 0;
  background: #e3ded3; border-radius: 6px; cursor: zoom-in;
}
/* Rounded corners live on the image itself (not a clipping parent), so nothing clips it mid-flight. */
/* position: relative lets Flip's zIndex lift the image above the viewer while it flies back. */
.thumb img, .viewer__media img { position: relative; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

.viewer {
  position: fixed; inset: 0; z-index: 50;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center;
  gap: clamp(16px, 4vw, 64px);
  padding: clamp(16px, 4vw, 56px);
}
.viewer[hidden] { display: none; }
.viewer__bg { position: absolute; inset: 0; background: #121216; }
.viewer__media { position: relative; margin: 0; height: 84vh; max-width: 100%; aspect-ratio: 4 / 5; justify-self: end; }
.viewer__info { position: relative; color: #f4f1ea; max-width: 420px; }
.viewer__cat { margin: 0 0 8px; font: 500 12px ui-monospace, monospace; text-transform: uppercase; letter-spacing: 0.08em; color: #8b8a94; }
.viewer h2 { margin: 0 0 16px; font: 700 clamp(36px, 5vw, 72px)/0.95 'Space Grotesk', system-ui, sans-serif; letter-spacing: -0.04em; }
.viewer__desc { margin: 0 0 32px; font-size: 18px; color: #c9c6bd; }
.viewer__close {
  padding: 10px 20px; border: 1px solid #f4f1ea; border-radius: 999px;
  background: none; color: inherit; font: 500 15px 'Space Grotesk', system-ui, sans-serif; cursor: pointer;
}

@media (max-width: 700px) {
  .viewer { grid-template-columns: 1fr; align-content: center; }
  .viewer__media { height: 55vh; justify-self: center; }
}
