:root {
  color-scheme: dark;
  --ink: #f3efe8;
  --muted: #aaa59d;
  --quiet: #716d66;
  --accent: #d7ad7d;
  --line: #302f2c;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #090909;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.wall {
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 8px;
  overflow: hidden;
  padding: 8px;
  background: #090909;
}

.sidebar {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-column: 1 / span 3;
  grid-row: 1 / span 8;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  padding: 13px 10px 12px 14px;
}

.wordmark {
  width: fit-content;
  font-size: clamp(13px, 1.2vw, 17px);
  font-weight: 700;
  letter-spacing: -0.06em;
  white-space: nowrap;
}

.wordmark span {
  margin-left: 5px;
  color: var(--accent);
  font-size: 0.8em;
}

.side-copy {
  align-self: center;
  padding: 0 4px;
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--accent);
  font-size: clamp(8px, 0.7vw, 10px);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 {
  max-width: 100%;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(29px, 4vw, 60px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

h1 em {
  color: var(--accent);
  font-weight: 500;
}

.side-caption {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(10px, 0.9vw, 13px);
  line-height: 1.7;
}

.email-link {
  width: fit-content;
  color: var(--muted);
  font-size: clamp(9px, 0.82vw, 12px);
}

.email-link span {
  margin-left: 4px;
  color: var(--accent);
}

.email-link:hover {
  color: var(--ink);
}

.gallery {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-column: 4 / span 9;
  grid-row: 1 / span 8;
  grid-auto-flow: dense;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.memory {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #141414;
}

.memory[hidden] {
  display: none;
}

.memory img {
  display: block;
  width: 100%;
  height: 100%;
  background: #141414;
  object-fit: cover;
  transition: transform 450ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.memory:hover img {
  transform: scale(1.035);
}

.memory::after {
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  content: "";
  pointer-events: none;
}

.memory-button {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.memory-caption {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 11px;
  left: 12px;
  color: #fff;
  font-size: clamp(9px, 0.8vw, 12px);
  line-height: 1.4;
  pointer-events: none;
}

.memory-caption:empty {
  display: none;
}

.memory-loading,
.memory-fallback {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 18px;
  background: #141414;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.memory-loading[hidden],
.memory-fallback[hidden] {
  display: none;
}

.memory--placeholder {
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.placeholder-paw {
  color: var(--accent);
  font-size: 25px;
}

.lightbox {
  width: min(92vw, 1050px);
  max-width: none;
  max-height: 92vh;
  padding: 42px 18px 15px;
  border: 1px solid #48433a;
  border-radius: 5px;
  background: #171614;
  color: var(--ink);
}

.lightbox::backdrop {
  background: rgba(7, 7, 6, 0.88);
  backdrop-filter: blur(5px);
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  margin: auto;
  object-fit: contain;
}

.lightbox p {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 27px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .wall {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
  }

  .sidebar {
    grid-column: 1 / span 2;
    grid-row: 1 / span 6;
    padding-inline: 8px;
  }

  .gallery {
    grid-column: 3 / span 4;
    grid-row: 1 / span 6;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
  }

  h1 {
    font-size: clamp(26px, 5vw, 42px);
  }
}

@media (max-width: 560px) {
  .wall {
    gap: 5px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
    padding: 5px;
  }

  .sidebar {
    grid-column: 1 / span 2;
    grid-row: 1 / span 6;
    gap: 10px;
    padding: 9px 5px 8px 7px;
  }

  .wordmark {
    font-size: 12px;
  }

  .side-copy {
    padding: 0 2px;
  }

  .eyebrow {
    margin-bottom: 8px;
    font-size: 7px;
    letter-spacing: 0.1em;
  }

  h1 {
    font-size: clamp(22px, 7vw, 34px);
  }

  .side-caption {
    margin-top: 10px;
    font-size: 9px;
  }

  .email-link {
    font-size: 8px;
  }

  .gallery {
    grid-column: 3 / span 2;
    grid-row: 1 / span 6;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
    gap: 5px;
  }

  .memory {
    border-radius: 8px;
  }

  .memory-caption {
    right: 7px;
    bottom: 7px;
    left: 7px;
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
