:root {
  --wine: #551719;
  --wine-dark: #260e10;
  --red: #9f2925;
  --paper: #f2e6d3;
  --ink: #211818;
  --cream: #fff8ed;
  --line: rgba(242, 230, 211, 0.45);
  --serif: Georgia, "Times New Roman", "Songti SC", SimSun, serif;
  --sans: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--wine-dark); }
body { margin: 0; background: var(--wine-dark); color: var(--cream); font-family: var(--sans); }
button { font: inherit; }

.opening { position: fixed; inset: 0; z-index: 20; overflow: hidden; background: var(--wine-dark); transition: opacity .9s ease, visibility .9s ease; }
.opening.is-open { opacity: 0; visibility: hidden; pointer-events: none; }
.opening__photo, .hero__image, .finale__photo { position: absolute; inset: 0; background: url("assets/us-blue-sky.jpg") center / cover no-repeat; }
.opening__photo { filter: saturate(.75) contrast(1.04); transform: scale(1.04); animation: slow-zoom 12s ease-out both; }
.opening__veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 9, 11, .22), rgba(37, 7, 10, .84)); }
.opening__content { position: absolute; inset: auto 8vw 7.5vh; text-align: center; }
.eyebrow { margin: 0 0 13px; font-size: 10px; line-height: 1.2; letter-spacing: 2px; color: var(--paper); }
.opening h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: 0; }
.opening h1 { margin: 0; font-size: clamp(38px, 11vw, 54px); line-height: 1.1; }
.opening__copy { margin: 18px auto 24px; max-width: 285px; font-size: 14px; line-height: 1.8; color: rgba(255,255,255,.84); }
.seal { width: 58px; height: 58px; padding: 0; border: 1px solid rgba(255,248,237,.75); border-radius: 50%; color: var(--cream); background: rgba(70, 18, 21, .5); cursor: pointer; transition: transform .25s ease, background .25s ease; }
.seal:active { transform: scale(.92); background: var(--red); }

.story { overflow: hidden; }
.section { position: relative; min-height: 100svh; }
.hero { display: flex; align-items: flex-end; padding: calc(30px + env(safe-area-inset-top)) 8vw calc(68px + env(safe-area-inset-bottom)); }
.hero__image { filter: saturate(.8) contrast(1.06); }
.hero__shade, .finale__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 8, 11, .05) 25%, rgba(27, 7, 10, .9) 100%); }
.hero__copy { position: relative; z-index: 1; }
.hero h2 { margin: 0; max-width: 350px; font-size: clamp(42px, 12vw, 62px); line-height: 1.05; }
.hero__copy > p:last-child { margin: 18px 0 0; font-size: 15px; line-height: 1.75; color: rgba(255,248,237,.88); }
.hero strong { color: #fec8ae; font-family: var(--serif); font-size: 19px; font-weight: 400; }
.scroll-cue { position: absolute; bottom: 23px; left: 8vw; z-index: 1; margin: 0; font-size: 10px; letter-spacing: 1px; color: rgba(255,248,237,.65); }

.paper { display: grid; place-items: center; overflow: hidden; color: var(--ink); background: var(--paper); }
.paper__grain { position: absolute; inset: 0; opacity: .13; background: url("assets/paper-texture.png") center / cover; mix-blend-mode: multiply; }
.days__inner { position: relative; z-index: 1; width: min(84vw, 430px); text-align: center; }
.eyebrow--dark { color: var(--wine); }
.days h2 { margin: 12px 0 0; font-size: 25px; }
.day-number { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin: 5px 0; color: var(--wine); }
.day-number span { font-family: var(--serif); font-size: clamp(104px, 31vw, 150px); line-height: 1; }
.day-number small { font-size: 10px; letter-spacing: 2px; }
.days__note { margin: 17px 0 34px; font-size: 14px; line-height: 1.9; }
.timeline { display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--wine); font-family: var(--serif); font-size: 13px; }
.timeline i { width: 48px; height: 1px; background: var(--wine); opacity: .65; }

