:root {
  color-scheme: light;
  --bg: #fff;
  --text: #111;
  --muted: #666;
  --border: #eaeaea;
  --soft: #f5f5f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

button,
a {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  color: var(--muted);
}

.topbar a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

main {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
}

.page-head p {
  margin: 0 0 6px;
  color: var(--muted);
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

h1 {
  font-size: 36px;
  line-height: 1.05;
}

h2 {
  font-size: 15px;
  line-height: 1.2;
}

.page-head .price {
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.gallery-shell {
  display: grid;
  gap: 34px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.photo-group {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.group-heading {
  position: sticky;
  top: 62px;
}

.group-heading span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

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

.image-button {
  display: block;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--soft);
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
}

.image-button.wide {
  grid-column: span 2;
  grid-row: span 2;
}

.image-button img {
  transition: transform 0.18s ease;
}

.image-button:hover img {
  transform: scale(1.02);
}

.image-button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.intro,
.description {
  display: grid;
  gap: 20px;
  margin-top: 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.intro p,
.description p {
  max-width: 900px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.description-copy {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.description-copy h2 {
  margin-top: 1px;
}

.highlight {
  display: inline-block;
  margin-right: 4px;
  color: var(--text);
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.stats div {
  min-height: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats div:nth-child(4n) {
  border-right: 0;
}

.stats div:nth-last-child(-n + 4) {
  border-bottom: 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: 600;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox figure {
  margin: 0;
  min-width: 0;
}

.lightbox img {
  max-height: calc(100vh - 90px);
  object-fit: contain;
}

.lightbox figcaption {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-size: 13px;
}

.lightbox__close,
.lightbox__nav {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.lightbox__close {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  font-size: 24px;
  line-height: 1;
}

.lightbox__nav {
  width: 44px;
  height: 44px;
  font-size: 32px;
  line-height: 0;
}

.lightbox__nav--prev {
  justify-self: end;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  main {
    padding: 18px;
  }

  .page-head,
  .photo-group,
  .description-copy,
  .description {
    grid-template-columns: 1fr;
  }

  .group-heading {
    position: static;
  }

  .photo-grid,
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats div:nth-child(4n) {
    border-right: 1px solid var(--border);
  }

  .stats div:nth-child(2n) {
    border-right: 0;
  }

  .stats div:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--border);
  }

  .stats div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 10px 14px;
  }

  main {
    padding: 14px;
  }

  h1 {
    font-size: 30px;
  }

  .photo-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .stats div,
  .stats div:nth-child(2n),
  .stats div:nth-child(4n) {
    border-right: 0;
  }

  .stats div:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .stats div:last-child {
    border-bottom: 0;
  }

  .image-button.wide {
    grid-column: span 1;
    grid-row: span 1;
  }

  .lightbox {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 6px;
    padding: 10px;
  }

  .lightbox__nav {
    width: 34px;
    height: 34px;
    font-size: 26px;
  }
}
