/* Ночное небо и плёночные полароиды. Один акцент: роза. Шрифты: Unbounded (заголовки), Onest (текст), Caveat (рукописные записки). */
:root {
  --night: #0c1020;
  --night-2: #151b35;
  --ink: #f6eff3;
  --mute: #b0aec6;
  --rose: #ff8fa3;
  --rose-deep: #e0587a;
  --paper: #fbf5ee;
  --paper-ink: #2b2233;
  --r: 20px;          /* карточки */
  --r-pill: 999px;    /* кнопки */
  --r-photo: 4px;     /* полароиды, как настоящие карточки */
  --gutter: clamp(20px, 5vw, 56px);
  --font-display: "Unbounded", "Onest", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, sans-serif;
  --font-hand: "Caveat", "Segoe Script", cursive;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; height: 100dvh; }
/* пока конверт закрыт, самой страницы не видно */
body.is-locked #page, body.is-locked .music, body.is-locked .progress { visibility: hidden; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html { overscroll-behavior-y: none; }
body { touch-action: manipulation; }
[hidden] { display: none !important; }
a { color: inherit; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
}
h2 { font-size: clamp(1.7rem, 5vw, 2.8rem); text-align: center; }
.hand { font-family: var(--font-hand); font-weight: 500; }

:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }

