/*
  Зову — библиотека анимаций приглашений (motion kit).
  Каждый эффект включается атрибутом или классом, см. tools/motion-catalog.md.
  Подключать после poster.css: <link rel="stylesheet" href="../../assets/motion.css">
*/

/* ============ 0. ПРЕЛОАДЕР  <html data-preloader="ring|counter|typewriter|heart"> ============ */
.zv-pre { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--pre-bg, var(--bg, #111)); color: var(--pre-fg, var(--accent, #fff)); transition: opacity .7s ease, visibility .7s; }
.zv-pre.done { opacity: 0; visibility: hidden; pointer-events: none; }
.zv-pre__in { display: grid; justify-items: center; gap: 18px; text-align: center; padding: 0 24px; }
.zv-pre svg { width: 120px; height: 120px; }
.zv-pre circle.track { fill: none; stroke: currentColor; stroke-opacity: .18; stroke-width: 1.5; }
.zv-pre circle.draw { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 340; stroke-dashoffset: 340; transform: rotate(-90deg); transform-origin: 50% 50%; animation: zv-draw 1.6s cubic-bezier(.6,0,.2,1) forwards; }
.zv-pre .mono { font: var(--pre-font, italic 500 34px/1 var(--display, serif)); position: absolute; }
.zv-pre .ring-wrap { position: relative; display: grid; place-items: center; }
.zv-pre .count { font: var(--pre-count-font, 400 64px/1 var(--display, serif)); font-variant-numeric: tabular-nums; }
.zv-pre .type { font: var(--pre-font, 500 26px/1.3 var(--display, serif)); min-height: 1.3em; }
.zv-pre .type::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -.12em; background: currentColor; animation: zv-caret .8s steps(1) infinite; }
.zv-pre .heart { width: 46px; height: 46px; background: currentColor; -webkit-mask: var(--zv-heart) center / contain no-repeat; mask: var(--zv-heart) center / contain no-repeat; animation: zv-beat 1s ease-in-out infinite; }
:root { --zv-heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-10-9.3C.4 8.4 2.3 4 6.4 4c2.3 0 3.8 1.3 5.6 3.3C13.8 5.3 15.3 4 17.6 4 21.7 4 23.6 8.4 22 11.7 19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E"); }
@keyframes zv-draw { to { stroke-dashoffset: 0; } }
@keyframes zv-caret { 50% { opacity: 0; } }
@keyframes zv-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(.96); } 45% { transform: scale(1.1); } }

