.home-invitations {
  --gallery-height: clamp(13.5rem, 33vw, 30rem);
  border-top: 1px solid var(--line);
  padding-block: clamp(3.5rem, 7vw, 7rem);
}

.home-gallery-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(1.4rem, 3.2vw, 2.8rem);
}

.home-gallery-heading h2 {
  font-size: clamp(3.4rem, 5.5vw, 6.25rem);
  line-height: .94;
  letter-spacing: -.035em;
}

.home-gallery-stage {
  position: relative;
  display: grid;
  align-items: center;
  height: var(--gallery-height);
  overflow: hidden;
  container-type: inline-size;
}

.home-gallery-fallback {
  justify-items: center;
}

.home-gallery-fallback img {
  width: min(88%, calc(var(--gallery-height) * 1.41));
  height: auto;
  border-radius: 1rem;
}

.home-gallery-static-links {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  margin-top: 1.2rem;
}

.home-gallery-native {
  --gallery-card: min(88cqw, calc(var(--gallery-height) * 1.41));
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  gap: 1rem;
  padding-inline: calc((100% - var(--gallery-card)) / 2);
  overflow: auto hidden;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  cursor: grab;
}

.home-gallery-native[data-dragging] {
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
}

.home-gallery-card {
  flex: none;
  width: var(--gallery-card);
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 1rem;
  aspect-ratio: 3 / 2;
  background: var(--satin);
  scroll-snap-align: center;
  transform: scale(.92);
  opacity: .78;
  transition: opacity .4s ease, transform .5s cubic-bezier(.22, 1, .36, 1);
  cursor: inherit;
}

.home-gallery-card[data-active="true"] {
  transform: none;
  opacity: 1;
}

.home-gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.home-gallery-engine {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .4s ease;
}

.home-gallery-engine[data-ready="true"] { opacity: 1; }

.home-gallery-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  outline-offset: -2px;
}

.home-gallery-canvas[data-dragging] { cursor: grabbing; }
.home-gallery-canvas:focus-visible, .home-gallery-native:focus-visible { outline: 2px solid var(--brass); }
.home-gallery-canvas .flex-carousel__live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.home-gallery-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .9rem 1.5rem;
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.home-gallery-name { animation: home-gallery-caption-in .4s ease both; }
.home-gallery-name h3, .home-gallery-dialog h3 {
  font-size: clamp(2.2rem, 3.15vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}
.home-gallery-name p {
  margin-top: .35rem;
  color: var(--muted);
  font-size: .88rem;
}

@keyframes home-gallery-caption-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.home-gallery-nav, .home-gallery-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem;
}

.home-gallery-nav span {
  min-width: 3.25rem;
  color: var(--muted);
  font-size: .79rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.home-gallery-nav button, .home-gallery-close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--ivory);
  font-size: 1.15rem;
}

.home-gallery-actions {
  grid-column: 3;
  justify-content: flex-end;
}

.home-gallery-open, .home-gallery-quick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .55rem .95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: .83rem;
  font-weight: 600;
  white-space: nowrap;
}

.home-gallery-open {
  width: fit-content;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--ivory);
}

.home-gallery-open:hover { text-decoration: none; background: var(--brass); border-color: var(--brass); }
.home-gallery-quick:hover, .home-gallery-nav button:hover, .home-gallery-close:hover { border-color: var(--brass); }
.home-gallery-open, .home-gallery-quick, .home-gallery-nav button, .home-gallery-close {
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.home-gallery-open:active, .home-gallery-quick:active, .home-gallery-nav button:active, .home-gallery-close:active {
  transform: translateY(1px);
  opacity: .8;
}

.home-gallery-dialog {
  max-width: min(62rem, calc(100% - 2rem));
  max-height: calc(100svh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1.3rem;
  background: var(--ivory);
  color: var(--ink);
}

body:has(.home-gallery-dialog[open]) { overflow: hidden; }
.home-gallery-dialog::backdrop { background: #28231ea6; backdrop-filter: blur(7px); }
.home-gallery-dialog-body { position: relative; display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; }
.home-gallery-close { position: absolute; z-index: 1; top: .8rem; right: .8rem; }
.home-gallery-detail { width: 100%; height: auto; display: block; aspect-ratio: 3 / 2; object-fit: cover; background: var(--satin); }
.home-gallery-dialog-copy { padding: clamp(1.45rem, 3vw, 2.8rem); }
.home-gallery-dialog-copy p { color: var(--muted); margin: .8rem 0 1.3rem; }

@media (max-width: 58rem) {
  .home-gallery-caption { grid-template-columns: minmax(0, 1fr) auto; }
  .home-gallery-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 42rem) {
  .home-gallery-heading h2 { font-size: clamp(2.9rem, 10.2vw, 4rem); }
  .home-gallery-heading { align-items: start; gap: .85rem; }
  .home-gallery-caption { gap: 1rem .6rem; }
  .home-gallery-name h3 { font-size: clamp(1.8rem, 6.7vw, 2.5rem); }
  .home-gallery-nav { gap: .15rem; flex-wrap: nowrap; }
  .home-gallery-nav span { min-width: 2.6rem; }
  .home-gallery-dialog-body { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 23rem) {
  .home-gallery-nav button { width: 2.3rem; height: 2.3rem; }
  .home-gallery-nav span { min-width: 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .home-gallery-name { animation: none; }
  .home-invitations *, .home-gallery-dialog::backdrop { transition: none !important; }
  .home-invitations :active { transform: none; }
}
