:root {
  --wine: #681a3a;
  --wine-dark: #3c0d23;
  --rose: #c85b7b;
  --blush: #f5d8df;
  --cream: #fffaf5;
  --paper: #fffdf9;
  --ink: #351f28;
  --muted: #745d66;
  --gold: #c79a52;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
}

body.lightbox-open { overflow: hidden; }

h1, h2, p { margin-top: 0; }

h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
}

h2 {
  margin-bottom: 1.4rem;
  font-size: clamp(2.35rem, 5vw, 4.2rem);
}

.section { padding: clamp(5rem, 10vw, 9rem) max(1.25rem, 5vw); }

.eyebrow {
  margin-bottom: 1rem;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  padding: 5rem max(1.5rem, 8vw);
  overflow: hidden;
  place-items: center;
  background: radial-gradient(circle at 70% 20%, #9e3155 0, var(--wine) 37%, var(--wine-dark) 100%);
  color: white;
  isolation: isolate;
}

.hero::after {
  position: absolute;
  inset: 1.2rem;
  border: 1px solid rgb(255 255 255 / 18%);
  content: "";
  pointer-events: none;
}

.hero__content { z-index: 2; max-width: 850px; text-align: center; }

.hero h1 {
  margin-bottom: 1.5rem;
  font-size: clamp(3.8rem, 9vw, 8.5rem);
  letter-spacing: -.045em;
}

.hero h1 em { color: #f3ced8; font-weight: 600; }

.hero__copy {
  max-width: 620px;
  margin: 0 auto 2.2rem;
  color: rgb(255 255 255 / 82%);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.button {
  display: inline-flex;
  gap: .8rem;
  align-items: center;
  padding: .9rem 1.35rem;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 999px;
  color: white;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, color .2s, transform .2s;
}

.button:hover { background: white; color: var(--wine); transform: translateY(-2px); }

.hero__number {
  position: absolute;
  right: -2vw;
  bottom: -15vw;
  margin: 0;
  color: rgb(255 255 255 / 4%);
  font-family: var(--serif);
  font-size: min(55vw, 42rem);
  line-height: 1;
  user-select: none;
}

.hero__portraits {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: .22;
}

.hero__portraits img {
  position: absolute;
  width: clamp(11rem, 22vw, 22rem);
  aspect-ratio: 3 / 4;
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: 45% 45% 8px 8px;
  box-shadow: 0 30px 70px rgb(20 3 11 / 45%);
  object-fit: cover;
  animation: portrait-float 7s ease-in-out infinite;
}

.hero__portraits img:nth-child(1) { top: 10%; left: 4%; transform: rotate(-8deg); }
.hero__portraits img:nth-child(2) { right: 3%; bottom: 5%; transform: rotate(7deg); animation-delay: -2.5s; }
.hero__portraits img:nth-child(3) { right: 18%; top: -12%; transform: rotate(-3deg); animation-delay: -4.5s; }

@keyframes portrait-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -18px; }
}

.memory-ribbon {
  width: 100%;
  padding: 1rem 0;
  overflow: hidden;
  background: var(--wine-dark);
}

.memory-ribbon__track {
  display: flex;
  width: max-content;
  gap: 1rem;
  animation: ribbon-scroll 55s linear infinite;
}

.memory-ribbon:hover .memory-ribbon__track { animation-play-state: paused; }

.memory-ribbon__photo {
  width: clamp(130px, 15vw, 210px);
  height: clamp(170px, 19vw, 270px);
  flex: none;
  overflow: hidden;
  border-radius: 2px;
  transform: rotate(var(--tilt));
}

.memory-ribbon__photo img { width: 100%; height: 100%; object-fit: cover; }

@keyframes ribbon-scroll {
  to { transform: translateX(calc(-50% - .5rem)); }
}

.hero__glow { position: absolute; border-radius: 50%; filter: blur(5px); }
.hero__glow--one { top: -8rem; left: -8rem; width: 24rem; height: 24rem; background: rgb(241 163 187 / 10%); }
.hero__glow--two { right: 15%; bottom: -12rem; width: 28rem; height: 28rem; border: 1px solid rgb(255 255 255 / 8%); }

.letter { max-width: 1000px; margin: auto; text-align: center; }

.letter__card {
  position: relative;
  padding: clamp(2.2rem, 6vw, 5rem);
  border: 1px solid #ead9d7;
  background: var(--paper);
  box-shadow: 0 28px 80px rgb(73 26 43 / 8%);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
}

.letter__card::before,
.letter__card::after { position: absolute; width: 3rem; height: 3rem; border-color: var(--gold); content: ""; }
.letter__card::before { top: .9rem; left: .9rem; border-top: 1px solid; border-left: 1px solid; }
.letter__card::after { right: .9rem; bottom: .9rem; border-right: 1px solid; border-bottom: 1px solid; }
.quote-mark { display: block; height: 3.5rem; color: var(--blush); font-family: var(--serif); font-size: 6rem; line-height: 1; }
.signature { margin: 2rem 0 0; color: var(--wine); font-style: italic; }

.memories { background: #f6e8e8; }
.section-heading { max-width: 700px; margin: 0 auto 4rem; text-align: center; }
.section-heading > p:last-child { color: var(--muted); }

.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(.8rem, 2vw, 1.4rem);
  max-width: 1320px;
  margin: auto;
}

.gallery__item {
  position: relative;
  grid-column: span 4;
  min-height: 350px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  background: #e2c8ca;
  box-shadow: 0 14px 35px rgb(80 29 46 / 10%);
  cursor: pointer;
  transition: box-shadow .3s ease, translate .3s ease;
}

.gallery__item:nth-child(5n + 1),
.gallery__item:nth-child(5n + 4) { grid-column: span 8; }

.gallery__item img { width: 100%; height: 100%; min-height: inherit; object-fit: cover; transition: transform .6s ease; }
.gallery__item:hover img { transform: scale(1.035); }
.gallery__item:hover { z-index: 2; box-shadow: 0 24px 50px rgb(80 29 46 / 22%); translate: 0 -7px; }
.gallery__item::after { position: absolute; inset: 0; background: linear-gradient(transparent 65%, rgb(45 11 27 / 42%)); content: ""; pointer-events: none; }
.gallery__number { position: absolute; z-index: 1; right: 1rem; bottom: .75rem; color: white; font-family: var(--serif); font-size: 1rem; }

.gallery__item.is-missing { cursor: default; }
.gallery__item.is-missing::before {
  position: absolute;
  inset: 1rem;
  display: grid;
  border: 1px dashed rgb(104 26 58 / 28%);
  color: var(--wine);
  content: "Add photo";
  font-family: var(--serif);
  font-size: 1.35rem;
  place-items: center;
}
.gallery__item.is-missing::after { display: none; }
.gallery__item.is-missing .gallery__number { color: var(--wine); }

.tribute {
  max-width: 1050px;
  margin: auto;
  text-align: center;
}

.tribute__ornament { margin-bottom: 1rem; color: var(--gold); font-size: 2rem; }
.tribute__intro { max-width: 680px; margin: 0 auto 2.5rem; color: var(--muted); font-family: var(--serif); font-size: clamp(1.1rem, 2vw, 1.3rem); }

.mum-card {
  position: relative;
  width: min(100%, 620px);
  padding: 0;
  overflow: hidden;
  border: 8px solid white;
  border-radius: 4px;
  background: var(--wine-dark);
  box-shadow: 0 25px 65px rgb(70 22 39 / 22%);
  cursor: pointer;
  transform: rotate(-1deg);
  transition: box-shadow .35s ease, transform .35s ease;
}

.mum-card:hover,
.mum-card:focus-visible { box-shadow: 0 35px 85px rgb(70 22 39 / 32%); transform: rotate(0) translateY(-8px); }
.mum-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .7s ease; }
.mum-card:hover img { transform: scale(1.035); }

