:root {
  color-scheme: dark;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, sans-serif;
  --night: #0e111c;
  --ivory: #fff1e4;
  --rose: #ffc1b4;
  --gold: #f1cd9d;
  --muted: #d3b6b6;
  --wine: #643246;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  min-width: 280px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(ellipse at 82% 38%, #42213470, transparent 47%),
    radial-gradient(ellipse at 10% 5%, #32355570, transparent 42%),
    linear-gradient(155deg, #141725, var(--night) 55%, #170f1b);
  color: var(--ivory);
  font-family: var(--sans);
  isolation: isolate;
}
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, #fdd9c004 3px 4px);
  pointer-events: none;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
#sky, #celebration {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#sky { z-index: -1; }
#celebration { z-index: 4; }

.masthead, .hero, .site-footer {
  width: min(1296px, calc(100% - clamp(40px, 12vw, 172px)));
  margin-inline: auto;
}
.masthead {
  min-height: 90px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #f6bfb62b;
}
.wordmark, .music-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.wordmark {
  color: #ffddc0;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.wordmark-star { color: #f9be99; font-size: 1.25rem; line-height: 1; }
.music-toggle {
  min-height: 43px;
  padding: 8px 15px;
  border: 1px solid #eabcad52;
  border-radius: 100vw;
  background: #38213060;
  color: #ffe3d1;
  font-size: 0.79rem;
  font-weight: 650;
  transition: background 180ms ease, border-color 180ms ease;
}
.music-toggle:hover { background: #6240518c; border-color: #ffc0ad; }
.music-icon { color: #ffc2a5; font-size: 1.10rem; line-height: 1; }
.music-playing .music-icon { animation: music-pulse 950ms ease-in-out infinite alternate; }
@keyframes music-pulse { to { transform: scale(1.22) rotate(-9deg); } }

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  align-items: center;
  gap: clamp(16px, 2vw, 42px);
  min-height: min(704px, calc(100svh - 153px));
  padding-block: clamp(37px, 6vh, 75px);
}
.hero-copy { position: relative; z-index: 1; margin-block: min(1vw, 17px); }
.eyebrow, .letter-kicker {
  margin: 0 0 23px;
  color: var(--gold);
  font-size: clamp(0.66rem, 1vw, 0.77rem);
  font-weight: 750;
  line-height: 1.5;
  letter-spacing: 0.23em;
  text-transform: uppercase;
}
.hero-copy .eyebrow { display: flex; align-items: center; gap: 12px; }
.hero-copy .eyebrow::before { content: ""; display: block; width: 27px; height: 1px; background: #d29e78; }
.hero h1 {
  margin: 0;
  font: 400 clamp(3rem, 6.4vw, 6.9rem)/0.92 var(--serif);
  letter-spacing: -0.055em;
  text-wrap: nowrap;
  text-shadow: 0 12px 55px #0c081a95;
}
.hero h1 em {
  display: inline-block;
  margin-top: 0.10em;
  color: var(--rose);
  font-weight: 400;
  text-shadow: 0 0 70px #fa9c9d30;
}
.dedication {
  max-width: 25rem;
  margin: 29px 0 0;
  color: #e8d0cb;
  font-size: clamp(1rem, 1.55vw, 1.13rem);
  line-height: 1.67;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 29px 0 0; }
.primary-button {
  min-height: 56px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 26px;
  padding: 13px 22px;
  border: 1px solid #f8d4be;
  border-radius: 100vw;
  background: linear-gradient(120deg, #fbe0c7, #efab9e);
  color: #482439;
  font-size: 0.94rem;
  font-weight: 800;
  box-shadow: 0 8px 30px #e67f7237, inset 0 0 0 2px #ffe7cf26;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.primary-button:hover { transform: translateY(-3px); box-shadow: 0 12px 36px #e9968870; }
.primary-button:active { transform: translateY(1px); }
.primary-button .arrow { font-size: 1.29rem; line-height: 1; transition: transform 180ms ease; }
.primary-button:hover .arrow { transform: translateX(3px); }
.hero-footnote { margin: 16px 0 0; color: var(--muted); font-size: 0.79rem; line-height: 1.55; }

.hero-gift { min-width: 0; padding-inline: clamp(4px, 1.2vw, 20px); }
.gift-scene {
  position: relative;
  min-height: 260px;
  aspect-ratio: 1 / 0.94;
  display: grid;
  align-items: center;
  justify-items: center;
  margin: 0;
  isolation: isolate;
}
.gift-scene::before, .gift-scene::after {
  position: absolute;
  color: #ffcda6;
  text-shadow: 0 0 20px #fecba6;
  pointer-events: none;
  font-size: clamp(1.3rem, 2.8vw, 2.5rem);
  animation: twinkle 5s ease-in-out infinite alternate both;
}
.gift-scene::before { content: "\2726"; z-index: 1; top: 15%; left: 8%; }
.gift-scene::after { content: "\2727"; z-index: 1; top: 30%; right: 5%; animation-delay: -2s; }
@keyframes twinkle {
  0%, 25% { opacity: 0.45; transform: scale(0.86); }
  80%, 100% { opacity: 1; transform: scale(1.12); }
}
.gift-glow {
  position: absolute;
  z-index: -2;
  inset: -5% -8%;
  background: radial-gradient(ellipse at 53% 49%, #c36c6f52, #a4466650 20%, #59334c4d 40%, transparent 69%);
  pointer-events: none;
}
.bouquet {
  position: absolute;
  z-index: -1;
  inset: -8% -10%;
  width: 120%;
  height: 112%;
  object-fit: cover;
  object-position: 55% 49%;
  color: transparent;
  opacity: 0.82;
  mix-blend-mode: screen;
  filter: saturate(0.83);
  mask-image: radial-gradient(ellipse at 52% 47%, #000 32%, #000b 52%, #0000 74%);
  pointer-events: none;
}
.bouquet[hidden], .bouquet:not([src]), .bouquet[src=""] { display: none; }
.envelope-button {
  --paper: #f9dfc8;
  position: relative;
  z-index: 2;
  width: min(79%, 420px);
  aspect-ratio: 1.52;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 10px 10px 14px 14px;
  background: none;
  transform: translateY(9%) rotate(-9deg);
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  perspective: 900px;
}
.envelope-button:hover { transform: translateY(4%) rotate(-5deg) scale(1.035); }
.is-opening .envelope-button { transform: translateY(17%) rotate(-2deg); }
.envelope-button > span { position: absolute; pointer-events: none; }
.envelope-shadow {
  inset: 17% 3% -14%;
  border-radius: 50%;
  background: #07030d;
  filter: blur(26px);
  opacity: 0.72;
}
.envelope-base {
  z-index: 0;
  inset: 0;
  border: 1px solid #e2a39b;
  border-radius: inherit;
  background: linear-gradient(140deg, #ae666d, #e29890 53%, #c37377);
  box-shadow: 0 0 40px #dfa8994a, 0 14px 60px #120812bc, inset 0 0 1px 2px #f5b2a740;
}
.envelope-paper {
  z-index: 1;
  top: 5%;
  right: 9%;
  left: 9%;
  height: 82%;
  display: grid;
  align-content: center;
  justify-items: center;
  padding-bottom: 14%;
  border: 1px solid #ffe8cf;
  border-radius: 3px;
  background: radial-gradient(ellipse at 48% 39%, #fff3dc, var(--paper));
  color: var(--wine);
  box-shadow: 0 0 12px #3f122b55;
  transform: translateY(-16%);
  transition: transform 480ms cubic-bezier(0.19, 1, 0.22, 1);
}
.paper-to { font-size: 0.66rem; font-weight: 750; letter-spacing: 0.22em; text-transform: uppercase; }
.paper-name { font: italic clamp(2.2rem, 5vw, 4.5rem)/0.89 var(--serif); }
.envelope-button:hover .envelope-paper { transform: translateY(-22%); }
.is-opening .envelope-paper { transform: translateY(-67%) rotate(4deg); transition-delay: 150ms; }
.envelope-front {
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(146deg, #efb7a5, #dc8e84 62%, #dd918a);
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px #ffd8bb8b;
  overflow: hidden;
}
.envelope-front::before, .envelope-front::after { content: ""; position: absolute; inset: 0; }
.envelope-front::before {
  background: linear-gradient(165deg, #e6ab99, #e9a398 45%, #f0b8a4);
  clip-path: polygon(0 99%, 50% 35%, 100% 99%, 100% 100%, 0 100%);
  filter: drop-shadow(0 -1px 0 #99616e);
}
.envelope-front::after { background: repeating-linear-gradient(90deg, transparent 0 2px, #783f4f11 3px 4px); opacity: 0.51; }
.envelope-flap {
  z-index: 3;
  inset: 0 0 auto;
  height: 70%;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(166deg, #f7c7ab 13%, #eaa392 66%, #d7837c);
  clip-path: polygon(0 0, 100% 0, 100% 4%, 53% 79%, 50% 81%, 47% 79%, 0 4%);
  transform-origin: center top;
  transition: transform 470ms cubic-bezier(0.4, 0, 0.2, 1), z-index 0ms 235ms;
}
.is-opening .envelope-flap { z-index: 0; transform: rotateX(178deg); }
.envelope-seal {
  z-index: 4;
  top: 44%;
  left: 50%;
  width: 19%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid #c06070;
  border-radius: 49% 46% 50% 44%;
  background: radial-gradient(circle at 34% 26%, #b65e72, #8d3b53 62%, #693144);
  color: #f6b7a3;
  font: 400 clamp(1.22rem, 3vw, 2.15rem)/1 var(--serif);
  text-shadow: 0 1px 4px #551b3d;
  box-shadow: inset 0 0 0 2px #7b2e47a0, inset 0 0 0 6px #c0717955, 0 6px 12px #77385063;
  transform: translate(-50%, -22%) rotate(5deg);
  transition: opacity 160ms ease, transform 200ms ease;
}
.is-opening .envelope-seal { opacity: 0; transform: translate(-50%, 0) scale(0.75) rotate(19deg); }
.envelope-address {
  z-index: 3;
  right: 5%;
  left: 5%;
  bottom: 7.5%;
  color: #642e43;
  font: italic clamp(1rem, 2.75vw, 2.1rem)/1 var(--serif);
  text-align: center;
  text-shadow: 0 1px #ffe4c963;
}
.gift-caption {
  position: absolute;
  bottom: 1%;
  right: 0;
  left: 0;
  color: #f0c3ae;
  font-size: 0.71rem;
  font-weight: 650;
  letter-spacing: 0.15em;
  line-height: 1.55;
  text-align: center;
  text-shadow: 0 2px 10px #0f0813;
  text-transform: uppercase;
}
.site-footer {
  min-height: 65px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid #f6bfb62b;
  color: var(--muted);
}
.site-footer small { font-size: 0.78rem; line-height: 1.4; }
.link-button {
  min-height: 40px;
  padding: 5px 0 5px 10px;
  border: 0;
  background: none;
  color: #f9c9ad;
  font-size: 0.78rem;
  font-weight: 700;
  text-underline-offset: 4px;
}
.link-button:hover { text-decoration: underline; }

dialog {
  position: fixed;
  max-height: calc(100svh - 34px);
  max-width: calc(100% - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid #fbcda7;
  border-radius: 9px;
  background: #fbe3d0;
  color: #4d2a3a;
  overscroll-behavior: contain;
  box-shadow: 0 24px 120px #03030ed9, 0 0 52px #f4b1a535;
}
dialog[open] { animation: reveal 460ms cubic-bezier(0.16, 1, 0.3, 1) both; }
dialog::backdrop { background: #090810cc; backdrop-filter: blur(8px); }
body:has(dialog:modal) { overflow: hidden; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(19px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.letter-dialog { width: 680px; }
.music-dialog {
  z-index: 5;
  inset: auto max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) auto;
  width: min(370px, calc(100% - 28px));
  max-width: none;
  margin: 0;
}
.dialog-close {
  position: sticky;
  z-index: 2;
  top: 12px;
  left: calc(100% - 55px);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  margin: 12px 12px -52px auto;
  border: 1px solid #98667252;
  border-radius: 50%;
  background: #fff0e6f5;
  color: #692c46;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  transition: background 180ms ease;
}
.dialog-close:hover { background: #f5cebc; }
dialog button:focus-visible, dialog a:focus-visible { outline-color: #8c3c5b; }
.letter-sheet, .music-sheet {
  position: relative;
  padding: clamp(38px, 7vw, 70px) clamp(23px, 7vw, 73px) clamp(32px, 6vw, 58px);
  isolation: isolate;
  background:
    radial-gradient(ellipse at 79% 0%, #ffd5bdc9, transparent 50%),
    radial-gradient(ellipse at 2% 89%, #edb8b14d, transparent 50%),
    repeating-linear-gradient(0deg, #ab627306 0 1px, transparent 1px 3px),
    #fff0df;
}
.letter-sheet::before, .music-sheet::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 12px;
  border: 1px solid #b4777c55;
  border-radius: 3px;
  pointer-events: none;
}
.letter-kicker, .music-sheet .eyebrow { margin: 0 0 11px; color: #905062; font-size: 0.67rem; }
.letter-heading, .music-sheet h2 {
  margin: 0 0 16px;
  color: var(--wine);
  font: italic 400 clamp(3rem, 9vw, 5rem)/0.95 var(--serif);
  letter-spacing: -0.045em;
}
.letter-lede { margin: 0 0 15px; color: #7a3d54; font: 400 clamp(1.38rem, 4vw, 1.7rem)/1.25 var(--serif); }
.letter-body { color: #502c3c; font-size: clamp(0.99rem, 2.6vw, 1.06rem); line-height: 1.75; }
.letter-body p { margin: 0 0 0.9em; }
.signature { margin: 25px 0; color: #77374f; font-size: 0.91rem; line-height: 1.5; }
.signature em { display: inline-block; margin-top: 3px; font: italic 400 2.55rem/0.95 var(--serif); }

.wish-panel {
  display: flex;
  align-items: center;
  gap: clamp(14px, 4vw, 26px);
  padding: 18px clamp(12px, 4vw, 22px);
  border: 1px solid #b874805e;
  border-radius: 5px;
  background: linear-gradient(110deg, #eeb7ac55, #ffd7b348);
}
.candle { position: relative; flex: 0 0 43px; height: 82px; align-self: center; margin-inline: 1px; }
.candle span { display: block; position: absolute; left: 50%; }
.candle-body {
  bottom: 0;
  width: 18px;
  height: 45px;
  border-radius: 4px 4px 2px 2px;
  background: repeating-linear-gradient(135deg, #fdc4b5 0 7px, #d87887 8px 13px);
  box-shadow: inset 4px 0 6px #fff2c974, inset -3px 0 5px #8838526b, 0 2px 8px #79445945;
  transform: translateX(-50%);
}
.wick { bottom: 43px; width: 2px; height: 11px; border-radius: 2px; background: #56353d; }
.flame {
  z-index: 1;
  bottom: 51px;
  width: 15px;
  height: 24px;
  border-radius: 60% 45% 58% 44%;
  background: radial-gradient(ellipse at 46% 61%, #fff9d1 14%, #ffd276 41%, #f69c53 66%, #ca4869 100%);
  box-shadow: 0 0 22px 5px #fff4b7, 0 0 43px 12px #ffaa5a66;
  transform: translateX(-50%) rotate(5deg);
  transform-origin: 55% 91%;
  animation: flicker 880ms ease-in-out infinite alternate;
  transition: opacity 250ms ease, scale 250ms ease;
}
@keyframes flicker {
  40% { transform: translateX(-50%) rotate(-5deg) scale(1.03, 0.88); }
  80% { transform: translateX(-50%) rotate(7deg) scale(0.93, 1.05); }
}
.is-blown .flame { opacity: 0; scale: 0.5; animation-play-state: paused; }
.is-blown .candle::after {
  content: "";
  position: absolute;
  left: 42%;
  bottom: 54px;
  width: 10px;
  height: 15px;
  border-radius: 50%;
  background: #9d777d;
  filter: blur(4px);
  animation: smoke 1.3s ease-out both;
}
@keyframes smoke {
  from { transform: scale(0.6); opacity: 0.55; }
  to { transform: translate(13px, -38px) scale(2.3); opacity: 0; }
}
.wish-copy { min-width: 0; }
.wish-title { margin: 0 0 3px; color: #733a50; font: 400 1.43rem/1.1 var(--serif); }
#wish-text { margin: 0 0 7px; font-size: 0.9rem; line-height: 1.4; }
.wish-button {
  min-height: 39px;
  padding: 6px 12px;
  border: 1px solid #863d57;
  border-radius: 100vw;
  background: #893e56;
  color: #fff1e3;
  font-size: 0.82rem;
  font-weight: 750;
}
.wish-button:hover { background: #693046; }
.wish-button:disabled { opacity: 0.73; cursor: default; }
.letter-foot { margin: 22px 0 0; color: #8e5365; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.10em; }

.music-sheet { padding: 21px 18px 17px; }
.music-sheet::before { inset: 7px; }
.music-sheet .eyebrow { margin-bottom: 5px; }
.music-sheet h2 { margin-bottom: 5px; font-size: 2.3rem; }
.music-track, .music-message { margin: 6px 0 8px; color: #65394f; font-size: 0.84rem; line-height: 1.45; }
.music-links { display: flex; flex-wrap: wrap; column-gap: 13px; }
.music-sheet a { display: inline-block; margin-top: 9px; color: #733a50; font-size: 0.77rem; font-weight: 750; text-underline-offset: 4px; }
.youtube-player {
  width: 100%;
  min-height: 200px;
  display: grid;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 4px;
  background: #191123;
  color: var(--ivory);
}
.youtube-player:empty { display: none; }
.youtube-player iframe { width: 100%; height: 100%; min-height: 200px; border: 0; }

@media (max-width: 820px) {
  .masthead, .hero, .site-footer { width: calc(100% - 54px); }
  .masthead { min-height: 74px; }
  .hero { gap: 7px; }
  .hero h1 { font-size: clamp(3rem, 7vw, 4.4rem); }
  .gift-caption { bottom: -4%; }
}
@media (max-width: 650px) {
  .masthead, .hero, .site-footer { width: calc(100% - 40px); }
  .masthead { min-height: 70px; }
  .wordmark { font-size: 0.67rem; letter-spacing: 0.15em; }
  .music-toggle { padding-inline: 12px; font-size: 0.74rem; }
  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 0; min-height: auto; padding-block: 37px 27px; }
  .hero-copy { margin: 0; }
  .hero h1 { font-size: clamp(2.85rem, 11.4vw, 4.75rem); }
  .hero-copy .eyebrow { margin-bottom: 15px; }
  .dedication { margin-top: 17px; max-width: 21rem; }
  .hero-actions { margin-top: 20px; }
  .primary-button { min-height: 50px; padding-block: 10px; }
  .hero-footnote { margin-top: 10px; }
  .hero-gift { align-self: center; width: min(100%, 428px); padding: 0; }
  .gift-scene { aspect-ratio: 1 / 0.8; }
  .gift-caption { bottom: 1%; }
  .envelope-button { width: min(69%, 320px); }
  .envelope-address { font-size: clamp(1rem, 5vw, 1.65rem); }
  .envelope-seal { font-size: clamp(1.12rem, 5vw, 2rem); }
  .paper-name { font-size: clamp(2.2rem, 9vw, 3.6rem); }
  .site-footer { min-height: 60px; }
}
@media (max-width: 350px) {
  .masthead, .hero, .site-footer { width: calc(100% - 32px); }
  .hero h1 { font-size: 11.4vw; }
  .site-footer { gap: 8px; }
  .site-footer small, .link-button { font-size: 0.71rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
.wish-confetti {
  position: absolute;
  z-index: 3;
  bottom: 63px;
  left: 50%;
  pointer-events: none;
}
.wish-confetti span {
  top: 0;
  left: 0;
  width: 5px;
  height: 9px;
  border-radius: 2px;
  animation: wish-burst 1s cubic-bezier(0.1, 0.48, 0.32, 1) both;
}
@keyframes wish-burst {
  from { opacity: 1; transform: translate(0, 0) scale(0.3); }
  58% { opacity: 1; }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--spin)); }
}
.letter-sheet > form {
  --sheet-top: clamp(38px, 7vw, 70px);
  --sheet-side: clamp(23px, 7vw, 73px);
  position: sticky;
  z-index: 3;
  top: 12px;
  height: 0;
  margin-top: calc(12px - var(--sheet-top));
  margin-bottom: calc(var(--sheet-top) - 12px);
}
.music-sheet > form { position: absolute; z-index: 3; top: 9px; right: 9px; }
.letter-sheet > form .dialog-close, .music-sheet > form .dialog-close {
  position: absolute;
  inset: 0 0 auto auto;
  margin: 0;
}
.letter-sheet > form .dialog-close { right: calc(12px - var(--sheet-side)); }
.music-sheet > form .dialog-close { width: 35px; height: 35px; }
.music-links .link-button { min-height: auto; padding: 0; }

html { overflow-x: clip; }
@media (max-width: 650px) {
  .music-playing { padding-bottom: 320px; }
  .music-sheet .eyebrow { display: none; }
  .music-sheet h2 { font-size: 2rem; }
  .music-sheet { padding-top: 15px; }
}
