:root {
  color-scheme: dark;
  --ink: #f6e9eb;
  --ink-soft: #c6adb4;
  --rose: #ff8da8;
  --rose-deep: #f3a0b2;
  --rose-light: #2c171f;
  --cream: #0b080c;
  --paper: #fffaf7;
  --gold: #976b4a;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 6%, rgba(112,32,61,.24), transparent 48%),
    radial-gradient(ellipse at 10% 48%, rgba(87,25,61,.12), transparent 44%),
    linear-gradient(155deg, #0d090e 0%, #080609 55%, #10090f 100%);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button { color: inherit; font: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 28rem;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
  opacity: .62;
}

.ambient-one { top: 15vh; left: -20rem; background: radial-gradient(circle, #742744 0%, transparent 70%); }
.ambient-two { right: -20rem; bottom: 5vh; background: radial-gradient(circle, #64213a 0%, transparent 68%); }

.site-header {
  position: relative;
  z-index: 10;
  width: min(1120px, calc(100% - 56px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-soft); text-decoration: none; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.wordmark-flower { color: var(--rose); font-size: 20px; }
.music-control { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 15px; border: 1px solid rgba(255,141,168,.23); border-radius: 999px; background: rgba(30,17,25,.76); color: var(--ink-soft); font-size: 12px; transition: background .2s, border-color .2s, transform .2s; }
.music-control:not(:disabled) { cursor: pointer; }
.music-control:not(:disabled):hover { transform: translateY(-1px); border-color: rgba(255,141,168,.55); background: #291720; }
.music-control:disabled { opacity: .75; }
.music-icon { color: var(--rose); font-size: 17px; }
.music-equalizer { display: inline-flex; height: 13px; gap: 2px; align-items: center; opacity: 0; }
.music-control.is-playing .music-equalizer { opacity: 1; }
.music-equalizer i { display: block; width: 2px; height: 5px; border-radius: 2px; background: var(--rose); animation: equalize .75s ease-in-out infinite alternate; }
.music-equalizer i:nth-child(2) { height: 10px; animation-delay: .15s; }
.music-equalizer i:nth-child(3) { height: 7px; animation-delay: .3s; }

.hero { position: relative; padding: 38px 24px 24px; text-align: center; }
.eyebrow { display: flex; justify-content: center; align-items: center; gap: 9px; color: var(--rose); font-size: 10px; font-weight: 700; letter-spacing: .19em; text-transform: uppercase; }
.eyebrow span { font-size: 15px; }
h1, h2, p { margin-top: 0; }
.hero h1 { margin: 15px 0 10px; font-family: var(--serif); font-size: clamp(40px, 5.5vw, 63px); font-weight: 500; line-height: 1.08; letter-spacing: -.035em; }
.hero h1 em, .section-heading h2 em { color: var(--rose); font-weight: 500; }
.phone-break { display: none; }
.hero-intro { margin: 0 auto; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }

.envelope-stage { position: relative; width: min(480px, 90vw); margin: 26px auto 0; perspective: 1200px; }
.envelope-halo { position: absolute; z-index: -1; inset: 13% -6% -8%; border-radius: 50%; background: radial-gradient(ellipse, rgba(255,112,153,.3), rgba(151,53,89,.11) 54%, transparent 75%); filter: blur(14px); }
.envelope-button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.envelope-button:focus-visible { outline: 3px solid rgba(255,141,168,.65); outline-offset: 8px; border-radius: 12px; }
.envelope { position: relative; display: block; width: 100%; aspect-ratio: 1.78; filter: drop-shadow(0 20px 25px rgba(115,73,70,.16)); transform-style: preserve-3d; }
.envelope-back { position: absolute; inset: 0; z-index: 1; border: 1px solid rgba(152,90,89,.18); border-radius: 11px; background: linear-gradient(135deg, #e8b2a7, #e9b9ad 45%, #dc9f9b); }
.envelope-letter-peek { position: absolute; z-index: 2; top: 12%; right: 9%; left: 9%; height: 83%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 9px; padding: 20px 10px; border: 1px solid rgba(179,141,119,.22); border-radius: 5px 5px 0 0; background: linear-gradient(#fffdf9, #faf1e8); box-shadow: 0 4px 12px rgba(80,49,45,.08); color: #956d68; font-family: var(--serif); font-size: clamp(15px, 2.4vw, 20px); transition: transform .95s cubic-bezier(.2,.8,.18,1); }
.peek-heart { color: var(--rose); font-size: 23px; }
.envelope-front { position: absolute; z-index: 4; inset: 0; border-radius: 0 0 11px 11px; background: linear-gradient(140deg,#f0c6b9,#edb9ac 48%,#df9c99); clip-path: polygon(0 0,50% 55%,100% 0,100% 100%,0 100%); }
.envelope-flap { position: absolute; z-index: 5; inset: 0 0 auto; height: 59%; transform-origin: 50% 0; transform-style: preserve-3d; backface-visibility: visible; border-radius: 10px 10px 0 0; background: linear-gradient(145deg, #f2d1c2 0%, #e8afa7 80%); clip-path: polygon(0 0,100% 0,50% 100%); transition: transform .85s cubic-bezier(.2,.8,.18,1), filter .6s; }
.wax-seal { position: absolute; z-index: 6; top: 39%; left: 50%; display: grid; width: 45px; aspect-ratio: 1; place-items: center; border: 2px solid rgba(255,231,218,.45); border-radius: 50%; background: radial-gradient(circle at 32% 27%, #d68c8a, #a95160 75%); box-shadow: 0 3px 8px rgba(102,45,57,.23), inset 0 1px 4px rgba(255,255,255,.35); color: #fff1ea; font-family: var(--serif); font-size: 23px; transform: translateX(-50%); transition: transform .5s, opacity .35s; }
.envelope-button.is-open .envelope-letter-peek { transform: translateY(-70%); }
.envelope-button.is-open .envelope-flap { transform: rotateX(180deg); filter: brightness(1.05); }
.envelope-button.is-open .wax-seal { opacity: 0; transform: translate(-50%,15px) scale(.6); }
.envelope-button.is-open .envelope { filter: drop-shadow(0 16px 20px rgba(115,73,70,.1)); }
.open-caption { margin-top: 14px; color: var(--rose-deep); font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; transition: opacity .3s; }
.envelope-stage.is-open { display: none; }

.letter-drawer { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows 1s cubic-bezier(.2,.8,.18,1), opacity .65s, visibility 0s linear 1s; }
.letter-drawer-inner { min-height: 0; overflow: hidden; }
.letter-drawer.is-open { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows 1s cubic-bezier(.2,.8,.18,1), opacity .65s, visibility 0s; }
.letter-drawer.is-open .letter-paper { position: relative; z-index: 21; animation: letter-rise .9s cubic-bezier(.16,.8,.3,1) both; }
.letter-paper { position: relative; width: min(700px, calc(100% - 40px)); margin: 7px auto 0; padding: clamp(30px, 5vw, 53px) clamp(24px, 7vw, 70px) 28px; overflow: hidden; border: 1px solid rgba(213,174,156,.45); border-radius: 5px; background:
  radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.98), transparent 54%),
  repeating-linear-gradient(0deg, rgba(169,138,108,.025), rgba(169,138,108,.025) 1px, transparent 1px, transparent 5px),
  var(--paper);
  box-shadow: 0 18px 45px rgba(0,0,0,.4), 0 0 20px rgba(255,141,168,.12);
  text-align: center;
}
.letter-paper::before, .letter-paper::after { position: absolute; width: 110px; height: 110px; color: rgba(187,111,120,.18); font-family: var(--serif); font-size: 89px; line-height: 1; pointer-events: none; }
.letter-paper::before { content: "❧"; top: -8px; left: -19px; transform: rotate(-35deg); }
.letter-paper::after { content: "❧"; right: -19px; bottom: 30px; transform: rotate(145deg); }
.letter-topline { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .19em; }
.letter-top-heart { font-size: 15px; color: var(--rose); }
.letter-paper h2 { margin: 17px 0 13px; font-family: var(--serif); font-size: clamp(34px, 5vw, 48px); font-weight: 500; letter-spacing: -.035em; color: #543c40; }
.letter-rule { display: flex; align-items: center; justify-content: center; gap: 9px; width: min(180px, 55%); margin: 0 auto 26px; color: var(--rose); font-size: 14px; }
.letter-rule::before, .letter-rule::after { height: 1px; flex: 1; background: linear-gradient(90deg, transparent, rgba(187,111,120,.43)); content: ""; }
.letter-rule::after { transform: scaleX(-1); }
.letter-paper p { margin: 0 auto 13px; max-width: 520px; color: #705c5f; font-size: 14px; line-height: 1.78; text-align: left; }
.letter-paper .letter-salutation { margin-bottom: 13px; color: var(--rose-deep); font-family: var(--serif); font-size: 21px; text-align: center; }
.letter-signoff { display: flex; flex-direction: column; gap: 2px; margin: 26px 0 8px; color: var(--ink-soft); font-family: var(--serif); font-size: 18px; }
.letter-signoff strong { color: var(--rose-deep); font-size: 27px; font-weight: 500; }
.letter-signoff strong span { color: var(--rose); font-size: 20px; }
.close-letter { position: relative; z-index: 1; padding: 9px 14px; border: 1px solid transparent; border-radius: 20px; background: transparent; color: #a08986; cursor: pointer; font-size: 11px; transition: color .2s, border-color .2s, background .2s; }
.close-letter:hover { border-color: #ecd8d1; background: #fff8f4; color: #995064; }
.close-letter span { padding-right: 5px; }

.memories-drawer { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows .8s cubic-bezier(.2,.8,.18,1), opacity .5s, visibility 0s linear .8s; }
.memories-drawer-inner { min-height: 0; overflow: hidden; }
.memories-drawer.is-open { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows .8s cubic-bezier(.2,.8,.18,1), opacity .5s, visibility 0s; }
.memories { width: min(830px, calc(100% - 40px)); margin: 12px auto 36px; }
.section-heading { margin-bottom: 18px; text-align: center; }
.section-heading .eyebrow { font-size: 9px; }
.section-heading h2 { margin: 11px 0 7px; font-family: var(--serif); font-size: clamp(29px, 4vw, 39px); font-weight: 500; letter-spacing: -.025em; }
.section-heading p { color: var(--ink-soft); font-size: 13px; }
.carousel { max-width: 700px; margin: 0 auto; }
.carousel-frame { position: relative; min-height: 295px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(255,141,168,.2); border-radius: 8px; background: linear-gradient(135deg,#1b1118,#120d13); box-shadow: 0 14px 42px rgba(0,0,0,.32), 0 0 18px rgba(255,141,168,.06); perspective: 1000px; }
.carousel-empty { display: flex; max-width: 340px; flex-direction: column; align-items: center; gap: 10px; padding: 40px 24px; color: var(--ink-soft); text-align: center; }
.empty-flower { margin-bottom: 4px; color: #ff94ac; font-size: 37px; filter: drop-shadow(0 0 12px rgba(255,111,151,.65)); }
.carousel-empty strong { color: var(--ink); font-family: var(--serif); font-size: 23px; font-weight: 500; }
.carousel-empty span:last-child { font-size: 12px; line-height: 1.7; }
.carousel-empty code { color: var(--rose-deep); font-size: 11px; }
.carousel-slide { position: absolute; inset: 0; overflow: hidden; background: #eadbd6; transform-origin: center; animation: photo-arrive .55s cubic-bezier(.16,.8,.3,1) both; }
.carousel-slide[hidden] { display: none; }
.carousel-slide.carousel-arrive { animation: photo-arrive .55s cubic-bezier(.16,.8,.3,1) both; }
.carousel-slide img { display: block; width: 100%; height: 100%; min-height: 315px; max-height: 500px; object-fit: cover; }
.photo-caption { position: absolute; right: 0; bottom: 0; left: 0; display: flex; align-items: center; gap: 8px; padding: 35px 22px 16px; background: linear-gradient(transparent,rgba(41,25,29,.61)); color: white; font-size: 12px; text-shadow: 0 1px 4px rgba(0,0,0,.25); }
.photo-heart { font-size: 19px; }
.carousel-arrow { position: absolute; z-index: 1; top: 50%; display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(255,255,255,.56); border-radius: 50%; background: rgba(255,250,246,.86); box-shadow: 0 3px 13px rgba(40,20,20,.12); color: var(--rose-deep); cursor: pointer; font-family: var(--serif); font-size: 28px; line-height: 1; transform: translateY(-50%); transition: transform .2s, background .2s; }
.carousel-arrow:hover { background: white; transform: translateY(-50%) scale(1.07); }
.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }
.carousel-footer { min-height: 31px; display: flex; align-items: center; justify-content: space-between; padding: 12px 3px 0; color: #a58d89; font-size: 10px; }
.carousel-dots { display: flex; gap: 7px; }
.carousel-dot { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 9px; background: #63404c; cursor: pointer; transition: width .25s, background .25s; }
.carousel-dot.is-active { width: 18px; background: var(--rose); }
.page-footer { display: flex; justify-content: center; gap: 9px; margin: 8px 0 38px; color: #a58d89; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.page-footer span { color: var(--rose); }

.rose-rain { position: fixed; z-index: 20; inset: 0; overflow: hidden; pointer-events: none; }
.falling-rose { position: absolute; top: -52px; display: grid; width: 45px; height: 55px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: radial-gradient(circle, rgba(255,106,151,.19), transparent 68%); color: #ff7298; cursor: pointer; font-family: var(--sans); font-size: 27px; line-height: 1; pointer-events: auto; text-shadow: 0 0 8px rgba(255,242,246,.7), 0 0 19px rgba(255,67,123,.8); filter: drop-shadow(0 0 8px rgba(255,75,130,.72)); animation: rose-fall var(--fall-time, 9s) linear forwards, rose-glow 2.3s ease-in-out infinite; will-change: transform, filter; }
.falling-rose::after { position: absolute; inset: 0; content: ""; }
.falling-rose:hover, .falling-rose:focus-visible { filter: drop-shadow(0 3px 9px rgba(124,41,58,.42)); transform: scale(1.2); outline: 0; }
.rose-message { position: fixed; z-index: 30; bottom: 28px; left: 50%; max-width: calc(100vw - 32px); padding: 13px 20px; border: 1px solid rgba(255,255,255,.65); border-radius: 999px; background: rgba(255,251,247,.95); box-shadow: 0 9px 30px rgba(94,56,53,.16); color: var(--rose-deep); font-family: var(--serif); font-size: 18px; opacity: 0; pointer-events: none; transform: translate(-50%,15px); transition: opacity .25s, transform .25s; white-space: nowrap; }
.rose-message.is-visible { opacity: 1; transform: translate(-50%,0); }
.music-note { position: fixed; z-index: 30; top: 77px; right: 28px; max-width: calc(100vw - 44px); padding: 9px 13px; border: 1px solid rgba(255,141,168,.2); border-radius: 12px; background: rgba(24,14,21,.95); box-shadow: 0 8px 24px rgba(0,0,0,.3); color: #f2dfe4; font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .25s; }
.music-note.is-visible { opacity: 1; }

@keyframes rose-fall { from { transform: translate3d(0,-8vh,0) rotate(-15deg); } to { transform: translate3d(var(--drift,40px),112vh,0) rotate(330deg); } }
@keyframes rose-glow { 0%,100% { filter: drop-shadow(0 0 6px rgba(255,75,130,.58)) brightness(1); } 50% { filter: drop-shadow(0 0 15px rgba(255,75,130,.96)) brightness(1.28); } }
@keyframes letter-rise { from { opacity: 0; transform: translateY(82px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes equalize { to { transform: scaleY(.35); } }
@keyframes photo-arrive { from { opacity: .5; transform: rotateY(-12deg) scale(.96); } to { opacity: 1; transform: rotateY(0) scale(1); } }

@media (max-width: 600px) {
  .site-header { width: calc(100% - 32px); height: 72px; }
  .wordmark { gap: 6px; font-size: 9px; letter-spacing: .1em; }
  .wordmark-flower { font-size: 17px; }
  .music-control { min-height: 37px; gap: 6px; padding: 0 11px; font-size: 10px; }
  .music-icon { font-size: 15px; }
  .hero { padding: 42px 18px 20px; }
  .hero h1 { margin-top: 15px; font-size: clamp(31px, 9.6vw, 46px); line-height: 1.1; }
  .phone-break { display: block; }
  .hero-intro { max-width: 290px; font-size: 13px; }
  .envelope-stage { width: min(420px, 86vw); margin-top: 25px; }
  .envelope-letter-peek { gap: 5px; padding-top: 15px; }
  .wax-seal { width: 38px; font-size: 20px; }
  .letter-paper { margin-top: 5px; }
  .letter-paper { width: calc(100% - 24px); padding: 28px 22px 26px; }
  .letter-paper p { font-size: 13px; line-height: 1.85; }
  .letter-paper::before, .letter-paper::after { font-size: 65px; }
  .memories { margin-bottom: 53px; }
  .carousel-frame { min-height: 250px; }
  .carousel-slide img { min-height: 260px; }
  .music-note { top: 66px; right: 16px; }
  .rose-message { bottom: 18px; font-size: 16px; }
}

@media (max-width: 360px) {
  .site-header { width: calc(100% - 24px); }
  .wordmark { font-size: 8px; letter-spacing: .08em; }
  .music-control { gap: 5px; padding: 0 9px; font-size: 9px; }
}

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