:root {
  color-scheme: dark;
  --background: #101713;
  --surface: #17231c;
  --text: #f5f1e8;
  --muted: #b7c2b9;
  --accent: #d5a957;
  --gutter: clamp(0.65rem, 1.4vw, 1.25rem);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  scrollbar-gutter: stable;
}

body {
  min-width: 18rem;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, rgba(83, 113, 88, 0.35), transparent 36rem),
    var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hero {
  padding: clamp(3.5rem, 9vw, 8rem) var(--gutter) clamp(2.5rem, 6vw, 5rem);
}

.hero__inner {
  width: min(100%, 96rem);
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 8vw, 7.8rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.88;
}

h1 span {
  color: var(--accent);
  white-space: nowrap;
}

.photo-count {
  margin: 1.5rem 0 0;
  color: var(--muted);
}

main {
  width: min(100%, 120rem);
  min-height: 40vh;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
}

.photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0.35rem;
  background: var(--surface);
  cursor: zoom-in;
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 280ms ease, filter 280ms ease;
}

.photo:hover img,
.photo:focus-visible img {
  filter: brightness(1.08);
  transform: scale(1.015);
}

.photo:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.gallery-error {
  padding: 4rem 1rem;
  color: var(--muted);
  text-align: center;
}

footer {
  padding: 4rem var(--gutter);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  background: rgba(6, 9, 7, 0.97);
}

.lightbox[open] {
  display: grid;
  grid-template-columns: clamp(2.75rem, 8vw, 6rem) 1fr clamp(2.75rem, 8vw, 6rem);
  grid-template-rows: auto 1fr;
}

.lightbox::backdrop {
  background: rgba(6, 9, 7, 0.97);
}

.lightbox__toolbar {
  z-index: 2;
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  min-height: 3.75rem;
  padding: 0.55rem 0.8rem 0.55rem 1rem;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.lightbox__download {
  margin-left: auto;
  color: var(--text);
  text-decoration: none;
}

.lightbox__download:hover {
  color: var(--accent);
}

.icon-button,
.lightbox__nav {
  border: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.icon-button {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 2rem;
  line-height: 1;
}

.lightbox__nav {
  grid-row: 2;
  font-family: Georgia, serif;
  font-size: clamp(3rem, 7vw, 6rem);
}

.lightbox__nav:hover,
.lightbox__nav:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  color: var(--accent);
}

.lightbox__nav--previous {
  grid-column: 1;
}

.lightbox__nav--next {
  grid-column: 3;
}

.lightbox figure {
  display: flex;
  grid-column: 2;
  grid-row: 2;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0 0 1rem;
}

.lightbox figure img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 5rem);
  object-fit: contain;
}

.lightbox figcaption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

body:has(.lightbox[open]) {
  overflow: hidden;
}

@media (min-width: 48rem) {
  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 75rem) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo img {
    transition: none;
  }
}
