:root {
  --wine: #792544;
  --wine-dark: #481526;
  --rose: #d98ca8;
  --rose-light: #f3dfe6;
  --blush: #fbf4f5;
  --paper: #fffaf8;
  --ink: #321d24;
  --muted: #7c626b;
  --line: rgba(82, 32, 50, 0.15);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

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

img,
video {
  display: block;
  width: 100%;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--wine);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: #f7d8e3;
}

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

h1,
h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2.5rem, 7vw, 5.4rem);
  line-height: 1.02;
}

h2 em {
  color: var(--wine);
  font-weight: 500;
}

.gift-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 16%, rgba(228, 151, 180, 0.3), transparent 32%),
    radial-gradient(circle at 80% 86%, rgba(121, 37, 68, 0.12), transparent 34%),
    var(--blush);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.gift-screen::before,
.gift-screen::after {
  position: absolute;
  width: min(38vw, 310px);
  height: min(38vw, 310px);
  border: 1px solid rgba(121, 37, 68, 0.13);
  border-radius: 50%;
  content: "";
}

.gift-screen::before {
  top: -12%;
  left: -8%;
}

.gift-screen::after {
  right: -9%;
  bottom: -13%;
}

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

.gift-orbit {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
  color: var(--wine);
}

.gift-orbit span:nth-child(2) {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid rgba(121, 37, 68, 0.25);
  border-radius: 50%;
  font-size: 1.45rem;
}

.gift-orbit span:not(:nth-child(2)) {
  font-size: 0.75rem;
}

.gift-screen h1 {
  max-width: 780px;
  margin: 0 0 22px;
  font-size: clamp(3.1rem, 9vw, 7rem);
  line-height: 0.92;
}

.gift-copy {
  max-width: 500px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  min-width: 230px;
  padding: 16px 22px;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: var(--wine);
  box-shadow: 0 14px 34px rgba(121, 37, 68, 0.22);
  font: 600 0.84rem var(--sans);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
}

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

.sound-note {
  margin: 18px 0 0;
  color: #a1848e;
  font-size: 0.72rem;
}

main {
  opacity: 0;
  transition: opacity 0.7s ease 0.3s;
}

main.is-visible {
  opacity: 1;
}

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  color: #fff;
  background: var(--wine-dark);
}

.hero-photo,
.hero-photo img,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-photo img {
  height: 100%;
  object-fit: cover;
  object-position: center 41%;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(44, 12, 25, 0.88) 0%, rgba(44, 12, 25, 0.5) 48%, rgba(44, 12, 25, 0.18) 100%),
    linear-gradient(0deg, rgba(44, 12, 25, 0.68), transparent 42%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  min-height: 100svh;
  max-width: 1300px;
  margin: auto;
  padding: 80px clamp(28px, 7vw, 110px);
}

.hero-kicker {
  margin-bottom: 9px;
  color: #f6e7ec;
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.hero h2 {
  max-width: 850px;
  margin-bottom: 28px;
  font-size: clamp(3.2rem, 8.5vw, 7.6rem);
  line-height: 0.92;
}

.hero h2 em {
  color: #f7cbd9;
}

.hero-lead {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.3vw, 1.8rem);
  font-style: italic;
}

.scroll-cue {
  position: absolute;
  right: clamp(28px, 5vw, 76px);
  bottom: 38px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.scroll-cue span:last-child {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
}

.section {
  position: relative;
  padding: clamp(90px, 12vw, 170px) clamp(24px, 7vw, 110px);
}

.section-number {
  position: absolute;
  top: 36px;
  left: clamp(24px, 4vw, 60px);
  color: rgba(121, 37, 68, 0.25);
  font: 500 0.72rem var(--sans);
}

.letter {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.78fr);
  gap: clamp(70px, 11vw, 180px);
  max-width: 1380px;
  margin: auto;
}

.letter-body {
  padding-top: 50px;
  color: #5e4850;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.9;
}

.letter-body p {
  margin-bottom: 24px;
}

.signature {
  margin-top: 42px;
  color: var(--wine);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.55;
}

.signature strong {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portrait-break {
  position: relative;
  height: min(82vh, 850px);
  margin: 0 clamp(18px, 4vw, 64px);
  overflow: hidden;
  background: #d8b3bf;
}

.portrait-break > img {
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.portrait-break::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(50, 18, 29, 0.04) 36%, rgba(50, 18, 29, 0.72) 100%);
  content: "";
}

.portrait-quote {
  position: absolute;
  z-index: 1;
  right: 6%;
  bottom: 10%;
  max-width: 430px;
  color: #fff;
}

.quote-mark {
  display: block;
  height: 58px;
  color: #f5bdce;
  font: 5rem/1 var(--serif);
}

.portrait-quote p {
  margin: 0;
  font: italic clamp(1.8rem, 4vw, 3.3rem)/1.15 var(--serif);
}

.reasons {
  max-width: 1380px;
  margin: auto;
}

.reasons-heading {
  max-width: 760px;
  margin-bottom: 70px;
}

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.reason {
  min-height: 300px;
  padding: 32px 28px 34px;
  border-right: 1px solid var(--line);
}

.reason:last-child {
  border-right: 0;
}

.reason > span {
  color: var(--rose);
  font-size: 0.72rem;
}

.reason h3 {
  margin: 86px 0 14px;
  font: 600 1.35rem var(--serif);
}

.reason p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.memories {
  color: #fff;
  background: var(--wine-dark);
}

.memories-title {
  max-width: 900px;
  margin-bottom: 70px;
}

.memories-title h2 em {
  color: #efb8cb;
}

.photo-grid {
  display: grid;
  align-items: start;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(18px, 3vw, 44px);
  max-width: 1380px;
  margin: auto;
}

.photo-grid figure {
  margin: 0;
}

