:root {
  color-scheme: dark;
  --paper: #241914;
  --surface: #35261f;
  --ink: #f5eee7;
  --muted: #c6b5a8;
  --accent: #e0a276;
  --line: #624b3d;
  --photo-surface: #3a2a22;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  position: relative;
  isolation: isolate;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
}

body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(135deg, rgb(36 25 20 / 50%), rgb(29 20 16 / 50%)),
    url("DSC_4399&.jpg");
  background-position: center, center 27%;
  background-size: cover, cover;
  background-repeat: no-repeat;
  pointer-events: none;
}

body > header,
body > main,
body > footer {
  position: relative;
  z-index: 1;
}

.hero {
  min-height: 62vh;
  padding: 6rem 1.5rem 5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font: 400 clamp(3rem, 8vw, 6.5rem)/1.05 var(--serif);
  letter-spacing: -0.055em;
}

.hero h1 span {
  color: var(--accent);
  font-style: italic;
}

.wedding-date {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro {
  max-width: 32rem;
  margin: 1.5rem auto 0;
  color: var(--muted);
  font: 1.1rem/1.7 var(--serif);
}

.discover-link {
  margin-top: 2rem;
  color: var(--ink);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.discover-link span {
  margin-left: 0.5rem;
  color: var(--accent);
  font-size: 2rem;
  line-height: 0.7;
  vertical-align: middle;
}

.gallery {
  width: min(1120px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 5rem 0 6rem;
}

.gallery-heading {
  margin-bottom: 2.25rem;
  text-align: center;
}

.gallery-heading h2 {
  margin: 0;
  font: 400 clamp(2.5rem, 5vw, 4rem)/1.1 var(--serif);
}

.gallery-heading > p:last-child {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 auto 4rem;
}

.filter-button {
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.filter-button:hover,
.filter-button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #241914;
}

.filter-button.is-active {
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--ink);
}

.filter-button:hover:not(.is-active) {
  border-color: var(--accent);
  color: #241914;
}

.filter-button:disabled {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.filter-button:focus-visible,
.photo:focus-visible,
.lightbox-close:focus-visible,
.zoom-button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.albums {
  display: grid;
  gap: 4.5rem;
}

.album[hidden] {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .album:not([hidden]) {
    animation: album-enter 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .album:nth-child(2) {
    animation-delay: 70ms;
  }

  .album:nth-child(3) {
    animation-delay: 140ms;
  }

  .album:nth-child(4) {
    animation-delay: 210ms;
  }

  .album:nth-child(5) {
    animation-delay: 280ms;
  }

  @keyframes album-enter {
    from {
      opacity: 0;
      transform: translateY(12px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .filter-button,
  .photo img {
    transition: none;
  }

  .photo:hover img {
    transform: none;
  }
}

.album-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.9rem;
  align-items: baseline;
  margin-bottom: 1.25rem;
}

.album-number {
  color: var(--accent);
  font: italic 1rem var(--serif);
}

.album-heading h3 {
  margin: 0;
  font: 400 1.9rem/1.2 var(--serif);
}

.album-heading p {
  grid-column: 2;
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.album-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.album-download-button {
  min-height: 2.75rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.album-download-button:hover:not(:disabled) {
  background: var(--accent);
  color: #241914;
}

.album-download-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.download-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.photo-card {
  position: relative;
  min-width: 0;
}

.photo {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--photo-surface);
  cursor: zoom-in;
}

.photo--reveal {
  cursor: pointer;
}

.photo-more {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  min-height: 48%;
  padding: 1.25rem 1rem 0.9rem;
  place-items: center;
  background: linear-gradient(transparent, rgb(24 15 11 / 94%));
  color: #fffefa;
  font-size: clamp(0.78rem, 2vw, 1rem);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-shadow: 0 1px 3px #180f0b;
}

.photo--reveal:hover .photo-more {
  color: var(--accent);
}

.photo-download {
  position: absolute;
  z-index: 1;
  top: 0.65rem;
  right: 0.65rem;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid rgb(255 254 250 / 65%);
  border-radius: 50%;
  background: rgb(24 15 11 / 82%);
  color: #fffefa;
  font-size: 1.4rem;
  line-height: 1;
  text-decoration: none;
}

.photo-download:hover,
.photo-download:focus-visible {
  background: var(--accent);
  color: #241914;
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms ease;
}

.photo:hover img {
  transform: scale(1.04);
}

.footer {
  padding: 2rem 1.5rem;
  border-top: 3px solid var(--accent);
  background: #180f0b;
  color: #ddc9b9;
  text-align: center;
  font: 1rem var(--serif);
}

.footer p {
  margin: 0;
}

.footer strong {
  color: #fffefa;
  font-weight: 400;
}

.lightbox {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(92vw, 1100px);
  height: min(84vh, 800px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgb(9 6 4 / 93%);
}

.lightbox-toolbar {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.zoom-button {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

.zoom-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.zoom-level {
  min-width: 3.5rem;
  color: var(--ink);
  font-size: 0.8rem;
  text-align: center;
}

.lightbox-stage {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
}

.lightbox-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform: translate(var(--pan-x, 0px), var(--pan-y, 0px)) scale(var(--zoom, 1));
  transform-origin: center;
  user-select: none;
  cursor: zoom-in;
}

.lightbox-image.is-zoomed {
  cursor: grab;
  touch-action: none;
}

.lightbox-image.is-panning {
  cursor: grabbing;
}

.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--accent);
  color: #241914;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.click-emote {
  position: fixed;
  z-index: 20;
  display: block;
  pointer-events: none;
  user-select: none;
  font-size: 1.7rem;
  line-height: 1;
  filter: drop-shadow(0 3px 8px rgb(0 0 0 / 55%));
  animation: click-emote-burst 2s cubic-bezier(0.18, 0.72, 0.25, 1) var(--burst-delay) both;
  will-change: transform, opacity;
}

@keyframes click-emote-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35);
  }

  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }

  72% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(
      calc(-50% + var(--burst-x)),
      calc(-50% + var(--burst-y))
    ) scale(0.85) rotate(var(--burst-rotation));
  }
}

@media (max-width: 700px) {
  .hero {
    min-height: 48svh;
    padding: 3rem 1rem;
  }

  .hero h1 {
    font-size: clamp(2rem, 10vw, 2.5rem);
  }

  .intro {
    max-width: 28rem;
    font-size: 1rem;
  }

  .gallery {
    width: min(calc(100% - 1.5rem), 540px);
    padding: 2rem 0 3rem;
  }

  .gallery-heading {
    margin-bottom: 1.5rem;
  }

  .gallery-heading h2 {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

  .gallery-heading > p:last-child {
    font-size: 0.82rem;
  }

  .filters {
    gap: 0.5rem;
    margin-bottom: 2rem;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .albums {
    gap: 2.5rem;
  }

  .album-heading h3 {
    font-size: 1.45rem;
  }

  .album-actions {
    align-items: flex-start;
  }

  .download-status {
    flex-basis: 100%;
  }

  .lightbox {
    width: calc(100vw - 1.5rem);
    height: calc(100svh - 2rem);
  }

  .lightbox-toolbar {
    gap: 0.3rem;
  }

  .lightbox-stage {
    padding-top: 3rem;
  }
}

@media (min-width: 701px) and (max-width: 900px) {
  .gallery {
    width: min(calc(100% - 3rem), 760px);
    padding: 4rem 0 5rem;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

@media (max-width: 360px) {
  .gallery {
    width: calc(100% - 1.25rem);
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }
}
