/*
 * Заснежись · слой движения
 * Фон, телефон и снежинки на первом экране движутся с разной амплитудой.
 * Все циклические анимации включаются только с классом .fx (его ставит fx.js,
 * если у посетителя не включено «уменьшение движения»).
 */

@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --lx { syntax: "<percentage>"; inherits: false; initial-value: 72%; }
@property --ly { syntax: "<percentage>"; inherits: false; initial-value: 36%; }

/* ---------- Общие слои ---------- */

html { scroll-padding-top: 80px; }
@media (max-width: 780px) { html { scroll-padding-top: 66px; } }

.snow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.snow.is-on { opacity: 1; }

.sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(112deg, transparent 0 38%, rgba(255,255,255,.34) 48%, rgba(255,255,255,.08) 54%, transparent 62% 100%) 160% 0 / 260% 100% no-repeat;
  mix-blend-mode: overlay;
}

.tilt-glare {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at var(--gx,50%) var(--gy,50%), rgba(255,255,255,.55), rgba(255,255,255,0) 42%),
    linear-gradient(115deg, rgba(186,160,255,0) 15%, rgba(186,160,255,.28) 38%, rgba(150,232,255,.28) 52%, rgba(255,186,226,.22) 66%, rgba(255,255,255,0) 85%) calc(var(--gx,50%) * .6) 0 / 220% 100%;
  mix-blend-mode: soft-light;
  transition: opacity .45s ease;
}
.is-tilting > .tilt-glare { opacity: 1; }

.float-flake {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  height: auto;
}

/* ---------- Первый экран ---------- */

.hero > .snow { z-index: 1; }
.hero-light {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle 420px at var(--lx) var(--ly), rgba(150,214,255,.2), rgba(150,214,255,.06) 45%, transparent 72%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity .8s ease, --lx .5s ease-out, --ly .5s ease-out;
}
.hero-glints { position: absolute; inset: 0; z-index: 2; pointer-events: none; --depth: .45; }
.glint {
  position: absolute;
  width: var(--s,18px);
  height: var(--s,18px);
  translate: -50% -50%;
  color: #fff;
  opacity: 0;
  filter: drop-shadow(0 0 4px rgba(200,236,255,.95)) drop-shadow(0 0 12px rgba(150,210,255,.55));
}
.glint svg { width: 100%; height: 100%; }
.wordmark-wrap { position: relative; display: block; width: 100%; max-width: 688px; }
.hero .wordmark { max-width: 100%; }
.wordmark-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask: url(assets/campaign-title.png) center / 100% 100% no-repeat;
  mask: url(assets/campaign-title.png) center / 100% 100% no-repeat;
  background: linear-gradient(100deg, transparent 0 36%, rgba(196,224,255,.85) 42%, rgba(222,204,255,.95) 46%, rgba(190,244,255,.95) 50%, rgba(255,214,238,.75) 54%, transparent 60% 100%) 140% 0 / 280% 100% no-repeat;
  opacity: 0;
}

/* Кнопки: блик стекла */
.fx .button-red, .fx .button-ice { position: relative; overflow: hidden; isolation: isolate; }
.fx .button-red::after, .fx .button-ice::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.32) 47%, rgba(255,255,255,.06) 53%, transparent 66%);
  translate: -130% 0;
}
.fx .button-ice::after { background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.85) 47%, rgba(255,255,255,.2) 53%, transparent 66%); }

/* ---------- Таймер ---------- */

