:root {
  color-scheme: dark;
  --bg: #11100f;
  --surface: #191715;
  --line: rgba(255, 244, 230, 0.13);
  --text: #f8f3ec;
  --muted: #a79e94;
  --accent: #dab78d;
}

* {
  box-sizing: border-box;
}

body {
  width: min(calc(100% - 36px), 1180px);
  margin: 0 auto;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

header,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-color: var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

header {
  height: 82px;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

main {
  padding: 84px 0 72px;
}

.intro {
  margin-bottom: 38px;
}

.gallery-count {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 7vw, 6.6rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

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

.picture-card {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: zoom-in;
}

.picture-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
}

.picture-card:hover img,
.picture-card:focus-visible img {
  transform: scale(1.035);
  filter: brightness(1.08);
}

.picture-card:focus-visible,
.page-button:focus-visible,
.lightbox button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.picture-number {
  position: absolute;
  right: 9px;
  bottom: 9px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(10, 9, 8, 0.7);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.67rem;
  backdrop-filter: blur(8px);
}

.pagination {
  display: flex;
  min-height: 42px;
  margin-top: 34px;
  justify-content: center;
  gap: 8px;
}

.page-button {
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.page-button:hover,
.page-button[aria-current="page"] {
  border-color: rgba(218, 183, 141, 0.52);
  color: var(--text);
}

.page-button[aria-current="page"] {
  background: rgba(218, 183, 141, 0.13);
}

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

.lightbox::backdrop {
  background: rgba(7, 6, 6, 0.9);
  backdrop-filter: blur(10px);
}

.lightbox-shell {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  align-items: center;
}

.lightbox figure {
  display: grid;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 26px 0 20px;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  place-items: center;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 72px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.lightbox figcaption {
  color: var(--muted);
  font-size: 0.76rem;
}

.lightbox button {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 20px;
  width: 44px;
  height: 44px;
  font-size: 2rem;
  line-height: 1;
}

.lightbox-arrow {
  width: 54px;
  height: 70px;
  margin: auto;
  border-radius: 12px !important;
  font-size: 3rem;
  line-height: 1;
}

.lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.07);
}

footer {
  padding: 28px 0 38px;
  border-top: 1px solid var(--line);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover,
footer a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 640px) {
  main {
    padding-top: 58px;
  }

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

  .picture-card {
    border-radius: 10px;
  }

  .lightbox-shell {
    grid-template-columns: 46px minmax(0, 1fr) 46px;
  }

  .lightbox-arrow {
    width: 42px;
    font-size: 2.5rem;
  }
}

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