:root {
  --bg1: #fff1f3; --bg2: #ffe0e6; --ink: #4a2530; --muted: #9a6b77;
  --rose: #e8436a; --rose-dark: #c22d55; --card: #ffffffd9;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Nunito", system-ui, sans-serif; color: var(--ink);
  background: linear-gradient(160deg, var(--bg1), var(--bg2)) fixed;
  overflow-x: hidden;
}
h1, h2, .brand { font-family: "Dancing Script", cursive; color: var(--rose-dark); }
.muted { color: var(--muted); }

/* floating hearts background */
#hearts { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.fheart {
  position: absolute; bottom: -40px; color: var(--rose); opacity: .5;
  animation: rise linear forwards;
}
@keyframes rise {
  to { transform: translateY(-110vh) rotate(25deg); opacity: 0; }
}
main, header, section, .flashes { position: relative; z-index: 1; }

.flashes { max-width: 520px; margin: 12px auto 0; padding: 0 16px; }
.flash { background: var(--card); border-left: 4px solid var(--rose); padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; }

.card { background: var(--card); backdrop-filter: blur(6px); border-radius: 20px; box-shadow: 0 10px 30px #c22d5522; padding: 24px; }
button {
  background: var(--rose); color: #fff; border: 0; border-radius: 999px;
  padding: 11px 22px; font: inherit; font-weight: 700; cursor: pointer; transition: transform .15s, background .15s;
}
button:hover { background: var(--rose-dark); transform: translateY(-1px); }
button.link { background: none; color: var(--rose-dark); padding: 4px 6px; font-weight: 600; }
button.link.danger { color: #b04; font-size: .8rem; }
input:not([type=file]) {
  width: 100%; padding: 11px 14px; border: 1.5px solid #f3c2cd; border-radius: 12px; font: inherit; background: #fff;
}
input:focus { outline: 2px solid var(--rose); outline-offset: 1px; }

/* login */
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 360px; text-align: center; display: grid; gap: 14px; }
.login h1 { margin: 0; font-size: 2.6rem; }
.login p { margin: 0; }
.login label { text-align: left; font-weight: 600; display: grid; gap: 6px; }
.big-heart { font-size: 3rem; color: var(--rose); animation: beat 1.2s infinite; }
@keyframes beat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }

/* top bar */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; }
.brand { font-size: 1.8rem; }

/* envelope + letter */
.hero { min-height: 80vh; display: grid; place-items: center; padding: 20px 16px; }
.envelope {
  position: relative; width: min(320px, 85vw); aspect-ratio: 3 / 2; cursor: pointer;
  background: #f7a8b8; border-radius: 8px; box-shadow: 0 14px 30px #c22d5533;
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-10px); } }
.envelope .pocket {
  position: absolute; inset: 0; border-radius: 8px;
  background: linear-gradient(to top right, #f48aa2 50%, transparent 50.5%) left / 50% 100% no-repeat,
              linear-gradient(to top left, #f39ab0 50%, transparent 50.5%) right / 50% 100% no-repeat;
}
.envelope .flap {
  position: absolute; inset: 0 0 auto 0; height: 60%; transform-origin: top; transition: transform .6s ease;
  background: #fbbccb; clip-path: polygon(0 0, 100% 0, 50% 100%); z-index: 2;
}
.envelope .seal {
  position: absolute; left: 50%; top: 52%; translate: -50% -50%; z-index: 3;
  width: 46px; height: 46px; border-radius: 50%; background: var(--rose); color: #fff;
  display: grid; place-items: center; font-size: 1.3rem; animation: beat 1.4s infinite;
}
.tap { position: absolute; bottom: -38px; width: 100%; text-align: center; color: var(--muted); margin: 0; }
.envelope.open { animation: none; }
.envelope.open .flap { transform: rotateX(180deg); }
.envelope.open .seal, .envelope.open .tap { opacity: 0; transition: opacity .3s; }
.envelope.gone { transition: transform .6s, opacity .6s; transform: translateY(40px) scale(.8); opacity: 0; }

.letter {
  max-width: 560px; background: #fffdfb; border-radius: 16px; padding: 32px 28px;
  box-shadow: 0 16px 40px #c22d5533; text-align: center; animation: unfold .8s ease both;
}
@keyframes unfold { from { transform: translateY(30px) scale(.95); opacity: 0; } }
.letter h2 { font-size: 2.4rem; margin: 0 0 16px; }
.letter .line {
  font-size: 1.15rem; line-height: 1.6; margin: 0 0 10px; opacity: 0;
  animation: fadeup .9s ease forwards; animation-delay: calc(.6s + var(--i) * 1.1s);
}
.letter .sign { font-family: "Dancing Script", cursive; font-size: 1.7rem; color: var(--rose-dark); margin-top: 18px; }
@keyframes fadeup { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.counter { color: var(--muted); margin: 18px 0 0; font-size: .95rem; }
/* song player, pinned to the bottom of the home page */
.song { position: fixed; z-index: 5; left: 50%; bottom: 12px; transform: translateX(-50%);
  width: min(420px, calc(100% - 32px)); border-radius: 12px; box-shadow: 0 8px 24px #c22d5533; }
.song iframe { display: block; border: 0; border-radius: 12px; }
body:has(.song) { padding-bottom: 104px; }

/* coming soon */
.soon { max-width: 960px; margin: 0 auto; padding: 20px 16px 60px; text-align: center; }
.soon > h2 { font-size: 2.4rem; margin: 0 0 20px; }
.soon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.soon-card { position: relative; padding: 22px 18px; }
.soon-card::after {
  content: "soon"; position: absolute; top: 12px; right: 12px; font-size: .7rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--rose-dark); background: #ffe0e6;
  padding: 3px 8px; border-radius: 999px;
}
.soon-icon { font-size: 2rem; }
.soon-card h3 { margin: 8px 0 6px; color: var(--rose-dark); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; }
  .letter .line { opacity: 1; }
}
