:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #0b0c0e;
  color: #f2f3f5;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: #0b0c0e;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: min(100% - 48px, 1440px);
  margin: 0 auto;
  padding: 24px 0 18px;
  border-bottom: 1px solid #292b30;
}

.brand {
  color: #f5f5f6;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.byline {
  color: #777c86;
  font-size: 12px;
}

main {
  width: min(100% - 48px, 1440px);
  margin: 0 auto;
  padding: 44px 0 80px;
}

h1,
p {
  margin: 0;
}

.collection-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #a99cf5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.collection-heading h1 {
  margin: 0 0 5px;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 620;
  letter-spacing: -0.045em;
}

.collection-heading p,
.published,
.file-details p,
.loading,
.empty,
.not-found p {
  color: #878c96;
  font-size: 12px;
}

.controls {
  display: flex;
  gap: 6px;
}

.quiet-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: #a9aeb7;
  padding: 6px 4px;
  font: inherit;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.quiet-action:hover {
  color: #f2f3f5;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-items: start;
  gap: 36px 18px;
}

.photo-card {
  min-width: 0;
}

.photo-link {
  display: block;
  color: #e5e7ea;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
  text-decoration: none;
}

.photo-link img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 10px;
  background: #15171b;
}

.photo-link span {
  display: block;
}

.photo-link:hover span {
  color: #b9aff8;
}

.photo-link:hover img {
  opacity: 0.88;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: #9398a2;
  font-size: 12px;
  text-decoration: none;
}

.back-link:hover {
  color: #f2f3f5;
}

.photo-detail {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.72fr);
  align-items: start;
  gap: clamp(36px, 5vw, 76px);
}

.detail-image {
  min-width: 0;
  text-align: center;
}

.detail-image img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: calc(100vh - 160px);
  margin: 0 auto;
  background: #15171b;
}

.detail-copy {
  position: sticky;
  top: 28px;
  padding-top: 2px;
}

.detail-copy h1 {
  margin: 8px 0 16px;
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 620;
  letter-spacing: -0.045em;
  line-height: 1.03;
}

.description {
  color: #b2b6be;
  font-size: 14px;
  line-height: 1.65;
}

.terms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
}

.terms a {
  border: 1px solid #353840;
  color: #9da2ac;
  padding: 4px 7px;
  font-size: 10px;
  line-height: 1.2;
  text-decoration: none;
}

.terms a.category {
  border-color: #504978;
  color: #bab0f5;
}

.terms a:hover {
  border-color: #777d89;
  color: #f2f3f5;
}

.file-details {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid #292b30;
}

.file-details a,
.not-found a {
  display: inline-block;
  margin-top: 7px;
  color: #b9aff8;
  font-size: 12px;
  text-decoration: none;
}

.file-details a:hover,
.not-found a:hover {
  text-decoration: underline;
}

.empty {
  grid-column: 1 / -1;
  padding-top: 18px;
  border-top: 1px solid #292b30;
}

.not-found {
  padding: 72px 0;
}

.not-found .quiet-action {
  margin-top: 12px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #a99cf5;
  outline-offset: 3px;
}

@media (max-width: 820px) {
  .photo-detail {
    grid-template-columns: 1fr;
  }

  .detail-copy {
    position: static;
    max-width: 640px;
  }

  .detail-image img {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .site-header,
  main {
    width: min(100% - 28px, 1440px);
  }

  .site-header {
    padding-top: 18px;
  }

  main {
    padding-top: 30px;
  }

  .collection-heading {
    align-items: start;
  }

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

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

@media (prefers-reduced-motion: no-preference) {
  .photo-link img {
    transition: opacity 140ms ease;
  }
}