.memories { padding: 76px 0 86px; min-height: auto; background: var(--wine-dark); }
.section-title { padding: 0 8vw 30px; }
.section-title h2, .secret h2, .record h2, .letter h2, .finale h2 { margin: 0; font-size: clamp(32px, 9vw, 44px); line-height: 1.16; }
.section-title > p:last-child { margin: 14px 0 0; color: rgba(255,248,237,.72); font-size: 13px; line-height: 1.7; }
.memory-card { position: relative; width: 76vw; max-width: 370px; aspect-ratio: .73; margin: 0 8vw 34px; overflow: hidden; cursor: pointer; background: #111; outline: none; }
.memory-card:nth-of-type(3) { margin-left: auto; margin-right: 8vw; }
.memory-card:nth-of-type(4) { margin-left: 12vw; }
.memory-card img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.14) saturate(.72) contrast(1.07); transition: transform .6s ease; }
.memory-card--drink img { object-position: 55% 30%; }
.memory-card--sea img { object-position: 50% 51%; }
.memory-card--waterfall img { object-position: 52% 50%; }
.memory-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(33, 7, 9, .8)); pointer-events: none; }
.memory-card:active img { transform: scale(1.04); }
.memory-card__caption { position: absolute; z-index: 1; right: 16px; bottom: 15px; left: 16px; display: grid; grid-template-columns: 28px 1fr 20px; align-items: end; gap: 8px; color: var(--cream); }
.memory-card__caption span { font-family: var(--serif); font-size: 16px; color: #f1b6a1; }
.memory-card__caption p { margin: 0; font-family: var(--serif); font-size: 20px; line-height: 1.2; }
.memory-card__caption b { font-size: 20px; font-weight: 300; }

.secret { display: grid; min-height: 100svh; overflow: hidden; place-items: center; }
.secret__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.72) contrast(1.1); }
.secret__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 5, 8, .15), rgba(24, 5, 9, .82)); }
.secret__copy { position: relative; z-index: 2; align-self: start; width: 84vw; margin-top: 13vh; text-align: center; }
.secret__copy p:last-child { margin: 13px 0 0; font-size: 13px; color: rgba(255,248,237,.8); }
.cherry { position: absolute; z-index: 3; width: 46px; height: 46px; border: 1px solid rgba(255, 222, 204, .82); border-radius: 50%; background: rgba(137, 18, 24, .12); box-shadow: 0 0 0 6px rgba(117, 18, 22, .14); cursor: pointer; animation: pulse 2.6s ease-in-out infinite; }
.cherry::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
.cherry--one { top: 48.5%; left: 17%; }
.cherry--two { top: 50.5%; right: 18%; animation-delay: .45s; }
.cherry--three { top: 54.5%; left: 44%; animation-delay: .9s; }
.secret-message { position: absolute; z-index: 5; right: 8vw; bottom: 9vh; left: 8vw; min-height: 62px; padding: 16px 18px; opacity: 0; color: var(--ink); background: var(--paper); font-family: var(--serif); font-size: 17px; line-height: 1.55; text-align: center; transform: translateY(10px); transition: opacity .3s ease, transform .3s ease; }
.secret-message.is-visible { opacity: 1; transform: translateY(0); }

