@font-face { font-family: "Playfair Display"; src: url(fonts/PlayfairDisplay.ttf); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url(fonts/PlayfairDisplay-Italic.ttf); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/Inter.ttf); font-weight: 100 900; font-display: swap; }

:root {
  --wine: #2A0E1A;
  --wine-2: #3D1426;
  --rose: #F2A7B8;
  --red: #D9435E;
  --gold: #E2B866;
  --ivory: #F5F0E6;
  --dim: rgba(245, 240, 230, 0.7);
  --paper: #FBF7F0;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 20% 0%, #5A1E35 0%, var(--wine) 55%) fixed, var(--wine);
  color: var(--ivory);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { font-family: var(--serif); font-style: italic; font-weight: 700; line-height: 1.15; margin: 0 0 16px; }
h1 { font-size: clamp(36px, 9vw, 64px); color: var(--gold); }
h2 { font-size: clamp(30px, 7vw, 44px); color: var(--gold); text-align: center; }
.eyebrow { font-size: 13px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--rose); margin: 0 0 12px; }
.lead { font-family: var(--serif); font-size: 21px; color: var(--dim); max-width: 520px; }
.caption { text-align: center; color: var(--dim); margin: 0 auto 28px; max-width: 520px; }

.screen { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 20px; position: relative; z-index: 1; }

/* floating hearts */
.hearts { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.hearts span { position: absolute; bottom: -40px; width: var(--s); height: var(--s); background: var(--rose); opacity: 0.16;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-10-9.3C.4 8.3 2.3 4 6.3 4c2.3 0 3.9 1.3 5.7 3.4C13.8 5.3 15.4 4 17.7 4c4 0 5.9 4.3 4.3 7.7C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-10-9.3C.4 8.3 2.3 4 6.3 4c2.3 0 3.9 1.3 5.7 3.4C13.8 5.3 15.4 4 17.7 4c4 0 5.9 4.3 4.3 7.7C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center/contain no-repeat;
  animation: rise var(--d) linear var(--delay) infinite; }
@keyframes rise { to { transform: translate(var(--x), -115vh) rotate(25deg); } }

.heart-big { width: 72px; height: 72px; background: var(--red); margin-bottom: 24px; animation: beat 1.4s ease-in-out infinite;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-10-9.3C.4 8.3 2.3 4 6.3 4c2.3 0 3.9 1.3 5.7 3.4C13.8 5.3 15.4 4 17.7 4c4 0 5.9 4.3 4.3 7.7C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-10-9.3C.4 8.3 2.3 4 6.3 4c2.3 0 3.9 1.3 5.7 3.4C13.8 5.3 15.4 4 17.7 4c4 0 5.9 4.3 4.3 7.7C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center/contain no-repeat; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.15); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }

/* lock */
.lock form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.question { font-family: var(--serif); font-size: 22px; color: var(--ivory); }
input { font: inherit; font-size: 18px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(242, 167, 184, 0.4); background: rgba(255, 255, 255, 0.07); color: var(--ivory); text-align: center; outline: none; }
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(226, 184, 102, 0.25); }
button, .btn { font: inherit; font-weight: 600; font-size: 17px; padding: 14px 26px; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--red), #B02A48); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; box-shadow: 0 10px 30px rgba(217, 67, 94, 0.35); }
button:active, .btn:active { transform: scale(0.97); }
.lock-msg { min-height: 1.6em; margin: 0; color: var(--rose); }
.hint { color: var(--dim); font-size: 14px; margin-top: 24px; }
.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.scroll-cue { margin-top: 40px; font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--dim); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.scroll-cue span { width: 2px; height: 36px; background: linear-gradient(var(--gold), transparent); animation: cue 1.6s ease-in-out infinite; }
@keyframes cue { 50% { transform: translateY(10px); opacity: 0.4; } }

/* timeline */
.timeline-wrap, .letters-wrap, .video-wrap { position: relative; z-index: 1; padding: 64px 16px; max-width: 760px; margin: 0 auto; }
.timeline { list-style: none; padding: 0; margin: 40px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: linear-gradient(transparent, rgba(226, 184, 102, 0.5) 8%, rgba(226, 184, 102, 0.5) 92%, transparent); transform: translateX(-1px); }
.milestone { position: relative; margin: 0 0 56px; display: flex; flex-direction: column; align-items: center; }
.milestone::before { content: ""; position: absolute; top: -10px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(226, 184, 102, 0.2); }
.polaroid { background: var(--paper); color: #3A2A2A; padding: 12px 12px 18px; border-radius: 6px; width: min(340px, 86vw); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5); transform: rotate(var(--r, -2deg)); margin-top: 18px; }
.polaroid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 35%; display: block; border-radius: 2px; background: #ddd; }
.polaroid .date { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: #B02A48; margin: 14px 0 4px; }
.polaroid h3 { font-family: var(--serif); font-style: italic; font-size: 24px; margin: 0 0 6px; color: #2A0E1A; }
.polaroid p { margin: 0; font-size: 15px; color: #5A4646; }

/* video */
.video-wrap { text-align: center; }
.video-frame { width: min(400px, 90vw); margin: 24px auto 18px; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(226, 184, 102, 0.3); background: #000; }
.video-frame video { width: 100%; display: block; aspect-ratio: 9 / 16; background: #000; }

/* letters */
.letters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
.envelope { position: relative; background: var(--paper); color: #2A0E1A; border-radius: 10px; aspect-ratio: 4 / 3; padding: 0; overflow: hidden; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45); font-family: var(--serif); font-style: italic; font-size: 18px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 14px; transition: transform 0.2s; }
.envelope::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 58%; background: #EADFCF; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.envelope::after { content: ""; position: absolute; top: 44%; left: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--red); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.envelope:hover { transform: translateY(-4px) rotate(-1deg); }
.envelope.opened { opacity: 0.75; }
dialog { border: 0; padding: 0; background: transparent; max-width: min(520px, 92vw); width: 100%; }
dialog::backdrop { background: rgba(20, 6, 14, 0.75); backdrop-filter: blur(4px); }
dialog article { background: var(--paper); color: #2A0E1A; border-radius: 14px; padding: 30px 24px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: open 0.35s ease-out; }
dialog .eyebrow { color: #B02A48; }
.letter-text { font-family: var(--serif); font-size: 20px; line-height: 1.6; white-space: pre-line; margin: 6px 0 24px; }
@keyframes open { from { transform: translateY(30px) scale(0.95); opacity: 0; } }

/* final */
.final-line { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: clamp(30px, 7vw, 46px); max-width: 600px; margin: 0 0 12px; }
.from { color: var(--gold); letter-spacing: 0.25em; text-transform: uppercase; font-size: 14px; margin: 0 0 32px; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (min-width: 720px) {
  .milestone:nth-child(odd) { align-items: flex-start; padding-right: 52%; }
  .milestone:nth-child(even) { align-items: flex-end; padding-left: 52%; }
  .milestone::before { top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