/* ---------- фон ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#fx  { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 90; pointer-events: none; }
main, .music, .progress { position: relative; z-index: 1; }
section { position: relative; }
.progress { position: fixed; z-index: 40; top: 0; left: 0; right: 0; height: 3px; background: transparent; }
.progress i { display: block; height: 100%; width: 100%; background: var(--rose); transform: scaleX(0); transform-origin: left; }

/* ---------- кнопки ---------- */
.btn {
  border: 0; border-radius: var(--r-pill);
  padding: 15px 30px; min-height: 52px;
  font-weight: 600; font-size: 1rem; white-space: nowrap;
  transition: transform .25s var(--ease), background .25s, box-shadow .25s;
}
.btn:active { transform: translateY(1px) scale(.98); }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-main { background: var(--rose); color: #26101c; box-shadow: 0 10px 30px -10px rgba(255, 143, 163, .6); }
@media (hover: hover) { .btn-main:hover { background: #ffa3b4; } }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(246, 239, 243, .45); }

/* ---------- вход: конверт ---------- */
#gate {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 70% at 50% 108%, rgba(224, 88, 122, .55), transparent 62%),
    radial-gradient(80% 50% at 50% 100%, rgba(255, 143, 163, .25), transparent 70%);
  transition: opacity 1s ease .1s, visibility 0s 1.2s;
}
#gate.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-inner { display: grid; justify-items: center; gap: 22px; padding: var(--gutter); text-align: center; }
.gate-to { margin: 0; font-family: var(--font-hand); font-size: clamp(2.4rem, 10vw, 3.6rem); font-weight: 600; color: var(--rose); line-height: 1; }
.gate-hint { margin: 6px 0 0; color: var(--mute); font-size: .95rem; animation: hint 2.4s ease-in-out infinite; }
@keyframes hint { 50% { opacity: .35; } }

.envelope {
  position: relative; display: block; border: 0; padding: 0; background: none;
  width: min(80vw, 340px); aspect-ratio: 3 / 2;
  perspective: 900px;
  animation: float 4.5s ease-in-out infinite;
  filter: drop-shadow(0 28px 36px rgba(0, 0, 0, .5));
}
@keyframes float { 50% { transform: translateY(-8px); } }
.envelope > span { position: absolute; display: block; }
.env-back { inset: 0; background: #d8bdb8; border-radius: 6px; }
.env-letter {
  left: 7%; right: 7%; top: 7%; bottom: 7%;
  background: var(--paper); border-radius: 4px; z-index: 2;
  padding: 16% 12% 0; display: grid; align-content: start; gap: 10px;
  transition: transform .9s var(--ease) .55s;
}
.env-letter-line { height: 5px; border-radius: 3px; background: rgba(43, 34, 51, .12); }
.env-letter-line.short { width: 55%; }
.env-front {
  inset: 0; z-index: 3; border-radius: 6px;
  background: linear-gradient(180deg, #f0e0da, #e6d0ca);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
}
.env-flap {
  left: 0; right: 0; top: 0; height: 56%; z-index: 4;
  background: linear-gradient(180deg, #e3cac4, #ecd8d2);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform .75s var(--ease), z-index 0s .3s;
}
.env-seal {
  left: 50%; top: 56%; z-index: 5; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f27a96, var(--rose-deep));
  color: #fff; font-size: 20px; box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
  transition: opacity .3s, transform .3s;
}
@media (hover: hover) { .envelope:hover .env-flap { transform: rotateX(-14deg); } }
.envelope { touch-action: none; }
.envelope.nudge .env-flap { transform: rotateX(-18deg); }
.envelope.open { animation: none; cursor: default; }
.envelope.open .env-flap { transform: rotateX(180deg); z-index: 1; }
.envelope.open .env-seal { opacity: 0; transform: scale(.4); }
.envelope.open .env-letter { transform: translateY(-62%); }

/* появление при прокрутке (включается только если работает JS) */
.js .rv { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform 1.1s var(--ease); }
.js .rv.in { opacity: 1; transform: none; }

/* всплеск сердечек при касании рисуется на canvas #fx */

/* ---------- 1. письмо ---------- */
.hero {
  min-height: 100dvh; display: grid; align-items: center; gap: 36px;
  padding: calc(var(--gutter) + 10px + env(safe-area-inset-top)) var(--gutter) calc(90px + env(safe-area-inset-bottom));
  max-width: 1120px; margin: 0 auto;
}
.hero-photo {
  width: min(78vw, 340px); aspect-ratio: 4 / 5; margin: 0 auto;
  border-radius: 999px 999px var(--r) var(--r); overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(224, 88, 122, .45), 0 0 0 8px rgba(255, 143, 163, .12);
}
.hero-text { max-width: 520px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.1rem, 8vw, 3.6rem); margin-bottom: 22px; }
.letter p { margin: 0 0 1em; color: #e8e1ea; max-width: 46ch; }
.sign { margin: 18px 0 0; font-size: 2.1rem; color: var(--rose); line-height: 1; }
@media (min-width: 880px) {
  .hero { grid-template-columns: 5fr 6fr; gap: 72px; }
  .hero-photo { width: 100%; max-width: 420px; }
  .hero-text { margin: 0; }
}
.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; width: 28px; height: 46px; margin-left: -14px;
  border-radius: 14px; box-shadow: inset 0 0 0 1.5px rgba(246, 239, 243, .4);
}
.scroll-cue span { position: absolute; left: 50%; top: 9px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--rose); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(16px); } }

/* Вход героя: единственная постановка при открытии */
.hero-photo, .hero h1, .letter p, .sign { opacity: 0; transform: translateY(26px); transition: opacity 1s ease, transform 1.2s var(--ease); }
body.is-open .hero-photo, body.is-open .hero h1, body.is-open .letter p, body.is-open .sign { opacity: 1; transform: none; }
body.is-open .hero-photo { transition-delay: .1s; }
body.is-open .hero h1 { transition-delay: .35s; }
body.is-open .letter p:nth-child(1) { transition-delay: .6s; }
body.is-open .letter p:nth-child(2) { transition-delay: .8s; }
body.is-open .letter p:nth-child(3) { transition-delay: 1s; }
body.is-open .letter p:nth-child(n+4) { transition-delay: 1.2s; }
body.is-open .sign { transition-delay: 1.4s; }

/* ---------- фото и заглушки ---------- */
.photo { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--night-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.ph {
  display: grid; place-items: center; text-align: center; padding: 16px;
  background: linear-gradient(150deg, hsl(var(--h, 345) 50% 42%), hsl(calc(var(--h, 345) + 14) 44% 24%));
  color: rgba(255, 255, 255, .78); font-family: var(--font-hand); font-size: 1.5rem; line-height: 1.1;
}
.photo.ph::before { content: "♥"; position: absolute; font-size: 5.5rem; opacity: .1; }

/* ---------- 2. счётчик ---------- */
.counter { text-align: center; padding: clamp(80px, 16vh, 160px) var(--gutter); }
.counter-pre { margin: 0; font-size: clamp(1.8rem, 6vw, 2.6rem); color: var(--rose); line-height: 1; }
.counter-days { margin: 10px 0 0; display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; column-gap: .25em; line-height: 1; }
#cDays {
  font-family: var(--font-display); font-weight: 200; letter-spacing: -0.05em;
  font-size: clamp(5.5rem, 26vw, 15rem); font-variant-numeric: tabular-nums;
}
.counter-days-word { font-family: var(--font-display); font-weight: 300; font-size: clamp(1.4rem, 5vw, 2.4rem); color: var(--mute); }
.counter-rest { margin: 26px 0 0; display: flex; justify-content: center; gap: clamp(18px, 5vw, 44px); font-size: 1.1rem; color: var(--mute); }
.counter-rest b { font-family: var(--font-display); font-weight: 400; color: var(--ink); font-size: 1.5rem; font-variant-numeric: tabular-nums; margin-right: .2em; display: inline-block; min-width: 1.4ch; text-align: right; }
.counter-since { margin: 22px 0 0; color: var(--mute); font-size: .95rem; }

/* ---------- 3. история ---------- */
.story { padding: clamp(60px, 10vh, 110px) var(--gutter) clamp(60px, 10vh, 120px); }
.story-tip { text-align: center; margin: 10px 0 40px; font-size: 1.5rem; color: var(--rose); }
.line { position: relative; max-width: 760px; margin: 0 auto; display: grid; gap: 54px; padding-top: 10px; }
/* верёвка, на которой всё висит */
.line::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed rgba(255, 143, 163, .45); }
.pol-wrap { position: relative; display: flex; }
.pol-wrap:nth-child(odd) { justify-content: flex-start; --tilt: -3deg; }
.pol-wrap:nth-child(even) { justify-content: flex-end; --tilt: 2.5deg; }
@media (max-width: 640px) {
  .pol-wrap:nth-child(n) { justify-content: center; }
  .pol-wrap:nth-child(odd) { transform: translateX(-4%); }
  .pol-wrap:nth-child(even) { transform: translateX(4%); }
}
.pol {
  position: relative; width: min(74vw, 290px); aspect-ratio: 10 / 13;
  transform-origin: 50% 0; transform: rotate(var(--tilt)); perspective: 1000px;
}
.pol.swing { animation: swing 2.2s var(--ease) both; }
@keyframes swing {
  0% { transform: rotate(calc(var(--tilt) - 9deg)); }
  25% { transform: rotate(calc(var(--tilt) + 5deg)); }
  50% { transform: rotate(calc(var(--tilt) - 3deg)); }
  75% { transform: rotate(calc(var(--tilt) + 1.5deg)); }
  100% { transform: rotate(var(--tilt)); }
}
/* прищепка */
.pol::before {
  content: ""; position: absolute; z-index: 5; left: 50%; top: -14px; width: 16px; height: 34px; margin-left: -8px;
  border-radius: 3px; background: linear-gradient(90deg, #c98a6a, #e1a888 40%, #b97a5c); box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
}
.pol-inner { position: absolute; inset: 0; border: 0; padding: 0; background: none; transform-style: preserve-3d; transition: transform .8s var(--ease); display: block; width: 100%; text-align: left; }
.pol.flipped .pol-inner { transform: rotateY(180deg); }
.pol-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--paper); color: var(--paper-ink); border-radius: var(--r-photo);
  box-shadow: 0 18px 34px -14px rgba(0, 0, 0, .65);
}
.pol-front { padding: 14px 14px 0; display: flex; flex-direction: column; }
.pol-front .photo { flex: 1 1 auto; min-height: 0; height: auto; border-radius: 2px; }
.pol-cap { flex: 0 0 auto; padding: 8px 2px 12px; text-align: center; }
.pol-date { display: block; font-family: var(--font-hand); font-size: 1.45rem; line-height: 1; color: var(--rose-deep); font-weight: 600; }
.pol-title { display: block; font-size: .92rem; font-weight: 500; margin-top: 3px; }
.pol-back { transform: rotateY(180deg); padding: 28px 24px; display: grid; align-content: center; text-align: center; gap: 14px; }
.pol-back p { margin: 0; font-family: var(--font-hand); font-size: 1.8rem; line-height: 1.18; font-weight: 500; }
.pol-back small { font-family: var(--font-hand); font-size: 1.3rem; color: var(--rose-deep); }

