/* =========================================================
   Two Months of You & Me — style
   ========================================================= */
:root {
  --ink: #5b3a46;
  --ink-soft: #7d5a66;
  --rose: #e87a98;
  --rose-deep: #c9567a;
  --blush: #ffd6e0;
  --petal: #ffe8ee;
  --cream: #fff8f4;
  --leaf: #7fa77a;
  --leaf-deep: #5d8a5e;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Nunito", system-ui, sans-serif;
  --hand: "Caveat", "Segoe Script", cursive;
  --ease: cubic-bezier(.22,.7,.25,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.85;
  background: var(--cream);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100vh; }

/* ---------- Background mood layers ---------- */
.sky { position: fixed; inset: 0; z-index: -2; }
.sky-layer { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; }
.sky-cover    { background: radial-gradient(ellipse at 50% 30%, #fff4f6 0%, #ffe1ea 55%, #fbcfdc 100%); }
.sky-begin    { background: radial-gradient(ellipse at 30% 10%, #fff3ea 0%, #ffe6e2 45%, #f9d6dd 100%); }
.sky-memories { background: radial-gradient(ellipse at 70% 20%, #fffafc 0%, #ffeaf2 50%, #ffdbe8 100%); }
.sky-between  { background: radial-gradient(ellipse at 50% 0%, #efe6ef 0%, #e3d6e3 50%, #d6c7d8 100%); }
.sky-thanks   { background: radial-gradient(ellipse at 50% 20%, #fff6ef 0%, #ffe6dc 50%, #f9d2cf 100%); }
.sky-finale   { background: linear-gradient(180deg, #ffd9c2 0%, #ffc4c4 45%, #f8b0c2 100%); }
body[data-mood="cover"]    .sky-cover,
body[data-mood="begin"]    .sky-begin,
body[data-mood="memories"] .sky-memories,
body[data-mood="between"]  .sky-between,
body[data-mood="thanks"]   .sky-thanks,
body[data-mood="finale"]   .sky-finale { opacity: 1; }

/* ---------- Petals ---------- */
.petals { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.petal {
  position: absolute; top: -40px;
  width: 14px; height: 11px;
  background: radial-gradient(ellipse at 30% 30%, #ffd3df, #f39ab4);
  border-radius: 80% 0 80% 0;
  opacity: .8;
  animation: fall linear forwards;
}
.petal.light { background: radial-gradient(ellipse at 30% 30%, #fff, #ffc2d3); }
@keyframes fall {
  0%   { transform: translate3d(0,0,0) rotate(0deg); }
  25%  { transform: translate3d(30px,25vh,0) rotate(90deg); }
  50%  { transform: translate3d(-20px,50vh,0) rotate(200deg); }
  75%  { transform: translate3d(35px,75vh,0) rotate(290deg); }
  100% { transform: translate3d(0,110vh,0) rotate(380deg); }
}

/* ---------- Cover ---------- */
.cover {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #fff6f8 0%, #ffe3ec 60%, #fbcddb 100%);
  transition: opacity 1.2s ease, visibility 1.2s;
  padding: 24px;
}
.cover.gone { opacity: 0; visibility: hidden; }
.cover-flowers { position: absolute; inset: 0; pointer-events: none; }
.cover-flowers svg { position: absolute; }
.cover-inner { position: relative; text-align: center; max-width: 520px; animation: rise 1.4s var(--ease) both; }
.eyebrow { font-family: var(--hand); font-size: 1.5rem; color: var(--rose-deep); }
.cover-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.4rem, 8vw, 4rem); line-height: 1.1;
  margin: 8px 0 18px; color: var(--ink);
}
.cover-sub { color: var(--ink-soft); margin-bottom: 30px; }
.btn {
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, #f08fab, #d9658a);
  border: 0; border-radius: 999px; padding: 14px 32px; cursor: pointer;
  box-shadow: 0 10px 28px -10px rgba(201,86,122,.7);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px rgba(201,86,122,.8); }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- Chapters ---------- */
.chapter { position: relative; min-height: 100vh; padding: 110px 22px 120px; overflow: hidden; }
.wrap { max-width: 640px; margin: 0 auto; position: relative; z-index: 2; }
.wrap-wide { max-width: 980px; }
.chapter-num { font-family: var(--hand); font-size: 1.4rem; color: var(--rose); letter-spacing: 2px; }
.chapter-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 6.5vw, 3.1rem); line-height: 1.15;
  margin: 2px 0 34px;
}
.wrap-wide .chapter-title, .wrap-wide .lead, .wrap-wide .chapter-num { text-align: center; }
.wrap-wide .lead { max-width: 620px; margin: 0 auto 14px; }
.chapter p.story { margin-bottom: 1.3em; }
.english-line {
  font-family: var(--serif); font-style: italic; font-size: 1.35rem; line-height: 1.5;
  color: var(--rose-deep); text-align: center; margin-top: 40px;
}

/* Location card */
.location {
  margin: 34px 0; padding: 22px 24px 22px 70px; position: relative;
  background: rgba(255,255,255,.72); border-radius: 18px;
  border: 1px solid rgba(232,122,152,.25);
  box-shadow: 0 16px 40px -24px rgba(150,70,100,.45);
  backdrop-filter: blur(4px);
}
.location::before {
  content: ""; position: absolute; left: 22px; top: 24px; width: 30px; height: 30px;
  background: var(--rose);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8 2 5 5.1 5 9c0 5.3 7 13 7 13s7-7.7 7-13c0-3.9-3-7-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8 2 5 5.1 5 9c0 5.3 7 13 7 13s7-7.7 7-13c0-3.9-3-7-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.location .loc-label { font-family: var(--hand); font-size: 1.25rem; color: var(--rose-deep); line-height: 1.2; }
.location .loc-name { font-weight: 600; font-size: 1.08rem; margin: 2px 0 4px; }
.location .loc-line { font-size: .95rem; color: var(--ink-soft); line-height: 1.6; }

/* Photos (polaroid) */
.photo-slot:empty { display: none; }
.polaroid {
  background: #fff; padding: 12px 12px 14px; border-radius: 4px;
  box-shadow: 0 18px 40px -22px rgba(120,60,80,.55);
  width: min(320px, 82%); margin: 40px auto 10px; transform: rotate(-2.5deg);
}
.polaroid:nth-of-type(even) { transform: rotate(2deg); }
.polaroid img { width: 100%; height: auto; max-height: 440px; object-fit: cover; display: block; border-radius: 2px; }
.memory .polaroid img { max-height: 380px; }
.polaroid .ph-empty {
  aspect-ratio: 4/5; display: grid; place-items: center; text-align: center;
  background: repeating-linear-gradient(45deg, #fff2f5 0 10px, #ffe9ef 10px 20px);
  border: 2px dashed #f4b6c8; border-radius: 2px; color: #d78aa2;
  font-family: var(--hand); font-size: 1.3rem; padding: 10px;
}
.polaroid figcaption { font-family: var(--hand); font-size: 1.35rem; text-align: center; margin-top: 8px; color: var(--ink-soft); }

/* Memory cards */
.day-count { text-align: center; font-family: var(--hand); font-size: 1.5rem; color: var(--rose-deep); margin-bottom: 10px; }
.memory-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px; margin-top: 40px;
}
.memory {
  background: rgba(255,255,255,.85); border-radius: 20px; padding: 24px 22px 22px;
  box-shadow: 0 18px 36px -26px rgba(150,70,100,.55);
  border: 1px solid rgba(255,182,203,.5);
  position: relative; transition: transform .45s var(--ease), box-shadow .45s;
}
.memory:nth-child(odd)  { transform: rotate(-1deg); }
.memory:nth-child(even) { transform: rotate(1deg); }
.memory:hover { transform: rotate(0) translateY(-6px); box-shadow: 0 24px 40px -24px rgba(150,70,100,.6); }
.memory .m-icon {
  font-size: 1.6rem; width: 52px; height: 52px; display: grid; place-items: center;
  background: var(--petal); border-radius: 50%; margin-bottom: 12px;
  animation: bob 3.2s ease-in-out infinite;
}
.memory:nth-child(2n) .m-icon { animation-delay: -1.4s; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-5px) rotate(4deg); } }
.memory h3 { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; line-height: 1.25; margin-bottom: 6px; }
.memory p { font-size: .98rem; line-height: 1.75; color: var(--ink-soft); }
.memory .polaroid { width: 100%; margin: 16px 0 0; transform: rotate(1.5deg); padding: 8px 8px 10px; }
.memory .polaroid .ph-empty { aspect-ratio: 4/3; }
.memory .polaroid figcaption { font-size: 1.15rem; margin-top: 4px; }

/* Section 3 — reflective */
body[data-mood="between"] { color: #5a4a57; }
#between .chapter-title { color: #6e5468; }
#between .chapter-num { color: #a98aa2; }
.soft-text p { margin-bottom: 1.45em; }
.soft-text p:first-child::first-letter {
  font-family: var(--serif); font-size: 3.2rem; float: left; line-height: .9;
  padding: 6px 10px 0 0; color: #a07592;
}
.miss-card {
  margin-top: 50px; padding: 34px 28px; text-align: center;
  background: rgba(255,255,255,.55); border-radius: 22px;
  border: 1px solid rgba(160,117,146,.25);
  box-shadow: 0 18px 40px -28px rgba(90,60,90,.6);
}
.miss-card p { font-family: var(--serif); font-style: italic; font-size: 1.35rem; line-height: 1.5; color: #7a5670; }
.miss-card p + p { margin-top: 6px; }
.miss-card p:last-child { margin-top: 16px; font-size: 1.5rem; color: #8c5577; }
.corner.muted { filter: saturate(.45) brightness(1.04); opacity: .7; }

/* Section 4 — letter */
.letter {
  background:
    linear-gradient(transparent 0 calc(1.85em - 1px), rgba(232,122,152,.13) calc(1.85em - 1px) 1.85em) 0 0/100% 1.85em,
    #fffdfb;
  padding: 40px 30px 36px; border-radius: 6px;
  box-shadow: 0 26px 50px -30px rgba(150,70,100,.55), 0 0 0 1px rgba(232,122,152,.15);
  position: relative;
}
.letter::before {
  content: ""; position: absolute; top: -14px; left: 50%; width: 110px; height: 28px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(244,170,192,.55); border-radius: 2px;
}
.letter p { margin-bottom: 1.3em; }
.letter .hl-intro { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--rose-deep); margin-top: 1.8em; }
.letter .hl {
  font-family: var(--serif); font-size: 1.35rem; line-height: 1.55; color: var(--ink);
  padding-left: 16px; border-left: 3px solid var(--blush);
}
.letter .signoff { font-family: var(--hand); font-size: 1.9rem; color: var(--rose-deep); text-align: right; margin: 26px 0 0; }

/* ---------- Corner flower clusters ---------- */
.corner { position: absolute; width: 230px; height: 230px; pointer-events: none; z-index: 1; opacity: .95; }
.corner svg { width: 100%; height: 100%; overflow: visible; }
.corner-tl { top: -30px; left: -40px; }
.corner-tr { top: -30px; right: -40px; transform: scaleX(-1); }
.corner-bl { bottom: -30px; left: -40px; transform: scaleY(-1); }
.corner-br { bottom: -30px; right: -40px; transform: scale(-1,-1); }
.sway { transform-origin: 50% 100%; animation: sway 6s ease-in-out infinite; transform-box: fill-box; }
@keyframes sway { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }

/* ---------- Finale ---------- */
.finale {
  position: relative; min-height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 90px 20px 0;
}
.sun {
  position: absolute; left: 50%; top: 56%; width: 340px; height: 340px; transform: translate(-50%,-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,240,214,1) 0%, rgba(255,214,180,.85) 35%, rgba(255,190,170,0) 70%);
  animation: glow 7s ease-in-out infinite;
}
@keyframes glow { 0%,100% { opacity: .85; transform: translate(-50%,-50%) scale(1); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.06); } }
.garden { position: absolute; left: 0; right: 0; bottom: 0; height: 46vh; min-height: 260px; z-index: 1; }
.garden svg { width: 100%; height: 100%; display: block; }
.finale-inner { position: relative; z-index: 3; width: 100%; display: flex; flex-direction: column; align-items: center; padding-bottom: 36vh; }

.scrapbook {
  position: relative; width: min(440px, 100%);
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.9), transparent 40%),
    #fffaf3;
  padding: 34px 26px 30px; text-align: center; border-radius: 6px;
  box-shadow: 0 30px 60px -30px rgba(120,50,70,.6);
  transform: rotate(-1.2deg);
}
.scrapbook.reveal.in { transform: rotate(-1.2deg); }
.tape { position: absolute; top: -12px; width: 90px; height: 26px; background: rgba(255,190,205,.75); }
.tape-l { left: 18px; transform: rotate(-8deg); }
.tape-r { right: 18px; transform: rotate(7deg); background: rgba(255,220,180,.75); }
.scrap-photo:empty { display: none; }
.scrap-photo .polaroid { margin: 0 auto 18px; width: 86%; transform: rotate(2deg); }
.scrap-photo .polaroid .ph-empty { aspect-ratio: 1/1; }
.heart-wrap { margin: 4px auto 6px; width: 38px; }
.heart { width: 38px; fill: #ec7b9c; animation: beat 1.6s ease-in-out infinite; filter: drop-shadow(0 4px 8px rgba(236,123,156,.45)); }
@keyframes beat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }
.finale-title { font-family: var(--hand); font-weight: 700; font-size: clamp(2.2rem, 8vw, 2.9rem); line-height: 1.1; color: var(--rose-deep); margin-bottom: 14px; }
.finale-sub { font-family: var(--serif); font-style: italic; font-size: 1.22rem; line-height: 1.55; color: var(--ink); }
.signature { font-family: var(--hand); font-size: 1.9rem; color: var(--ink); margin-top: 20px; }
.doodle { position: absolute; font-size: 1.3rem; color: #f2a0b8; }
.d1 { left: 14px; bottom: 16px; transform: rotate(-12deg); }
.d2 { right: 18px; bottom: 50px; color: #f6b48f; }
.d3 { right: 30px; top: 46px; font-size: 1rem; }
.replay {
  margin-top: 26px; background: rgba(255,255,255,.55); border: 0; border-radius: 999px;
  padding: 8px 20px; font-family: var(--hand); font-size: 1.25rem; color: var(--ink-soft); cursor: pointer;
}

/* ---------- Music ---------- */
.music-btn {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.85); border: 1px solid rgba(232,122,152,.35);
  border-radius: 999px; padding: 8px 14px 8px 8px; cursor: pointer;
  box-shadow: 0 10px 24px -14px rgba(150,70,100,.6); backdrop-filter: blur(6px);
  font-family: var(--sans); font-size: .82rem; color: var(--ink-soft); max-width: 70vw;
}
.music-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--rose); color: #fff; font-size: 1rem; }
.music-btn.playing .music-icon { animation: spin 4s linear infinite; }
.music-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.memory.reveal.in:nth-child(odd)  { transform: rotate(-1deg); }
.memory.reveal.in:nth-child(even) { transform: rotate(1deg); }
.memory.reveal.in:hover { transform: rotate(0) translateY(-6px); }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  body { font-size: 16.5px; line-height: 1.8; }
  .chapter { padding: 90px 20px 100px; }
  .corner { width: 150px; height: 150px; }
  .location { padding: 20px 18px 20px 58px; }
  .location::before { left: 16px; }
  .letter { padding: 32px 20px 28px; }
  .letter .hl { font-size: 1.22rem; }
  .miss-card { padding: 28px 20px; }
  .memory-grid { gap: 20px; }
  .sun { width: 240px; height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .petals { display: none; }
}
