:root {
  --ivory: #f6efe4;
  --paper: #efe3cf;
  --ink: #2a1f1a;
  --gold: #b8893b;
  --gold2: #d9ad55;
  --gold3: #f1cf86;
  --lapis: #1f4e8c;
  --pom: #a3283a;
  --turq: #2fa3ad;
  --night: #0f1633;
  --muted: #7a6a5c;
  --script: "Marck Script", "Segoe Script", cursive;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --vh: 1vh;
  --gh: 80px;
  --sw: 400px;
}
@supports (height: 1svh) { :root { --vh: 1svh; } }

* { box-sizing: border-box; }
html { background: var(--night); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body.locked { overflow: hidden; height: 100vh; height: 100dvh; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, p { margin: 0; font-weight: inherit; }
h2, .final-sub, .addr, .caption, .gate-script, .fire-hint, .panel-sub { text-wrap: balance; }
.card-text { text-wrap: pretty; }
.script { font-family: var(--script); }

/* ═══════════ СЦЕНА ═══════════ */
#stage { position: fixed; inset: 0; overflow: hidden; cursor: pointer; }
.sky { position: absolute; inset: 0; }
#skySunset { background: linear-gradient(180deg, #f1d9cc 0%, #f6e4d4 30%, #fbeedf 58%, #fdf1dd 80%, #f8dfb6 100%); }
#skyDusk { background: linear-gradient(180deg, #3a2f4a 0%, #6e5068 30%, #a8787f 58%, #dcab98 82%, #f1c9a2 100%); opacity: 0; }
#skyNight { background: linear-gradient(180deg, #0c0b18 0%, #15142a 38%, #221f3d 72%, #352e55 100%); opacity: 0; }
#sun {
  position: absolute; left: 50%; bottom: var(--gh);
  width: 78vmin; height: 78vmin; border-radius: 50%;
  transform: translate(-50%, 50%) translateY(var(--sy, 0%));
  background: radial-gradient(circle, #fff8dd 0 17%, #ffe1a6 25%, rgba(255, 196, 130, .45) 42%, rgba(255, 190, 130, 0) 68%);
}
#moon {
  position: absolute; top: 33%; right: calc(50% - var(--sw) / 2 + 14px);
  width: 54px; height: 54px; border-radius: 50%; opacity: 0;
  transform: translateY(var(--my, 40px));
  background: radial-gradient(circle at 38% 36%, #fffdf2 0%, #f4ecd2 55%, #d9cfb2 100%);
  box-shadow: 0 0 40px 12px rgba(255, 244, 210, .28), 0 0 120px 40px rgba(180, 200, 255, .12);
}
#moon::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 62% 60%, rgba(160, 150, 120, .25) 0 8%, transparent 9%),
              radial-gradient(circle at 36% 66%, rgba(160, 150, 120, .2) 0 6%, transparent 7%),
              radial-gradient(circle at 58% 30%, rgba(160, 150, 120, .18) 0 5%, transparent 6%);
}
#stars, #fx { position: absolute; inset: 0; width: 100%; height: 100%; }
#fx { pointer-events: none; }
#ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--gh);
  background: #e9d8bb;
  box-shadow: 0 -1px 0 rgba(184, 137, 59, .45);
}
#ground::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(0, 0, 0, .18));
}
#scene, .layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.layer { will-change: opacity, transform; }
.cam-l { transform-origin: 50% calc(100% - var(--gh)); }

/* интро: арка прорисовывается после открытия конверта */
.arch-line { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.6s cubic-bezier(.6, .1, .2, 1) .2s; }
#arch .portal { opacity: 0; transition: opacity 1.8s ease .9s; }
body.intro .arch-line { stroke-dashoffset: 0; }
body.intro #arch .portal { opacity: 1; }

.bulb { animation: twinkle 1.6s ease-in-out infinite; animation-delay: var(--d); }
.lamp-glow { animation: twinkle 2.8s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .45; } }

