:root {
  --bg: #141414;
  --surface: #242424;
  --text: #f2f0ec;
  --muted: #a6a29b;
  --line: #33312e;
  --focus: #f0b429;
  --radius: 0.5rem;
  --gap: clamp(0.5rem, 1.2vw, 0.875rem);
  --page: min(1180px, calc(100% - 2rem));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--focus);
  color: #141414;
}

.masthead {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(1.25rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--line);
}

.masthead__eyebrow {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.masthead__meta {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
}

.gallery {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(11rem, 100%), 1fr));
  gap: var(--gap);
}

.shot {
  margin: 0;
  min-width: 0;
}

.shot__open {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06);
}

.shot__open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

.shot__lightbox {
  display: none;
}

.shot:target .shot__lightbox {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgb(8 8 8 / 0.95);
  animation: fade-in 0.18s ease-out;
}

.shot:target .shot__lightbox::before {
  content: "";
  position: fixed;
  inset: clamp(1rem, 5vmin, 3.5rem);
  background: var(--full) center / contain no-repeat;
  pointer-events: none;
}

.shot__backdrop {
  position: fixed;
  inset: 0;
  cursor: zoom-out;
}

.shot:target .shot__backdrop::after {
  content: "\00d7";
  position: fixed;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
  color: #fff;
  font-size: 1.85rem;
  line-height: 1;
  pointer-events: none;
}

.shot__backdrop:focus-visible {
  outline: none;
}

.shot:target .shot__backdrop:focus-visible::after {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.shot__nav {
  position: fixed;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: clamp(2.5rem, 6vw, 3.25rem);
  height: clamp(2.5rem, 6vw, 3.25rem);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.14);
  color: #fff;
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  line-height: 1;
  text-decoration: none;
  transform: translateY(-50%);
  transition: background-color 0.2s ease;
}

.shot__nav--prev {
  left: clamp(0.5rem, 2vw, 1.5rem);
}

.shot__nav--next {
  right: clamp(0.5rem, 2vw, 1.5rem);
}

.shot__nav--prev::before {
  content: "\2190";
}

.shot__nav--next::before {
  content: "\2192";
}

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

body:has(.shot:target) {
  overflow: hidden;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (hover: hover) {
  .shot__open:hover img {
    transform: scale(1.05);
  }

  .shot__nav:hover {
    background: rgb(255 255 255 / 0.24);
  }
}

.footer {
  width: var(--page);
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.footer p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .shot__open img {
    transition: none;
  }

  .shot__nav {
    transition: none;
  }

  .shot:target .shot__lightbox {
    animation: none;
  }
}
