@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Manrope:wght@400;500;600&display=swap');

:root {
  --ink: #2d170f;
  --moss: #704634;
  --paper: #f7ecdc;
  --butter: #e8c997;
  --line: rgba(45, 23, 15, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Manrope, Arial, sans-serif;
}

html.lightbox-open { overflow: hidden; overscroll-behavior: none; }
body.lightbox-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

.site-header {
  width: min(1400px, calc(100% - 48px));
  height: 62px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: inherit;
  text-decoration: none;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.06em;
}

.paw { color: #b96544; font-size: 0.92rem; margin-right: 0.18rem; }

.header-note, footer, .photo-count, .eyebrow {
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-note { color: var(--moss); }

main { width: min(1400px, calc(100% - 48px)); margin: auto; padding-top: 12px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(170px, 19vw, 285px);
  gap: 10px;
  padding-bottom: 4.5rem;
}

.gallery-status {
  grid-column: 1 / -1;
  min-height: min(48vh, 26rem);
  display: grid;
  place-content: center;
  gap: 0.75rem;
  color: var(--moss);
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.loading-paw {
  color: #8b4c31;
  font-family: Arial, sans-serif;
  font-size: 2rem;
  animation: paw-bounce 1s ease-in-out infinite;
}

@keyframes paw-bounce {
  50% { transform: translateY(-0.45rem) rotate(-8deg); }
}

.photo-card {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #ddd;
  cursor: zoom-in;
}

.photo-card.tall { grid-row: span 2; }
.photo-card.wide { grid-column: span 2; }

.photo-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 450ms cubic-bezier(.2,.8,.2,1), filter 450ms ease;
}

.photo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(16, 31, 27, 0.6));
  opacity: 0;
  transition: opacity 250ms ease;
}

.photo-card:hover img, .photo-card:focus-visible img { transform: scale(1.045); filter: saturate(1.08); }
.photo-card:hover::after, .photo-card:focus-visible::after { opacity: 1; }

.card-label {
  position: absolute;
  z-index: 1;
  left: 16px;
  bottom: 14px;
  color: white;
  font-size: 0.76rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.photo-card:hover .card-label, .photo-card:focus-visible .card-label { opacity: 1; transform: translateY(0); }
.photo-card:focus-visible { outline: 3px solid #b96544; outline-offset: 3px; }

footer {
  width: min(1400px, calc(100% - 48px));
  margin: auto;
  padding: 1.7rem 0 2.5rem;
  display: flex;
  gap: 0.75rem;
  color: var(--moss);
  border-top: 1px solid var(--line);
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 4.5rem clamp(1rem, 6vw, 7rem);
  border: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: rgba(18, 30, 27, 0.96);
  color: #fff;
}

.lightbox::backdrop { background: rgba(18, 30, 27, 0.75); }
.lightbox figure {
  height: 100%;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 0.55rem;
}
.lightbox-image { max-width: 100%; max-height: 100%; min-height: 0; display: block; object-fit: contain; }
.lightbox figcaption {
  max-width: min(100%, 42rem);
  margin: 0;
  padding: 0 0.5rem;
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.close, .lightbox-nav {
  position: absolute;
  z-index: 2;
  border: 0;
  color: #fff;
  background: rgba(255,255,255,.13);
  cursor: pointer;
  transition: background 150ms ease;
}
.close:hover, .lightbox-nav:hover, .close:focus-visible, .lightbox-nav:focus-visible { background: rgba(255,255,255,.25); }
.close { top: 22px; right: 24px; width: 42px; height: 42px; border-radius: 50%; font-size: 2rem; line-height: 1; }
.lightbox-nav { top: 50%; width: 46px; height: 46px; border-radius: 50%; font-size: 1.35rem; transform: translateY(-50%); }
.previous { left: 22px; }.next { right: 22px; }

@media (max-width: 700px) {
  .site-header, main, footer { width: min(100% - 32px, 1400px); }
  .site-header { height: 54px; }
  .header-note { display: none; }
  main { padding-top: 8px; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 48vw; gap: 6px; padding-bottom: 3.5rem; }
  .photo-card.wide { grid-column: span 2; }
  .card-label { display: none; }
  .lightbox { padding: 4rem 0.75rem 6rem; }
  .lightbox-nav { bottom: 16px; top: auto; transform: none; }
  .previous { left: calc(50% - 54px); }.next { right: calc(50% - 54px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  .loading-paw { animation: none; }
}
