/* Cover and ambient motion. Section entrances are handled by scroll-motion.js. */

.cv > main { position: relative; z-index: 1; }

/* ── Cover entrance ───────────────────────────────────────────────────────── */
html.js .cv:not(.has-opening) .st-in > *, html.js .cv.is-opened .st-in > *,
html.js .cv:not(.has-opening) .kk-hero > :not(.inv-backdrop, .cv-langs), html.js .cv.is-opened .kk-hero > :not(.inv-backdrop, .cv-langs),
html.js .cv:not(.has-opening) .kc-body > *, html.js .cv.is-opened .kc-body > *,
html.js .cv:not(.has-opening) .zh-cover > :not(.inv-backdrop, .cv-langs), html.js .cv.is-opened .zh-cover > :not(.inv-backdrop, .cv-langs) {
  animation: mo-rise 1s cubic-bezier(.2,.7,.2,1) backwards;
}
html.js .cv :is(.st-in, .kk-hero, .kc-body, .zh-cover) > :nth-child(2) { animation-delay: 0.12s; }
html.js .cv :is(.st-in, .kk-hero, .kc-body, .zh-cover) > :nth-child(3) { animation-delay: 0.24s; }
html.js .cv :is(.st-in, .kk-hero, .kc-body, .zh-cover) > :nth-child(4) { animation-delay: 0.36s; }
html.js .cv :is(.st-in, .kk-hero, .kc-body, .zh-cover) > :nth-child(5) { animation-delay: 0.48s; }
html.js .cv :is(.st-in, .kk-hero, .kc-body, .zh-cover) > :nth-child(6) { animation-delay: 0.6s; }
html.js .cv :is(.st-in, .kk-hero, .kc-body, .zh-cover) > :nth-child(7) { animation-delay: 0.72s; }
html.js .cv :is(.st-in, .kk-hero, .kc-body, .zh-cover) > :nth-child(n+8) { animation-delay: 0.84s; }
@keyframes mo-rise { from { opacity: 0; transform: translateY(22px); } }
/* Picture covers (.st-obraz-pic): after an opening the text is already in place under the dissolving picture (the opening's last frame = the cover's first),
   so it must not enter a second time. Without an opening the text only fades in, no travel. */
html.js .cv.is-opened .st-obraz-pic .st-in > * { animation: none; }
html.js .cv:not(.has-opening) .st-obraz-pic .st-in > * { animation: mo-fade 0.7s ease-out backwards; }
@keyframes mo-fade { from { opacity: 0; } }