/* ============ 1. ОТКРЫТИЕ ОБЛОЖКИ  <div class="cover" data-cover data-open="..."> ============ */
/* Подсказка-кольцо и надписи прячем в момент открытия, это общий для всех способов шаг */
.cover.zv-opening .cover-to, .cover.zv-opening .cover-hint, .cover.zv-opening .cover-ring, .cover.zv-opening .zv-slide, .cover.zv-opening .cover-extra { opacity: 0 !important; transition: opacity .3s; animation: none; }
.cover.zv-opening::before { opacity: 0; transition: opacity .4s; }
.zv-flash { position: absolute; inset: 0; z-index: 8; pointer-events: none; opacity: 0; background: var(--flash, #fff); }
.zv-flash.go { animation: zv-flash .9s ease-out forwards; }
@keyframes zv-flash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

/* После открытия обложка со своим способом открытия просто растворяется, без общего «влёта» в фото */
.is-open .cover[data-open]:not([data-open="zoom"]) > img { transform: none !important; opacity: 1 !important; transition: none !important; }
.is-open .cover[data-open]:not([data-open="zoom"]) { opacity: 0; transition: opacity .7s var(--cover-fade-delay, .2s), background .3s; }

/* flap: верхний клапан конверта откидывается вверх, изнутри тёплый свет, вспышка */
.cover[data-open="flap"] { perspective: 1400px; }
.zv-flap { position: absolute; inset: 0; z-index: 3; transform-origin: 50% 0; backface-visibility: hidden; clip-path: polygon(0 0, 100% 0, 100% 4%, var(--fx, 50%) var(--flap-y, 52%), 0 4%); transition: transform 1s cubic-bezier(.55,0,.25,1), filter 1s; }
.zv-flap img { width: 100%; height: 100%; object-fit: cover; object-position: var(--fx, 50%) var(--fy, 50%); }
.zv-inside { position: absolute; inset: 0; z-index: 2; pointer-events: none; clip-path: polygon(0 0, 100% 0, 100% 4%, var(--fx, 50%) var(--flap-y, 52%), 0 4%); background: radial-gradient(ellipse at var(--fx, 50%) 20%, rgba(255,214,150,.55), rgba(0,0,0,.25) 45%, rgba(0,0,0,.6)); }
.zv-glow { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; mix-blend-mode: screen; background: radial-gradient(circle at var(--fx, 50%) var(--fy, 50%), var(--glow, rgba(255,220,160,.95)) 0, rgba(255,200,120,.35) 28%, transparent 60%); transition: opacity .9s .35s; }
.cover.zv-opening .zv-flap { transform: rotateX(-178deg); filter: brightness(.6); }
.cover.zv-opening .zv-glow { opacity: 1; }
.cover[data-open="flap"].zv-gone > img, .cover[data-open="flap"].zv-gone .zv-glow { opacity: 0; transition: opacity .7s; }

/* letter: настоящий лист выезжает из конверта.
   Слои (все — фото/вырезки из Higgsfield): задняя часть открытого конверта, лист с текстом, передний карман.
   <div class="cover" data-cover data-open="letter">
     <img src="стол.webp" alt="">                      — фон
     <div class="zv-letter" aria-hidden="true">
       <img class="zv-env-back" src="env-back.webp">
       <div class="zv-card-clip"><div class="zv-card"><img src="card.webp"><div class="zv-card__text">…</div></div></div>
       <img class="zv-env-front" src="env-front.webp">
     </div>
   Положение листа в конверте: --card-left, --card-w, --card-top, --card-ratio (ширина/высота листа), --env-bottom. */
.zv-letter { position: absolute; z-index: 3; left: 50%; top: var(--letter-y, 52%); width: min(var(--letter-w, 92vw), 440px); aspect-ratio: 1; transform: translate(-50%, -50%); transition: transform 1.2s cubic-bezier(.45,0,.15,1); }
.zv-env-back, .zv-env-front { position: absolute; inset: 0; width: 100%; height: 100%; }
.zv-env-back { filter: drop-shadow(0 26px 30px rgba(0,0,0,.45)); }
.zv-env-front { z-index: 3; pointer-events: none; }
.zv-card-clip { position: absolute; inset: 0; z-index: 2; clip-path: inset(-300% -50% var(--env-bottom, 2%) -50%); }
.zv-card { position: absolute; left: var(--card-left, 17%); width: var(--card-w, 66%); top: var(--card-top, 48%); aspect-ratio: var(--card-ratio, .729); container-type: inline-size;
  animation: zv-peek 2.8s ease-in-out infinite; filter: drop-shadow(0 10px 16px rgba(0,0,0,.25)); }
.zv-card > img { width: 100%; height: 100%; display: block; }
.zv-card__text { position: absolute; inset: 0; display: grid; align-content: start; justify-items: center; text-align: center; padding: var(--card-pad-top, 26%) 12% 0; color: var(--card-ink, #2A231C); }
@keyframes zv-peek { 50% { translate: 0 -3%; } }
.cover[data-open="letter"].zv-out .zv-card-clip { clip-path: none; }
.cover[data-open="letter"].zv-opening .zv-letter-hint { opacity: 0; }
/* Печать, скрепляющая лист с конвертом: <img class="zv-seal" src="seal.webp"> внутри .zv-letter.
   По касанию сначала снимается печать, потом выезжает лист. Положение: --seal-x, --seal-y, --seal-w. */
.zv-seal { position: absolute; z-index: 4; left: var(--seal-x, 50%); top: var(--seal-y, 70%); width: var(--seal-w, 22%); transform: translate(-50%, -50%); filter: drop-shadow(0 6px 8px rgba(40,5,10,.45)); animation: zv-seal-breathe 2.6s ease-in-out infinite; }
@keyframes zv-seal-breathe { 50% { scale: 1.05; } }
.zv-letter:has(.zv-seal) .zv-card { animation: none; }
@media (prefers-reduced-motion: reduce) { .zv-card, .zv-seal { animation: none; } }

/* slide: «проведите, чтобы открыть» — ползунок на дорожке */
.zv-slide { position: absolute; z-index: 6; left: 50%; bottom: max(96px, calc(env(safe-area-inset-bottom) + 80px)); width: min(300px, 80vw); height: 64px; transform: translateX(-50%); border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); touch-action: none; }
.zv-slide__label { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 52px; color: #fff; font: 500 15px/1 var(--text, sans-serif); letter-spacing: .04em; pointer-events: none; animation: zv-pulse 2.2s ease-in-out infinite; }
.zv-slide__knob { position: absolute; left: 6px; top: 6px; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--slide-ink, #111); display: grid; place-items: center; cursor: grab; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.zv-slide__knob svg { width: 22px; height: 22px; }
.zv-slide__target { position: absolute; right: 8px; top: 8px; width: 48px; height: 48px; border-radius: 50%; border: 1.5px dashed rgba(255,255,255,.7); }
.zv-slide.snap .zv-slide__knob { transition: transform .35s cubic-bezier(.3,1.4,.5,1); }
@keyframes zv-pulse { 50% { opacity: .55; } }

/* Сцена за обложкой «Кен Бёрнс» после открытия: <header class="hero" data-kenburns> */
.is-open [data-kenburns] .hero__img { animation: zv-kb 7s ease-out both !important; }
@keyframes zv-kb { from { transform: scale(1.18); } to { transform: scale(1.04); } }

/* ============ 2. ПЕРВОЕ ФОТО  <img class="hero__img" data-hero-fx="gray|blur|rise|zoomout"> ============ */
.is-open [data-hero-fx="gray"] { animation: zv-gray 2.2s .5s ease both !important; }
.is-open [data-hero-fx="blur"] { animation: zv-blur 2.6s .3s ease both !important; }
.is-open [data-hero-fx="rise"] { animation: zv-rise 1.4s .3s cubic-bezier(.2,.8,.2,1) both !important; }
.is-open [data-hero-fx="zoomout"] { animation: zv-zoomout 2.4s .2s cubic-bezier(.2,.8,.2,1) both !important; }
[data-hero-fx="gray"] { filter: grayscale(1); } [data-hero-fx="blur"] { filter: blur(18px); }
@keyframes zv-gray { from { filter: grayscale(1) contrast(1.1); } to { filter: grayscale(0); } }
@keyframes zv-blur { from { filter: blur(18px); transform: scale(1.1); } to { filter: blur(0); transform: scale(1.04); } }
@keyframes zv-rise { from { transform: translateY(30%); opacity: 0; } to { transform: translateY(0) scale(1.04); opacity: 1; } }
@keyframes zv-zoomout { from { transform: scale(1.5); } to { transform: scale(1.04); } }

/* ============ 3. ТЕКСТ  data-split="letters|words" data-fx="rise|blur|drop|pop|wave"  ·  data-write  ·  data-type  ·  data-countup ============ */
.zv-ch { display: inline-block; white-space: pre; }
[data-split] .zv-ch { opacity: 0; }
[data-split].zv-in .zv-ch { animation: zv-ch-rise .7s calc(var(--i) * var(--step, 45ms) + var(--delay, 0ms)) cubic-bezier(.2,.8,.2,1) both; }
[data-split][data-fx="blur"].zv-in .zv-ch { animation-name: zv-ch-blur; animation-duration: .9s; }
[data-split][data-fx="drop"].zv-in .zv-ch { animation-name: zv-ch-drop; }
[data-split][data-fx="pop"].zv-in .zv-ch { animation-name: zv-ch-pop; animation-timing-function: cubic-bezier(.3,1.6,.5,1); }
[data-split][data-fx="wave"].zv-in .zv-ch { animation-name: zv-ch-wave; }
@keyframes zv-ch-rise { from { opacity: 0; transform: translateY(.45em); } to { opacity: 1; transform: none; } }
@keyframes zv-ch-blur { from { opacity: 0; filter: blur(10px); transform: scale(1.15); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes zv-ch-drop { from { opacity: 0; transform: translateY(-.8em) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes zv-ch-pop { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
@keyframes zv-ch-wave { 0% { opacity: 0; transform: translateY(.6em); } 60% { opacity: 1; transform: translateY(-.12em); } 100% { opacity: 1; transform: none; } }

/* Рукописное «пишется» слева направо */
[data-write] { clip-path: inset(-20% 100% -20% 0); }
[data-write].zv-in { animation: zv-write var(--write-dur, 2s) var(--delay, 0ms) cubic-bezier(.55,.1,.35,1) forwards; }
@keyframes zv-write { to { clip-path: inset(-20% -5% -20% 0); } }

[data-type].zv-typing::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -.1em; background: currentColor; animation: zv-caret .8s steps(1) infinite; }

/* Текст рассыпается в пыль, когда уходит вверх (для браузеров с анимацией по прокрутке) */
@supports (animation-timeline: view()) {
  [data-dust] .zv-ch { animation: zv-dust linear both; animation-timeline: view(); animation-range: exit 10% exit 80%; }
}
@keyframes zv-dust { to { opacity: 0; transform: translate(var(--dx, 0px), var(--dy, -40px)) rotate(var(--dr, 0deg)); filter: blur(3px); } }

/* ============ 4. ПОЯВЛЕНИЕ БЛОКОВ  data-reveal="up|left|right|zoom|blur|flip|clip" (вместо .rv) ============ */
[data-reveal] { opacity: 0; transition: opacity .9s cubic-bezier(.22,.61,.36,1), transform .9s cubic-bezier(.22,.61,.36,1), filter .9s; transition-delay: var(--delay, 0ms); }
[data-reveal="clip"] { transition: clip-path 1.1s cubic-bezier(.7,0,.2,1); }
[data-reveal="up"] { transform: translateY(28px); }
[data-reveal="left"] { transform: translateX(-40px); }
[data-reveal="right"] { transform: translateX(40px); }
[data-reveal="zoom"] { transform: scale(.88); }
[data-reveal="blur"] { filter: blur(12px); }
[data-reveal="flip"] { transform: perspective(800px) rotateX(35deg); transform-origin: 50% 100%; }
[data-reveal="clip"] { opacity: 1; clip-path: inset(0 0 100% 0); }
[data-reveal].zv-in { opacity: 1; transform: none; filter: none; }
[data-reveal="clip"].zv-in { clip-path: inset(0 0 0 0); }
/* после появления ничего не обрезаем: иначе тени и кольца вокруг фото срезаются квадратом */
[data-reveal]:not([data-reveal="clip"]) { clip-path: none; }

/* ============ 5. МАСКИ И РАМКИ ФОТО ============ */
.m-arch { border-radius: 999px 999px 0 0; overflow: hidden; }
.m-arch-inv { border-radius: 0 0 999px 999px; overflow: hidden; }
.m-capsule { border-radius: 999px; overflow: hidden; }
.m-circle { border-radius: 50%; overflow: hidden; aspect-ratio: 1; }
.m-leaf { border-radius: 0 70% 0 70% / 0 70% 0 70%; overflow: hidden; }
.m-outline { position: relative; }
.m-outline::before { content: ""; position: absolute; inset: 0; transform: translate(12px, 12px); border: 1px solid var(--outline, var(--accent)); border-radius: inherit; z-index: -1; pointer-events: none; }
.m-polaroid { background: #fff; padding: 12px 12px 46px; box-shadow: 0 16px 34px rgba(0,0,0,.28); }
.zv-stack { position: relative; display: grid; }
.zv-stack > * { grid-area: 1 / 1; }
.zv-stack > :first-child { transform: rotate(-6deg) translate(-14px, 6px); filter: brightness(.9); }
.zv-stack > :last-child { transform: rotate(3deg); }

/* Фото «лестницей», каждое растворяется в следующее (стопка путешествия) */
.zv-fadestack img { width: 100%; display: block; -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent); margin-top: -12%; }
.zv-fadestack img:first-child { margin-top: 0; }

/* Буквы, залитые фотографией */
.zv-knock { background-size: cover; background-position: 50% 50%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
@supports (animation-timeline: view()) { .zv-knock { animation: zv-knock linear both; animation-timeline: view(); animation-range: cover; } }
@keyframes zv-knock { from { background-position: 50% 0%; } to { background-position: 50% 100%; } }

/* ============ 6. ПРЕДМЕТЫ НА СТЫКАХ И ВЫХОДЯЩИЕ ИЗ РАМКИ ============ */
/* <img class="zv-prop" data-prop="left|right" style="top:-60px; width:46%"> — выезжает из края при появлении */
.zv-prop { position: absolute; z-index: 4; pointer-events: none; max-width: none; transition: transform 1.2s cubic-bezier(.2,.8,.2,1), opacity 1s; opacity: 0; }
.zv-prop[data-prop="left"] { left: -6%; transform: translateX(-60%) rotate(-12deg); }
.zv-prop[data-prop="right"] { right: -6%; transform: translateX(60%) rotate(12deg); }
.zv-prop.zv-in { opacity: 1; transform: none; }
/* Вырезанный объект поднимается из блока и перекрывает текст выше */
@supports (animation-timeline: view()) {
  [data-popout] { animation: zv-popout linear both; animation-timeline: view(); animation-range: entry 0% cover 55%; }
  [data-meet] .meet-l { animation: zv-meet-l linear both; animation-timeline: view(); animation-range: entry 10% cover 50%; }
  [data-meet] .meet-r { animation: zv-meet-r linear both; animation-timeline: view(); animation-range: entry 10% cover 50%; }
  [data-drift] { animation: zv-drift linear both; animation-timeline: view(); animation-range: cover; }
}
@keyframes zv-popout { from { transform: translateY(45%) scale(.92); } to { transform: none; } }
@keyframes zv-meet-l { from { transform: translateX(-70%); } to { transform: none; } }
@keyframes zv-meet-r { from { transform: translateX(70%); } to { transform: none; } }
@keyframes zv-drift { from { transform: translateY(calc(var(--drift, 80px) * 1)); } to { transform: translateY(calc(var(--drift, 80px) * -1)); } }

/* Рваный край между блоками: <div class="zv-edge" data-edge="torn|wave|scallop" style="--edge-color:#F3ECDF"></div> */
.zv-edge { position: absolute; left: 0; right: 0; height: 34px; top: -33px; z-index: 2; pointer-events: none; color: var(--edge-color, var(--paper)); }
.zv-edge svg { width: 100%; height: 100%; display: block; }
.zv-edge--bottom { top: auto; bottom: -33px; transform: scaleY(-1); }

/* ============ 7. ДАТА И ОТСЧЁТ ============ */
.date-wheel { display: flex; justify-content: center; align-items: center; gap: 14px; font: var(--wheel-font, 400 26px/1 var(--display)); }
.date-wheel span { opacity: .35; transform: scale(.8); }
.date-wheel span:nth-child(2), .date-wheel span:nth-child(4) { opacity: .6; transform: scale(.92); }
.date-wheel b { font-size: 2.6em; font-weight: inherit; color: var(--accent); padding: 0 6px; border-left: 1px solid currentColor; border-right: 1px solid currentColor; }
.date-wheel.zv-in span, .date-wheel.zv-in b { animation: zv-wheel .9s calc(var(--i, 0) * 70ms) cubic-bezier(.2,.8,.2,1) both; }
@keyframes zv-wheel { from { transform: translateY(40px); opacity: 0; } }
.date-stack { display: grid; gap: 6px; justify-items: center; }
.date-stack div { display: flex; align-items: baseline; gap: 12px; }
.date-stack b { font: var(--stack-font, 400 64px/1 var(--display)); color: var(--accent); }
.date-stack small { font: italic 400 20px/1 var(--display); opacity: .8; min-width: 70px; text-align: left; }
.cd--boxed > div { border: 1px solid var(--line, rgba(255,255,255,.3)); border-radius: 12px; padding: 12px 4px; }
.cd--divided > div + div { border-left: 1px solid var(--line, rgba(255,255,255,.3)); }
.cd--tilt { transform: rotate(-6deg); border: 1px solid var(--accent); border-radius: 999px; padding: 14px 10px; }
.cd--diag { transform: rotate(-9deg); position: relative; }
.cd--diag::before { content: ""; position: absolute; left: -20%; right: -20%; top: 50%; border-top: 1px solid var(--accent); opacity: .5; z-index: -1; }

/* ============ 8. ФОН И АТМОСФЕРА ============ */
canvas.zv-ambient { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
.zv-aurora { position: relative; overflow: hidden; isolation: isolate; }
.zv-aurora::before, .zv-aurora::after { content: ""; position: absolute; z-index: -1; width: 90%; aspect-ratio: 1; border-radius: 50%; filter: blur(60px); opacity: .55; animation: zv-aur 14s ease-in-out infinite alternate; }
.zv-aurora::before { background: var(--aur-a, #ff9a62); left: -30%; top: -20%; }
.zv-aurora::after { background: var(--aur-b, #6a7dff); right: -30%; bottom: -20%; animation-delay: -7s; }
@keyframes zv-aur { to { transform: translate(25%, 20%) scale(1.2); } }
.zv-watermark { position: absolute; z-index: 0; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); font: var(--wm-font, 400 120px/1 var(--display)); white-space: nowrap; opacity: .06; pointer-events: none; letter-spacing: .04em; }
.zv-neon { color: #fff; text-shadow: 0 0 4px #fff, 0 0 12px var(--neon, #ff4fd8), 0 0 28px var(--neon, #ff4fd8), 0 0 48px var(--neon, #ff4fd8); animation: zv-flick 5s infinite; }
@keyframes zv-flick { 0%, 92%, 100% { opacity: 1; } 93% { opacity: .4; } 94% { opacity: 1; } 96% { opacity: .6; } }
.zv-hint { display: grid; justify-items: center; gap: 6px; margin-top: 28px; font-size: 14px; opacity: .8; }
.zv-hint::after { content: ""; width: 12px; height: 12px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); animation: zv-bob 1.6s ease-in-out infinite; }
@keyframes zv-bob { 50% { transform: translateY(6px) rotate(45deg); } }



/* unfold: сложенная открытка раскрывается (обложка открытки — отдельная картинка, внутри — лист с текстом) */
.zv-fold { position: absolute; z-index: 3; left: 50%; top: var(--fold-y, 52%); width: min(var(--fold-w, 70vw), 320px); aspect-ratio: var(--fold-ratio, .72); transform: translate(-50%, -50%); perspective: 1600px; }
.zv-fold__inside, .zv-fold__front { position: absolute; inset: 0; container-type: inline-size; }
.zv-fold__inside > img, .zv-fold__front > img { width: 100%; height: 100%; display: block; }
.zv-fold__inside { filter: drop-shadow(0 24px 34px rgba(0,0,0,.4)); }
.zv-fold__front { transform-origin: 0 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; filter: drop-shadow(0 24px 34px rgba(0,0,0,.4)); animation: zv-breathe 3s ease-in-out infinite; }
@keyframes zv-breathe { 50% { transform: rotateY(-7deg); } }

/* lift: фото/карточка лежит на столе, по касанию поднимается к зрителю */
.zv-lift { position: absolute; z-index: 3; left: 50%; top: var(--lift-y, 50%); width: min(var(--lift-w, 76vw), 340px); transform: translate(-50%, -50%) rotate(var(--lift-rot, -4deg)); container-type: inline-size; }
/* тень на картинке, а не на всём блоке: иначе текст на повёрнутой карточке иногда не рисуется */
.zv-lift > img { width: 100%; display: block; filter: drop-shadow(0 18px 24px rgba(0,0,0,.45)); }

/* gift: крышка коробки поднимается, изнутри свет */
.zv-gift { position: absolute; z-index: 3; left: 50%; top: var(--gift-y, 56%); width: min(var(--gift-w, 74vw), 340px); aspect-ratio: 1; transform: translate(-50%, -50%); }
.zv-gift__box, .zv-gift__lid { position: absolute; left: 0; width: 100%; filter: drop-shadow(0 18px 24px rgba(0,0,0,.4)); }
.zv-gift__box { bottom: 0; }
.zv-gift__lid { top: var(--lid-top, 0); z-index: 2; animation: zv-lid 2.4s ease-in-out infinite; }
.zv-gift__glow { position: absolute; left: 10%; right: 10%; top: 30%; height: 40%; z-index: 1; border-radius: 50%; background: radial-gradient(closest-side, var(--gift-glow, rgba(255,236,170,.95)), transparent); opacity: 0; filter: blur(6px); }
@keyframes zv-lid { 50% { transform: translateY(-3%) rotate(-1.5deg); } }

/* dissolve: обложка мягко уходит в размытие, вслед за ней — лепестки/блёстки (data-burst) */
.cover[data-open="dissolve"].zv-opening > img { transition: filter 1.4s ease, transform 1.6s cubic-bezier(.2,.8,.2,1), opacity 1.2s .3s; filter: blur(18px) brightness(1.15); transform: scale(1.12); opacity: 0; }
.cover[data-open="dissolve"] { transition: background .8s .6s; }
.cover[data-open="dissolve"].zv-opening { background: transparent; }
@media (prefers-reduced-motion: reduce) { .zv-fold__front, .zv-gift__lid { animation: none; } }

/* ===================================================================
   v3 — новые открытия и блоки (каждый шаблон берёт свой, без повторов)
   =================================================================== */

/* flip: карточка/билет парит, по касанию переворачивается, показывает оборот и улетает в страницу */
.zv-flip { position: absolute; z-index: 3; left: 50%; top: var(--flip-y, 50%); width: min(var(--flip-w, 72vw), 330px); aspect-ratio: var(--flip-ratio, .56); transform: translate(-50%, -50%); perspective: 1400px; }
.zv-flip__in { position: absolute; inset: 0; transform-style: preserve-3d; animation: zv-sway 5s ease-in-out infinite; }
.zv-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; container-type: inline-size; filter: drop-shadow(0 30px 40px rgba(0,0,0,.45)); }
.zv-face > img { width: 100%; height: 100%; display: block; }
.zv-face--back { transform: rotateY(180deg); }
@keyframes zv-sway { 0%, 100% { transform: rotateY(-9deg) rotateX(3deg); } 50% { transform: rotateY(9deg) rotateX(-2deg); } }

/* countdown: по касанию 3 · 2 · 1, вспышка — и праздник */
.zv-count { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; pointer-events: none; }
.zv-count span { grid-area: 1 / 1; font: var(--count-font, 400 46vw/1 var(--display, serif)); color: var(--count-color, #fff); opacity: 0; text-shadow: 0 10px 40px rgba(0,0,0,.45); }
.zv-count span.go { animation: zv-count .62s cubic-bezier(.2,.8,.2,1) both; }
@keyframes zv-count { 0% { opacity: 0; transform: scale(.55); filter: blur(8px); } 35% { opacity: 1; transform: scale(1); filter: blur(0); } 100% { opacity: 0; transform: scale(1.35); filter: blur(4px); } }
.cover[data-open="countdown"].zv-opening > img { transition: filter .6s, transform 2.2s cubic-bezier(.2,.8,.2,1); filter: brightness(.45) blur(2px); transform: scale(1.08); }

/* Панорама: широкое фото едет вбок, пока листаете  <section class="zv-pan" data-pan><div class="zv-pan__stage"><img>…подпись…</div></section> */
.zv-pan { position: relative; height: 240vh; }
.zv-pan__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.zv-pan__stage > img { height: 100%; width: auto; max-width: none; display: block; transform: translateX(calc(var(--p, 0) * (var(--pan-w, 100vw) - 100%))); will-change: transform; }
.zv-pan__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 120px 28px max(48px, 7vh); text-align: center; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75) 55%); }
@supports (animation-timeline: view()) {
  .zv-pan { view-timeline: --pan block; }
  .zv-pan__stage > img { animation: zv-pan linear both; animation-timeline: --pan; animation-range: contain 0% contain 100%; }
}
@keyframes zv-pan { from { transform: translateX(0); } to { transform: translateX(calc(var(--pan-w, 100vw) - 100%)); } }

/* Фото наливается цветом и приближается, пока листаете  <figure class="zv-colorize"><img></figure> */
.zv-colorize { margin: 0; overflow: hidden; position: relative; }
.zv-colorize img { width: 100%; display: block; filter: grayscale(calc(1 - var(--p, .5) * 1.6)) brightness(calc(.75 + var(--p, .5) * .4)); transform: scale(calc(1.15 - var(--p, .5) * .15)); }
@supports (animation-timeline: view()) { .zv-colorize img { animation: zv-colorize linear both; animation-timeline: view(); animation-range: entry 0% cover 55%; } }
@keyframes zv-colorize { from { filter: grayscale(1) brightness(.7); transform: scale(1.15); } to { filter: grayscale(0) brightness(1.02); transform: scale(1); } }

/* Карточка наезжает на фото  <section class="zv-overlap"><img class="zv-overlap__img" data-drift><div class="zv-overlap__card">…</div></section> */
.zv-overlap { position: relative; padding-bottom: 72px; }
.zv-overlap__img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; --drift: 40px; }
.zv-overlap__card { position: relative; z-index: 2; margin: -34% 22px 0; padding: 34px 26px 30px; text-align: center; box-shadow: 0 26px 60px rgba(0,0,0,.35); border-radius: var(--card-r, 4px); }

/* Отсчёт столбиком: огромные цифры, подпись справа */
.cd--stack { display: grid; grid-template-columns: 1fr; gap: 0; max-width: 340px; margin: 26px auto 0; text-align: left; }
.cd--stack > div { display: flex; align-items: baseline; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line, rgba(255,255,255,.2)); }
.cd--stack strong { font-size: var(--stack-size, 76px); line-height: 1; min-width: 2.4ch; text-align: right; }
.cd--stack small { font-size: 18px; margin: 0; }

/* Отсчёт карточками-конфетками */
.cd--cards { gap: 10px; }
.cd--cards > div { background: var(--cards-bg, #FF7A59); color: var(--cards-fg, #10164F); border-radius: 18px; padding: 16px 4px 12px; box-shadow: 0 10px 0 rgba(0,0,0,.18); }
.cd--cards > div:nth-child(odd) { rotate: -4deg; } .cd--cards > div:nth-child(even) { rotate: 3deg; background: var(--cards-bg2, #FFE27A); }
.cd--cards strong { color: inherit !important; }

/* Ответ гостя: варианты оформления */
.rsvp-sheet form { margin-top: 18px; text-align: left; }
.rsvp-plain form { margin-top: 26px; text-align: left; }
.rsvp-plain label, .rsvp-plain legend { display: block; font-size: 15px; color: var(--muted); }
.rsvp-plain input[type=text], .rsvp-plain input[type=number] { width: 100%; font: 400 19px/1.3 var(--text); color: var(--fg); background: transparent; border: 0; border-bottom: 1px solid var(--accent); padding: 8px 2px 10px; margin: 4px 0 20px; border-radius: 0; }
.rsvp-plain fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.rsvp-plain .radio { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 18px; color: var(--fg); }
.rsvp-plain .radio input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }
.rsvp-plain .note { color: inherit; }
.card--stub { border-radius: 16px; -webkit-mask: radial-gradient(circle 14px at 0 86px, transparent 13.5px, #000 14px) left / 51% 100% no-repeat, radial-gradient(circle 14px at 100% 86px, transparent 13.5px, #000 14px) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 14px at 0 86px, transparent 13.5px, #000 14px) left / 51% 100% no-repeat, radial-gradient(circle 14px at 100% 86px, transparent 13.5px, #000 14px) right / 51% 100% no-repeat; padding-top: 30px; }
.card--stub .stub-head { display: flex; justify-content: space-between; font-size: 14px; color: var(--paper-muted); padding-bottom: 24px; border-bottom: 2px dashed rgba(0,0,0,.2); margin-bottom: 26px; }

@media (prefers-reduced-motion: reduce) {
  [data-split] .zv-ch, [data-write], [data-reveal], .zv-prop { opacity: 1 !important; transform: none !important; filter: none !important; clip-path: none !important; animation: none !important; }
  canvas.zv-ambient, .zv-aurora::before, .zv-aurora::after, .zv-flip__in, .zv-pan__stage > img, .zv-colorize img { animation: none; }
}
