:root {
  --ink: #3d292c;
  --wine: #7b3f4b;
  --rose: #c87582;
  --blush: #f4d9d9;
  --cream: #fffaf3;
  --paper: #fffdf9;
  --lavender: #d8c8dd;
  --shadow: 0 24px 70px rgba(87, 48, 55, 0.15);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(244, 217, 217, 0.78), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(216, 200, 221, 0.62), transparent 30rem),
    var(--cream);
  font-family: var(--sans);
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

img,
video {
  display: block;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  z-index: 50;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.welcome {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 2rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.95), transparent 28rem),
    linear-gradient(145deg, #fae9e8, #f9f0ec 55%, #e8ddea);
  transition: opacity 700ms ease, visibility 700ms ease;
}

.welcome.is-open {
  opacity: 0;
  visibility: hidden;
}

.welcome__glow {
  position: absolute;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  filter: blur(42px);
  z-index: -1;
}

.envelope {
  position: relative;
  width: 8rem;
  height: 5.4rem;
  margin-bottom: 2.2rem;
  border-radius: 0.4rem;
  background: #f9cfd2;
  box-shadow: 0 16px 35px rgba(112, 61, 72, 0.18);
  transform: rotate(-3deg);
}

.envelope::before,
.envelope::after {
  content: "";
  position: absolute;
  inset: 0;
}

.envelope::before {
  clip-path: polygon(0 0, 50% 66%, 100% 0);
  background: #ffe6e2;
}

.envelope::after {
  clip-path: polygon(0 100%, 50% 45%, 100% 100%);
  background: #edb8be;
}

.envelope__heart {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  color: var(--wine);
  font-size: 1.7rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--wine);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.welcome h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.2rem, 10vw, 6.5rem);
  font-weight: 500;
  line-height: 0.95;
}

.welcome__copy {
  margin: 1.2rem 0 2rem;
  color: #765a5e;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.75rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:focus-visible,
.play-button:focus-visible,
.sound-button:focus-visible,
.nav a:focus-visible {
  outline: 3px solid rgba(123, 63, 75, 0.35);
  outline-offset: 4px;
}

.button--primary {
  color: #fff;
  background: var(--wine);
  box-shadow: 0 12px 28px rgba(123, 63, 75, 0.22);
}

.button--quiet {
  color: var(--wine);
  border-color: rgba(123, 63, 75, 0.2);
  background: rgba(255, 255, 255, 0.55);
}

main {
  opacity: 0;
  transition: opacity 600ms ease;
}

main.is-visible {
  opacity: 1;
}

.nav {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 78rem;
  margin: 0 auto;
  padding: 1.4rem clamp(1.2rem, 4vw, 3rem);
}

.nav a {
  color: var(--ink);
  text-decoration: none;
}

.nav__mark {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
}

.nav__links {
  display: flex;
  gap: 1.4rem;
  font-size: 0.83rem;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(25rem, 1.1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 7rem);
  width: min(100% - 2.4rem, 78rem);
  min-height: 100svh;
  margin: 0 auto;
  padding: 7rem 0 5rem;
}

.hero h2,
.section__heading h2,
.final-note h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.hero h2 {
  max-width: 10ch;
  font-size: clamp(3.4rem, 7vw, 6.7rem);
  line-height: 0.93;
}

.hero h2 em {
  color: var(--rose);
  font-weight: 500;
}

.hero__intro {
  max-width: 36rem;
  margin: 1.6rem 0 2rem;
  color: #6c5559;
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero__photos {
  position: relative;
  min-height: 35rem;
}

.polaroid,
.photo-card {
  margin: 0;
  padding: 0.72rem 0.72rem 1.2rem;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.polaroid {
  position: absolute;
  width: min(70%, 24rem);
}

.polaroid--one {
  top: 1rem;
  left: 0;
  transform: rotate(-5deg);
}

.polaroid--two {
  right: 0;
  bottom: 1.5rem;
  transform: rotate(5deg);
}

.rotated-photo {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #ead8d6;
}

.rotated-photo img {
  position: absolute;
  top: -38.888%;
  left: 21.875%;
  width: 56.25%;
  height: 177.777%;
  object-fit: cover;
  transform: rotate(-90deg);
}

.polaroid figcaption,
.photo-card figcaption {
  padding-top: 0.75rem;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: #74565c;
}

.doodle {
  position: absolute;
  color: var(--rose);
  font-family: var(--serif);
}

.doodle--heart {
  right: 2%;
  top: -6%;
  font-size: 5rem;
  transform: rotate(12deg);
}

.doodle--spark {
  left: 3%;
  bottom: 3%;
  font-size: 3rem;
}

.marquee {
  overflow: hidden;
  padding: 1rem 0;
  color: #fff;
  background: var(--wine);
  transform: rotate(-1deg) scale(1.02);
}

.marquee__track {
  display: flex;
  gap: 1.4rem;
  width: max-content;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
  animation: drift 20s linear infinite;
}

.marquee__track b {
  color: #f4bdc4;
}

@keyframes drift {
  to { transform: translateX(-50%); }
}

.section {
  width: min(100% - 2.4rem, 72rem);
  margin: 0 auto;
  padding: clamp(5rem, 10vw, 9rem) 0;
}

.section__heading {
  max-width: 48rem;
  margin: 0 auto 3rem;
  text-align: center;
}

.section__heading h2 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1;
}

.section__heading > p:last-child:not(.eyebrow) {
  max-width: 42rem;
  margin: 1rem auto 0;
  color: #755e62;
  line-height: 1.65;
}

.letter-section {
  position: relative;
}

.letter {
  position: relative;
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(2.2rem, 7vw, 5rem);
  background:
    repeating-linear-gradient(transparent 0 2.02rem, rgba(123, 63, 75, 0.08) 2.08rem),
    var(--paper);
  box-shadow: var(--shadow);
  transform: rotate(-0.5deg);
}

.letter::before {
  content: "♡";
  position: absolute;
  right: 2rem;
  top: 1.4rem;
  color: var(--rose);
  font-size: 3rem;
  transform: rotate(12deg);
}

.letter__tape {
  position: absolute;
  top: -1rem;
  left: 50%;
  width: 7rem;
  height: 2.2rem;
  background: rgba(224, 189, 195, 0.7);
  transform: translateX(-50%) rotate(2deg);
}

.letter p {
  margin: 0 0 1.45rem;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.75;
}

.letter__signoff {
  padding-top: 1rem;
  font-style: italic;
}

.photos {
  width: min(100% - 2.4rem, 82rem);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.2rem, 3vw, 2.4rem);
}

.photo-card:nth-child(odd) { transform: rotate(-1.5deg); }
.photo-card:nth-child(even) { transform: rotate(1.5deg); }

.memories {
  width: min(100% - 2.4rem, 82rem);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.video-card {
  overflow: hidden;
  border: 1px solid rgba(123, 63, 75, 0.12);
  border-radius: 1.4rem;
  background: rgba(255, 253, 249, 0.82);
  box-shadow: 0 18px 50px rgba(87, 48, 55, 0.1);
}

.video-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 20% 10%, rgba(244, 217, 217, 0.85), transparent 45%),
    linear-gradient(135deg, #d8c8dd, #8b6570);
}

.video-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(44, 29, 33, 0.28);
}