/* ---------- 3.5 ты: фото по месяцам ---------- */
.her { padding: clamp(60px, 10vh, 110px) 0 clamp(20px, 5vh, 60px); }
.her h2 { font-size: clamp(3.4rem, 15vw, 6rem); font-weight: 200; letter-spacing: -.04em; }
.her-sub { text-align: center; margin: 8px 0 54px; font-size: 1.6rem; color: var(--rose); line-height: 1.1; }
.month { max-width: 920px; margin: 0 auto 72px; padding: 0 var(--gutter); }
.month-head h3 { margin: 0; font-family: var(--font-display); font-weight: 200; font-size: clamp(3.4rem, 17vw, 7rem); line-height: .95; letter-spacing: -.045em; }
.month-cap { margin: 8px 0 24px; font-size: 1.65rem; line-height: 1.1; color: var(--rose); max-width: 22ch; }
.collage { columns: 2; column-gap: 12px; max-width: 580px; }
@media (min-width: 880px) { .collage { columns: 3; column-gap: 16px; max-width: 920px; } }
.tile {
  display: block; width: 100%; margin: 0 0 12px; padding: 0; border: 0; break-inside: avoid;
  border-radius: var(--r); overflow: hidden; background: var(--night-2);
  box-shadow: 0 18px 34px -16px rgba(0, 0, 0, .75);
  transform: rotate(var(--tilt, 0deg)); transition: transform .3s var(--ease);
}
.tile .photo { height: 100%; }
.tile:active { transform: rotate(var(--tilt, 0deg)) scale(.97); }
.js .tile { opacity: 0; transform: translateY(46px) rotate(calc(var(--tilt) * 3)) scale(.93); transition: opacity .7s ease var(--d, 0s), transform .95s var(--ease) var(--d, 0s); }
.js .tile.in { opacity: 1; transform: rotate(var(--tilt, 0deg)); }
.js .tile.in:active { transform: rotate(var(--tilt, 0deg)) scale(.97); transition-delay: 0s; transition-duration: .25s; }
.month.solo .collage { columns: 1; max-width: min(78vw, 330px); }
@media (min-width: 880px) { .month.solo .collage { columns: 1; max-width: 330px; } }