.mum-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 2rem 1rem;
  color: white;
  background: linear-gradient(transparent 40%, rgb(42 7 23 / 88%));
  text-shadow: 0 2px 12px rgb(0 0 0 / 35%);
}

.mum-card__overlay strong { font-family: var(--serif); font-size: clamp(1.65rem, 4vw, 2.5rem); }
.mum-card__overlay > span:last-child { color: rgb(255 255 255 / 78%); font-size: .9rem; }
.mum-card__heart { margin-bottom: .3rem; color: #f4b7c8; font-size: 1.6rem; animation: heart-beat 1.8s ease-in-out infinite; }

@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.18); }
  30% { transform: scale(1); }
}

.mum-modal {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  padding: clamp(1rem, 4vw, 3rem);
  overflow-y: auto;
  place-items: center;
}

.mum-modal[hidden] { display: none; }
.mum-modal__backdrop { position: fixed; inset: 0; background: rgb(29 7 17 / 88%); backdrop-filter: blur(8px); }

.mum-letter {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr);
  width: min(100%, 980px);
  max-height: calc(100svh - 2rem);
  overflow: auto;
  background: var(--paper);
  box-shadow: 0 35px 100px rgb(0 0 0 / 45%);
  animation: letter-open .6s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes letter-open {
  from { opacity: 0; transform: translateY(30px) scale(.95); }
}