.video-shell.is-rotated video {
  position: absolute;
  top: -38.888%;
  left: 21.875%;
  width: 56.25%;
  height: 177.777%;
  object-fit: cover;
  transform: rotate(-90deg);
}

.video-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.play-button,
.sound-button {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  background: rgba(61, 41, 44, 0.58);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.play-button {
  left: 50%;
  top: 50%;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, opacity 180ms ease;
}

.play-button:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.video-shell.is-playing .play-button {
  opacity: 0;
}

.video-shell.is-playing:hover .play-button,
.video-shell.is-playing:focus-within .play-button {
  opacity: 1;
}

.sound-button {
  right: 0.8rem;
  bottom: 0.8rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1rem;
}

.video-card__caption {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem 1.1rem;
}

.video-card__caption span {
  color: var(--rose);
  font-family: var(--serif);
  font-size: 1.6rem;
  font-style: italic;
}

.video-card__caption p {
  margin: 0;
  color: #654c51;
  font-family: var(--serif);
  font-style: italic;
}

.promise-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.promise {
  min-height: 16rem;
  padding: 2rem;
  border: 1px solid rgba(123, 63, 75, 0.14);
  border-radius: 50% 50% 1.4rem 1.4rem;
  text-align: center;
  background: rgba(255, 253, 249, 0.82);
}

.promise span {
  color: var(--rose);
  font-family: var(--serif);
  font-size: 2.5rem;
  font-style: italic;
}

.promise h3 {
  margin: 1rem 0 0.6rem;
  font-family: var(--serif);
  font-size: 1.45rem;
}

.promise p {
  margin: 0;
  color: #71595d;
  font-size: 0.92rem;
  line-height: 1.65;
}

.final-note {
  position: relative;
  max-width: 68rem;
  margin-bottom: 5rem;
  padding: clamp(3rem, 8vw, 6rem);
  border-radius: 2rem;
  text-align: center;
  background: linear-gradient(145deg, #f3d9da, #e4d7e7);
  box-shadow: var(--shadow);
}

.final-note h2 {
  margin: 0 auto;
  max-width: 19ch;
  font-size: clamp(2.5rem, 5.5vw, 4.8rem);
  line-height: 1.02;
}

.final-note > p:not(.eyebrow) {
  margin: 1.4rem 0 2rem;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.heart-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.floating-heart {
  position: absolute;
  bottom: 18%;
  color: var(--wine);
  animation: float-heart 1.8s ease-out forwards;
}

@keyframes float-heart {
  to {
    transform: translateY(-18rem) rotate(25deg) scale(1.4);
    opacity: 0;
  }
}

footer {
  padding: 2rem 1rem 3rem;
  text-align: center;
  color: #765e62;
  font-family: var(--serif);
  font-style: italic;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 850px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 8rem;
  }

  .hero__copy {
    text-align: center;
  }

  .hero h2,
  .hero__intro {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__photos {
    min-height: 32rem;
  }

  .polaroid {
    width: min(72%, 24rem);
  }

  .video-grid,
  .promise-grid {
    grid-template-columns: 1fr;
  }

  .promise {
    min-height: auto;
    border-radius: 4rem 4rem 1.4rem 1.4rem;
  }
}

@media (max-width: 560px) {
  .nav__links {
    display: none;
  }

  .hero h2 {
    font-size: clamp(3rem, 15vw, 4.5rem);
  }

  .hero__photos {
    min-height: 24rem;
  }

  .polaroid {
    width: 76%;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

  .letter {
    padding: 3.2rem 1.5rem 2rem;
  }

  .video-grid {
    gap: 1.25rem;
  }

  .hero__actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