/* ---------- 4. причины ---------- */
.reasons { padding: clamp(60px, 10vh, 110px) var(--gutter); }
.jar-area { max-width: 520px; margin: 40px auto 0; display: grid; justify-items: center; gap: 22px; }
.note-stage { position: relative; width: 100%; min-height: 250px; display: grid; place-items: center; }
.note-stage::before, .note-stage::after {
  content: ""; position: absolute; inset: 6% 5%; background: var(--paper); border-radius: var(--r-photo); opacity: .16; z-index: 0;
}
.note-stage::before { transform: rotate(-4deg); }
.note-stage::after { transform: rotate(3deg); opacity: .1; }
.note {
  position: relative; z-index: 1; width: 100%; margin: 0; padding: 38px 30px;
  background: var(--paper); color: var(--paper-ink); border-radius: var(--r-photo);
  font-size: clamp(1.7rem, 6vw, 2.2rem); line-height: 1.15; text-align: center;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .6); transform: rotate(var(--rot, -1.5deg));
}
.note-empty { color: rgba(43, 34, 51, .55); }
.note { touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; will-change: transform; }
.note.dragging { cursor: grabbing; }
.swipe-hint { margin: -8px 0 0; font-size: .85rem; color: var(--mute); }
.note.drop { animation: drop .7s var(--ease) both; }
@keyframes drop { from { opacity: 0; transform: translateY(70px) rotate(calc(var(--rot) + 8deg)) scale(.9); } to { opacity: 1; transform: rotate(var(--rot)); } }
.jar-count { margin: 0; color: var(--mute); font-size: 1.4rem; min-height: 1.4em; }