.mum-letter__photo { min-height: 560px; }
.mum-letter__photo img { width: 100%; height: 100%; object-fit: cover; }
.mum-letter__words { position: relative; align-self: center; padding: clamp(2.5rem, 6vw, 5rem); text-align: left; }
.mum-letter__words::before { display: block; height: 3rem; color: var(--blush); content: "“"; font: 6rem/1 var(--serif); }
.mum-letter__words h2 { color: var(--wine); font-size: clamp(2.2rem, 5vw, 3.6rem); }
.mum-letter__words > p:not(.eyebrow, .mum-letter__note) { font-family: var(--serif); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.mum-letter__signoff { margin-top: 2rem; color: var(--wine); font-style: italic; }
.mum-letter__note { margin: 2rem 0 0; padding-top: 1rem; border-top: 1px solid #ead9d7; color: var(--muted); font-size: .72rem; letter-spacing: .04em; }
.mum-letter__close { position: absolute; z-index: 2; top: .8rem; right: 1rem; width: 2.8rem; height: 2.8rem; border: 0; border-radius: 50%; color: var(--wine); background: rgb(255 255 255 / 90%); cursor: pointer; font-size: 2rem; line-height: 1; }

.closing {
  min-height: 70vh;
  display: grid;
  color: white;
  background: linear-gradient(145deg, var(--wine-dark), #7b2042);
  place-items: center;
  text-align: center;
}
.closing__content { max-width: 760px; }
.closing h2 { margin-bottom: 1rem; font-size: clamp(4rem, 10vw, 8rem); font-style: italic; }
.closing__content > p:not(.eyebrow) { color: rgb(255 255 255 / 75%); font-size: 1.1rem; }
.closing__toast { margin-top: 2rem; font-family: var(--serif); font-style: italic; }

.wish-button {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 999px;
  color: white;
  background: rgb(255 255 255 / 8%);
  font: 600 .9rem var(--sans);
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}

.wish-button:hover { color: var(--wine); background: white; transform: scale(1.04); }

.wish-message {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 2rem;
  width: min(90vw, 560px);
  padding: 1rem 1.4rem;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 999px;
  color: white;
  background: rgb(60 13 35 / 92%);
  box-shadow: 0 15px 45px rgb(30 4 17 / 35%);
  text-align: center;
  transform: translateX(-50%);
  animation: wish-in .5s ease both;
}

.wish-message[hidden] { display: none; }

@keyframes wish-in {
  from { opacity: 0; transform: translate(-50%, 20px) scale(.96); }
}

.confetti { position: fixed; z-index: 25; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.lightbox {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  padding: 2rem 5rem 3.5rem;
  background: rgb(30 7 18 / 95%);
  place-items: center;
}
.lightbox[hidden] { display: none; }
.lightbox__image { max-width: min(1100px, 90vw); max-height: 82vh; box-shadow: 0 20px 70px #12030a; object-fit: contain; }
.lightbox__caption { position: absolute; bottom: .8rem; color: rgb(255 255 255 / 70%); }
.lightbox button { position: absolute; border: 0; color: white; background: transparent; cursor: pointer; font-family: var(--sans); }
.lightbox__close { top: 1rem; right: 1.5rem; font-size: 2.5rem; }
.lightbox__nav { top: 50%; padding: 1rem; font-size: 3.5rem; transform: translateY(-50%); }
.lightbox__nav--previous { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .hero { padding-inline: 1.5rem; }
  .hero::after { inset: .7rem; }
  .gallery__item, .gallery__item:nth-child(n) { grid-column: span 6; min-height: 260px; }
  .lightbox { padding-inline: 3.5rem; }
  .lightbox__nav--previous { left: .25rem; }
  .lightbox__nav--next { right: .25rem; }
  .hero__portraits img:nth-child(1) { left: -12%; }
  .hero__portraits img:nth-child(2) { right: -12%; }
  .hero__portraits img:nth-child(3) { display: none; }
  .mum-letter { grid-template-columns: 1fr; }
  .mum-letter__photo { min-height: 300px; max-height: 42vh; }
  .mum-letter__words { padding: 2rem 1.5rem 2.5rem; }
}

@media (max-width: 480px) {
  .gallery__item, .gallery__item:nth-child(n) { grid-column: 1 / -1; min-height: 390px; }
  .letter__card { padding-inline: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .memory-ribbon__track, .hero__portraits img { animation: none; }
  .mum-card__heart { animation: none; }
}
