:root {
  --pink-50: #fff3f8;
  --pink-100: #ffe3ef;
  --pink-200: #ffc8de;
  --pink-300: #ff9fc6;
  --pink-400: #ff74ac;
  --pink-500: #ff4d94;
  --pink-600: #e8327c;
  --rose-700: #b81d62;
  --plum: #5b1a48;
  --ink: #4a1638;
  --ink-soft: #8a4a72;
  --lav: #d9c8ff;
  --gold: #ffd37e;
  --card: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 159, 198, 0.55);
  --shadow: 0 18px 50px -18px rgba(184, 29, 98, 0.45);
  --radius: 26px;
  --script: "Dancing Script", "Pacifico", cursive;
  --display: "Pacifico", "Dancing Script", cursive;
  --body: "Quicksand", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }  /* never let a layout rule un-hide something */
html { scroll-behavior: smooth; }
html { overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: linear-gradient(180deg, #ffe6f1 0%, #fff3f8 30%, #ffe9f3 60%, #fde2f5 100%);
  background-attachment: fixed;
  overflow-x: hidden; overflow-x: clip;
  min-height: 100vh;
}
body.locked { overflow: hidden; height: 100vh; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

#sky { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
#floaters { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.floater {
  position: absolute; width: 74px; opacity: .55; filter: drop-shadow(0 6px 10px rgba(184,29,98,.18));
  animation: drift linear infinite;
}
@keyframes drift {
  0%   { transform: translate3d(0, 110vh, 0) rotate(-8deg); }
  50%  { transform: translate3d(30px, 50vh, 0) rotate(8deg); }
  100% { transform: translate3d(-20px, -20vh, 0) rotate(-6deg); }
}

main { position: relative; z-index: 2; }

/* ---------------- buttons ---------------- */
.btn {
  border: 0; cursor: pointer; border-radius: 999px; padding: 14px 28px; font-weight: 700; font-size: 1.05rem;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: scale(.95); }
.btn.small { padding: 9px 18px; font-size: .92rem; }
.btn-glow {
  color: #fff;
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  box-shadow: 0 10px 30px -8px rgba(232, 50, 124, .7), inset 0 -3px 0 rgba(0,0,0,.08);
}
.btn-glow:hover { transform: translateY(-2px) scale(1.03); }
.btn-soft {
  background: #fff; color: var(--rose-700);
  box-shadow: 0 6px 18px -8px rgba(184,29,98,.45); border: 2px solid var(--pink-200);
}
.btn-soft:hover { background: var(--pink-50); }

/* ---------------- INTRO ---------------- */
#intro {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; text-align: center;
  background: linear-gradient(180deg, #120c33 0%, #2a1650 45%, #5b1a5c 100%);
  color: #fff; overflow: hidden;
  transition: opacity 1.2s ease 1.6s, visibility 0s linear 2.8s;
}
#intro::before { /* sunrise glow layer */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, #ffb3d1 0%, #ffd0e2 40%, #ffe7c4 100%);
  opacity: 0; transition: opacity 2s ease;
}
.awake #intro::before { opacity: 1; }
.awake #intro { opacity: 0; visibility: hidden; }
.stars { position: absolute; inset: 0; transition: opacity 1.5s ease; }
.stars i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff;
  animation: twinkle 2.6s ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity: .2; transform: scale(.7);} 50% { opacity: 1; transform: scale(1.2);} }