/* ---------- 5. открой, когда ---------- */
.openwhen { padding: clamp(60px, 10vh, 110px) var(--gutter); }
.ow-list { max-width: 600px; margin: 40px auto 0; display: grid; gap: 14px; }
.ow { border-radius: var(--r); background: var(--night-2); box-shadow: inset 0 0 0 1px rgba(255, 143, 163, .2); overflow: hidden; }
.ow-head {
  width: 100%; display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 0; background: none; text-align: left;
  font-family: var(--font-display); font-weight: 300; font-size: 1.05rem; letter-spacing: -.01em;
}
.ow-seal {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #f27a96, var(--rose-deep)); color: #fff; font-size: 15px;
  transition: transform .5s var(--ease);
}
.ow.open .ow-seal { transform: rotate(360deg) scale(.9); }
.ow-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.ow.open .ow-body { grid-template-rows: 1fr; }
.ow-body > div { overflow: hidden; }
.ow-text {
  margin: 0 14px 14px; padding: 24px 22px; background: var(--paper); color: var(--paper-ink); border-radius: calc(var(--r) - 8px);
  font-family: var(--font-hand); font-size: 1.75rem; line-height: 1.2; font-weight: 500;
}

/* ---------- 6. лента фото ---------- */
.gallery { padding: clamp(60px, 10vh, 110px) 0; }
.rail {
  margin-top: 40px; display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 10px var(--gutter) 24px; scrollbar-width: thin; scrollbar-color: rgba(255, 143, 163, .5) transparent;
}
.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: rgba(255, 143, 163, .5); border-radius: 3px; }
.shot {
  flex: 0 0 auto; width: min(72vw, 330px); aspect-ratio: 3 / 4; scroll-snap-align: center;
  border: 0; padding: 0; background: none; border-radius: var(--r); overflow: hidden;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .7); transition: transform .4s var(--ease);
}
@media (hover: hover) { .shot:hover { transform: translateY(-6px); } }
.shot:active { transform: scale(.97); }
.shot.wide { width: min(86vw, 440px); aspect-ratio: 4 / 3; }
@media (min-width: 880px) { .rail { justify-content: flex-start; } .shot { width: 300px; } .shot.wide { width: 400px; } }
.rail { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.dots { display: flex; justify-content: center; gap: 7px; margin-top: 4px; flex-wrap: wrap; padding: 0 var(--gutter); }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(246, 239, 243, .25); transition: transform .3s var(--ease), background .3s; }
.dots i.on { background: var(--rose); transform: scale(1.5); }