/* ═══════════ ИСТОРИЯ ═══════════ */
#story { position: relative; z-index: 2; }
#story > section { position: relative; height: calc(var(--h) * var(--vh)); pointer-events: none; }
#story > section + section { margin-top: calc(-100 * var(--vh)); }
.pin { position: sticky; top: 0; height: 100vh; height: calc(100 * var(--vh)); overflow: hidden; }
.ov {
  --o: 0; --y: 0px; --tx: -50%; --ty: 0%;
  position: absolute; left: 50%;
  opacity: var(--o);
  transform: translate(var(--tx), calc(var(--ty) + var(--y)));
  will-change: transform, opacity;
}
a, .btn { pointer-events: auto; }

/* ---------- hero ---------- */
.hero { top: 49%; --ty: -50%; width: 100%; padding: 0 16px; text-align: center; }
.hero::before { content: ""; position: absolute; left: 50%; top: 50%; width: min(130vw, 720px); height: 150%; transform: translate(-50%, -50%); z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 246, 228, .92) 0%, rgba(255, 244, 224, .75) 45%, rgba(255, 240, 220, 0) 100%); }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .38em; text-transform: uppercase; color: #9a7438; padding-left: .38em; }
.hero-names { margin: 14px 0 10px; font-family: var(--script); font-weight: 400; line-height: .95; color: #3b2616; }
.hero-names .nm { display: block; font-size: clamp(44px, 12.8vw, 90px); text-shadow: 0 0 18px rgba(255, 244, 222, .95), 0 0 2px rgba(255, 250, 240, .9); }
.hero-names .amp { display: block; font-size: clamp(30px, 8vw, 52px); color: var(--gold); margin: 2px 0; text-shadow: 0 0 14px rgba(255, 244, 222, .95); }
.hero-date { font-size: 21px; font-weight: 600; letter-spacing: .12em; color: #5a3f22; }
.hero-sub { margin-top: 4px; font-size: 15px; letter-spacing: .28em; text-transform: uppercase; color: #9a7438; padding-left: .28em; }
.ch { display: inline-block; opacity: 0; transform: translateY(.35em) scale(.9); filter: blur(6px);
  transition: opacity .9s ease, transform 1.1s cubic-bezier(.2, .8, .2, 1), filter .9s ease;
  transition-delay: calc(var(--i) * 70ms + 1.1s); }
body.intro .ch { opacity: 1; transform: none; filter: none; }
.hero .kicker, .hero .amp, .hero-date, .hero-sub { opacity: 0; transition: opacity 1.2s ease 2.2s; }
body.intro .hero .kicker, body.intro .hero .amp, body.intro .hero-date, body.intro .hero-sub { opacity: 1; }

.scroll-hint { bottom: calc(var(--gh, 80px) + 18px); display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: #6d4436; }
.scroll-hint span { opacity: 0; transition: opacity 1s ease 2.4s; padding-left: .3em; }
.scroll-hint svg { opacity: 0; transition: opacity 1s ease 2.4s; animation: bob 1.8s ease-in-out infinite; }
body.intro .scroll-hint span, body.intro .scroll-hint svg { opacity: 1; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* ---------- подпись встречи ---------- */
.caption { top: max(8%, 70px); width: 100%; padding: 0 16px; text-align: center; font-family: var(--script);
  font-size: clamp(30px, 8.4vw, 46px); color: #7a5528;
  text-shadow: 0 0 18px rgba(255, 248, 232, .95), 0 0 4px rgba(255, 248, 232, .9); }

/* ---------- карточка приглашения ---------- */
.card {
  top: max(7%, 66px); width: min(88vw, 400px); padding: 34px 26px 28px; text-align: center; color: var(--ink);
  background: radial-gradient(ellipse at 50% 0%, #fffaf2 0%, #f8eedd 60%, #f1e2c8 100%);
  border-radius: 6px;
  box-shadow: 0 30px 70px -24px rgba(40, 18, 30, .6), 0 0 0 1px rgba(184, 137, 59, .55),
              inset 0 0 0 7px #fbf4e8, inset 0 0 0 8px rgba(184, 137, 59, .4);
}
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(150, 110, 60, .08) 1px, transparent 1px); background-size: 5px 5px; }
.corner { position: absolute; width: 38px; height: 38px; color: var(--gold); }
.corner.tl { top: 12px; left: 12px; }
.corner.tr { top: 12px; right: 12px; transform: scaleX(-1); }
.corner.bl { bottom: 12px; left: 12px; transform: scaleY(-1); }
.corner.br { bottom: 12px; right: 12px; transform: scale(-1, -1); }
.card-kicker { position: relative; font-family: var(--script); font-size: clamp(28px, 7.6vw, 36px); color: #9a6a3a; line-height: 1.15; }
.divider { display: block; margin: 12px auto 14px; color: var(--gold); }
.card-text { position: relative; font-size: clamp(18px, 4.9vw, 20.5px); line-height: 1.55; font-weight: 500; }
.card-text em { font-style: italic; font-weight: 600; color: #a0605a; }
.card-sign { position: relative; margin-top: 16px; font-size: 16px; font-style: italic; color: var(--muted); line-height: 1.3; }
.card-sign .script { font-style: normal; font-size: 25px; color: var(--ink); }

/* ---------- панели (ночь) ---------- */
.panel { top: max(7%, 66px); width: min(92vw, 430px); text-align: center; color: var(--ivory); }
.panel-kicker { font-family: var(--script); font-size: clamp(30px, 8.4vw, 42px); color: var(--gold3); line-height: 1.15;
  text-shadow: 0 0 22px rgba(241, 207, 134, .45); }
.panel-sub { margin-top: 14px; font-size: 17px; letter-spacing: .08em; color: rgba(246, 239, 228, .88); }
.count-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 20px; }
.count-grid[hidden] { display: none; }
.cell { display: flex; flex-direction: column; align-items: center; padding: 14px 0 12px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(40, 36, 70, .72), rgba(24, 22, 46, .72));
  border: 1px solid rgba(217, 173, 85, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 10px 30px -12px rgba(0, 0, 0, .5);
  }
.num { font-size: clamp(34px, 10vw, 48px); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; color: #fff4dc; }
.num.flip { animation: flip .55s cubic-bezier(.2, .8, .2, 1); }
@keyframes flip { 0% { transform: translateY(-40%) rotateX(70deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.lbl { margin-top: 6px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(241, 207, 134, .9); }
.count-done { margin-top: 18px; font-family: var(--script); font-size: 34px; color: #fff4dc; }

.glass { padding: 24px 20px 22px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(22, 24, 56, .93), rgba(14, 16, 40, .9));
  border: 1px solid rgba(217, 173, 85, .42); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  }
.addr { margin-top: 12px; font-size: clamp(18px, 4.8vw, 20px); font-weight: 600; line-height: 1.45; }
.btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px;
  font-size: 16px; font-weight: 700; letter-spacing: .04em; text-decoration: none; color: var(--ivory);
  border: 1px solid rgba(217, 173, 85, .75); background: rgba(255, 255, 255, .04);
  transition: transform .2s ease, background .2s ease; }
.btn.solid { color: #2a1f1a; border-color: transparent; background: linear-gradient(180deg, #f0cd80, #c9973e); box-shadow: 0 8px 22px -8px rgba(217, 173, 85, .7); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, button:focus-visible { outline: 2px solid var(--gold3); outline-offset: 3px; }

/* ---------- финал ---------- */
.final { top: max(7%, 66px); width: min(92vw, 440px); text-align: center; color: var(--ivory); }
.final-script { font-family: var(--script); font-size: clamp(44px, 12vw, 68px); line-height: 1.05;
  background: linear-gradient(180deg, #fff3d0 10%, #f1cf86 55%, #d9a24a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(241, 207, 134, .45)); padding: 0 .1em; }
.final-sub { margin-top: 10px; font-size: clamp(18px, 4.8vw, 21px); font-style: italic; font-weight: 500; line-height: 1.4; color: rgba(246, 239, 228, .92); }
.final-names { margin-top: 12px; font-size: 16px; font-style: italic; color: rgba(246, 239, 228, .75); }
.final-names .script { font-style: normal; font-size: 26px; color: #fff4dc; }
.fire-hint { position: static; transform: none; margin-top: 16px; font-size: 13px; line-height: 1.6; letter-spacing: .18em; text-transform: uppercase; color: rgba(241, 207, 134, .85); }

/* ═══════════ КОНВЕРТ ═══════════ */
#gate {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px;
  color: #5a3f22; text-align: center;
  background: radial-gradient(ellipse at 50% 42%, #fffaf0 0%, #f7eddb 45%, #ead9b8 100%);
}
.gate-pattern, .gate-shine { position: absolute; inset: 0; background-size: 64px 64px;
  --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M32 4l8 20 20 8-20 8-8 20-8-20-20-8 20-8z'/%3E%3Cpath d='M32 16l4 12 12 4-12 4-4 12-4-12-12-4 12-4z'/%3E%3Ccircle cx='0' cy='0' r='6'/%3E%3Ccircle cx='64' cy='0' r='6'/%3E%3Ccircle cx='0' cy='64' r='6'/%3E%3Ccircle cx='64' cy='64' r='6'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask: var(--pat) 0 0 / 64px 64px repeat; mask: var(--pat) 0 0 / 64px 64px repeat; }
.gate-pattern { background: #c9a15a; opacity: .3; }
.gate-shine { overflow: hidden; }
.gate-shine::before { content: ""; position: absolute; top: 0; bottom: 0; left: -100%; width: 100%; will-change: transform;
  background: linear-gradient(115deg, transparent 20%, #fff6d8 44%, #e8c170 50%, #fff6d8 56%, transparent 80%);
  animation: foil 5.5s ease-in-out infinite; }
@keyframes foil { 0% { transform: translateX(0); } 60%, 100% { transform: translateX(300%); } }
#gateFx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.gate-frame { position: absolute; inset: 14px; border: 1px solid rgba(184, 137, 59, .55); border-radius: 4px; pointer-events: none; }
.gate-frame::after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(184, 137, 59, .3); border-radius: 2px; }
.g-corner { position: absolute; width: 90px; height: 90px; fill: #c9a15a; pointer-events: none; }
.g-corner path { fill: none; stroke: #b8893b; stroke-width: 1.3; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s cubic-bezier(.6, .1, .2, 1) .3s forwards; }
.g-corner.tl { top: 14px; left: 14px; }
.g-corner.tr { top: 14px; right: 14px; transform: scaleX(-1); }
.g-corner.bl { bottom: 14px; left: 14px; transform: scaleY(-1); }
.g-corner.br { bottom: 14px; right: 14px; transform: scale(-1, -1); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.gate-inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.gate-script { font-family: var(--script); font-size: clamp(29px, 8vw, 44px); white-space: nowrap; color: #a57b35; text-shadow: 0 1px 0 rgba(255, 255, 255, .8); }
.gate-script .ch { transition-delay: calc(var(--i) * 55ms + .4s); }
#gate .gate-script .ch { opacity: 1; transform: none; filter: none; animation: chIn 1s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 55ms + .3s); }
@keyframes chIn { from { opacity: 0; transform: translateY(.35em); filter: blur(6px); } }
.gate-names { margin-top: 26px; font-size: 14px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; padding-left: .3em; }
.gate-date { margin-top: 8px; font-size: 14px; letter-spacing: .32em; color: #a57b35; padding-left: .32em; }
.btn-open {
  margin-top: 26px; min-height: 52px; padding: 0 30px; border-radius: 999px; border: 0;
  background: linear-gradient(180deg, #f3d68f, #c9a15a); color: #3b2616; box-shadow: 0 10px 24px -10px rgba(140, 100, 40, .7), inset 0 1px 0 rgba(255, 255, 255, .6); font-size: 18px; font-weight: 600; letter-spacing: .05em;
  animation: glowPulse 2.6s ease-in-out infinite;
}
@keyframes glowPulse { 50% { box-shadow: 0 0 0 7px rgba(201, 161, 90, .18), 0 10px 30px -8px rgba(201, 161, 90, .8), inset 0 1px 0 rgba(255, 255, 255, .6); } }

.env { position: relative; display: block; width: min(80vw, 330px); aspect-ratio: 3 / 2; margin-top: 26px; padding: 0; border: 0; background: none; perspective: 900px;
  filter: drop-shadow(0 22px 28px rgba(120, 85, 35, .35)); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-.6deg); } }
#gate.open .env { animation: none; }
.env > span { position: absolute; display: block; }
.env-back { inset: 0; border-radius: 6px; background: linear-gradient(180deg, #eadbbd, #dfcaa4); }
.letter { left: 6%; right: 6%; top: 7%; height: 86%; z-index: 1; border-radius: 4px;
  background: radial-gradient(ellipse at 50% 20%, #fffaf2, #f5ead6); box-shadow: inset 0 0 0 5px #fffaf2, inset 0 0 0 6px rgba(184, 137, 59, .5);
  transition: transform 1.1s cubic-bezier(.3, .7, .2, 1) 1.15s; }
.letter-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 12%; color: var(--ink); }
.l-script { font-family: var(--script); font-size: clamp(19px, 5.4vw, 24px); }
.l-date { margin-top: 4px; font-size: 12px; letter-spacing: .3em; color: var(--gold); }
.env-front { inset: 0; z-index: 2; border-radius: 6px;
  background: linear-gradient(160deg, #fffaf1 0%, #f3e6cd 100%);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%); box-shadow: inset 0 0 0 5px #fffaf1, inset 0 0 0 6px rgba(184, 137, 59, .6); }
.env-front::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top right, transparent calc(50% - 1px), rgba(150, 110, 60, .25) 50%, transparent calc(50% + 1px)) left bottom / 50% 100% no-repeat,
              linear-gradient(to top left, transparent calc(50% - 1px), rgba(150, 110, 60, .25) 50%, transparent calc(50% + 1px)) right bottom / 50% 100% no-repeat; }
.flap { left: 0; right: 0; top: 0; height: 58%; z-index: 3; transform-origin: 50% 0;
  background: linear-gradient(180deg, #fbf3e3, #ecdbb9); clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: transform .9s cubic-bezier(.6, .05, .3, 1) .4s, z-index 0s linear .85s; }
.seal { left: 50%; top: 58%; z-index: 4; width: 78px; height: 78px; transform: translate(-50%, -50%);
  display: flex !important; align-items: center; justify-content: center;
  border-radius: 47% 53% 49% 51% / 52% 47% 53% 48%;
  background: radial-gradient(circle at 34% 28%, #f6dc9c 0%, #c9a15a 48%, #8c6a2f 100%);
  box-shadow: 0 5px 12px rgba(90, 60, 20, .4), inset 0 0 0 5px rgba(0, 0, 0, .08), inset 0 -3px 8px rgba(80, 50, 10, .3);
  animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 5px 12px rgba(90, 60, 20, .4), 0 0 0 8px rgba(233, 207, 148, .25), 0 0 34px rgba(233, 190, 110, .7), inset 0 0 0 5px rgba(0, 0, 0, .08), inset 0 -3px 8px rgba(80, 50, 10, .3); } }
.seal::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; border: 1.5px solid rgba(255, 246, 220, .55); }
.seal-mono { font-family: var(--script); font-size: 25px; color: #fff8e6; text-shadow: 0 1px 1px rgba(90, 55, 15, .6); }
.env:hover .seal { transform: translate(-50%, -50%) scale(1.04); }

#gate.open .btn-open { animation: none; opacity: 0; transition: opacity .3s; }
#gate.open .seal { animation: sealOff .6s cubic-bezier(.5, 0, .7, .4) forwards; }
#gate.open .flap { transform: rotateX(180deg); z-index: 0; }
#gate.open .letter { transform: translateY(-58%); }
#gate.open .gate-inner { animation: zoomOut 1s cubic-bezier(.6, 0, .3, 1) 2.05s forwards; }
#gate.open { animation: fadeOut .9s ease 2.3s forwards; }
@keyframes sealOff { 35% { transform: translate(-50%, -50%) scale(1.14); } 100% { transform: translate(-50%, -30%) scale(.3) rotate(-30deg); opacity: 0; } }
@keyframes zoomOut { to { transform: scale(1.35); opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }

/* ═══════════ UI ═══════════ */
#progress { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 40; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--gold2), var(--gold3)); }
.langs { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 60; display: flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: rgba(28, 24, 44, .58); border: 1px solid rgba(255, 255, 255, .22); }
.langs button { min-width: 44px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent;
  color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.langs button[aria-pressed="true"] { background: var(--ivory); color: var(--ink); }
#musicBtn { position: fixed; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 60; width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(28, 24, 44, .62); border: 1px solid rgba(241, 207, 134, .55); }
#musicBtn[hidden] { display: none; }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--gold3); transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; } .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
#musicBtn.off .eq i { animation: none; transform: scaleY(.3); opacity: .6; }
#musicBtn.off::after { content: ""; position: absolute; width: 26px; height: 1.6px; background: var(--gold3); transform: rotate(-45deg); }

/* ═══════════ ДЕСКТОП: панели сбоку от сцены ═══════════ */
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .side-l, .side-r { top: 50%; --ty: -50%; width: min(420px, calc(50vw - var(--sw) / 2 - 48px)); }
  .side-l { left: calc(25vw - var(--sw) / 4); }
  .side-r { left: auto; right: calc(25vw - var(--sw) / 4); --tx: 50%; }
  .caption { top: 9%; }
}

@media (min-width: 900px) and (min-height: 640px) {
  .env { width: 440px; }
  .gate-script { font-size: 56px; }
  .gate-names, .gate-date { font-size: 16px; }
  .l-script { font-size: 30px; }
  .seal { width: 96px; height: 96px; }
  .seal-mono { font-size: 31px; }
}

/* ═══════════ reduced motion ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; transition-delay: 0s !important; }
}
#hero:focus { outline: none; }

/* ═══════════ бумажные фигурки ═══════════ */
#couple .paper, .paper { --pg: #2c4280; --pb: #fdfaf3; }
.paper .groom :is(path, rect, circle, ellipse):not(.keep):not(.line) { fill: var(--pg); stroke: none; }
.paper .bride :is(path, rect, circle, ellipse):not(.keep):not(.line) { fill: var(--pb); stroke: none; }
.paper :is(.groom, .bride) .line:not(.keep) { stroke: none; }
.paper .g-legB :is(path) { fill: #22346a !important; }
#grain { position: absolute; inset: 0; pointer-events: none; opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .38  0 0 0 0 .3  0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.firefly { animation: firefly 5s ease-in-out infinite; animation-delay: var(--d); }
@keyframes firefly { 0%, 100% { opacity: .15; transform: translate(0, 0); } 50% { opacity: 1; transform: translate(var(--dx), -10px); } }

/* ═══════════ полароид «Она сказала Да» ═══════════ */
.polaroid { top: max(10%, 88px); width: min(76vw, 320px); margin: 0; padding: 12px 12px 14px; background: #fbf4e8;
  border: 1px solid rgba(201, 161, 90, .7); border-radius: 4px; text-align: center; pointer-events: auto;
  transform: translate(var(--tx), calc(var(--ty) + var(--y))) rotate(var(--r, -3deg));
  box-shadow: 7px 9px 0 -1px #eccbbd, -6px 12px 0 -2px #e3cfae, 0 34px 60px -22px rgba(60, 30, 20, .5), 0 2px 5px rgba(60, 30, 20, .18); }
@media (min-width: 900px) and (min-aspect-ratio: 5/4) { .polaroid { top: 9vh; width: min(300px, 34vh); } }
.polaroid img { display: block; width: 100%; height: auto; aspect-ratio: 640 / 724; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 4px #fffaf2, 0 0 0 5px rgba(201, 161, 90, .55); }
.polaroid .tape { position: absolute; left: 50%; top: -12px; width: 110px; height: 26px; transform: translateX(-50%) rotate(-4deg);
  background: linear-gradient(90deg, rgba(233, 207, 148, .85), rgba(247, 228, 180, .85), rgba(233, 207, 148, .85));
  box-shadow: 0 2px 4px rgba(90, 60, 20, .2); }
.polaroid figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.yes-title { font-family: var(--script); font-size: clamp(26px, 7.4vw, 34px); color: #9a5a52; line-height: 1.1; }
.yes-sub { font-size: 15px; font-style: italic; color: var(--muted); }
/* лица скрыты: кожа и волосы — тень, одежда и украшения остаются */
.paper { --shade: #3b2c3c; }
.faceless .shade { fill: var(--shade); }
.faceless .face { display: none; }
.faceless .b-armJoin > path:nth-child(2), .faceless .b-arm > path:nth-child(2) { opacity: .82; }
