 :root {
  --ivory: #FFF9F2;
  --blush: #F3DDE2;
  --rose: #C98798;
  --rose-dark: #ad6d80;
  --brown: #55434A;
  --muted: #907b80;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0; min-width: 320px; color: var(--brown); background: var(--ivory);
  font-family: var(--sans); overflow-x: hidden;
}
button, a { font: inherit; }
button:focus-visible, a:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid #b96f85; outline-offset: 5px; }
.ambient { position: fixed; z-index: 0; width: 340px; height: 340px; border-radius: 50%; filter: blur(75px); opacity: .22; pointer-events: none; }
.ambient-one { background: #f0cbd5; top: -180px; left: -120px; }
.ambient-two { background: #f4dfc8; right: -170px; bottom: -180px; }
.opening {
  position: relative; z-index: 2; min-height: 100svh; display: grid; place-items: center;
  padding: 42px 22px; text-align: center; transition: opacity .9s ease, transform .9s ease;
}
.opening.is-opening { opacity: 0; transform: translateY(-18px) scale(.98); pointer-events: none; }
.envelope-wrap { width: min(100%, 440px); display: flex; align-items: center; flex-direction: column; }
.eyebrow { color: var(--rose-dark); font-size: 10px; letter-spacing: .22em; font-weight: 600; margin: 0 0 17px; }
.envelope { width: 230px; height: 155px; position: relative; margin: 28px auto 20px; filter: drop-shadow(0 14px 17px rgba(109, 70, 80, .13)); }
.envelope-back { position: absolute; inset: 0; background: #e8c4cc; border-radius: 5px; }
.envelope-front { position: absolute; inset: 0; background: #f0d5da; clip-path: polygon(0 100%, 50% 42%, 100% 100%); border-radius: 0 0 5px 5px; }
.envelope-flap { position: absolute; inset: 0; background: #f7e5e7; clip-path: polygon(0 0, 100% 0, 50% 61%); transform-origin: top; transition: transform .75s cubic-bezier(.2,.7,.2,1); z-index: 3; }
.envelope-letter { position: absolute; z-index: 1; width: 82%; height: 120px; left: 9%; top: 10px; background: #fffdf9; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: var(--rose-dark); font-family: var(--serif); font-style: italic; transition: transform .9s .15s ease; }
.envelope-letter b { font-family: var(--sans); font-size: 14px; }
.wax-seal { position: absolute; z-index: 4; left: 50%; top: 61%; transform: translate(-50%,-50%); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff6f3; background: var(--rose); font-size: 13px; box-shadow: 0 2px 5px #a66d7a55; transition: opacity .3s; }
.envelope.is-open .envelope-flap { transform: rotateX(180deg); }
.envelope.is-open .envelope-letter { transform: translateY(-75px); z-index: 4; }
.envelope.is-open .wax-seal { opacity: 0; }
.envelope-recipient { font-family: var(--serif); font-style: italic; color: var(--rose-dark); font-size: 19px; margin: 0 0 20px; }
.opening h1 { font: 500 clamp(28px, 5vw, 39px)/1.25 var(--serif); margin: 0 0 25px; }
.primary-button { border: 0; border-radius: 99px; padding: 15px 24px; background: var(--brown); color: white; cursor: pointer; transition: transform .25s, background .25s, box-shadow .25s; box-shadow: 0 8px 20px #55434a20; }
.primary-button:hover { background: var(--rose-dark); transform: translateY(-2px); box-shadow: 0 11px 24px #55434a26; }
.primary-button span { margin-left: 12px; }
.tiny-note { font-size: 11px; color: #a18c90; margin-top: 18px; letter-spacing: .04em; }
.opening-sparkle { position: absolute; color: var(--rose); font-size: 25px; }
.sparkle-one { top: 22%; left: 21%; }.sparkle-two { right: 20%; bottom: 24%; font-size: 31px; }
.birthday-page { position: relative; z-index: 1; display: none; opacity: 0; }
.birthday-page.is-visible { display: block; animation: page-in 1s ease forwards; }
@keyframes page-in { to { opacity: 1; } }
.top-note { text-align: center; padding: 25px 15px 0; font-size: 9px; letter-spacing: .23em; color: var(--muted); }
.top-note span { color: var(--rose); margin: 0 8px; }
.section-shell { width: min(100% - 44px, 980px); margin-inline: auto; }
.hero { min-height: 650px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; padding-block: 70px 85px; position: relative; }
.hero-copy { padding-left: clamp(0px, 4vw, 50px); }
.hero h2 { font: 600 clamp(42px, 6vw, 69px)/1.13 var(--serif); letter-spacing: -.04em; margin: 0; }
.hero h2 em { color: var(--rose-dark); font-weight: 500; }
.pink-dot { color: var(--rose); }
.hero-subtitle { max-width: 350px; color: #8e7c80; font-size: 14px; line-height: 1.8; margin: 24px 0 25px; }
.text-link { color: var(--rose-dark); text-decoration: none; font-size: 12px; border-bottom: 1px solid #d9aab5; padding-bottom: 5px; }
.text-link span { margin-left: 7px; }
.photo-area { position: relative; display: grid; place-items: center; min-height: 390px; }
.polaroid { width: min(78%, 315px); margin: 0; padding: 13px 13px 20px; background: #fffefa; box-shadow: 0 18px 50px #674b5320; transform: rotate(3deg); position: relative; }
.photo-frame { width: 100%; aspect-ratio: 4/4.7; overflow: hidden; background: #f0e1df; }
.photo-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: #a66d7d; background: radial-gradient(circle at 50% 40%, #fff7ef, #efd5da); }
.placeholder-flower { font-size: 45px; opacity: .8; }
.placeholder-initial { font: 500 62px var(--serif); color: #a96f80; }
.placeholder-caption { font: italic 13px var(--serif); color: #9b7d83; }
.polaroid figcaption { text-align: center; padding-top: 15px; font: italic 15px var(--serif); color: #947b80; }
.photo-tape { position: absolute; top: 29px; width: 90px; height: 25px; background: #e8c9b4a8; transform: rotate(-9deg); z-index: 2; }
.photo-sparkle { position: absolute; color: var(--rose); font-size: 30px; }.photo-sparkle-a { top: 40px; right: 9%; }.photo-sparkle-b { bottom: 43px; left: 5%; font-size: 22px; }
.floating-heart { position: absolute; color: #d79aaa; animation: float 4.5s ease-in-out infinite; }.heart-one { top: 15%; right: 43%; font-size: 23px; }.heart-two { bottom: 19%; left: 43%; font-size: 15px; animation-delay: -2s; }
@keyframes float { 50% { transform: translateY(-12px) rotate(9deg); } }
.letter-section { padding: 60px 0 105px; text-align: center; }
.section-flourish { color: var(--rose); letter-spacing: .2em; margin-bottom: 22px; }
.letter-section h3, .cake-section h3 { font: 500 clamp(30px, 4vw, 42px) var(--serif); margin: 0 0 34px; }
.letter-card { position: relative; width: min(100%, 660px); margin: auto; padding: 50px clamp(25px, 7vw, 75px) 42px; background: #fffdf9; border: 1px solid #f0e5df; box-shadow: 0 15px 45px #70545a0d; text-align: left; }
.letter-card:before, .letter-card:after { content: "✿"; position: absolute; color: #d8a8b3; font-size: 18px; }.letter-card:before { top: 17px; left: 20px; }.letter-card:after { bottom: 15px; right: 20px; }
.quote-mark { position: absolute; top: 14px; right: 27px; font: 70px var(--serif); color: #f0dce0; }
.message-text { font: 16px/2 var(--serif); color: #6e5960; white-space: pre-line; min-height: 80px; }
.letter-signoff { margin-top: 28px; display: flex; flex-direction: column; gap: 5px; color: #9b8589; font-size: 12px; }
.letter-signoff strong { font: italic 23px var(--serif); color: var(--rose-dark); }
.signature-heart { color: var(--rose); font-size: 20px; margin-top: 5px; }
.cake-section { padding: 40px 0 45px; text-align: center; }
.cake-section h3 { margin-bottom: 10px; }
.cake-instruction { color: #9a8589; font-size: 12px; margin: 0; }
.cake-scene { position: relative; width: 270px; height: 245px; margin: 15px auto 20px; }
.cake { position: absolute; width: 210px; height: 130px; bottom: 26px; left: 30px; }
.cake-side { position: absolute; left: 0; right: 0; bottom: 12px; height: 80px; background: #e8bfc8; border-radius: 10px 10px 16px 16px; display: flex; justify-content: space-around; align-items: center; color: #fff7f1; font-size: 21px; box-shadow: inset -8px 0 #d9aab5; }
.cake-top { position: absolute; left: 0; top: 34px; width: 210px; height: 37px; border-radius: 50%; background: #f8e8df; z-index: 2; }
.cake-icing { position: absolute; left: 0; top: 45px; width: 210px; height: 28px; border-radius: 0 0 50% 50%; background: #fff2e9; z-index: 3; }
.cake-plate { position: absolute; left: -13px; bottom: 0; width: 236px; height: 19px; border-radius: 50%; background: #ead9d2; }
.candle { position: absolute; z-index: 5; left: 126px; top: 43px; width: 25px; height: 85px; cursor: pointer; }
.candle-body { position: absolute; left: 7px; top: 27px; width: 12px; height: 54px; border-radius: 3px; background: repeating-linear-gradient(135deg, #fff4eb 0 7px, #d88fa0 7px 11px); box-shadow: 1px 0 2px #b979872e; }
.wick { position: absolute; z-index: 2; left: 12px; top: 20px; width: 2px; height: 10px; background: #6f5552; }
.flame { position: absolute; left: 6px; top: 0; width: 14px; height: 22px; border-radius: 60% 40% 55% 45%; background: #f6b84f; transform: rotate(4deg); box-shadow: 0 0 18px #f5b84f99, 0 0 35px #f5b84f55; animation: flicker .8s ease-in-out infinite alternate; transform-origin: bottom; }
@keyframes flicker { to { transform: rotate(-5deg) scale(.88,1.08); } }
.candle.blown .flame { opacity: 0; transform: translateY(-10px) scale(.2); transition: .35s; }
.cake-sparkle { position: absolute; color: var(--rose); font-size: 24px; }.cake-sparkle-left { left: 4px; top: 75px; }.cake-sparkle-right { right: 1px; top: 40px; }
.closing-message { width: min(100%, 500px); margin: 15px auto 55px; animation: rise-in .8s ease both; }
.closing-message p { font: italic 22px/1.6 var(--serif); color: var(--rose-dark); margin: 8px 0; }.closing-message strong { font: 13px var(--sans); color: var(--muted); }
.closing-heart { color: var(--rose); font-size: 25px; }
@keyframes rise-in { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: none; } }
footer { color: #b19da0; font-size: 9px; letter-spacing: .2em; padding: 30px 0 25px; } footer span { color: var(--rose); margin-left: 6px; }
.music-control { position: fixed; z-index: 20; right: 20px; bottom: 20px; display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border: 1px solid #ead9d5; border-radius: 99px; background: #fffdf8ed; box-shadow: 0 5px 20px #55434a16; backdrop-filter: blur(10px); }
.music-control[hidden] { display: none; }
.music-control button { width: 31px; height: 31px; border: 0; border-radius: 50%; color: white; background: var(--brown); cursor: pointer; }
.music-control button:hover { background: var(--rose-dark); }.music-label { font-size: 10px; color: #907b80; padding-left: 3px; }
.youtube-player { position: fixed; width: 1px; height: 1px; left: -10px; bottom: -10px; overflow: hidden; pointer-events: none; }
.confetti-layer { position: fixed; inset: 0; z-index: 30; overflow: hidden; pointer-events: none; }
.confetti-piece { position: absolute; top: -20px; width: 8px; height: 12px; opacity: 0; animation: confetti-fall 3.2s ease-in forwards; }
@keyframes confetti-fall { 0% { opacity: 1; transform: translateY(-20px) rotate(0); } 100% { opacity: 0; transform: translateY(110vh) rotate(720deg); } }
@media (max-width: 700px) {
  .hero { min-height: auto; grid-template-columns: 1fr; gap: 18px; padding-block: 75px 60px; text-align: center; }
  .hero-copy { padding: 0; }.hero-subtitle { margin-inline: auto; }.photo-area { min-height: 350px; }
  .polaroid { width: min(72%, 285px); }.photo-tape { top: 20px; }.heart-one { right: 17%; top: 5%; }.heart-two { left: 13%; bottom: 12%; }
  .letter-section { padding: 30px 0 75px; }.letter-card { padding-top: 48px; }.message-text { font-size: 15px; }
  .section-shell { width: min(100% - 36px, 980px); }.opening-sparkle.sparkle-one { left: 9%; }.opening-sparkle.sparkle-two { right: 8%; }
  .music-control { right: 12px; bottom: 12px; }.music-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