/* ---------- 7. финал ---------- */
.finale {
  min-height: 100dvh; display: grid; place-items: center; text-align: center; padding: 90px var(--gutter);
  background: radial-gradient(90% 60% at 50% 100%, rgba(224, 88, 122, .38), transparent 70%);
}
.finale-ask h2 { color: var(--mute); font-size: clamp(1.1rem, 4vw, 1.5rem); margin-bottom: 18px; }
.question { margin: 0 auto 46px; max-width: 14ch; font-family: var(--font-display); font-weight: 300; letter-spacing: -.03em; line-height: 1.08; font-size: clamp(2.5rem, 11vw, 5.6rem); }
.answers { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; min-height: 110px; }
#yes { transition: transform .4s var(--ease), background .25s; font-size: 1.1rem; padding-inline: 38px; }
.no-slot { display: inline-block; }
.finale { overflow: hidden; }
#no.run { position: absolute; z-index: 20; transition: left .35s var(--ease), top .35s var(--ease); }
.finale-choose { width: 100%; max-width: 460px; }
.finale-choose h2 { font-size: clamp(2rem, 8vw, 3rem); color: var(--ink); margin-bottom: 28px; animation: rise 1s var(--ease) both; }
.choices { display: grid; gap: 14px; }
.choice {
  display: grid; gap: 4px; justify-items: center; width: 100%; padding: 24px 22px; border: 0; border-radius: var(--r);
  background: var(--night-2); box-shadow: inset 0 0 0 1.5px rgba(255, 143, 163, .35);
  animation: rise .9s var(--ease) both; animation-delay: var(--d, 0s);
  transition: transform .35s var(--ease), background .3s, box-shadow .3s, opacity .4s;
}
.choice-title { font-family: var(--font-display); font-weight: 300; font-size: 1.7rem; letter-spacing: -.02em; line-height: 1.15; }
.choice-hint { font-family: var(--font-hand); font-size: 1.45rem; color: var(--rose); line-height: 1.1; }
.choice:active { transform: scale(.97); }
.choice.picked { background: var(--rose); box-shadow: 0 14px 34px -10px rgba(255, 143, 163, .7); transform: scale(1.03); }
.choice.picked .choice-title { color: #26101c; }
.choice.picked .choice-hint { color: #5a1d33; }
.choice.dim { opacity: .25; transform: scale(.96); }
@media (hover: hover) { .choice:hover:not(.picked) { background: #1c2347; } }
.finale-answer { max-width: 560px; animation: rise 1.2s var(--ease) both; }
.answer-title { margin: 0 0 18px; font-family: var(--font-display); font-weight: 300; font-size: clamp(2.6rem, 11vw, 5rem); letter-spacing: -.03em; line-height: 1.05; color: var(--rose); }
.answer-text { text-wrap: balance; margin: 0 auto; font-size: 1.2rem; max-width: 34ch; }
.answer-sign { margin: 28px 0 0; font-size: 2.6rem; color: var(--rose); line-height: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }

.foot { text-align: center; padding: 10px var(--gutter) calc(40px + env(safe-area-inset-bottom)); color: var(--mute); }
.foot p { margin: 0; font-size: 1.4rem; }

/* ---------- музыка ---------- */
.music {
  position: fixed; z-index: 45; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 14px; border: 0; border-radius: var(--r-pill);
  background: rgba(21, 27, 53, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 143, 163, .3); font-size: .9rem; color: var(--ink);
}
.music-bars { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.music-bars i { width: 3px; height: 4px; border-radius: 2px; background: var(--rose); }
.music[aria-pressed="true"] .music-bars i { animation: eq 1s ease-in-out infinite; }
.music[aria-pressed="true"] .music-bars i:nth-child(2) { animation-delay: .2s; }
.music[aria-pressed="true"] .music-bars i:nth-child(3) { animation-delay: .4s; }
.music[aria-pressed="true"] .music-bars i:nth-child(4) { animation-delay: .1s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }

/* ---------- просмотр фото ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(8, 10, 20, .96); animation: fade .3s ease; touch-action: none; overscroll-behavior: contain; }
@keyframes fade { from { opacity: 0; } }
.lb-stage { width: 100%; height: 100%; display: grid; place-items: center; padding: calc(64px + env(safe-area-inset-top)) 16px calc(70px + env(safe-area-inset-bottom)); touch-action: none; }
.lb-img { width: min(100%, 560px); height: 100%; max-height: 780px; border-radius: var(--r); overflow: hidden; will-change: transform; }
.lb-img.in-next { animation: lbNext .4s var(--ease); }
.lb-img.in-prev { animation: lbPrev .4s var(--ease); }
@keyframes lbNext { from { opacity: 0; transform: translateX(60px) scale(.96); } }
@keyframes lbPrev { from { opacity: 0; transform: translateX(-60px) scale(.96); } }
.lb-img .photo, .lb-img img { height: 100%; }
.lb-img img { object-fit: contain; object-position: center; -webkit-user-drag: none; }
.lb-close { position: absolute; z-index: 3; top: calc(12px + env(safe-area-inset-top)); right: 14px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); font-size: 28px; line-height: 1; }
.lb-count { position: absolute; left: 0; right: 0; bottom: calc(22px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font-size: 1.6rem; color: var(--mute); pointer-events: none; }
.lb-nav { position: absolute; z-index: 3; top: 50%; width: 48px; height: 64px; margin-top: -32px; border: 0; border-radius: var(--r); background: rgba(255, 255, 255, .1); font-size: 34px; line-height: 1; display: none; }
.lb-prev { left: 8px; } .lb-next { right: 8px; }
@media (hover: hover) and (pointer: fine) { .lb-nav { display: block; } }

/* ---------- год вместе ---------- */
.year { max-width: 360px; margin: 36px auto 0; }
.year-text { margin: 0 0 10px; font-size: 1.6rem; color: var(--rose); line-height: 1.1; }
.year-bar { height: 8px; border-radius: 4px; background: rgba(246, 239, 243, .12); overflow: hidden; }
.year-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--rose-deep), var(--rose)); transition: width 2.4s var(--ease) .3s; }
.year.in .year-bar i { width: var(--p, 0%); }

/* ---------- купоны ---------- */
.coupons { padding: clamp(60px, 10vh, 110px) var(--gutter); }
.coupons-sub { text-align: center; margin: 8px 0 34px; font-size: 1.5rem; color: var(--rose); line-height: 1.1; }
.cp-list { max-width: 460px; margin: 0 auto; display: grid; gap: 18px; }
.cp {
  position: relative; display: grid; grid-template-columns: 1fr 72px; width: 100%; border: 0; padding: 0; text-align: left;
  border-radius: 16px; background: var(--paper); color: var(--paper-ink); box-shadow: 0 16px 30px -16px rgba(0, 0, 0, .7);
  transition: transform .35s var(--ease);
}
.cp:active { transform: scale(.98); }
.cp-main { padding: 20px 18px 20px 22px; transition: opacity .5s; }
.cp-title { display: block; font-family: var(--font-display); font-weight: 300; font-size: 1.2rem; letter-spacing: -.02em; line-height: 1.2; }
.cp-text { display: block; margin-top: 6px; font-family: var(--font-hand); font-size: 1.45rem; line-height: 1.1; color: rgba(43, 34, 51, .75); }
.cp-stub { position: relative; display: grid; place-items: center; border-left: 2px dashed rgba(43, 34, 51, .25); color: var(--rose-deep); font-size: 1.7rem; transition: opacity .5s; }
.cp-stub::before, .cp-stub::after { content: ""; position: absolute; left: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--night); }
.cp-stub::before { top: -8px; }
.cp-stub::after { bottom: -8px; }
.cp-stamp { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.cp-stamp span {
  opacity: 0; font-family: var(--font-display); font-weight: 400; font-size: .95rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--rose-deep); border: 3px solid var(--rose-deep); border-radius: 10px; padding: 6px 14px; background: rgba(251, 245, 238, .55);
  transform: rotate(-9deg) scale(2.4);
}
.cp.used { cursor: default; }
.cp.used .cp-main, .cp.used .cp-stub { opacity: .38; }
.cp.used .cp-stamp span { animation: stamp .55s var(--ease) forwards; }
@keyframes stamp { 0% { opacity: 0; transform: rotate(-9deg) scale(2.4); } 60% { opacity: 1; transform: rotate(-9deg) scale(.92); } 100% { opacity: 1; transform: rotate(-9deg) scale(1); } }

/* ---------- стирашка ---------- */
.scratch { padding: clamp(40px, 8vh, 90px) var(--gutter) clamp(40px, 8vh, 80px); text-align: center; }
.scratch-tip { margin: 8px 0 28px; font-size: 1.5rem; color: var(--rose); line-height: 1.1; }
.scratch-card { position: relative; width: min(100%, 380px); aspect-ratio: 5 / 3; margin: 0 auto; border-radius: var(--r); overflow: hidden; background: var(--paper); box-shadow: 0 22px 44px -18px rgba(0, 0, 0, .7); }
.scratch-under { text-wrap: balance; position: absolute; inset: 0; margin: 0; display: grid; place-items: center; padding: 22px 26px; color: var(--paper-ink); font-size: clamp(1.8rem, 7vw, 2.3rem); line-height: 1.12; }
#scCanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity .9s ease; }
#scCanvas.done { opacity: 0; pointer-events: none; }
.scratch-sign { margin: 22px 0 0; font-size: 2rem; color: var(--rose); line-height: 1; opacity: 0; transition: opacity 1s ease .6s; }
.scratch.revealed .scratch-sign { opacity: 1; }

/* ---------- финал: дата и календарь ---------- */
.date-count { margin: 30px 0 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(1.05rem, 4.4vw, 1.35rem); letter-spacing: -.01em; line-height: 1.35; }
.date-count b { display: block; font-family: var(--font-hand); font-weight: 600; font-size: 2.5rem; letter-spacing: 0; color: var(--rose); line-height: 1.05; margin-bottom: 6px; }
#addCal { margin-top: 22px; }

/* ---------- котёнок ---------- */
.cat {
  position: fixed; z-index: 44; left: max(10px, env(safe-area-inset-left)); bottom: 0; width: 80px; height: 52px; pointer-events: none;
  transform: translateY(80px); transition: transform .9s var(--ease) 2.6s;
}
body.is-open .cat { transform: none; }
body.is-locked .cat { visibility: hidden; }
.cat-svg { position: absolute; left: 0; bottom: -10px; width: 80px; height: auto; display: block; pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; overflow: visible; }
.cat-head { transform-box: fill-box; transform-origin: 50% 92%; animation: breathe 3.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(1.5px) scale(1.012); } }
.cat.pet .cat-head { animation: pet .6s var(--ease); }
@keyframes pet { 0% { transform: none; } 25% { transform: rotate(-8deg) translateY(-3px); } 55% { transform: rotate(6deg); } 100% { transform: none; } }
.eyes { transform-box: fill-box; transform-origin: 50% 55%; animation: blink 5.5s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
.ear { transform-box: fill-box; transform-origin: 50% 100%; }
.ear-l { animation: twitchL 7s infinite 1s; }
.ear-r { animation: twitchR 9s infinite 3s; }
@keyframes twitchL { 0%, 92%, 100% { transform: none; } 95% { transform: rotate(-10deg); } 97% { transform: rotate(3deg); } }
@keyframes twitchR { 0%, 92%, 100% { transform: none; } 95% { transform: rotate(10deg); } 97% { transform: rotate(-3deg); } }
.cat.sleep .eyes { animation: none; transform: scaleY(.08); }
.cat-z { position: absolute; left: 58px; top: 0; font-size: 1.5rem; line-height: 1; color: var(--rose); opacity: 0; pointer-events: none; }
.cat.sleep .cat-z { animation: zz 2.8s ease-in-out infinite; }
@keyframes zz { 0% { opacity: 0; transform: translate(0, 8px) scale(.7); } 30% { opacity: .9; } 100% { opacity: 0; transform: translate(12px, -22px) scale(1.15); } }
.cat-bubble {
  position: absolute; left: 4px; bottom: 58px; margin: 0; width: max-content; max-width: min(62vw, 240px); padding: 8px 14px 9px;
  background: var(--paper); color: var(--paper-ink); border-radius: 16px; font-size: 1.5rem; line-height: 1.1;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6); opacity: 0; transform: translateY(8px) scale(.9); transform-origin: 24px 100%;
  transition: opacity .3s, transform .4s var(--ease); pointer-events: none;
}
.cat-bubble::after { content: ""; position: absolute; left: 24px; bottom: -6px; width: 12px; height: 12px; background: var(--paper); transform: rotate(45deg); border-radius: 2px; }
.cat-bubble.show { opacity: 1; transform: none; }