.photo-grid img {
  height: 100%;
  object-fit: cover;
}

.photo-wide img {
  aspect-ratio: 4 / 3;
}

.photo-tall {
  margin-top: 90px !important;
}

.photo-tall img {
  aspect-ratio: 3 / 4;
  object-position: 50% 42%;
}

.photo-grid figcaption {
  padding-top: 16px;
  color: rgba(255, 255, 255, 0.7);
  font: italic 1rem var(--serif);
}

.video-section {
  display: grid;
  align-items: center;
  grid-template-columns: 0.75fr 1.25fr;
  gap: clamp(50px, 8vw, 120px);
  max-width: 1380px;
  margin: auto;
}

.video-copy > p:not(.eyebrow) {
  max-width: 470px;
  margin-top: 28px;
  color: var(--muted);
  line-height: 1.8;
}

.video-frame {
  position: relative;
  padding: 12px;
  background: #f3dfe6;
}

.video-frame video {
  max-height: 72vh;
  background: #231118;
  object-fit: contain;
}

.finale {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 100svh;
  padding: 100px 28px;
  overflow: hidden;
  color: #fff;
  text-align: center;
  background: var(--wine);
}

.finale-glow {
  position: absolute;
  width: min(75vw, 900px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 110px rgba(255, 255, 255, 0.025),
    0 0 0 220px rgba(255, 255, 255, 0.018);
}

.finale > *:not(.finale-glow) {
  position: relative;
  z-index: 1;
}

.finale h2 {
  max-width: 1000px;
}

.finale h2 em {
  color: #f6cbd9;
}

.finale-copy {
  max-width: 650px;
  margin: 30px auto 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.8;
}

.forty {
  margin: 38px 0 14px;
  font: 600 clamp(6rem, 20vw, 13rem)/0.8 var(--serif);
  letter-spacing: -0.09em;
  text-shadow: 0 16px 50px rgba(51, 10, 26, 0.25);
}

.final-sign {
  margin: 15px 0 0;
  color: #f6cbd9;
  font: italic 1.25rem var(--serif);
}

.music-toggle {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 100px;
  color: #fff;
  background: rgba(72, 21, 38, 0.86);
  box-shadow: 0 8px 28px rgba(44, 10, 24, 0.22);
  backdrop-filter: blur(12px);
  font: 500 0.7rem var(--sans);
  cursor: pointer;
}

.music-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 13px;
}

.music-bars i {
  width: 2px;
  height: 7px;
  background: #f7c8d8;
  animation: equalize 0.7s ease-in-out infinite alternate;
}

.music-bars i:nth-child(2) {
  animation-delay: 0.2s;
}

.music-bars i:nth-child(3) {
  animation-delay: 0.4s;
}

.music-toggle.is-paused .music-bars i {
  height: 3px;
  animation: none;
}

#birthdaySong {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

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

@keyframes equalize {
  from {
    height: 4px;
  }
  to {
    height: 13px;
  }
}

@media (max-width: 900px) {
  .hero-shade {
    background:
      linear-gradient(0deg, rgba(44, 12, 25, 0.91) 0%, rgba(44, 12, 25, 0.42) 70%, rgba(44, 12, 25, 0.2) 100%);
  }

  .hero-content {
    justify-content: flex-end;
    padding-bottom: 112px;
  }

  .hero h2 {
    font-size: clamp(3.4rem, 12vw, 6rem);
  }

  .scroll-cue {
    right: auto;
    left: 28px;
    bottom: 30px;
  }

  .letter,
  .video-section {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .letter-body {
    max-width: 680px;
    padding-top: 0;
  }

  .portrait-break::after {
    background: linear-gradient(0deg, rgba(50, 18, 29, 0.76), transparent 65%);
  }

  .portrait-quote {
    right: 8%;
    bottom: 7%;
    left: 8%;
  }

  .reasons-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reason:nth-child(2) {
    border-right: 0;
  }

  .reason:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .video-copy {
    max-width: 720px;
  }
}

@media (max-width: 620px) {
  h2 {
    font-size: 2.65rem;
  }

  .gift-screen {
    padding: 26px;
  }

  .gift-screen h1 {
    font-size: clamp(3rem, 15vw, 4.5rem);
  }

  .hero-photo img {
    object-position: 58% center;
  }

  .hero-content {
    padding: 52px 24px 104px;
  }

  .hero .eyebrow {
    margin-bottom: 14px;
  }

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

  .scroll-cue span:first-child {
    max-width: 190px;
  }

  .section {
    padding: 94px 22px;
  }

  .letter {
    gap: 34px;
  }

  .letter-body {
    font-size: 0.98rem;
  }

  .portrait-break {
    height: 72vh;
    min-height: 540px;
    margin: 0 14px;
  }

  .portrait-break > img {
    object-position: 48% center;
  }

  .portrait-quote p {
    font-size: 2rem;
  }

  .reasons-heading {
    margin-bottom: 45px;
  }

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

  .reason {
    min-height: 0;
    padding: 28px 8px 34px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .reason:last-child {
    border-bottom: 0;
  }

  .reason h3 {
    margin: 40px 0 12px;
  }

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

  .photo-tall {
    margin-top: 20px !important;
  }

  .photo-wide img {
    aspect-ratio: 1 / 1;
  }

  .photo-tall img {
    aspect-ratio: 4 / 5;
  }

  .memories-title {
    margin-bottom: 45px;
  }

  .video-frame {
    padding: 7px;
  }

  .finale {
    min-height: 100svh;
    padding: 90px 24px;
  }

  .finale h2 {
    font-size: 2.7rem;
  }

  .finale-copy {
    font-size: 0.92rem;
  }

  .music-toggle {
    right: 14px;
    bottom: 14px;
  }

}

@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;
  }
}