.timer-icon { background: radial-gradient(circle at 40% 35%, #ffffff, #dcefff 70%); box-shadow: inset 0 0 0 1px #cfe6f5; }
.timer-icon img { width: 36px; height: 36px; filter: drop-shadow(0 2px 4px rgba(64,104,170,.28)); }
.clock b { will-change: transform; }

/* ---------- Карточки шагов и призов ---------- */

.prizes, .bonus { position: relative; isolation: isolate; overflow: hidden; }
.prizes > .wrap, .bonus > .wrap { position: relative; z-index: 1; }
.prizes > .snow, .bonus > .snow { z-index: 0; }

.aurora {
  position: absolute;
  inset: -25% -15%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 34% at 22% 28%, rgba(96,176,226,.24), transparent 70%),
    radial-gradient(30% 28% at 78% 72%, rgba(150,128,230,.16), transparent 70%),
    radial-gradient(26% 22% at 60% 18%, rgba(120,220,240,.12), transparent 70%);
  filter: blur(18px);
}
.aurora-bonus {
  background:
    radial-gradient(34% 30% at 80% 18%, rgba(96,176,226,.26), transparent 70%),
    radial-gradient(30% 26% at 18% 80%, rgba(150,128,230,.14), transparent 70%);
}

.float-flake-a { width: 250px; right: -70px; top: -50px; opacity: .42; filter: blur(2px); }
.float-flake-b { width: 120px; left: -34px; bottom: 70px; opacity: .55; filter: blur(3px); }
.float-flake-c { width: 190px; left: -80px; top: 36%; opacity: .32; filter: blur(2.5px); }

.prize-main .sheen { z-index: -1; }
.prize-phone { transition: translate .7s cubic-bezier(.2,.7,.2,1), scale .9s cubic-bezier(.2,.7,.2,1); }
.prize-main.is-tilting .prize-phone { translate: calc(var(--px,0) * -10px) calc(var(--py,0) * -8px); scale: 1.035; }
.prize-main h3 { text-shadow: 0 0 28px rgba(255,176,204,.18); }
.prize-count.is-counted { box-shadow: 0 0 0 4px rgba(214,240,255,.35); transition: box-shadow 1.2s ease; }

/* Полоса «принт каждому» */
.prize-action { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.gift-strip {
  position: relative;
  overflow: hidden;
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 6px 8px 6px 7px;
  border-radius: 45px;
  border: 1px solid rgba(204,236,255,.26);
  background: linear-gradient(100deg, rgba(255,255,255,.09), rgba(255,255,255,.03) 60%, rgba(160,200,255,.07));
  color: #eaf7ff;
  transition: border-color .3s ease, background-color .3s ease;
}
.gift-strip-art { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 45% 35%, #f6fbff, #c9e3f4); overflow: hidden; }
.gift-strip-art img { position: absolute; display: block; }
.gift-strip-art img:first-child { inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; }
.gift-strip-art img:last-child { width: 30%; left: 35%; top: 44%; }
.gift-strip-copy { min-width: 0; display: grid; line-height: 1.2; padding-right: 22px; }
.gift-strip-copy strong { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.gift-strip-copy small { margin-top: 2px; color: #a9cfe5; font-size: 12px; font-weight: 700; }
.gift-strip-go { margin-left: auto; padding-left: 0; flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(214,240,255,.14); color: #dff4ff; }
.gift-strip-go svg { width: 18px; height: 18px; }
.gift-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.14) 48%, transparent 64%);
  translate: -120% 0;
}

/* ---------- Бонус ---------- */

.bonus-stamp { box-shadow: 0 18px 40px -18px rgba(0,10,25,.6), inset 0 0 22px rgba(160,220,255,.08); }

/* ---------- Регистрация и розыгрыш ---------- */

.scan-beam {
  position: absolute;
  left: 0;
  width: 100%;
  top: 10%;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, #0a9cf0 12%, #18c2ff 50%, #0a9cf0 88%, transparent);
  box-shadow: 0 0 12px 2px rgba(0,150,255,.55), 0 0 2px rgba(0,120,230,.8);
  opacity: 0;
  pointer-events: none;
}
.scan-beam::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 1px;
  height: 12px;
  background: linear-gradient(0deg, rgba(0,160,255,.2), transparent);
}
.draw > .snow { z-index: -1; }

/* ---------- Вопросы ---------- */

.faq-aside { position: relative; }
.faq-flake { position: absolute; width: 128px; height: auto; right: 8%; top: 18px; filter: drop-shadow(0 14px 20px rgba(80,110,170,.22)); pointer-events: none; }
.questions details > p { transition: opacity .3s ease; }
.questions details.is-closing > p { opacity: 0; }

/* ---------- Подвал: сугроб ---------- */

footer { position: relative; }
footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 20px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='20' viewBox='0 0 260 20'%3E%3Cpath fill='%23102e47' d='M0 0h260v7c-14 0-18 9-34 9-15 0-17-6-31-6-17 0-20 9-38 9-17 0-21-8-36-8-16 0-18 6-33 6-14 0-17-9-33-9-14 0-17 5-29 5C14 13 10 7 0 7Z'/%3E%3C/svg%3E") 0 0 / 260px 20px repeat-x;
}

/* ---------- Липкая шапка ---------- */

.top.is-stuck {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 70px;
  min-height: 0;
  color: #fff;
  border-bottom-color: transparent;
}
.top.is-stuck::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  translate: -50% 0;
  z-index: -1;
  background: rgba(8,35,60,.82);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(214,240,255,.14);
  box-shadow: 0 12px 30px -16px rgba(3,18,33,.6);
}
.top.is-stuck .logo { width: 146px; }
.top :focus-visible { outline-color: #a4ebff; }
.top { color: #fff; }

/* ---------- Мобильные размеры ---------- */

@media (max-width: 1080px) {
  .top.is-stuck { height: auto; min-height: 64px; }
}

@media (max-width: 780px) {
  .wordmark-wrap { max-width: 520px; }
  .timer-icon img { width: 26px; height: 26px; }
  .float-flake-a { width: 160px; right: -60px; top: -30px; }
  .float-flake-b { display: none; }
  .float-flake-c { width: 120px; left: -60px; top: 8%; }
  .prize-action { flex-direction: column; align-items: stretch; gap: 9px; margin-top: 12px; }
  .gift-strip { border-radius: 18px; min-height: 60px; }
  .gift-strip-copy strong { font-size: 14px; }
  .gift-strip-copy small { font-size: 11px; }
  .faq-flake { display: none; }
  .top.is-stuck { min-height: 58px; }
  .top.is-stuck .logo { width: 124px; }
}

@media (min-width: 781px) and (max-width: 1080px) {
  .faq-flake { width: 96px; right: 0; top: 4px; }
  .float-flake-a { width: 200px; }
}

/* ============================================================
 * Движение. Только при .fx (нет prefers-reduced-motion: reduce)
 * ============================================================ */

/* Первый экран: одна срежиссированная заставка */
.fx .hero-scene { animation: art-in 1.2s ease-out backwards; }
.fx .hero-plate, .fx .hero-wave, .fx .hero-object, .fx .hero-glints {
  transition: translate .58s cubic-bezier(.2,.7,.2,1);
}
.fx .hero-snowflake img { animation: hero-flake-turn var(--turn) linear infinite; }
.fx .hero-color img { animation-direction: reverse; }
.fx .hero-light { opacity: 1; }
.fx .hero-light.is-tracking { transition: opacity .8s ease, --lx .25s ease-out, --ly .25s ease-out; }
.fx .glint { animation: glint 8.5s var(--delay,0s) ease-in-out infinite; }
.fx .top:not(.is-stuck) { animation: fade-down .8s .1s ease-out backwards; }
.fx .top.is-stuck { animation: header-in .45s cubic-bezier(.2,.7,.2,1); }
.fx .hero-title, .fx .hero-offer { animation: none; }
.fx .hero-label { animation: rise .7s .15s cubic-bezier(.2,.7,.2,1) backwards; }
.fx .wordmark-wrap { animation: word-in 1.15s .3s cubic-bezier(.7,0,.2,1) backwards; }
.fx .wordmark-sheen { animation: word-sheen 9s 1.5s ease-in-out infinite; }
.fx .hero .hero-sub { animation: sub-in 1.2s .85s cubic-bezier(.2,.7,.2,1) backwards; }
.fx .hero-offer h2 { animation: rise .8s 1s cubic-bezier(.2,.7,.2,1) backwards; }
.fx .hero-offer p { animation: rise .8s 1.1s cubic-bezier(.2,.7,.2,1) backwards; }
.fx .hero-actions { animation: rise .8s 1.2s cubic-bezier(.2,.7,.2,1) backwards; }
.fx .figure-label { animation: rise .8s 1.5s cubic-bezier(.2,.7,.2,1) backwards; }
.fx .has-shine::after { animation: btn-shine 7s 2.6s ease-in-out infinite; }
.fx .countdown { animation: lift-in .9s .95s cubic-bezier(.2,.7,.2,1) backwards; }

/* Таймер */
.fx .countdown::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  background: conic-gradient(from var(--ang), transparent 0 60%, rgba(150,214,255,.0) 64%, rgba(150,214,255,.85) 74%, rgba(255,255,255,1) 77%, rgba(196,170,255,.6) 81%, transparent 88% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin-angle 10s linear infinite;
}
.fx .timer-icon img { animation: slow-spin 48s linear infinite; }
.fx .clock b.tick { animation: tick .5s cubic-bezier(.2,.7,.2,1); }

/* Появление групп карточек */
.fx [data-reveal], .fx [data-tilt] {
  transition:
    opacity .75s ease var(--d,0s),
    translate .95s cubic-bezier(.2,.7,.2,1) var(--d,0s),
    transform .7s cubic-bezier(.2,.7,.2,1),
    box-shadow .45s ease,
    background-color .2s ease,
    color .2s ease,
    border-color .3s ease;
}
.fx.fx-ready [data-reveal]:not(.is-in) { opacity: 0; translate: 0 28px; }
.fx.fx-ready .gift-strip[data-reveal]:not(.is-in) { translate: 24px 0; }
.fx [data-tilt] { transform: perspective(1100px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)); }
.fx [data-tilt].is-tilting {
  transition: opacity .75s ease var(--d,0s), translate .95s cubic-bezier(.2,.7,.2,1) var(--d,0s), transform .12s linear, box-shadow .45s ease;
}
.fx .step.is-tilting { box-shadow: 0 22px 40px -22px rgba(18,62,88,.42); }
.fx .mini-prize.is-tilting, .fx .prize-main.is-tilting { box-shadow: 0 26px 46px -24px rgba(0,8,20,.75); }

/* Штамп ×2 */
.fx [data-reveal="stamp"] { transition: none; }
.fx.fx-ready [data-reveal="stamp"]:not(.is-in) { opacity: 0; translate: none; }
.fx [data-reveal="stamp"].is-in { animation: stamp .75s cubic-bezier(.3,1.35,.5,1) backwards; }

/* Объекты на карточках слегка парят */
.fx .step-art, .fx .prize-sprite { animation: bob 6.5s ease-in-out infinite; transition: scale .6s cubic-bezier(.2,.7,.2,1); }
.fx .step-2 .step-art, .fx .certificate .prize-sprite { animation-delay: -1.6s; }
.fx .step-3 .step-art { animation-delay: -3.2s; }
.fx .step-4 .step-art { animation-delay: -4.8s; }
.fx .step.is-tilting .step-art, .fx .mini-prize.is-tilting .prize-sprite { scale: 1.05; }
.fx .step-print img:last-child { animation: holo-shift 7s ease-in-out infinite; }

/* Тёмные секции */
.fx .aurora { animation: aurora 26s ease-in-out infinite alternate; }
.fx .float-flake { animation: flake-turn 40s linear infinite; }
.fx .float-flake-b { animation-duration: 32s; animation-direction: reverse; }
.fx .prize-main .sheen-loop { animation: sheen 8s 1.5s ease-in-out infinite; }
.fx .bonus-result svg { animation: twinkle 3.2s ease-in-out infinite; }
.fx .bonus-result svg:last-child { animation-delay: -1.6s; }

/* Регистрация и розыгрыш */
.fx .scan-beam { animation: scan 2.6s ease-in-out infinite alternate; }
.fx .draw-ball { transition: translate .52s ease-out, rotate .52s ease-out; }
.fx .draw-ball img { animation: draw-ball-roll var(--drift-time) var(--drift-delay) ease-in-out infinite alternate paused; }
.fx .draw-art.is-in-view .draw-ball img { animation-play-state: running; }

/* Вопросы */
.fx .faq-flake { animation: faq-float 9s ease-in-out infinite; }

/* Наведение: только мышь */
@media (hover: hover) {
  .fx .button-red:not(:disabled):hover::after,
  .fx .button-ice:not(:disabled):hover::after,
  .fx .gift-strip:hover::after { translate: 130% 0; transition: translate .9s cubic-bezier(.2,.7,.2,1); }
  .gift-strip:hover { border-color: rgba(214,240,255,.5); background-color: rgba(255,255,255,.05); }
  .fx .gift-strip:hover .gift-strip-art img:first-child { scale: 1.08; }
  .gift-strip-art img { transition: scale .5s cubic-bezier(.2,.7,.2,1); }
  .fx .partner { transition: opacity .75s ease var(--d,0s), translate .95s cubic-bezier(.2,.7,.2,1) var(--d,0s), transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s ease; }
  .fx .partner.is-in:hover { transform: translateY(-5px); box-shadow: 0 22px 40px -22px rgba(0,8,20,.8); }
}

@media (hover: none) {
  .fx .hero-light { animation: light-drift 18s ease-in-out infinite alternate; }
}

/* ---------- Ключевые кадры ---------- */

@keyframes art-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes hero-flake-turn {
  from { rotate: var(--start-angle); }
  to { rotate: calc(var(--start-angle) + 360deg); }
}
@keyframes glint {
  0%, 100% { opacity: 0; scale: 0; rotate: 0deg; }
  4% { opacity: 1; scale: 1; rotate: 40deg; }
  10% { opacity: 0; scale: .15; rotate: 90deg; }
}
@keyframes word-in {
  from { clip-path: inset(-30% 100% -30% -2%); filter: blur(8px); opacity: .2; }
  60% { filter: blur(1px); opacity: 1; }
  to { clip-path: inset(-30% -4% -30% -2%); filter: none; opacity: 1; }
}
@keyframes word-sheen {
  0% { opacity: 0; background-position: 140% 0; }
  3% { opacity: 1; }
  20% { opacity: 1; background-position: -40% 0; }
  23%, 100% { opacity: 0; background-position: -40% 0; }
}
@keyframes sub-in {
  from { opacity: 0; letter-spacing: .6em; }
  to { opacity: 1; letter-spacing: .21em; }
}
@keyframes rise {
  from { opacity: 0; translate: 0 16px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes lift-in {
  from { opacity: 0; translate: 0 30px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes fade-down {
  from { opacity: 0; translate: 0 -12px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes header-in {
  from { translate: 0 -100%; }
  to { translate: 0 0; }
}
@keyframes btn-shine {
  0% { translate: -130% 0; }
  16%, 100% { translate: 130% 0; }
}
@keyframes spin-angle { to { --ang: 360deg; } }
@keyframes slow-spin { to { rotate: 360deg; } }
@keyframes tick {
  from { translate: 0 -38%; opacity: 0; filter: blur(3px); }
  to { translate: 0 0; opacity: 1; filter: none; }
}
@keyframes stamp {
  0% { opacity: 0; scale: 1.9; rotate: -9deg; filter: blur(4px); }
  55% { opacity: 1; scale: .93; rotate: 1deg; filter: none; }
  78% { scale: 1.03; rotate: 0deg; }
  100% { scale: 1; rotate: 0deg; }
}
@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}
@keyframes holo-shift {
  0%, 100% { filter: drop-shadow(0 1px 2px #2e506d30) hue-rotate(0deg); }
  50% { filter: drop-shadow(0 1px 2px #2e506d30) hue-rotate(28deg) brightness(1.08); }
}
@keyframes aurora {
  from { translate: -4% -3%; rotate: -3deg; }
  to { translate: 5% 3%; rotate: 6deg; }
}
@keyframes flake-turn { to { rotate: 360deg; } }
@keyframes sheen {
  0% { background-position: 160% 0; }
  24%, 100% { background-position: -60% 0; }
}
@keyframes twinkle {
  0%, 100% { scale: 1; rotate: 0deg; opacity: 1; }
  50% { scale: .6; rotate: 45deg; opacity: .55; }
}
@keyframes scan {
  0% { top: 10%; opacity: .9; }
  100% { top: 86%; opacity: .9; }
}
@keyframes draw-ball-roll {
  from { transform: translate(calc(var(--drift-x) * -1),calc(var(--drift-y) * -1)) rotate(calc(var(--drift-turn) * -1)); }
  to { transform: translate(var(--drift-x),var(--drift-y)) rotate(var(--drift-turn)); }
}
@keyframes faq-float {
  0%, 100% { translate: 0 0; rotate: -6deg; }
  50% { translate: 0 -12px; rotate: 6deg; }
}
@keyframes light-drift {
  0% { --lx: 62%; --ly: 22%; }
  50% { --lx: 84%; --ly: 48%; }
  100% { --lx: 70%; --ly: 70%; }
}