/* Oyu: the felt frame opens from the middle, the motif turns in. */
html.js .cv:is(:not(.has-opening), .is-opened) .st-oyu .st-in { animation: mo-frame 1.1s cubic-bezier(.6,0,.2,1) backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-oyu .st-art { animation: mo-turn-in 1.4s cubic-bezier(.2,.7,.2,1) 0.2s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-oyu.m-tunduk .st-art { animation: mo-turn-in 1.4s cubic-bezier(.2,.7,.2,1) 0.2s backwards, mo-spin 80s linear 1.6s infinite; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-oyu .st-names { animation: mo-spread 1.2s cubic-bezier(.2,.7,.2,1) 0.45s backwards; }
@keyframes mo-frame { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }
@keyframes mo-turn-in { from { opacity: 0; transform: rotate(-90deg) scale(0.5); } }
@keyframes mo-spin { to { transform: rotate(360deg); } }
@keyframes mo-spread { from { opacity: 0; letter-spacing: 0.4em; } }

/* Gulzar: the flowers bloom and sway, the names are written left to right. */
html.js .cv:is(:not(.has-opening), .is-opened) .st-gulzar :is(.gz-top, .gz-bottom) { animation: mo-bloom 1.6s cubic-bezier(.2,.7,.2,1) backwards, mo-sway 7s ease-in-out 1.6s infinite; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-gulzar .gz-bottom { animation-delay: 0.3s, 1.9s; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-gulzar .st-names { animation: mo-write 1.8s cubic-bezier(.45,0,.25,1) 0.35s backwards; }
@keyframes mo-bloom { from { opacity: 0; scale: 0.4; } }
@keyframes mo-sway { 0%, 100% { translate: 0 0; } 50% { translate: 6px -4px; } }
@keyframes mo-write { from { clip-path: inset(-20% 100% -20% 0); } to { clip-path: inset(-20% -5% -20% 0); } }

/* Jash: blobs float, the motif bounces in, names land with a bounce, tiles pop. */
html.js .cv .st-jash .js-blob { animation: mo-float 9s ease-in-out infinite alternate; }
html.js .cv .st-jash .js-blob-2 { animation-duration: 11s; animation-delay: -3s; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-jash .st-art { animation: mo-drop 1s cubic-bezier(.3,1.5,.5,1) backwards, mo-bob 4s ease-in-out 1s infinite; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-jash .st-names { animation: mo-land 0.9s cubic-bezier(.3,1.5,.5,1) 0.3s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .js-tile { animation: mo-pop 0.6s cubic-bezier(.3,1.6,.5,1) backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .js-tile + .js-tile { animation-delay: 0.12s; }
@keyframes mo-float { to { translate: 8% 6%; scale: 1.08; } }
@keyframes mo-drop { from { opacity: 0; transform: translateY(-40px) scale(0.8); } }
@keyframes mo-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes mo-land { from { opacity: 0; transform: translateY(40px) rotate(-4deg) scale(1.08); } }
@keyframes mo-pop { from { opacity: 0; transform: scale(0.6); } }

/* Saray: the art glows in, the monogram turns, the rule draws, the names close their spacing. */
html.js .cv:is(:not(.has-opening), .is-opened) .st-saray .st-art { animation: mo-glow-in 1.6s ease backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-saray .sr-mono { animation: mo-turn-in 1.2s cubic-bezier(.2,.7,.2,1) 0.3s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-saray .sr-rule { animation: mo-draw 1s cubic-bezier(.6,0,.2,1) 0.7s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-saray .st-names { animation: mo-spread 1.4s cubic-bezier(.2,.7,.2,1) 0.4s backwards; }
@keyframes mo-glow-in { from { opacity: 0; transform: scale(1.06); filter: brightness(1.6); } }
@keyframes mo-draw { from { transform: scaleX(0); } }

/* Ak barak: a slow, quiet rise; the line drawing draws itself. */
html.js .cv:is(:not(.has-opening), .is-opened) .st-ak-barak .st-in > * { animation-duration: 1.4s; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-ak-barak .st-art :is(path, circle, ellipse, line, polyline) { stroke-dasharray: 600; animation: mo-ink 2.4s ease 0.3s backwards; }
@keyframes mo-ink { from { stroke-dashoffset: 600; } to { stroke-dashoffset: 0; } }

/* The type's number counts up (invite.js) and pulses once. */
.st-number { display: flex; align-items: baseline; justify-content: center; gap: 2cqi; margin: 2cqi 0 0; color: var(--inv-accent); }
.st-number b { font-family: var(--st-serif, 'Cormorant Garamond', serif); font-weight: 600; font-size: clamp(28px, 22cqi, 110px); line-height: 0.9; font-variant-numeric: tabular-nums; }
.st-number span { font-size: clamp(9px, 3.4cqi, 15px); letter-spacing: 0.2em; text-transform: uppercase; color: var(--inv-muted); }
.st-jash .st-number { justify-content: flex-start; }
.st-jash .st-number b { font-family: var(--st-display); font-weight: 800; }
.cover-on-media .st-number, .cover-on-media .st-number span { color: #fff; }

/* "Scroll down" under the first screen. */
.st-scroll { position: absolute; left: 50%; bottom: 18px; z-index: 2; width: 22px; height: 22px; margin-left: -11px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; opacity: 0.45; animation: mo-hint 2s ease-in-out infinite; }
.st-oyu .st-scroll { bottom: 26px; }
@keyframes mo-hint { 0%, 100% { translate: 0 -4px; opacity: 0.25; } 50% { translate: 0 4px; opacity: 0.6; } }

/* Calendar: the day pulses; countdown digits flip when they change (invite.js adds .tick). */
.cv-day.is-marked b::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--inv-accent); opacity: 0; animation: mo-ring 2.4s ease-out 1.2s infinite; }
@keyframes mo-ring { 0% { transform: scale(0.8); opacity: 0.7; } 100% { transform: scale(1.5); opacity: 0; } }
.cv-unit b.tick { animation: mo-tick 0.45s cubic-bezier(.2,.7,.2,1); }
@keyframes mo-tick { from { transform: translateY(-40%) rotateX(70deg); opacity: 0.2; } }

/* Contain button decoration. */
.cv-btn { position: relative; overflow: hidden; }

/* Entrances of the D020 covers. */
html.js .cv:is(:not(.has-opening), .is-opened) .st-kilem .kl-border { animation: mo-frame 1.1s cubic-bezier(.6,0,.2,1) backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-kilem .st-art { animation: mo-turn-in 1.4s cubic-bezier(.2,.7,.2,1) 0.25s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-kilem .st-names { animation: mo-spread 1.2s cubic-bezier(.2,.7,.2,1) 0.45s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-akvarel .av-wash { animation: av-bleed 2.2s ease-out backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-akvarel .av-wash-2 { animation-delay: 0.3s; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-akvarel .st-names { animation: mo-write 1.8s cubic-bezier(.45,0,.25,1) 0.4s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-akvarel .av-line { animation: mo-draw 1s cubic-bezier(.6,0,.2,1) 1s backwards; }
html.js .cv .st-balapan .bl-cloud-1 { animation: bl-drift 16s linear infinite; }
html.js .cv .st-balapan .bl-cloud-2 { animation: bl-drift 20s linear infinite reverse; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-balapan .st-art { animation: mo-drop 1s cubic-bezier(.3,1.5,.5,1) backwards, mo-bob 4s ease-in-out 1s infinite; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-balapan .bl-star { animation: bl-spin 0.9s cubic-bezier(.3,1.5,.5,1) 0.3s backwards; }
@keyframes av-bleed { from { opacity: 0; transform: scale(0.6); } }
@keyframes bl-drift { to { background-position-x: 56px; } }
@keyframes bl-spin { from { transform: rotate(-180deg) scale(0); } }

/* ── D022: cover entrances ────────────────────────────────────────────────── */
/* Tush kiyiz: the panel opens, blooms grow, the stitches run along the curls. */
html.js .cv:is(:not(.has-opening), .is-opened) .tk-panel { animation: mo-frame 1.1s cubic-bezier(.6,0,.2,1) backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .tk-bloom { animation: tk-in 1.3s cubic-bezier(.2,.7,.2,1) 0.3s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .tk-bloom .la { animation: tk-stitch 2.4s linear 0.4s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-tush-kiyiz .st-art { animation: mo-turn-in 1.4s cubic-bezier(.2,.7,.2,1) 0.2s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-tush-kiyiz .st-names { animation: mo-spread 1.2s cubic-bezier(.2,.7,.2,1) 0.45s backwards; }
@keyframes tk-in { from { opacity: 0; transform: scale(0.5) rotate(-20deg); } }
@keyframes tk-stitch { from { stroke-dashoffset: 90; } }

/* Kumush: the necklace swings down, the tumar sways, light runs over the names. */
html.js .cv:is(:not(.has-opening), .is-opened) .km-chain { transform-origin: 50% 0; animation: km-swing 1.6s cubic-bezier(.3,1.4,.5,1) backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-kumush .st-art { transform-origin: 50% 0; animation: mo-drop 1s cubic-bezier(.3,1.5,.5,1) 0.3s backwards, km-sway 5s ease-in-out 1.3s infinite; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-kumush .st-names { animation: mo-rise 1s cubic-bezier(.2,.7,.2,1) 0.4s backwards, km-shine 6s ease-in-out 1.4s infinite; }
@keyframes km-swing { from { opacity: 0; transform: translateY(-40%) rotate(-3deg); } }
@keyframes km-sway { 0%, 100% { rotate: -2deg; } 50% { rotate: 2deg; } }
@keyframes km-shine { 0%, 100% { background-position: 0 0; } 50% { background-position: 100% 0; } }

/* Kol: the ranges rise one after another, the sun comes up, the lake glints, birds glide. */
html.js .cv:is(:not(.has-opening), .is-opened) .ko-land :is(.ko-sun, .ko-sun-halo) { animation: ko-sun 2.4s cubic-bezier(.2,.7,.2,1) backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .ko-land :is(.ko-far, .ko-snow) { animation: ko-rise 1.6s cubic-bezier(.2,.7,.2,1) backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .ko-land .ko-mid { animation: ko-rise 1.6s cubic-bezier(.2,.7,.2,1) 0.15s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .ko-land .ko-shore { animation: ko-rise 1.6s cubic-bezier(.2,.7,.2,1) 0.3s backwards; }
html.js .cv .ko-glint { animation: ko-glint 3s ease-in-out infinite; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-kol:is(.m-gulls, .m-burkut) .st-art { animation: mo-rise 1s cubic-bezier(.2,.7,.2,1) backwards, ko-glide 8s ease-in-out 1s infinite; }
@keyframes ko-sun { from { transform: translateY(70px); } }
@keyframes ko-rise { from { opacity: 0; transform: translateY(40px); } }
@keyframes ko-glint { 50% { opacity: 0.3; } }
@keyframes ko-glide { 50% { translate: 10px -6px; } }

/* Chiy: the bands weave in from opposite ends, the card pops, the date tiles follow. */
html.js .cv:is(:not(.has-opening), .is-opened) .ch-band-l { animation: ch-weave 1.2s cubic-bezier(.6,0,.2,1) backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .ch-band-r { animation: ch-weave-up 1.2s cubic-bezier(.6,0,.2,1) backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-chiy .st-in { animation: mo-pop 0.7s cubic-bezier(.3,1.5,.5,1) 0.3s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .ch-date b { animation: mo-pop 0.5s cubic-bezier(.3,1.6,.5,1) 0.9s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .ch-date b:nth-child(2) { animation-delay: 1s; }
html.js .cv:is(:not(.has-opening), .is-opened) .ch-date b:nth-child(3) { animation-delay: 1.1s; }
@keyframes ch-weave { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes ch-weave-up { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }

/* Barkyt: the flap settles, light runs over the velvet, the gold script is written and shines. */
html.js .cv:is(:not(.has-opening), .is-opened) .bk-flap { animation: bk-flap 1.2s cubic-bezier(.6,0,.2,1) backwards; }
/* «Көшөгө» (emerald-curtain, D123): the cover waits for the reveal under the parting curtain. */
html.js .cv.has-opening.opening-emerald-curtain:not(.is-opened) .st-barkyt :is(.st-in, .st-scroll) { opacity: 0; visibility: hidden; }
html.js .cv:is(:not(.has-opening), .is-opened) .bk-sheen { animation: bk-sheen 8s ease-in-out 0.6s infinite; }
html.js .cv:is(:not(.has-opening), .is-opened) .bk-crest { animation: mo-glow-in 1.6s ease 0.2s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-barkyt .st-names { animation: mo-write 1.8s cubic-bezier(.45,0,.25,1) 0.4s backwards, km-shine 6s ease-in-out 2.2s infinite; }
html.js .cv:is(:not(.has-opening), .is-opened) .bk-rule { animation: mo-draw 1s cubic-bezier(.6,0,.2,1) 0.9s backwards; }
@keyframes bk-flap { from { opacity: 0; transform: translateY(-30%); } }
@keyframes bk-sheen { 0% { background-position: 100% 0; } 45%, 100% { background-position: -60% 0; } }

/* Zhibek: the silk unfurls and floats, the flowers bloom, the names are written. */
html.js .cv:is(:not(.has-opening), .is-opened) .zb-silk { animation: zb-unfurl 1.8s cubic-bezier(.6,0,.2,1) backwards, zb-wave 9s ease-in-out 1.8s infinite alternate; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-zhibek :is(.zb-top, .zb-bottom) { animation: mo-bloom 1.6s cubic-bezier(.2,.7,.2,1) 0.3s backwards, mo-sway 7s ease-in-out 1.9s infinite; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-zhibek .st-names { animation: mo-write 1.8s cubic-bezier(.45,0,.25,1) 0.35s backwards; }
@keyframes zb-unfurl { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0); } }
@keyframes zb-wave { to { transform: translateY(-1.5%) skewY(-1.5deg); } }

/* Mramor: the veins surface, the gold frame draws itself, the names close their spacing. */
html.js .cv:is(:not(.has-opening), .is-opened) .mr-veins { animation: mr-fade 2s ease backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-mramor .st-art :is(path, circle) { stroke-dasharray: 1600; animation: mr-draw 2.6s ease 0.2s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-mramor .st-names { animation: mo-spread 1.4s cubic-bezier(.2,.7,.2,1) 0.5s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .mr-rule { animation: mo-draw 1s cubic-bezier(.6,0,.2,1) 0.9s backwards; }
@keyframes mr-fade { from { opacity: 0; } }
@keyframes mr-draw { from { stroke-dashoffset: 1600; } to { stroke-dashoffset: 0; } }

/* Tunku-bak: the flowers rise and open, the moon glows, the stars twinkle. */
html.js .cv:is(:not(.has-opening), .is-opened) .st-tunku-bak .tb-bottom { animation: tb-grow 1.8s cubic-bezier(.2,.7,.2,1) backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-tunku-bak .tb-top { animation: mo-bloom 1.6s cubic-bezier(.2,.7,.2,1) 0.4s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-tunku-bak .st-names { animation: mo-write 1.8s cubic-bezier(.45,0,.25,1) 0.4s backwards; }
html.js .cv .tb-moon { animation: tb-glow 5s ease-in-out infinite; }
html.js .cv .tb-stars { animation: tb-twinkle 4s ease-in-out infinite; }
@keyframes tb-grow { from { opacity: 0; transform: translateX(-50%) translateY(18%) scale(0.9); } }
@keyframes tb-glow { 50% { box-shadow: 0 0 60px 18px color-mix(in srgb, var(--inv-accent) 40%, transparent); } }
@keyframes tb-twinkle { 50% { opacity: 0.3; } }

/* Jurnal: the masthead drops, the picture is revealed, the names slide in, the barcode prints. */
html.js .cv:is(:not(.has-opening), .is-opened) .st-jurnal .st-kicker { animation: jr-mast 1s cubic-bezier(.2,.7,.2,1) backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .jr-photo { animation: jr-photo 1.1s cubic-bezier(.6,0,.2,1) 0.25s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-jurnal .st-names { animation: jr-names 1s cubic-bezier(.3,1.4,.5,1) 0.6s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .jr-code span { transform-origin: left; animation: mo-draw 0.8s cubic-bezier(.6,0,.2,1) 1.1s backwards; }
@keyframes jr-mast { from { opacity: 0; transform: translateY(-30px); letter-spacing: 0.2em; } }
@keyframes jr-photo { from { clip-path: inset(-10% -10% 100% -10%); } to { clip-path: inset(-10%); } }
@keyframes jr-names { from { opacity: 0; transform: translateX(-30%); } }

/* Neon: the frame and the sign flicker on, the names hum now and then. */
html.js .cv:is(:not(.has-opening), .is-opened) .st-neon .st-in { animation: ne-on 1.4s steps(1) backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-neon .st-art { animation: ne-on 1.6s steps(1) 0.3s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-neon .st-names { animation: ne-on 1.8s steps(1) 0.5s backwards, ne-hum 7s steps(1) 3s infinite; }
@keyframes ne-on { 0% { opacity: 0; } 10% { opacity: 1; } 14% { opacity: 0.2; } 22% { opacity: 1; } 30% { opacity: 0.3; } 36%, 100% { opacity: 1; } }
@keyframes ne-hum { 0%, 92%, 100% { opacity: 1; } 93% { opacity: 0.55; } 95% { opacity: 1; } 96% { opacity: 0.7; } }

/* Retro: the sunburst turns, the arcs rise, the names land, the date pops. */
html.js .cv .rt-burst { animation: rt-spin 60s linear infinite; }
html.js .cv:is(:not(.has-opening), .is-opened) .rt-arcs { transform-origin: 50% 100%; animation: rt-rise 1.4s cubic-bezier(.3,1.3,.5,1) backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-retro .st-art { animation: mo-drop 1s cubic-bezier(.3,1.5,.5,1) backwards, mo-bob 4s ease-in-out 1s infinite; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-retro .st-names { animation: mo-land 0.9s cubic-bezier(.3,1.5,.5,1) 0.3s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .rt-date { animation: mo-pop 0.6s cubic-bezier(.3,1.6,.5,1) 0.8s backwards; }
@keyframes rt-spin { to { rotate: 360deg; } }
@keyframes rt-rise { from { transform: scaleY(0); } }

/* Albom: the polaroids drop and settle, the tape and the sticker go on, the doodles are drawn. */
html.js .cv:is(:not(.has-opening), .is-opened) .al-photo { animation: al-drop 1s cubic-bezier(.3,1.4,.5,1) 0.15s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .al-photo-back { animation-delay: 0s; }
html.js .cv:is(:not(.has-opening), .is-opened) .al-tape { animation: al-tape 0.4s ease 1s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .al-sticker { animation: bl-spin 0.8s cubic-bezier(.3,1.5,.5,1) 1.1s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .al-d path { stroke-dasharray: 400; animation: al-ink 2s ease 0.8s backwards; }
html.js .cv:is(:not(.has-opening), .is-opened) .st-albom .st-names { animation: mo-write 1.6s cubic-bezier(.45,0,.25,1) 0.5s backwards; }
@keyframes al-drop { from { opacity: 0; transform: translateY(-60px) rotate(-14deg) scale(1.1); } }
@keyframes al-tape { from { opacity: 0; transform: scale(1.4); } }
@keyframes al-ink { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }

/* ── Ambient particles behind the blocks ──────────────────────────────────── */
.amb { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.amb i { position: absolute; top: -8%; left: var(--x, 50%); width: 12px; height: 12px; opacity: 0; animation: amb-fall var(--t, 16s) linear var(--w, 0s) infinite; }
.amb i:nth-child(1) { --x: 6%; --t: 17s; --w: -2s; } .amb i:nth-child(2) { --x: 18%; --t: 21s; --w: -9s; }
.amb i:nth-child(3) { --x: 29%; --t: 15s; --w: -5s; } .amb i:nth-child(4) { --x: 41%; --t: 23s; --w: -14s; }
.amb i:nth-child(5) { --x: 52%; --t: 18s; --w: -1s; } .amb i:nth-child(6) { --x: 63%; --t: 20s; --w: -11s; }
.amb i:nth-child(7) { --x: 74%; --t: 16s; --w: -7s; } .amb i:nth-child(8) { --x: 85%; --t: 22s; --w: -16s; }
.amb i:nth-child(9) { --x: 94%; --t: 19s; --w: -4s; } .amb i:nth-child(10) { --x: 12%; --t: 24s; --w: -19s; }
.amb i:nth-child(11) { --x: 58%; --t: 26s; --w: -21s; } .amb i:nth-child(12) { --x: 80%; --t: 14s; --w: -10s; }
@keyframes amb-fall {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  10% { opacity: var(--o, 0.45); }
  50% { transform: translate(28px, 55vh) rotate(200deg); }
  90% { opacity: var(--o, 0.45); }
  100% { opacity: 0; transform: translate(-12px, 112vh) rotate(380deg); }
}
.amb-petals i { width: 12px; height: 9px; border-radius: 80% 0 80% 0; background: color-mix(in srgb, var(--inv-accent) 55%, #fff); --o: 0.5; }
.amb-confetti i { width: 7px; height: 11px; border-radius: 2px; background: var(--inv-accent); --o: 0.35; }
.amb-confetti i:nth-child(3n+2) { background: #e9c46a; }
.amb-confetti i:nth-child(3n) { background: color-mix(in srgb, var(--inv-accent) 40%, #fff); width: 8px; height: 8px; border-radius: 50%; }
.amb-hearts i { top: auto; bottom: -6%; animation-name: amb-rise; --o: 0.35; }
.amb-hearts i::before { content: "♥"; font-size: 14px; line-height: 1; color: var(--inv-accent); }
.amb-hearts i:nth-child(even)::before { font-size: 10px; }
@keyframes amb-rise {
  0% { opacity: 0; transform: translate(0, 0) scale(0.8); }
  10% { opacity: var(--o); }
  50% { transform: translate(-20px, -55vh) scale(1); }
  90% { opacity: var(--o); }
  100% { opacity: 0; transform: translate(14px, -112vh) scale(1.1); }
}
.amb-stars i, .amb-sparkles i { top: var(--y, 20%); width: 4px; height: 4px; border-radius: 50%; background: var(--inv-accent); box-shadow: 0 0 8px var(--inv-accent); animation: twinkle-soft 3.2s ease-in-out var(--w) infinite; }
.amb-sparkles i { width: 8px; height: 8px; border-radius: 0; background: none; box-shadow: none; }
.amb-sparkles i::before { content: ""; position: absolute; inset: 0; background: var(--inv-accent); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.amb i:nth-child(1) { --y: 12%; } .amb i:nth-child(2) { --y: 34%; } .amb i:nth-child(3) { --y: 58%; } .amb i:nth-child(4) { --y: 80%; }
.amb i:nth-child(5) { --y: 22%; } .amb i:nth-child(6) { --y: 46%; } .amb i:nth-child(7) { --y: 70%; } .amb i:nth-child(8) { --y: 90%; }
.amb i:nth-child(9) { --y: 6%; } .amb i:nth-child(10) { --y: 64%; } .amb i:nth-child(11) { --y: 30%; } .amb i:nth-child(12) { --y: 52%; }
@keyframes twinkle-soft { 0%, 100% { opacity: 0.1; transform: scale(0.6); } 50% { opacity: 0.55; transform: scale(1.3); } }

/* D020: ambients picked in the design form ("Анимация фона"). */
.amb-snow i { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--inv-accent) 18%, #fff); box-shadow: 0 0 6px rgb(255 255 255 / 0.9), 0 0 0 1px color-mix(in srgb, var(--inv-accent) 14%, transparent); --o: 0.75; }
.amb-snow i:nth-child(3n) { width: 4px; height: 4px; }
.amb-snow i:nth-child(4n+1) { width: 9px; height: 9px; filter: blur(0.6px); }
.amb-leaves i { width: 15px; height: 10px; border-radius: 0 100% 0 100%; background: #d98a3a; --o: 0.6; }
.amb-leaves i:nth-child(3n) { background: #b5523b; }
.amb-leaves i:nth-child(3n+1) { background: #c9a227; width: 12px; height: 8px; }
.amb-lanterns i, .amb-bubbles i, .amb-butterflies i { top: auto; bottom: -8%; animation-name: amb-rise; }
.amb-lanterns i { width: 13px; height: 17px; border-radius: 42% 42% 28% 28%; background: linear-gradient(#ffd98a, #ff9a3c); box-shadow: 0 0 14px 5px rgb(255 166 70 / 0.5); --o: 0.8; }
.amb-lanterns i:nth-child(3n) { width: 9px; height: 12px; }
.amb-bubbles i { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--inv-accent) 40%, #fff); background: radial-gradient(circle at 30% 30%, rgb(255 255 255 / 0.9) 0 12%, transparent 14%), radial-gradient(circle, transparent 58%, color-mix(in srgb, var(--inv-accent) 18%, transparent)); --o: 0.7; }
.amb-bubbles i:nth-child(3n) { width: 14px; height: 14px; }
.amb-bubbles i:nth-child(4n+1) { width: 30px; height: 30px; }
.amb-butterflies i { width: 20px; height: 14px; animation-name: amb-flutter; --o: 0.65; }
.amb-butterflies i::before, .amb-butterflies i::after { content: ""; position: absolute; top: 0; width: 10px; height: 13px; background: var(--inv-accent); animation: amb-wing 0.32s ease-in-out infinite alternate; }
.amb-butterflies i::before { left: 0; border-radius: 70% 20% 40% 60%; transform-origin: right center; }
.amb-butterflies i::after { right: 0; border-radius: 20% 70% 60% 40%; transform-origin: left center; }
.amb-butterflies i:nth-child(odd)::before, .amb-butterflies i:nth-child(odd)::after { background: color-mix(in srgb, var(--inv-accent) 45%, #ffd27a); }
@keyframes amb-wing { to { transform: scaleX(0.25); } }
@keyframes amb-flutter {
  0% { opacity: 0; transform: translate(0, 0) rotate(-10deg); }
  10% { opacity: var(--o); }
  30% { transform: translate(44px, -30vh) rotate(14deg); }
  60% { transform: translate(-34px, -62vh) rotate(-10deg); }
  90% { opacity: var(--o); }
  100% { opacity: 0; transform: translate(18px, -112vh) rotate(6deg); }
}
.amb-gold i { top: var(--y); width: 3px; height: 3px; border-radius: 50%; background: #e9c46a; box-shadow: 0 0 6px #e9c46a; animation: amb-dust 7s ease-in-out var(--w) infinite; }
.amb-gold i:nth-child(3n) { width: 5px; height: 5px; }
@keyframes amb-dust { 0%, 100% { opacity: 0.1; transform: translate(0, 0); } 50% { opacity: 0.85; transform: translate(16px, -20px); } }
.amb-fireflies i { top: var(--y); width: 5px; height: 5px; border-radius: 50%; background: #e8ff8a; box-shadow: 0 0 10px 3px rgb(214 255 110 / 0.55); animation: amb-firefly 9s ease-in-out var(--w) infinite; }
.amb-aurora i{top:var(--y);left:var(--x);width:26vw;height:32vh;filter:blur(24px);border-radius:50%;background:color-mix(in srgb,var(--inv-accent) 34%,#74d8bd);opacity:.12;animation:amb-aurora 15s ease-in-out var(--w) infinite alternate}
.amb-ribbons i{width:3px;height:42vh;border-radius:9px;background:linear-gradient(transparent,var(--inv-accent),color-mix(in srgb,var(--inv-accent) 12%,white),transparent);animation:amb-ribbon 12s ease-in-out var(--w) infinite}
.amb-dandelions i{width:9px;height:9px;border:1px solid color-mix(in srgb,var(--inv-accent) 50%,white);border-radius:80% 0 80% 0;background:color-mix(in srgb,var(--inv-accent) 18%,transparent);animation:amb-dandelion 19s ease-in-out var(--w) infinite}
.amb-feathers i{width:11px;height:26px;clip-path:polygon(50% 0,82% 19%,68% 42%,100% 65%,51% 100%,0 69%,32% 45%,16% 22%);background:color-mix(in srgb,var(--inv-accent) 58%,#fff);animation:amb-feather-drift 15s ease-in-out var(--w) infinite}
.amb-rain i{width:1px;height:34px;background:linear-gradient(transparent,color-mix(in srgb,var(--inv-accent) 45%,white));animation:amb-rain 1.8s linear var(--w) infinite}
.amb-fireworks-soft i{top:var(--y);width:6px;height:6px;border-radius:50%;background:#f4d58d;box-shadow:0 0 16px 5px #f4d58d;animation:twinkle-soft 2.8s ease-in-out var(--w) infinite}
.amb-waves i{top:var(--y);left:var(--x);width:72px;height:20px;border:1px solid color-mix(in srgb,var(--inv-accent) 30%,transparent);border-radius:50%;animation:amb-wave 7s ease-out var(--w) infinite}
.amb-pollen i,.amb-moon-dust i{top:var(--y);width:4px;height:4px;border-radius:50%;background:color-mix(in srgb,var(--inv-accent) 40%,#fff);box-shadow:0 0 7px currentColor;animation:amb-dust 9s ease-in-out var(--w) infinite}
.amb-embers i{top:auto;bottom:-5%;width:4px;height:4px;border-radius:50%;background:#ffad65;box-shadow:0 0 9px 2px #ef8354;animation:amb-ember-rise 8s ease-out var(--w) infinite}
.amb-paper i{width:9px;height:13px;border-radius:1px;background:var(--inv-accent);animation:amb-fall 13s ease-in var(--w) infinite}
@keyframes amb-aurora{to{transform:translate(18vw,12vh) scale(1.4) rotate(15deg);opacity:.24}}
@keyframes amb-ribbon{50%{transform:translate(30px,42vh) rotate(18deg);opacity:.25}to{transform:translate(-20px,100vh) rotate(-12deg);opacity:0}}
@keyframes amb-dandelion{50%{transform:translate(28px,48vh) rotate(140deg)}to{transform:translate(-18px,108vh) rotate(300deg);opacity:0}}
@keyframes amb-rain{to{transform:translate(-14px,110vh);opacity:0}}
@keyframes amb-feather-drift{0%{opacity:0;transform:translate(0,-8vh) rotate(0)}12%{opacity:.58}55%{transform:translate(36px,52vh) rotate(38deg)}100%{opacity:0;transform:translate(-24px,112vh) rotate(-30deg)}}
@keyframes amb-ember-rise{0%{opacity:0;transform:translate(0,0) scale(.7)}14%{opacity:.9}to{opacity:0;transform:translate(24px,-100vh) scale(.1)}}
@keyframes amb-wave{0%{transform:scale(.3);opacity:0}30%{opacity:.45}to{transform:scale(2.4);opacity:0}}
@keyframes amb-firefly {
  0%, 100% { opacity: 0; transform: translate(0, 0); }
  20% { opacity: 0.9; }
  40% { transform: translate(30px, -22px); }
  60% { opacity: 0.25; transform: translate(-22px, -42px); }
  80% { opacity: 0.9; transform: translate(12px, -12px); }
}

@media (prefers-reduced-motion: reduce) {
  .amb { display: none; }
  html.js .cv *, html.js .cv *::before, html.js .cv *::after { animation: none !important; transition: none !important; }
}