.awake .stars { opacity: 0; }
.moon {
  position: absolute; top: 9%; right: 12%; width: 74px; height: 74px; border-radius: 50%;
  box-shadow: -14px 8px 0 4px #ffe9b0; transform: rotate(-20deg);
  transition: transform 2s ease, opacity 1.5s ease;
}
.awake .moon { transform: translateY(-40vh) rotate(-20deg); opacity: 0; }
.sun {
  position: absolute; left: 50%; bottom: -160px; width: 180px; height: 180px; margin-left: -90px; border-radius: 50%;
  background: radial-gradient(circle, #fff6c9 0%, #ffd37e 45%, #ff9fc6 100%);
  box-shadow: 0 0 80px 30px rgba(255, 211, 126, .6);
  transition: transform 2.2s cubic-bezier(.2,.8,.2,1);
}
.awake .sun { transform: translateY(-62vh); }
.intro-inner { position: relative; padding: 24px; max-width: 520px; transition: transform 1.4s ease, opacity 1s ease; }
.awake .intro-inner { transform: translateY(-30px) scale(.96); opacity: 0; }
.intro-gif {
  width: 190px; height: 190px; object-fit: contain; margin: 0 auto 10px; border-radius: 50%;
  background: rgba(255,255,255,.08); padding: 10px; box-shadow: 0 0 0 10px rgba(255,255,255,.04);
  animation: bob 3s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.intro-kicker { font-family: var(--script); font-size: 1.6rem; margin: 0; opacity: .8; }
.intro-title { font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 7vw, 2.8rem); margin: 4px 0 6px; line-height: 1.25; }
.intro-sub { margin: 0 0 26px; opacity: .85; font-size: 1.05rem; }
.intro-hint { margin-top: 18px; font-size: .85rem; opacity: .6; }
#wakeBtn { animation: pulse 1.8s ease-in-out infinite; font-size: 1.15rem; padding: 16px 34px; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,116,172,.7);} 50% { box-shadow: 0 0 0 18px rgba(255,116,172,0);} }

/* ---------------- lock screen ---------------- */
.login .intro-gif { width: 150px; height: 150px; }
.login-input {
  display: block; width: min(300px, 82vw); margin: 0 auto 12px; padding: 14px 20px; border-radius: 999px;
  border: 2px solid rgba(255, 200, 222, .45); background: rgba(255, 255, 255, .12); color: #fff;
  font: 600 16px var(--body); /* 16px stops iPhone from zooming in on focus */ outline: none; text-align: center;
  transition: border-color .2s ease, background .2s ease; -webkit-appearance: none; appearance: none;
}
.login-input::placeholder { color: rgba(255, 255, 255, .65); }
.login-input:focus { border-color: var(--pink-300); background: rgba(255, 255, 255, .2); }
.pass-wrap { position: relative; width: min(300px, 82vw); margin: 0 auto; }
.pass-wrap .login-input { width: 100%; padding-right: 52px; padding-left: 52px; }
.peek { position: absolute; right: 8px; top: 6px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 1.2rem; cursor: pointer; }
#loginBtn { margin-top: 6px; }
.login-msg { min-height: 1.5em; margin: 14px auto 0; max-width: 320px; font-weight: 600; color: #ffd0e2; line-height: 1.4; }
.login.shake { animation: shake .45s ease; }
@keyframes shake { 0%,100% { transform: translateX(0);} 20% { transform: translateX(-12px);} 40% { transform: translateX(10px);} 60% { transform: translateX(-7px);} 80% { transform: translateX(5px);} }
.login.unlocking { transition: opacity .8s ease, transform .8s ease; opacity: 0; transform: scale(.9); }

/* ---------------- sections ---------------- */
.section { padding: 70px 18px; max-width: 1100px; margin: 0 auto; position: relative; }
.center { text-align: center; }
.section-title {
  font-family: var(--display); font-weight: 400; color: var(--rose-700);
  font-size: clamp(1.7rem, 5.5vw, 2.6rem); margin: 0 0 8px; line-height: 1.25;
}
.section-sub { color: var(--ink-soft); margin: 0 0 26px; }
.card {
  background: var(--card); border: 1.5px solid var(--card-border); border-radius: var(--radius);
  box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- HERO ---------------- */
#hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-top: 40px; }
.hero-stickers { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 4px; margin-bottom: 8px; }
.hero-stickers { max-width: 100%; }
.hero-main { width: min(260px, 54vw); aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 16px 24px rgba(184,29,98,.25)); animation: bob 3.4s ease-in-out infinite; }
.hero-sticker { width: min(110px, 20vw); aspect-ratio: 1; object-fit: contain; opacity: .95; }
.hero-sticker.left { animation: wiggle 2.8s ease-in-out infinite; }
.hero-sticker.right { animation: wiggle 3.1s ease-in-out infinite reverse; }
@keyframes wiggle { 0%,100% { transform: rotate(-7deg) translateY(0);} 50% { transform: rotate(7deg) translateY(-8px);} }
.kicker { font-family: var(--script); font-size: 1.5rem; color: var(--pink-600); margin: 0; }
.hero-title { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 9vw, 4.4rem); line-height: 1.15; margin: 4px 0 14px; color: var(--plum); }
.hero-title .script {
  font-family: var(--script); font-weight: 700; font-size: 1.25em;
  background: linear-gradient(90deg, var(--pink-500), #ff8fb8, var(--rose-700), var(--pink-500));
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite; display: inline-block; padding: 0 .15em;
}
@keyframes shimmer { to { background-position: 300% 0; } }
.typer { min-height: 3.2em; font-size: clamp(1rem, 4vw, 1.25rem); color: var(--ink-soft); max-width: 620px; margin: 0 auto; font-weight: 500; }
.caret { animation: blink 1s steps(1) infinite; color: var(--pink-500); margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

.together { margin-top: 22px; }
.together > p { margin: 0 0 8px; font-family: var(--script); font-size: 1.4rem; color: var(--rose-700); }
.counter { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.counter div {
  background: #fff; border: 1.5px solid var(--pink-200); border-radius: 18px; padding: 10px 12px; min-width: 70px;
  box-shadow: 0 8px 20px -12px rgba(184,29,98,.5);
}
.counter b { display: block; font-size: 1.6rem; color: var(--pink-600); font-variant-numeric: tabular-nums; }
.counter span { font-size: .75rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; }
.anniv-line { margin: 12px 0 0 !important; font-family: var(--body) !important; font-size: 1rem !important; color: var(--ink) !important; font-weight: 600; }

.scroll-cue { margin-top: 30px; color: var(--ink-soft); text-decoration: none; font-size: .9rem; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.scroll-cue i { width: 24px; height: 38px; border: 2px solid var(--pink-400); border-radius: 14px; position: relative; }
.scroll-cue i::after { content: ""; position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--pink-500); animation: scrolly 1.6s ease-in-out infinite; }
@keyframes scrolly { 0% { transform: translateY(0); opacity: 1;} 100% { transform: translateY(14px); opacity: 0;} }

/* ---------------- NOTE ---------------- */
.note-card { display: grid; grid-template-columns: 220px 1fr; gap: 26px; align-items: center; padding: 28px; }
.note-gif { width: 100%; border-radius: 20px; background: var(--pink-50); }
.note-text { font-size: 1.12rem; line-height: 1.75; margin: 0; }
.note-weather { color: var(--ink-soft); font-size: .9rem; margin: 14px 0 0; }

/* ---------------- TIMELINE ---------------- */
.big15 {
  margin: 0 auto 30px; width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; align-content: center;
  background: radial-gradient(circle at 30% 30%, #fff, var(--pink-200));
  box-shadow: 0 0 0 10px rgba(255,159,198,.25), 0 0 0 22px rgba(255,159,198,.12), var(--shadow);
  animation: heartbeat 1.6s ease-in-out infinite;
}
.big15 span { font-family: var(--display); font-size: 4.2rem; line-height: 1; color: var(--pink-600); }
.big15 small { font-family: var(--script); font-size: 1.4rem; color: var(--rose-700); }
@keyframes heartbeat { 0%,100% { transform: scale(1);} 15% { transform: scale(1.07);} 30% { transform: scale(1);} 45% { transform: scale(1.05);} }
.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: linear-gradient(var(--pink-200), var(--pink-500), var(--pink-200)); border-radius: 3px; }
.timeline li { position: relative; width: 50%; padding: 0 34px 34px; opacity: 0; transform: translateY(30px); transition: all .8s cubic-bezier(.2,.8,.2,1); }
.timeline li.in { opacity: 1; transform: none; }
.timeline li:nth-child(odd) { left: 0; text-align: right; }
.timeline li:nth-child(even) { left: 50%; }
.timeline .dot {
  position: absolute; top: 4px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem;
  background: #fff; border: 3px solid var(--pink-400); box-shadow: 0 6px 16px -6px rgba(184,29,98,.6);
}
.timeline li:nth-child(odd) .dot { right: -22px; }
.timeline li:nth-child(even) .dot { left: -22px; }
.timeline .tl-card { padding: 16px 18px; }
.timeline .when { font-family: var(--script); color: var(--pink-600); font-size: 1.3rem; }
.timeline h3 { margin: 2px 0 6px; font-size: 1.1rem; color: var(--plum); }
.timeline p { margin: 0; color: var(--ink-soft); line-height: 1.55; font-size: .97rem; }

/* ---------------- LONG DISTANCE ---------------- */
.ld-map { position: relative; max-width: 560px; height: 120px; margin: 0 auto 26px; }
.ld-path { position: absolute; left: 8%; right: 8%; top: 18px; width: 84%; height: 80px; overflow: visible; }
.ld-path path { fill: none; stroke: var(--pink-400); stroke-width: 3; stroke-dasharray: 8 9; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -34; } }
.ld-pin { position: absolute; bottom: 0; display: flex; flex-direction: column; align-items: center; font-size: 2rem; }
.ld-pin small { font-size: .85rem; font-weight: 700; color: var(--rose-700); background: #fff; padding: 3px 10px; border-radius: 999px; border: 1.5px solid var(--pink-200); }
.ld-pin.him { left: 0; } .ld-pin.her { right: 0; }
.ld-traveller { position: absolute; left: 0; top: 0; font-size: 1.7rem; will-change: transform; }
.hug-wrap { display: flex; flex-direction: column; align-items: center; }
.hug-btn {
  position: relative; width: 230px; height: 230px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: #fff; box-shadow: var(--shadow); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .2s ease;
}
.hug-btn.holding { transform: scale(.94); }
.hug-btn img { position: absolute; inset: 22px; width: calc(100% - 44px); height: calc(100% - 44px); object-fit: contain; border-radius: 50%; pointer-events: none; }
.hug-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hug-ring circle { fill: none; stroke-width: 8; stroke: var(--pink-100); }
.hug-ring #hugProgress { stroke: var(--pink-500); stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; }
.hug-text { margin-top: 18px; font-weight: 600; color: var(--rose-700); text-align: center; min-height: 3em; max-width: 420px; }
.meet-line { text-align: center; font-family: var(--script); font-size: 1.6rem; color: var(--pink-600); margin: 10px 0 0; }

/* ---------------- chips / mood ---------------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 22px; }
.chip {
  border: 2px solid var(--pink-200); background: #fff; color: var(--rose-700); border-radius: 999px; padding: 9px 16px; font-weight: 700; cursor: pointer;
  transition: all .2s ease; font-size: .95rem;
}
.chip:hover { transform: translateY(-2px); border-color: var(--pink-400); }
.chip.on { background: linear-gradient(135deg, var(--pink-400), var(--pink-600)); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -8px rgba(232,50,124,.7); }
.chip .n { opacity: .65; font-weight: 500; margin-left: 4px; font-size: .8em; }
.mood-result { max-width: 460px; margin: 0 auto; text-align: center; animation: popIn .5s cubic-bezier(.2,1.4,.4,1); }
.mood-result img { width: 260px; height: 260px; object-fit: contain; margin: 0 auto 14px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); padding: 8px; }
.mood-result p { font-size: 1.12rem; line-height: 1.6; margin: 0 0 16px; font-weight: 500; }
@keyframes popIn { from { transform: scale(.6); opacity: 0;} to { transform: none; opacity: 1;} }

/* ---------------- reasons ---------------- */
.reason-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; perspective: 1200px; }
.reason { height: 230px; cursor: pointer; position: relative; border: 0; background: none; padding: 0; perspective: 1000px; -webkit-perspective: 1000px; display: block; width: 100%; }
.reason-inner { position: absolute; inset: 0; transform-style: preserve-3d; -webkit-transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.reason.flipped .reason-inner { transform: rotateY(180deg); }
/* don't rely on backface-visibility alone: swap the visible face exactly halfway through the flip */
.reason .front { visibility: visible; transition: visibility 0s linear .4s; }
.reason .back  { visibility: hidden;  transition: visibility 0s linear .4s; }
.reason.flipped .front { visibility: hidden; }
.reason.flipped .back  { visibility: visible; }
.reason .face {
  position: absolute; inset: 0; border-radius: 22px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; text-align: center;
}
.reason .front { transform: rotateY(0deg) translateZ(1px); background: linear-gradient(145deg, #fff, var(--pink-100)); border: 1.5px solid var(--pink-200); box-shadow: var(--shadow); }
.reason .front img { width: 120px; height: 120px; object-fit: contain; }
.reason .front b { font-family: var(--display); font-weight: 400; color: var(--pink-600); font-size: 1.4rem; margin-top: 6px; }
.reason .back { transform: rotateY(180deg) translateZ(1px); background: linear-gradient(145deg, var(--pink-400), var(--rose-700)); color: #fff; font-size: 1.08rem; line-height: 1.55; font-weight: 600; box-shadow: var(--shadow); }
.reason .back::before { content: "💗"; font-size: 1.6rem; margin-bottom: 8px; }

/* ---------------- kiss ---------------- */
#kiss { text-align: center; }
.kiss-btn { border: 0; background: #fff; border-radius: 50%; width: 240px; height: 240px; padding: 16px; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s ease; margin: 0 auto; display: block; }
.kiss-btn:active { transform: scale(.9); }
.kiss-btn img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.kiss-count { font-size: 1.3rem; margin: 18px 0 4px; }
.kiss-count b { color: var(--pink-600); font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.kiss-msg { font-family: var(--script); font-size: 1.5rem; color: var(--rose-700); min-height: 1.6em; margin: 0; }

/* ---------------- question ---------------- */
.q-card { max-width: 620px; margin: 0 auto; text-align: center; padding: 30px 22px; position: relative; }
.q-gif { width: 190px; height: 190px; object-fit: contain; margin: 0 auto 10px; }
.q-title { font-family: var(--display); font-weight: 400; font-size: clamp(1.4rem, 5vw, 2rem); color: var(--plum); margin: 0 0 24px; line-height: 1.35; }
.q-actions { display: flex; justify-content: center; align-items: center; gap: 16px; min-height: 70px; flex-wrap: wrap; }
#noBtn { transition: transform .25s ease, left .25s ease, top .25s ease; }
#noBtn.runaway { position: fixed; z-index: 60; }

/* ---------------- wall ---------------- */
.wall-tools { display: flex; gap: 10px; justify-content: center; margin-bottom: 22px; }
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.meme {
  margin: 0; border-radius: 18px; overflow: hidden; background: #fff; cursor: zoom-in; position: relative; aspect-ratio: 1;
  box-shadow: 0 10px 26px -14px rgba(184,29,98,.55); border: 1.5px solid var(--pink-100);
  opacity: 0; transform: translateY(20px) scale(.97); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1);
}
.meme.in { opacity: 1; transform: none; }
.meme.sticker { background: linear-gradient(145deg, #fff, var(--pink-50)); padding: 10px; }
.meme img { width: 100%; height: 100%; object-fit: contain; background: var(--pink-50); }
.meme.sticker img { background: transparent; }
.meme:hover { box-shadow: 0 16px 34px -14px rgba(184,29,98,.75); }
.wall-sentinel { display: grid; place-items: center; padding: 30px; }
.loader { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--pink-200); border-top-color: var(--pink-500); animation: spin 1s linear infinite; }
.wall-sentinel.done .loader { display: none; }
.wall-sentinel.done::after { content: "that's all of them… for now 💗"; color: var(--ink-soft); font-family: var(--script); font-size: 1.4rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- letter ---------------- */
.envelope { position: relative; width: min(360px, 88vw); height: min(240px, 58vw); margin: 40px auto 0; cursor: pointer; transition: margin .8s ease; }
.envelope:focus-visible { outline: 3px dashed var(--pink-400); outline-offset: 8px; border-radius: 10px; }
.env-back, .env-front, .env-flap { position: absolute; inset: 0; border-radius: 12px; }
.env-back { background: var(--pink-400); }
.env-back { box-shadow: var(--shadow); }
.env-front { z-index: 3; background: linear-gradient(160deg, var(--pink-300), var(--pink-200)); clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%); }
.env-flap {
  z-index: 4; height: 60%; border-radius: 12px 12px 0 0; transform-origin: top; transition: transform .7s ease, z-index 0s linear .35s;
  background: linear-gradient(to bottom, var(--pink-500), var(--pink-400)); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.env-seal { position: absolute; z-index: 5; left: 50%; top: 52%; transform: translate(-50%, -50%); font-size: 2.2rem; transition: opacity .3s ease; animation: heartbeat 1.6s ease-in-out infinite; }
.envelope.open .env-flap { transform: rotateX(180deg); z-index: 1; }
.envelope.open .env-seal { opacity: 0; }
.letter {
  position: absolute; z-index: 2; left: 6%; right: 6%; top: 8%; bottom: 8%; background: #fffafc; border-radius: 10px;
  transition: transform 1s cubic-bezier(.2,.8,.2,1) .5s, height 1s ease .5s; overflow: hidden;
  box-shadow: 0 6px 20px -10px rgba(0,0,0,.25);
}
.letter-body { padding: 26px 22px; font-family: var(--script); font-size: 1.35rem; line-height: 1.6; color: var(--plum); opacity: 0; transition: opacity .6s ease 1.3s; }
.letter-body p { margin: 0 0 14px; }
.letter-body .sign { text-align: right; font-size: 1.7rem; color: var(--pink-600); }
.envelope.open { margin-top: 0; }
.envelope.open .letter { position: relative; left: auto; right: auto; top: auto; bottom: auto; transform: translateY(-20px); z-index: 6; overflow: visible; margin: 0 auto; width: 100%; height: auto; animation: rise 1.2s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: translateY(40%) scale(.85); opacity: .4;} to { transform: translateY(-20px); opacity: 1;} }
.envelope.open .letter-body { opacity: 1; }
.envelope.open { height: auto; width: min(560px, 94vw); }
.envelope.open .env-back, .envelope.open .env-front, .envelope.open .env-flap { display: none; }
.envelope.open .letter { background: radial-gradient(circle at 100% 0, var(--pink-100), transparent 40%), radial-gradient(circle at 0 100%, var(--pink-100), transparent 40%), #fffafc; border: 1.5px solid var(--pink-200); box-shadow: var(--shadow); }
.envelope.open .letter::before { content: "💗"; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 2rem; }

/* ---------------- footer ---------------- */
.footer { text-align: center; padding: 40px 18px 110px; color: var(--ink-soft); }
.footer img { width: 120px; margin: 0 auto 10px; }
.footer p { margin: 4px 0; font-family: var(--script); font-size: 1.4rem; color: var(--rose-700); }
.footer .tiny { font-family: var(--body); font-size: .8rem; color: var(--ink-soft); }

/* ---------------- music ---------------- */
.music-btn {
  position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600)); box-shadow: 0 10px 26px -8px rgba(232,50,124,.8);
  display: grid; place-items: center;
}
.vinyl { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle, #ffd0e2 0 18%, #2b0f22 19% 40%, #4a1638 41% 44%, #2b0f22 45% 100%); animation: spin 2.4s linear infinite; }
.music-btn.paused .vinyl { animation-play-state: paused; }
.eq { position: absolute; right: -4px; top: -4px; display: flex; gap: 2px; align-items: flex-end; height: 16px; background: #fff; padding: 3px 4px; border-radius: 8px; }
.eq i { width: 3px; background: var(--pink-600); animation: eq .8s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .4s; }
.music-btn.paused .eq i { animation: none; height: 3px; }
@keyframes eq { 0%,100% { height: 3px;} 50% { height: 10px;} }
.music-help { position: fixed; right: 0; bottom: 0; width: 2px; height: 2px; opacity: 0.01; overflow: hidden; pointer-events: none; z-index: 41; }
.music-help.show {
  width: 240px; height: auto; opacity: 1; overflow: visible; pointer-events: auto; right: 16px; bottom: 84px;
  background: #fff; border-radius: 18px; padding: 10px; box-shadow: var(--shadow); border: 1.5px solid var(--pink-200);
  animation: popIn .4s ease;
}
.music-help p { margin: 0 0 8px; font-weight: 700; color: var(--rose-700); text-align: center; font-size: .9rem; }
.music-help.show iframe { width: 220px !important; height: 124px !important; border-radius: 12px; }
.music-help:not(.show) p { display: none; }

/* ---------------- lightbox & celebrate ---------------- */
.lightbox, .celebrate {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  background: rgba(74, 22, 56, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fade .3s ease;
}
.lightbox[hidden], .celebrate[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.lightbox figure { margin: 0; max-width: 90vw; text-align: center; }
.lightbox img { max-width: min(90vw, 520px); max-height: 72vh; border-radius: 20px; background: #fff; margin: 0 auto; animation: popIn .35s cubic-bezier(.2,1.4,.4,1); }
.lightbox figcaption { color: #fff; margin-top: 12px; font-size: .95rem; opacity: .9; padding: 0 20px; }
.lb-close, .lb-prev, .lb-next { position: absolute; border: 0; background: rgba(255,255,255,.92); color: var(--rose-700); width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; cursor: pointer; display: grid; place-items: center; }
.lb-close { top: 18px; right: 18px; font-size: 1.2rem; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.celebrate { text-align: center; color: #fff; padding: 20px; align-content: center; gap: 14px; background: radial-gradient(circle at 50% 40%, rgba(232, 50, 124, .93), rgba(91, 26, 72, .97)); }
.celebrate img { width: min(300px, 70vw); margin: 0 auto; border-radius: 24px; background: #fff; padding: 8px; animation: popIn .6s cubic-bezier(.2,1.4,.4,1); }
.celebrate > * { max-width: calc(100vw - 40px); }
.celebrate p { font-family: var(--display); font-size: clamp(1.3rem, 5vw, 2rem); width: 560px; margin: 8px auto 10px; line-height: 1.4; }

/* tap hearts */
.tap-heart { position: fixed; z-index: 80; pointer-events: none; font-size: 22px; animation: tapHeart 1.1s ease-out forwards; }
@keyframes tapHeart { 0% { transform: translate(-50%,-50%) scale(.4); opacity: 1;} 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2) rotate(var(--rot)); opacity: 0;} }

/* ---------------- PHOTOS (polaroids) ---------------- */
.polaroids { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 26px 22px; align-items: start; padding: 10px 4px; }
.polaroid {
  margin: 0; background: #fff; padding: 12px 12px 14px; border-radius: 6px; cursor: zoom-in; position: relative;
  box-shadow: 0 14px 30px -14px rgba(91, 26, 72, .45), 0 2px 6px rgba(91,26,72,.08);
  transform: rotate(var(--tilt)) translateY(40px) scale(.95); opacity: 0;
  transition: transform .8s cubic-bezier(.2,.8,.2,1), opacity .8s ease, box-shadow .3s ease;
}
.polaroid.in { opacity: 1; transform: rotate(var(--tilt)); }
.polaroid:hover { transform: rotate(0deg) scale(1.03); z-index: 2; box-shadow: 0 22px 40px -14px rgba(184,29,98,.55); }
.polaroid img { width: 100%; height: auto; border-radius: 2px; background: var(--pink-50); }
.polaroid figcaption { text-align: center; padding-top: 10px; }
.polaroid figcaption span { display: block; font-family: var(--script); font-size: 1.35rem; color: var(--plum); line-height: 1.2; }
.polaroid figcaption small { color: var(--ink-soft); font-size: .78rem; letter-spacing: .06em; }
.polaroid .pin { position: absolute; top: -9px; left: 50%; width: 64px; height: 20px; margin-left: -32px; background: rgba(255, 159, 198, .55); transform: rotate(-3deg); border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* ---------------- FOODIE WHEEL ---------------- */
.food-wrap { display: flex; flex-wrap: wrap; gap: 30px; justify-content: center; align-items: center; }
.wheel-box { position: relative; width: min(340px, 86vw); aspect-ratio: 1; }
.wheel {
  position: absolute; inset: 0; border-radius: 50%; border: 8px solid #fff;
  box-shadow: var(--shadow), inset 0 0 0 3px rgba(255,255,255,.6);
  transition: transform 4.2s cubic-bezier(.12,.8,.12,1);
  overflow: hidden;
}
.wheel-label { position: absolute; inset: 0; display: flex; justify-content: center; pointer-events: none; }
.wheel-label span { display: flex; flex-direction: column; align-items: center; padding-top: 8%; }
.wheel-label b { font-size: clamp(1.4rem, 6vw, 1.9rem); line-height: 1; }
.wheel-label i { font-style: normal; font-weight: 700; font-size: clamp(.62rem, 2.6vw, .78rem); color: var(--plum); background: rgba(255,255,255,.85); padding: 1px 6px; border-radius: 8px; margin-top: 4px; white-space: nowrap; }
.wheel-pointer { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); z-index: 3; font-size: 2rem; color: var(--rose-700); filter: drop-shadow(0 3px 3px rgba(0,0,0,.2)); }
.spin-btn {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; width: 26%; aspect-ratio: 1; border-radius: 50%; border: 5px solid #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--pink-500), var(--rose-700)); color: #fff; font-weight: 800; letter-spacing: .05em; font-size: clamp(.8rem, 3.4vw, 1rem);
  box-shadow: 0 8px 20px -6px rgba(184,29,98,.8);
}
.spin-btn:disabled { opacity: .85; cursor: wait; }
.coupon {
  display: flex; gap: 14px; align-items: center; max-width: 380px; padding: 16px; background: #fff; border-radius: 20px; position: relative;
  border: 2px dashed var(--pink-400); box-shadow: var(--shadow); animation: popIn .5s cubic-bezier(.2,1.4,.4,1);
}
.coupon img { width: 110px; height: 110px; object-fit: contain; border-radius: 14px; background: var(--pink-50); flex: none; }
.coupon small { color: var(--pink-600); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; }
.coupon h3 { margin: 4px 0 6px; font-family: var(--display); font-weight: 400; color: var(--rose-700); font-size: 1.4rem; }
.coupon p { margin: 0; font-size: .88rem; color: var(--ink-soft); line-height: 1.5; }
.wallet { text-align: center; margin-top: 26px; }
.wallet p { margin: 0 0 10px; font-family: var(--script); font-size: 1.3rem; color: var(--rose-700); }
.wallet-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ticket { background: var(--pink-100); border: 1.5px dashed var(--pink-400); color: var(--rose-700); font-weight: 700; padding: 6px 12px; border-radius: 10px; font-size: .9rem; }

/* ---------------- COUNTDOWN (daily tiles) ---------------- */
.daily-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 12px; max-width: 900px; margin: 0 auto; }
.day-tile {
  position: relative; aspect-ratio: 1; border: 0; border-radius: 18px; cursor: pointer; padding: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: linear-gradient(145deg, var(--pink-400), var(--pink-600)); color: #fff;
  box-shadow: 0 10px 22px -12px rgba(184,29,98,.8); transition: transform .2s ease;
}
.day-tile:active { transform: scale(.94); }
.day-tile b { font-family: var(--display); font-weight: 400; font-size: 1.5rem; line-height: 1; }
.day-tile small { font-size: .7rem; font-weight: 700; opacity: .9; }
.day-tile .ico { position: absolute; top: 6px; right: 8px; font-size: .9rem; }
.day-tile.seen { background: linear-gradient(145deg, #fff, var(--pink-100)); color: var(--rose-700); border: 1.5px solid var(--pink-200); }
.day-tile.locked { background: linear-gradient(145deg, #f3e6ee, #ead6e2); color: #a77d97; box-shadow: none; }
.day-tile.today { outline: 3px solid var(--gold); outline-offset: 2px; animation: heartbeat 1.6s ease-in-out infinite; }
.day-tile.big { grid-column: span 2; aspect-ratio: auto; }
.day-tile.big b { font-size: 1.9rem; }
.day-tile.shake, .ow-env.shake { animation: shake .45s ease; }

/* ---------------- OPEN WHEN ---------------- */
.ow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; max-width: 1000px; margin: 0 auto; }
.ow-env {
  position: relative; height: 140px; border: 0; border-radius: 14px; cursor: pointer; overflow: hidden; padding: 0;
  background: linear-gradient(160deg, #fff, var(--pink-100)); box-shadow: var(--shadow); color: var(--plum);
  transition: transform .25s ease;
}
.ow-env:hover { transform: translateY(-4px) rotate(-1deg); }
.ow-flap { position: absolute; left: 0; right: 0; top: 0; height: 58%; background: linear-gradient(to bottom, var(--pink-300), var(--pink-200)); clip-path: polygon(0 0, 100% 0, 50% 100%); transition: transform .5s ease; transform-origin: top; }
.ow-emoji { position: absolute; left: 14px; bottom: 12px; font-size: 1.8rem; }
.ow-label { position: absolute; right: 14px; bottom: 12px; text-align: right; font-size: .82rem; color: var(--ink-soft); line-height: 1.3; }
.ow-label b { font-family: var(--script); font-size: 1.3rem; color: var(--rose-700); font-weight: 700; }
.ow-seal { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); font-size: 1.6rem; transition: opacity .3s ease; }
.ow-env.opened .ow-flap { transform: scaleY(-.35); opacity: .7; }
.ow-env.opened .ow-seal { opacity: 0; }
.ow-env.opened::after { content: "opened 💗"; position: absolute; top: 8px; right: 10px; font-size: .7rem; font-weight: 700; color: var(--pink-600); }

/* ---------------- MODAL ---------------- */
.modal { position: fixed; inset: 0; z-index: 72; display: grid; place-items: center; padding: 18px; background: rgba(74, 22, 56, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade .3s ease; }
.modal-card {
  position: relative; width: min(440px, 100%); max-height: 88vh; overflow-y: auto; background: #fffafc; border-radius: 26px; padding: 22px 22px 26px; text-align: center;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); animation: popIn .45s cubic-bezier(.2,1.4,.4,1);
}
.modal-card img { width: 200px; height: 200px; object-fit: contain; margin: 4px auto 10px; border-radius: 18px; background: var(--pink-50); }
.modal-card img.photo { width: 100%; height: auto; max-height: 46vh; object-fit: cover; border-radius: 14px; border: 8px solid #fff; box-shadow: 0 10px 24px -12px rgba(91,26,72,.5); transform: rotate(-1.5deg); }
.modal-card small { display: block; color: var(--pink-600); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .72rem; }
.modal-card h3 { font-family: var(--display); font-weight: 400; color: var(--rose-700); font-size: 1.6rem; margin: 6px 0 10px; line-height: 1.25; }
.modal-card p { margin: 0; font-size: 1.05rem; line-height: 1.65; color: var(--ink); }
.modal-close { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--pink-100); color: var(--rose-700); font-size: 1rem; cursor: pointer; z-index: 2; }

/* ---------------- QUIZ ---------------- */
.quiz-box { max-width: 560px; margin: 0 auto; padding: 24px 20px; text-align: center; }
.quiz-box h3 { font-family: var(--display); font-weight: 400; color: var(--plum); font-size: 1.45rem; margin: 6px 0 18px; line-height: 1.3; }
.quiz-box img { width: 170px; height: 170px; object-fit: contain; margin: 0 auto 6px; }
.quiz-n { color: var(--pink-600); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt { border: 2px solid var(--pink-200); background: #fff; color: var(--plum); border-radius: 16px; padding: 13px 16px; font-weight: 700; font-size: 1rem; cursor: pointer; transition: all .2s ease; }
.quiz-opt.right { background: #e6f9ee; border-color: #3cb371; color: #1f7a45; }
.quiz-opt.wrong { background: #ffe8ee; border-color: #e8327c; color: #b81d62; animation: shake .45s ease; }
.quiz-note { min-height: 1.4em; margin: 14px 0 10px; color: var(--ink-soft); font-weight: 600; }

/* ---------------- DISTANCE facts ---------------- */
.ld-facts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: -8px auto 22px; max-width: 560px; }
.ld-facts span { background: #fff; border: 1.5px solid var(--pink-200); color: var(--rose-700); font-weight: 700; font-size: .82rem; padding: 6px 12px; border-radius: 999px; }

/* ---------------- VOICE NOTE ---------------- */
.voice-box { display: flex; flex-direction: column; align-items: center; margin: 28px auto 0; }
.voice-btn {
  display: flex; align-items: center; gap: 14px; border: 0; cursor: pointer; padding: 14px 22px 14px 14px; border-radius: 999px;
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600)); color: #fff; box-shadow: 0 12px 28px -10px rgba(232,50,124,.8);
  animation: pulse 2s ease-in-out infinite;
}
.voice-btn.playing { animation: none; }
.voice-icon { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--pink-600); display: grid; place-items: center; font-size: 1.1rem; font-weight: 800; }
.voice-wave { display: flex; align-items: center; gap: 4px; height: 30px; }
.voice-wave i { width: 4px; height: 8px; border-radius: 3px; background: #fff; opacity: .85; }
.voice-btn.playing .voice-wave i { animation: eq .9s ease-in-out infinite; }
.voice-btn.playing .voice-wave i:nth-child(2n) { animation-delay: .15s; } .voice-btn.playing .voice-wave i:nth-child(3n) { animation-delay: .3s; }
.voice-title { margin: 12px 0 0; font-family: var(--script); font-size: 1.4rem; color: var(--rose-700); }

/* ---------------- responsive ---------------- */
@media (max-width: 700px) {
  .section { padding: 56px 16px; }
  .note-card { grid-template-columns: 1fr; text-align: center; padding: 22px; }
  .note-gif { width: 180px; margin: 0 auto; }
  .timeline::before { left: 22px; }
  .timeline li, .timeline li:nth-child(even), .timeline li:nth-child(odd) { width: 100%; left: 0; text-align: left; padding: 0 0 26px 62px; }
  .timeline li .dot, .timeline li:nth-child(odd) .dot, .timeline li:nth-child(even) .dot { left: 0; right: auto; }
  .wall-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  #wallChips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 0 -16px 18px; padding: 4px 16px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #wallChips::-webkit-scrollbar { display: none; }
  #wallChips .chip { flex: 0 0 auto; }
  .meme { border-radius: 14px; }
  .reason-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .reason { height: 210px; }
  .reason .front img { width: 90px; height: 90px; }
  .reason .back { font-size: .92rem; padding: 12px; }
  .letter-body { font-size: 1.22rem; padding: 22px 16px; }
  .floater { width: 52px; opacity: .4; }
  .hug-btn { width: 200px; height: 200px; }
  .daily-grid { grid-template-columns: repeat(4, 1fr); gap: 9px; }
  .day-tile b { font-size: 1.25rem; }
  .ow-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .ow-env { height: 128px; }
  .ow-label b { font-size: 1.1rem; }
  .music-btn { width: 50px; height: 50px; right: 12px; bottom: 12px; }
  .vinyl { width: 30px; height: 30px; }
  .polaroids { grid-template-columns: 1fr 1fr; gap: 18px 12px; }
  .polaroid { padding: 7px 7px 9px; }
  .polaroid figcaption span { font-size: 1.05rem; }
  .coupon img { width: 84px; height: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }
}
