* {
  box-sizing: border-box;
}

:root {
  --text: #222;
  --muted: #6c6c6c;
  --line: #dedede;
  --soft: #f4f5f6;
  --button: #71c83d;
  --button-muted: #8aa0a5;
}

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: grid;
  grid-template-columns: auto auto minmax(260px, 520px) 1fr;
  gap: 22px;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid #eee;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #111;
  text-decoration: none;
  font-size: 28px;
  font-weight: 700;
}

.main-site-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #d6d6d6;
  border-radius: 4px;
  color: #333;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.main-site-link:hover {
  border-color: #a9a9a9;
}

.search {
  position: relative;
  display: block;
}

.search input {
  width: 100%;
  height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 24px;
  background: #f4f5f7;
}

.nav {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
}

.nav button,
.nav a,
.action-row button,
.controls button {
  border: 0;
  background: transparent;
  color: #3f3f3f;
  cursor: pointer;
  text-decoration: none;
}

main {
  padding: 34px 28px 64px;
}

.collection-head h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  line-height: 1.05;
}

.collection-head p {
  margin: 40px 0 0;
  color: #555;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin: 40px 0 30px;
}

.show-control,
.view-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #777;
}

.show-control button.active,
.show-control button:hover {
  color: #111;
  font-weight: 700;
}

.icon {
  min-width: 44px;
  height: 34px;
  color: #777;
  font-size: 14px;
}

.icon.active {
  color: #111;
}

select {
  min-width: 150px;
  padding: 8px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: #444;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px;
}

.grid.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 26px;
}

.card {
  min-width: 0;
}

.thumb-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.thumb-button img {
  width: 100%;
  aspect-ratio: 1 / 1.25;
  object-fit: cover;
  object-position: center;
  background: #f0f0f0;
}

.card h2 {
  margin: 14px 0 6px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
}

.card a {
  color: #666;
  text-decoration: none;
}

.card a:hover {
  color: #111;
  text-decoration: underline;
}

.empty {
  padding: 40px 0;
  color: var(--muted);
}

.creator-deck {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.creator-card {
  position: relative;
  display: block;
  min-height: 150px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background: #222;
}

.creator-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.58;
}

.creator-card div {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
}

.creator-card strong,
.creator-card span {
  display: block;
}

.creator-card strong {
  font-size: 20px;
  line-height: 1.2;
}

.creator-card span {
  margin-top: 6px;
}

.creator-meta {
  max-width: 760px;
  margin-top: 14px;
  color: #555;
  font-size: 20px;
  line-height: 1.4;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 58px 8vw;
  overflow: auto;
  background: rgba(24, 25, 32, 0.86);
}

.close {
  position: fixed;
  right: 28px;
  top: 24px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #333;
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
}

.modal-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 54px;
  min-height: 75vh;
  padding: 48px;
  background: #fff;
}

.modal-image-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
}

.modal-image-wrap img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.modal-info {
  align-self: start;
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.02);
}

.modal-info h2 {
  margin: 0 0 12px;
  font-size: 21px;
  line-height: 1.25;
}

.modal-info p {
  margin: 8px 0;
  color: #555;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0 14px;
}

.action-row button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #e1e3e6;
  border-radius: 4px;
  background: #fff;
}

.download-box,
.license-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
  padding: 16px;
  border-radius: 4px;
  background: var(--soft);
}

.download-box strong,
.download-box span {
  display: block;
}

.download-box span {
  margin-top: 6px;
  color: #777;
  font-size: 14px;
}

.download-box button {
  min-width: 118px;
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  background: var(--button);
  color: #fff;
  cursor: pointer;
}

.download-box.muted button {
  background: var(--button-muted);
}

.license-box {
  display: block;
  color: #666;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .grid,
  .grid.compact,
  .creator-deck {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .modal-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .collection-head h1 {
    font-size: 38px;
  }

  .controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid,
  .grid.compact,
  .creator-deck {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .modal {
    padding: 56px 0 0;
  }

  .modal-panel {
    padding: 24px;
  }
}
