/* Рейс IR 42: ніч, світанок, день, захід і знову ніч із салютом */
:root {
  --night: #140B34;
  --night2: #1F0F4A;
  --violet: #3A1766;
  --plum: #6A2370;
  --dawn: #A2306E;
  --peach: #F2876F;
  --day: #FFE3D6;
  --day2: #FFF1EA;
  --sunset: #D2557A;
  --gold: #F7C873;
  --gold2: #FFE7AE;
  --rose: #FF3D6E;
  --blush: #FFC2D4;
  --ink: #2A1150;
  --ink-soft: #6A4F86;
  --stamp-red: #C8243F;
  --stamp-blue: #2F45C8;

  --display: "Yeseva One", Georgia, serif;
  --body: "Manrope", system-ui, -apple-system, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: #fff;
  background: var(--night);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; height: 100%; }
html:has(body.is-locked) { overflow: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 40; pointer-events: none; }

/* зоряне небо з кількох шарів точок */
.starry {
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, rgba(255,255,255,.95) 50%, transparent 52%),
    radial-gradient(1px 1px at 67% 32%, rgba(255,255,255,.8) 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 38% 76%, rgba(255,231,174,.9) 50%, transparent 52%),
    radial-gradient(1px 1px at 88% 64%, rgba(255,255,255,.7) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 23% 52%, rgba(255,255,255,.75) 50%, transparent 52%),
    radial-gradient(1px 1px at 54% 8%, rgba(255,194,212,.8) 50%, transparent 52%),
    radial-gradient(1.1px 1.1px at 78% 88%, rgba(255,255,255,.8) 50%, transparent 52%),
    radial-gradient(1px 1px at 5% 92%, rgba(255,255,255,.6) 50%, transparent 52%);
  background-size: 260px 260px, 330px 330px, 410px 410px, 290px 290px, 370px 370px, 230px 230px, 450px 450px, 310px 310px;
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 54px; padding: 0 28px;
  border: 0; border-radius: 999px;
  font-weight: 800; font-size: 1.05rem; letter-spacing: .01em;
  transition: transform .15s ease, box-shadow .2s ease;
}
.btn svg { width: 22px; height: 22px; fill: currentColor; }
.btn:active { transform: scale(.97); }
.btn-rose { background: var(--rose); color: #fff; box-shadow: 0 10px 30px rgba(255,61,110,.45); }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 10px 30px rgba(247,200,115,.35); }
.btn-link { background: none; border: 0; padding: 8px 4px; text-decoration: underline; text-underline-offset: 4px; color: var(--gold2); font-weight: 600; }

/* ---------- посадковий талон ---------- */
.gate {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background-color: var(--night);
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, rgba(255,255,255,.95) 50%, transparent 52%),
    radial-gradient(1px 1px at 67% 32%, rgba(255,255,255,.8) 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 38% 76%, rgba(255,231,174,.9) 50%, transparent 52%),
    radial-gradient(1px 1px at 88% 64%, rgba(255,255,255,.7) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 23% 52%, rgba(255,255,255,.75) 50%, transparent 52%),
    radial-gradient(120% 70% at 50% 0%, #34186F 0%, var(--night) 65%);
  background-size: 260px 260px, 330px 330px, 410px 410px, 290px 290px, 370px 370px, 100% 100%;
  overflow-y: auto;
  transition: opacity .9s ease .2s, visibility 0s linear 1.1s;
}
.gate.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-note { font-family: var(--hand); font-weight: 700; font-size: 1.75rem; line-height: 1.1; color: var(--gold2); margin: 0; text-align: center; }

.pass {
  width: min(360px, 100%);
  color: var(--ink);
  filter: drop-shadow(0 30px 50px rgba(0,0,0,.45));
  animation: pass-in 1s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes pass-in { from { opacity: 0; transform: translateY(30px) rotate(-3deg); } }
.pass-main { background: #fff; border-radius: 22px 22px 0 0; padding: 20px 22px 18px; transition: transform .7s cubic-bezier(.5,0,.3,1), opacity .6s ease; }
.pass-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .78rem; color: var(--ink-soft); font-weight: 600; }
.pass-air { font-family: var(--display); font-size: 1.05rem; color: var(--rose); }
.pass-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 16px 0 14px; }
.pass-route b { display: block; font-family: var(--display); font-weight: 400; font-size: 2.6rem; line-height: 1; color: var(--ink); }
.pass-route span { display: block; font-size: .72rem; line-height: 1.3; color: var(--ink-soft); margin-top: 6px; }
.pass-route .to { text-align: right; }
.pass-plane { width: 30px; height: 30px; fill: var(--rose); transform: rotate(90deg); }
.pass-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; margin: 0; padding-top: 14px; border-top: 1px solid #EEE6F4; }
.pass-grid dt { font-size: .68rem; color: var(--ink-soft); }
.pass-grid dd { margin: 0; font-weight: 800; font-size: .95rem; line-height: 1.25; }

.pass-stub {
  position: relative;
  background: #fff;
  border-radius: 0 0 22px 22px;
  padding: 20px 22px 22px;
  display: grid; gap: 16px;
  /* виїмки по краях лінії відриву */
  -webkit-mask: radial-gradient(circle 12px at 0 0, transparent 97%, #000) top left / 51% 100% no-repeat,
                radial-gradient(circle 12px at 100% 0, transparent 97%, #000) top right / 51% 100% no-repeat;
          mask: radial-gradient(circle 12px at 0 0, transparent 97%, #000) top left / 51% 100% no-repeat,
                radial-gradient(circle 12px at 100% 0, transparent 97%, #000) top right / 51% 100% no-repeat;
  transition: transform .8s cubic-bezier(.5,0,.6,1), opacity .7s ease .1s;
  transform-origin: 85% 0;
}
.pass-stub::before { content: ""; position: absolute; top: 0; left: 18px; right: 18px; border-top: 2px dashed #D9CFE6; }
.barcode {
  height: 46px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 7px, transparent 7px 9px, var(--ink) 9px 10px, transparent 10px 13px, var(--ink) 13px 16px, transparent 16px 17px);
  opacity: .85;
}
.pass .btn { width: 100%; }
.pass.is-torn .pass-stub { transform: translateY(70px) rotate(14deg); opacity: 0; }
.pass.is-torn .pass-main { transform: translateY(-40px) scale(.96); opacity: 0; transition-delay: .25s; }

/* ---------- кнопка звуку ---------- */
.sound {
  position: fixed; z-index: 70;
  top: max(14px, env(safe-area-inset-top)); right: 14px;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(20,11,52,.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: grid; place-items: center;
}
.sound svg { width: 24px; height: 24px; fill: #fff; }
.sound .i-off { display: none; }
.sound[aria-pressed="false"] .i-on { display: none; }
.sound[aria-pressed="false"] .i-off { display: block; }

/* ---------- спільні заголовки секцій ---------- */
section { position: relative; }
.sec-head { max-width: 640px; margin: 0 auto; text-align: center; padding: 0 16px; }
.sec-head h2 { font-size: clamp(2.3rem, 9vw, 3.8rem); line-height: 1.05; }
.sec-head p { margin: 14px auto 0; max-width: 34em; font-size: 1.05rem; opacity: .88; }

/* ---------- головний екран ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 88px 16px 150px;
  background-color: var(--night);
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, rgba(255,255,255,.95) 50%, transparent 52%),
    radial-gradient(1px 1px at 67% 32%, rgba(255,255,255,.8) 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 38% 76%, rgba(255,231,174,.9) 50%, transparent 52%),
    radial-gradient(1px 1px at 88% 64%, rgba(255,255,255,.7) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 23% 52%, rgba(255,255,255,.75) 50%, transparent 52%),
    linear-gradient(180deg, var(--night) 0%, var(--night2) 100%);
  background-size: 260px 260px, 330px 330px, 410px 410px, 290px 290px, 370px 370px, 100% 100%;
  cursor: crosshair;
  user-select: none; -webkit-user-select: none;
}
.hero-inner { max-width: 900px; }
.big42 {
  font-family: var(--display);
  font-size: clamp(10rem, 52vw, 22rem);
  line-height: .86;
  background: linear-gradient(180deg, #FFF6D8 0%, var(--gold) 45%, #D38B2E 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 28px rgba(247,200,115,.45));
  opacity: 0;
  transform: scale(.94);
  transition: opacity 1.4s ease, transform 2s cubic-bezier(.2,.8,.2,1);
}
.big42.is-on { opacity: 1; transform: none; }
.hero-title { font-size: clamp(2.5rem, 9.5vw, 5rem); line-height: 1.04; margin-top: .15em; text-wrap: balance; }
.hero-sub { font-size: clamp(1.05rem, 3.6vw, 1.3rem); max-width: 30em; margin: 18px auto 0; opacity: .9; text-wrap: balance; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.8,.2,1); }
.reveal.is-on { opacity: 1; transform: none; }
.hero-sub.reveal.is-on { opacity: .9; }
.hero-hint { position: absolute; left: 0; right: 0; bottom: 92px; margin: 0; font-family: var(--hand); font-size: 1.5rem; color: var(--gold2); }
.scroll-cue {
  position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom));
  translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: #fff; text-decoration: none; font-size: .9rem; font-weight: 600; opacity: .8;
  white-space: nowrap;
}
.scroll-cue.reveal { opacity: 0; }
.scroll-cue.reveal.is-on { opacity: .8; }
.scroll-cue svg { width: 30px; height: 30px; fill: currentColor; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(6px); } }

/* ---------- лічильник і ілюмінатор ---------- */
.days { padding: 96px 16px 110px; background: linear-gradient(180deg, var(--night2) 0%, var(--violet) 100%); }
.days-wrap { max-width: 1040px; margin: 0 auto; display: grid; gap: 52px; align-items: center; }
.window { margin: 0 auto; width: min(290px, 76vw); text-align: center; }
.window-frame {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 16px;
  border-radius: 46% / 36%;
  background: linear-gradient(150deg, #FFFFFF 0%, #E9E1F2 55%, #CFC2E0 100%);
  box-shadow: 0 30px 60px rgba(0,0,0,.45), inset 0 -6px 14px rgba(42,17,80,.18);
}
.window-frame img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 44% / 34%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}
.window-frame::after {
  content: ""; position: absolute; inset: 16px; border-radius: 44% / 34%;
  box-shadow: inset 0 8px 22px rgba(0,0,0,.35);
  pointer-events: none;
}
.window-blind {
  position: absolute; inset: 16px; border-radius: 44% / 34%; overflow: hidden;
  pointer-events: none;
}
.window-blind::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 100%;
  background: repeating-linear-gradient(180deg, #F3EEF8 0 22px, #E3DAEE 22px 24px);
  box-shadow: 0 6px 12px rgba(0,0,0,.2);
  transition: transform 1.6s cubic-bezier(.7,0,.2,1) .3s;
}
.window.is-open .window-blind::before { transform: translateY(-101%); }
.window figcaption { font-family: var(--hand); font-size: 1.45rem; line-height: 1.15; color: var(--gold2); margin-top: 18px; }

.days-text h2 { font-size: clamp(2.1rem, 8vw, 3.2rem); line-height: 1.08; }
.counter { list-style: none; margin: 22px 0 26px; padding: 0; display: grid; gap: 6px; }
.counter li { display: flex; align-items: baseline; gap: .45em; flex-wrap: wrap; }
.counter b { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 10vw, 3.3rem); line-height: 1.12; color: var(--gold); font-variant-numeric: tabular-nums; }
.counter span { font-size: 1.05rem; font-weight: 600; opacity: .85; }
.days-text p { max-width: 34em; margin: 0 0 14px; opacity: .9; }

/* ---------- кругосвітка ---------- */
.journey {
  padding: 100px 0 80px;
  background: linear-gradient(180deg, var(--violet) 0%, var(--plum) 18%, var(--dawn) 38%, var(--peach) 66%, var(--day) 100%);
}
.route { position: relative; max-width: 1100px; margin: 56px auto 0; padding: 30px 16px 40px 58px; }
.route-line {
  position: absolute; top: 0; bottom: 0; left: 28px; width: 3px; margin-left: -1.5px;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.75) 0 9px, transparent 9px 18px);
  border-radius: 3px;
  filter: drop-shadow(0 0 1.5px rgba(42,17,80,.45));
}
.route-done { position: absolute; top: 0; left: 0; width: 100%; height: 0; background: var(--gold); border-radius: 3px; box-shadow: 0 0 12px rgba(247,200,115,.8); }
.plane {
  position: absolute; left: 28px; top: 0; z-index: 3;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  display: grid; place-items: center;
  border-radius: 50%; background: #fff;
  box-shadow: 0 8px 24px rgba(42,17,80,.35);
  will-change: top;
}
.plane svg { width: 28px; height: 28px; fill: var(--rose); transform: rotate(180deg); }

.card { position: relative; margin: 0 0 70px; max-width: 440px; }
.card:last-child { margin-bottom: 0; }
.card::before {
  content: ""; position: absolute; left: -38px; top: 40px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 5px rgba(255,255,255,.35);
}
.card-paper {
  position: relative;
  background: #fff; color: var(--ink);
  border-radius: 6px;
  padding: 12px 12px 18px;
  box-shadow: 0 22px 44px rgba(42,10,60,.3), 0 2px 6px rgba(42,10,60,.15);
  transform: rotate(var(--tilt, 0deg));
  transition: transform .9s cubic-bezier(.2,.8,.2,1), opacity .9s ease;
}
.card.is-pending .card-paper { opacity: 0; transform: translateY(40px) rotate(calc(var(--tilt, 0deg) * -2)); }
.card-media { position: relative; }
.card-photo { display: block; width: 100%; padding: 0; border: 0; background: #EEE; border-radius: 3px; overflow: hidden; aspect-ratio: 4 / 5; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card-photo:hover img { transform: scale(1.03); }
/* перша листівка: «Привіт із Чернівців!» у старовинному стилі */
.home-art {
  aspect-ratio: 4 / 3;
  border-radius: 3px;
  display: flex; flex-direction: column; justify-content: center;
  padding: 18px 22px;
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(255,231,174,.9), transparent 60%),
    linear-gradient(160deg, #FF8FB0 0%, var(--rose) 45%, #A3122E 100%);
  color: #fff;
  overflow: hidden;
}
.home-art span { font-family: var(--hand); font-weight: 700; font-size: 2.4rem; line-height: 1; color: var(--gold2); }
.home-art b {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.2rem, 10.5vw, 3.1rem); line-height: 1;
  text-shadow: 3px 3px 0 #7A0E25, 0 0 24px rgba(255,231,174,.35);
}

.stamp {
  position: absolute; top: -16px; right: -12px; z-index: 2;
  width: 76px; height: 92px; padding: 7px;
  background: #fff;
  transform: rotate(7deg);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.25));
  -webkit-mask: radial-gradient(circle 3.4px, transparent 96%, #000) -4px -4px / 8px 8px round, linear-gradient(#000 0 0) content-box;
          mask: radial-gradient(circle 3.4px, transparent 96%, #000) -4px -4px / 8px 8px round, linear-gradient(#000 0 0) content-box;
}
.stamp-in {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--c); color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.55), inset 0 0 0 4px var(--c);
}
.stamp-in b { font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1; }
.stamp-in i { font-style: normal; font-size: .6rem; font-weight: 800; line-height: 1.15; letter-spacing: .02em; margin-top: 4px; opacity: .9; text-align: center; }
.postmark {
  position: absolute; left: -18px; bottom: -34px; z-index: 2;
  width: 170px; height: auto;
  transform: rotate(-12deg);
  opacity: .82;
  pointer-events: none;
  transition: transform .5s cubic-bezier(.3,1.6,.5,1) .35s, opacity .4s ease .35s;
}
.card.is-pending .postmark { opacity: 0; transform: rotate(-12deg) scale(1.7); }
.card-body { padding: 44px 6px 0; }
.card-body h3 { font-size: 2rem; line-height: 1.05; }
.card-body .hand { font-family: var(--hand); font-weight: 500; font-size: 1.7rem; line-height: 1.12; margin: 8px 0 0; color: var(--ink); }
.thumbs { display: flex; gap: 8px; margin-top: 14px; }
.thumbs button { width: 64px; height: 64px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: #EEE; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.card-next .card-paper {
  background: rgba(255,255,255,.55);
  border: 2px dashed rgba(42,17,80,.45);
  box-shadow: none;
  text-align: center;
  padding: 34px 20px 30px;
}
.card-next .q { font-family: var(--display); font-size: 5.5rem; line-height: 1; color: var(--rose); }
.card-next .card-body { padding: 0; }
.card-next .hand { font-size: 1.9rem; }

/* ---------- сімейна стіна ---------- */
.family { padding: 100px 16px 110px; color: var(--ink); background: linear-gradient(180deg, var(--day) 0%, var(--day2) 100%); }
.family .sec-head p { opacity: 1; color: var(--ink-soft); }
.wall { max-width: 1100px; margin: 48px auto 0; columns: 2; column-gap: 14px; }
.pol {
  display: block; width: 100%;
  margin: 0 0 18px; padding: 8px 8px 10px;
  break-inside: avoid;
  border: 0; background: #fff; text-align: center;
  box-shadow: 0 12px 26px rgba(70,25,80,.18);
  transform: rotate(var(--r, 0deg));
  transition: transform .3s ease;
}
.pol:hover { transform: rotate(0deg) scale(1.02); }
.pol img { width: 100%; height: auto; background: #F3E7EC; }
.pol span { display: block; font-family: var(--hand); font-weight: 500; font-size: 1.3rem; line-height: 1.1; color: var(--ink); margin-top: 6px; }

/* ---------- відео ---------- */
.reels { padding: 100px 0 100px; color: var(--ink); background: linear-gradient(180deg, var(--day2) 0%, #F9B49A 42%, var(--sunset) 100%); }
.reels .sec-head p { opacity: 1; color: var(--ink-soft); }
.reel-row {
  display: flex; gap: 16px;
  max-width: 1120px; margin: 44px auto 0;
  padding: 6px 16px 18px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.reel-row::-webkit-scrollbar { display: none; }
.reel { flex: 0 0 min(64vw, 250px); scroll-snap-align: center; margin: 0; }
.reel-frame { position: relative; aspect-ratio: 464 / 848; border-radius: 22px; overflow: hidden; background: #2A1150; box-shadow: 0 18px 40px rgba(60,10,50,.35); }
.reel video { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-play {
  position: absolute; inset: 0; border: 0; padding: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, transparent 55%, rgba(20,11,52,.45));
  transition: opacity .3s ease;
}
.reel-play span { width: 66px; height: 66px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.reel-play svg { width: 30px; height: 30px; fill: var(--rose); margin-left: 4px; }
.reel.is-playing .reel-play { opacity: 0; pointer-events: none; }
.reel figcaption { font-family: var(--hand); font-weight: 700; font-size: 1.5rem; line-height: 1.1; text-align: center; margin-top: 10px; color: #fff; }

/* ---------- банка побажань ---------- */
.wishes { padding: 100px 16px 110px; background: linear-gradient(180deg, var(--sunset) 0%, var(--plum) 45%, var(--violet) 100%); }
.jar-stage { max-width: 760px; margin: 44px auto 0; display: grid; justify-items: center; gap: 30px; }
.jar { position: relative; width: 210px; height: 270px; padding: 0; border: 0; background: none; transition: transform .2s ease; }
.jar:active { transform: scale(.97) rotate(-2deg); }
.jar:disabled { cursor: default; }
.jar-lid {
  position: absolute; left: 38px; right: 38px; top: 0; height: 34px; z-index: 2;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #FFE7AE, var(--gold) 60%, #C98A2E);
  box-shadow: 0 4px 0 rgba(0,0,0,.15);
}
.jar-bow { position: absolute; left: 50%; bottom: -12px; width: 40px; height: 24px; translate: -50% 0; }
.jar-bow::before, .jar-bow::after {
  content: ""; position: absolute; top: 0; width: 22px; height: 18px; background: var(--rose);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.jar-bow::before { left: -2px; transform: rotate(-24deg); }
.jar-bow::after { right: -2px; transform: rotate(24deg); }
.jar-glass {
  position: absolute; left: 0; right: 0; top: 28px; bottom: 0;
  border-radius: 42px 42px 52px 52px;
  background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,.07) 40%, rgba(255,255,255,.14));
  border: 3px solid rgba(255,255,255,.55);
  overflow: hidden;
}
.jar-shine { position: absolute; top: 22px; left: 18px; width: 14px; height: 120px; border-radius: 10px; background: rgba(255,255,255,.35); }
.jar-notes { position: absolute; inset: 0; }
.note {
  position: absolute; width: 34px; height: 20px; border-radius: 3px;
  background: var(--nc); box-shadow: inset 0 -4px 0 rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.2);
  transform: rotate(var(--nr));
  transition: transform .7s cubic-bezier(.3,0,.2,1), opacity .5s ease .25s;
}
.note.is-out { transform: translate(var(--fx), -300px) rotate(220deg) scale(1.3); opacity: 0; }
.wish {
  width: min(520px, 100%); text-align: center;
  background: #fff; color: var(--ink);
  border-radius: 16px; padding: 22px 22px 26px;
  box-shadow: 0 24px 50px rgba(20,5,40,.35);
  transform: rotate(-1.5deg);
}
.wish-count { margin: 0; font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
.wish-text { margin: 8px 0 0; font-family: var(--hand); font-weight: 700; font-size: 2rem; line-height: 1.12; min-height: 2.24em; }
.wish.is-pop { animation: pop .55s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { 0% { transform: rotate(-1.5deg) scale(.86); opacity: .3; } 100% { transform: rotate(-1.5deg) scale(1); opacity: 1; } }

/* ---------- торт ---------- */
.cake-sec { padding: 100px 16px 110px; background: linear-gradient(180deg, var(--violet) 0%, var(--night2) 100%); }
.cake-stage { display: grid; justify-items: center; gap: 30px; margin-top: 40px; }
.cake { position: relative; width: 280px; height: 300px; }
.plate { position: absolute; left: -10px; right: -10px; bottom: 0; height: 22px; border-radius: 50%; background: linear-gradient(180deg, #fff, #D8CDE6); box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.tier { position: absolute; left: 50%; translate: -50% 0; border-radius: 18px 18px 12px 12px; }
.tier-bottom {
  bottom: 12px; width: 260px; height: 104px;
  background:
    radial-gradient(14px 18px at 10% 0, #fff 98%, transparent) 0 0 / 52px 30px repeat-x,
    linear-gradient(180deg, #fff 0 12px, transparent 12px),
    linear-gradient(180deg, #FF8FB0, var(--rose));
}
.tier-top {
  bottom: 112px; width: 190px; height: 82px;
  background:
    radial-gradient(12px 16px at 10% 0, #fff 98%, transparent) 0 0 / 40px 26px repeat-x,
    linear-gradient(180deg, #fff 0 10px, transparent 10px),
    linear-gradient(180deg, #FFD6E1, #FF9FBC);
}
.tier-bottom::after, .tier-top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 18px; height: 8px;
  background: radial-gradient(circle 4px, var(--gold) 96%, transparent) 0 0 / 18px 8px repeat-x;
}
.candle {
  position: absolute; bottom: 186px; z-index: 2;
  width: 64px; height: 100px; padding: 0; border: 0; background: none;
}
.candle:first-of-type { left: 76px; }
.candle:nth-of-type(2) { right: 76px; }
.digit {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-family: var(--display); font-size: 92px; line-height: .84;
  background: repeating-linear-gradient(135deg, var(--gold2) 0 10px, var(--gold) 10px 20px);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #C98A2E) drop-shadow(0 6px 10px rgba(0,0,0,.25));
}
.flame {
  position: absolute; left: 50%; bottom: 82px; width: 22px; height: 36px; margin-left: -11px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 72%, #fff 0 18%, #FFE27A 34%, #FFA51F 62%, rgba(255,90,30,.0) 74%);
  box-shadow: 0 0 26px 10px rgba(255,190,80,.45);
  transform-origin: 50% 90%;
  animation: flicker 1.1s ease-in-out infinite alternate;
  transition: opacity .25s ease, transform .3s ease;
}
.candle:nth-of-type(2) .flame { animation-delay: -.5s; }
@keyframes flicker {
  0% { transform: rotate(calc(var(--lean, 0) * 1deg - 3deg)) scaleY(1); }
  50% { transform: rotate(calc(var(--lean, 0) * 1deg + 2deg)) scaleY(1.08); }
  100% { transform: rotate(calc(var(--lean, 0) * 1deg - 1deg)) scaleY(.94); }
}
.smoke { position: absolute; left: 50%; bottom: 88px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: rgba(230,225,240,.55); opacity: 0; }
.cake.is-out .flame { opacity: 0; transform: scale(.2) translateY(10px); animation: none; }
.cake.is-out .smoke { animation: smoke 2.4s ease-out forwards; }
@keyframes smoke {
  0% { opacity: .8; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(14px, -120px) scale(6); }
}
.cake-actions, .cake-done { text-align: center; }
.cake-help { margin: 12px 0 0; font-size: .98rem; opacity: .85; min-height: 1.6em; }
.cake-done p { font-family: var(--hand); font-weight: 700; font-size: 2rem; line-height: 1.15; color: var(--gold2); margin: 0 0 8px; max-width: 16em; }

/* ---------- лист ---------- */
.letter-sec { padding: 90px 16px 120px; background: linear-gradient(180deg, var(--night2) 0%, var(--night) 100%); }
.letter {
  position: relative;
  max-width: 600px; margin: 0 auto;
  padding: 58px 28px 40px;
  color: var(--ink);
  background:
    repeating-linear-gradient(180deg, transparent 0 41px, rgba(47,69,200,.12) 41px 42px) 0 52px / 100% calc(100% - 52px) no-repeat,
    #FFFDF9;
  border-radius: 6px;
  box-shadow: 0 30px 70px rgba(0,0,0,.5);
  transform: rotate(-.6deg);
}
.letter p { font-family: var(--hand); font-weight: 500; font-size: 1.62rem; line-height: 1.3; margin: 0 0 .7em; }
.letter .letter-hi { font-weight: 700; font-size: 2.2rem; }
.letter .letter-sign { font-weight: 700; font-size: 2.1rem; text-align: right; margin: 1em 0 0; color: var(--stamp-red); }
.seal {
  position: absolute; top: -30px; left: 50%; margin-left: -32px;
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 1.8rem; color: #FFD9DF;
  background: radial-gradient(circle at 35% 30%, #E8455F, #A3122E 70%);
  box-shadow: 0 6px 14px rgba(0,0,0,.35), inset 0 -3px 6px rgba(0,0,0,.25);
}

/* ---------- фінал ---------- */
.finale {
  min-height: 92vh; min-height: 92svh;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  text-align: center; padding: 24px 16px 40px;
  background-color: var(--night);
}
.finale-sky { flex: none; width: 100%; max-width: 900px; height: 36vh; height: 36svh; }
.finale h2 { font-size: clamp(2.5rem, 10vw, 5rem); line-height: 1.04; max-width: 11em; text-wrap: balance; }
.finale p { font-size: 1.15rem; margin: 0 0 12px; opacity: .9; }
.finale footer { margin-top: auto; padding-top: 80px; font-size: .9rem; opacity: .6; }

/* ---------- перегляд фото ---------- */
.lb {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: rgba(14,6,36,.94);
  padding: 64px 12px 40px;
}
.lb[hidden] { display: none; }
.lb-fig { margin: 0; display: grid; justify-items: center; gap: 12px; max-width: 100%; }
.lb-fig img { max-width: min(92vw, 1000px); max-height: 78vh; max-height: 78svh; width: auto; height: auto; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lb-fig figcaption { font-family: var(--hand); font-size: 1.5rem; color: var(--gold2); text-align: center; min-height: 1em; }
.lb-btn {
  position: absolute; width: 50px; height: 50px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1);
  display: grid; place-items: center;
}
.lb-btn svg { width: 28px; height: 28px; fill: #fff; }
.lb-close { top: max(12px, env(safe-area-inset-top)); right: 12px; }
.lb-prev { left: 10px; top: 50%; margin-top: -25px; }
.lb-next { right: 10px; top: 50%; margin-top: -25px; }

/* ---------- ширші екрани ---------- */
@media (min-width: 720px) {
  .wall { columns: 3; column-gap: 20px; }
  .pol { margin-bottom: 24px; }
}
@media (min-width: 900px) {
  body { font-size: 18px; }
  .days-wrap { grid-template-columns: 360px 1fr; gap: 72px; }
  .window { width: 340px; }
  .route { padding: 30px 24px 40px; }
  .route-line, .plane { left: 50%; }
  .card { width: calc(50% - 64px); max-width: 460px; }
  .card:nth-of-type(odd) { margin-right: auto; }
  .card:nth-of-type(even) { margin-left: auto; }
  .card + .card { margin-top: -230px; }
  .card:nth-of-type(odd)::before { left: auto; right: -72px; }
  .card:nth-of-type(even)::before { left: -72px; }
  .card-next { margin-top: -120px !important; }
  .wall { columns: 4; }
  .reel { flex-basis: 250px; }
  .reel-row { justify-content: center; }
  .jar-stage { grid-template-columns: 220px 1fr; align-items: center; justify-items: start; gap: 48px; }
  .letter { padding: 66px 56px 48px; }
}

@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; }
}