/* ---------- всплывающая записка ---------- */
.toast {
  position: fixed; z-index: 95; left: 50%; top: calc(18px + env(safe-area-inset-top)); margin: 0; width: max-content; max-width: min(88vw, 420px);
  padding: 14px 22px; border-radius: 18px; text-align: center; background: rgba(251, 245, 238, .97); color: var(--paper-ink);
  font-family: var(--font-hand); font-size: 1.6rem; line-height: 1.12; box-shadow: 0 16px 34px -12px rgba(0, 0, 0, .65);
  transform: translate(-50%, -150%); opacity: 0; transition: transform .6s var(--ease), opacity .4s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- звёздочка желаний ---------- */
.wish-star {
  position: fixed; z-index: 43; top: 0; left: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 0; padding: 0; background: none;
  display: grid; place-items: center; color: #fff1f4; font-size: 30px; line-height: 1;
  text-shadow: 0 0 12px #ff8fa3, 0 0 28px rgba(255, 143, 163, .85);
  animation: fly var(--dur, 7s) linear forwards; transition: opacity .45s;
}
.wish-star::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 110px; height: 2px; margin-top: -1px; border-radius: 2px; pointer-events: none;
  transform-origin: 0 50%; transform: rotate(-13deg); background: linear-gradient(90deg, rgba(255, 200, 212, .85), transparent);
}
.wish-star.caught { animation-play-state: paused; opacity: 0; }
@keyframes fly { from { transform: translate(110vw, var(--y, 20vh)); } to { transform: translate(-14vw, calc(var(--y, 20vh) + 14vh)); } }

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