.record { display: grid; overflow: hidden; place-items: center; background: #100b0c; }
.record__bg { position: absolute; inset: 0; opacity: .36; background: url("assets/vinyl.png") 60% center / cover no-repeat; filter: saturate(.7); }
.record::after { content: ""; position: absolute; inset: 0; background: rgba(9,7,8,.5); }
.record__content { position: relative; z-index: 1; width: 84vw; max-width: 420px; text-align: center; }
.record__hint { margin: 13px 0 26px; font-size: 13px; color: rgba(255,248,237,.74); }
.record-player { position: relative; width: min(66vw, 290px); aspect-ratio: 1; margin: 0 auto; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.record-disc { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; background: repeating-radial-gradient(circle at center, #101010 0 2px, #252022 3px 5px, #0e0c0d 6px 9px); box-shadow: 0 11px 34px rgba(0,0,0,.52); animation: spin 3.2s linear infinite; animation-play-state: paused; }
.record-disc::before { content: ""; position: absolute; width: 49%; aspect-ratio: 1; border-radius: 50%; background: var(--red); border: 1px solid rgba(255,232,204,.6); }
.record-label { position: relative; z-index: 1; color: var(--cream); font-family: var(--serif); font-size: 14px; letter-spacing: 1px; line-height: 1.1; }
.record-arm { position: absolute; z-index: 2; top: -13%; right: -8%; width: 42%; height: 7px; border-radius: 8px; background: #c9ae82; box-shadow: 0 2px 2px #000; transform: rotate(-36deg); transform-origin: right center; transition: transform .8s ease; }
.record-arm::after { content: ""; position: absolute; left: -7px; bottom: -5px; width: 17px; height: 17px; background: #1b1818; }
.record-player.is-playing .record-disc { animation-play-state: running; }
.record-player.is-playing .record-arm { transform: rotate(-14deg); }
.now-playing { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 11px; margin: 25px 0 12px; padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; }
.now-playing p { margin: 0; min-width: 0; }
.now-playing strong, .now-playing small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing strong { font-family: var(--serif); font-size: 15px; font-weight: 400; }
.now-playing small { margin-top: 4px; color: rgba(255,248,237,.6); font-size: 10px; }
.now-playing time { color: rgba(255,248,237,.65); font-size: 10px; font-variant-numeric: tabular-nums; }
.sound-bars { display: flex; align-items: center; justify-content: center; gap: 3px; height: 22px; }
.sound-bars i { width: 2px; height: 6px; background: #f1b6a1; animation: sound-wave .7s ease-in-out infinite alternate; animation-play-state: paused; }
.sound-bars i:nth-child(2) { height: 13px; animation-delay: -.25s; }
.sound-bars i:nth-child(3) { height: 9px; animation-delay: -.45s; }
.record-player.is-playing + audio + .now-playing .sound-bars i { animation-play-state: running; }
.record__message { min-height: 40px; margin: 0; color: #f1b6a1; font-family: var(--serif); font-size: 16px; line-height: 1.5; }

.letter { overflow: hidden; background: #200b0d; }
.letter__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.65) contrast(1.08); transition: transform 1s cubic-bezier(.22,.7,.2,1), filter .8s ease; }
.letter__shade { position: absolute; inset: 0; background: rgba(23, 5, 8, .44); }
.letter__intro { position: absolute; z-index: 1; top: 11vh; right: 8vw; left: 8vw; text-align: center; }
.envelope-button { position: absolute; z-index: 2; top: 48%; left: 50%; width: min(68vw, 330px); aspect-ratio: 1.18; padding: 0; border: 0; color: var(--cream); background: transparent; cursor: pointer; transform: translate(-50%, -31%); }
.envelope-button__focus { position: absolute; inset: 12% 7% 15%; border: 1px solid rgba(255,238,218,.42); clip-path: polygon(50% 0,100% 31%,100% 100%,0 100%,0 31%); animation: envelope-breathe 2.6s ease-in-out infinite; }
.envelope-button__label { position: absolute; right: 0; bottom: -20px; left: 0; font-size: 11px; letter-spacing: 1px; text-shadow: 0 1px 8px #170407; }
.letter.is-opening .letter__image { transform: scale(1.1) translateY(2%); filter: saturate(.72) contrast(1.1) brightness(.7); }
.letter.is-opening .envelope-button { pointer-events: none; opacity: 0; transition: opacity .35s ease; }
.letter-sheet { position: absolute; z-index: 7; inset: auto 5vw 5vh; max-height: 79svh; padding: 43px 28px 28px; overflow: auto; opacity: 0; color: var(--ink); background: var(--paper); box-shadow: 0 18px 45px rgba(0,0,0,.5); pointer-events: none; transform: translateY(28%) scale(.96); transform-origin: center bottom; clip-path: inset(100% 0 0); transition: opacity .55s ease, transform .8s cubic-bezier(.22,.7,.2,1), clip-path .8s cubic-bezier(.22,.7,.2,1); }
.letter-sheet.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); clip-path: inset(0); }
.close-letter, .dialog-close { position: absolute; top: 10px; right: 14px; border: 0; color: var(--wine); background: transparent; font-size: 28px; line-height: 1; cursor: pointer; }
.letter-sheet__date { margin: 0 0 20px; color: var(--wine); font-size: 11px; letter-spacing: 1px; }
.letter-sheet h3 { margin: 0 0 18px; font-size: 24px; }
.letter-sheet p:not(.letter-sheet__date) { font-size: 15px; line-height: 1.9; }
.letter-sheet__signature { margin: 22px 0 0; color: var(--wine); font-family: var(--serif); font-size: 18px !important; text-align: right; }

.finale { display: grid; place-items: center; min-height: 100svh; }
.finale__photo { filter: saturate(.75) contrast(1.05); background-position: 55% center; }
.finale__content { position: relative; z-index: 1; width: 84vw; text-align: center; }
.finale__content > p { margin: 16px auto 23px; max-width: 290px; color: rgba(255,248,237,.8); font-size: 13px; line-height: 1.7; }
.hold-button { position: relative; width: 96px; height: 96px; padding: 0; overflow: hidden; border: 1px solid rgba(255,248,237,.8); border-radius: 50%; color: var(--cream); background: rgba(103,25,28,.32); cursor: pointer; touch-action: none; }
.hold-button__ring { position: absolute; inset: 5px; border: 1px solid rgba(255,248,237,.55); border-radius: 50%; transform: scale(0); }
.hold-button span:last-child { position: relative; z-index: 1; font-size: 12px; letter-spacing: 1px; }
.hold-button.is-holding .hold-button__ring { animation: hold-fill 1.35s linear forwards; }
.finale.is-complete h2 { color: #ffcfb8; }

.memory-dialog { width: min(84vw, 400px); padding: 44px 28px 31px; border: 0; color: var(--ink); background: var(--paper); box-shadow: 0 24px 80px rgba(0,0,0,.55); }
.memory-dialog::backdrop { background: rgba(13,6,8,.78); backdrop-filter: blur(4px); }
.memory-dialog h2 { margin: 9px 0 15px; color: var(--wine); font-size: 31px; line-height: 1.2; }
.memory-dialog p:last-child { margin: 0; font-size: 16px; line-height: 1.85; }

@keyframes slow-zoom { to { transform: scale(1.12); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px rgba(117, 18, 22, .05); transform: scale(1.06); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sound-wave { to { height: 19px; } }
@keyframes envelope-breathe { 50% { opacity: .45; transform: scale(1.025); } }
@keyframes hold-fill { to { transform: scale(1); background: rgba(255, 205, 178, .22); } }

@media (min-width: 700px) {
  body { background: #110b0c; }
  .story, .opening { width: min(100%, 560px); margin: 0 auto; box-shadow: 0 0 70px rgba(0,0,0,.35); }
  .opening { right: auto; left: 50%; width: min(100%, 560px); transform: translateX(-50%); }
  .memory-card { width: 360px; }
}

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