/* ============================================================
   НОВЫЙ ГОД 2027: снег, гирлянда над фото зала, новогодний фон
   у блока акции и Дед Мороз в левом нижнем углу.
   Ёлка, гирлянда и Дед Мороз сгенерированы в Higgsfield; зал на фото
   настоящий, генерация только поверх, как украшение.
   Подключение: блок «НОВЫЙ ГОД» в каждой странице. Сроки: украшения
   до 10 января, Дед Мороз до 31 декабря (конец акции), см. ny.js.
   В январе блоки подключения убрать со страниц, а файлы ny.* и
   assets/ny/ удалить.
   ============================================================ */

/* ---------- снег ---------- */
.ny-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90; /* над страницей, под шапкой (100) и нижней панелью (110) */
}

/* ---------- гирлянда над фото зала на первом экране ---------- */
.ny-on .hero__plate::before {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  top: 0;
  z-index: 1;
  aspect-ratio: 1600 / 480;
  background: url(./ny/fir-top.webp) center top / 100% auto no-repeat;
  pointer-events: none;
}

/* ---------- новогодний фон у блока акции ---------- */
.ny-on .promo--dec::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: min(46vw, 640px);
  background:
    linear-gradient(to bottom, rgba(24, 29, 23, 0) 40%, var(--bg-2) 100%),
    url(./ny/fir-promo.webp) center top / cover no-repeat;
  pointer-events: none;
}
.ny-on .promo--dec .dec__badge { margin-top: clamp(40px, 7vw, 120px); }

/* в светлой теме тёмные ветви ложатся пятном: там их нет, остаётся снег и Дед Мороз */
[data-theme="light"].ny-on .hero__plate::before,
[data-theme="light"].ny-on .promo--dec::before { display: none; }
[data-theme="light"].ny-on .promo--dec .dec__badge { margin-top: 0; }

/* ---------- Дед Мороз ---------- */
.ny-dm {
  position: fixed;
  left: -6px;
  bottom: 0;
  z-index: 105;
  width: 116px; /* левее кнопок первого экрана: текст начинается с 126px */
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: translateY(110%);
  transition: transform .9s cubic-bezier(.16, 1, .3, 1);
  -webkit-tap-highlight-color: transparent;
}
.ny-dm.is-in { transform: none; }
.ny-dm img {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .45));
}
.ny-dm:hover img, .ny-dm:focus-visible img { transform: translateY(-6px) rotate(-2deg); }
.ny-dm img { transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
.ny-dm:focus-visible { outline: 2px solid var(--lamp); outline-offset: 4px; border-radius: 12px; }

/* лёгкое покачивание раз в несколько секунд, чтобы заметили */
@media (prefers-reduced-motion: no-preference) {
  .ny-dm.is-in:not(:hover):not([aria-expanded="true"]) img { animation: ny-sway 6s ease-in-out 2s infinite; }
  @keyframes ny-sway {
    0%, 84%, 100% { transform: none; }
    88% { transform: rotate(-3deg) translateY(-4px); }
    92% { transform: rotate(2deg) translateY(-2px); }
    96% { transform: rotate(-1deg); }
  }
}

/* подсказка-облачко */
.ny-tip {
  position: fixed;
  left: 112px;
  bottom: 100px;
  z-index: 106;
  max-width: 220px;
  padding: 10px 14px;
  border-radius: 14px 14px 14px 4px;
  background: #f3efe4;
  color: #14170f;
  font: 500 14px/1.3 "Golos Text", "Segoe UI", sans-serif;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.ny-tip.is-in { opacity: 1; transform: none; }

/* карточка акции */
.ny-card {
  position: fixed;
  left: 16px;
  bottom: 140px;
  z-index: 130;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100svh - 200px);
  overflow: auto;
  padding: 22px 22px 20px;
  border-radius: 16px;
  background: var(--bg-2);
  color: var(--fg);
  border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transform-origin: 0 100%;
  visibility: hidden;
  transition: opacity .25s ease, transform .3s cubic-bezier(.16, 1, .3, 1), visibility 0s .3s;
}
.ny-card.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity .25s ease, transform .3s cubic-bezier(.16, 1, .3, 1); }
.ny-card__x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ny-card__x:hover { background: var(--bg-3); color: var(--fg); }
.ny-card__badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--lamp);
  color: var(--lamp-on);
  font-family: var(--meas); font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
}
[data-theme="light"] .ny-card__badge { background: var(--fg); color: var(--bg); }
.ny-card__left { margin-top: 10px; color: var(--fg-2); font-size: 14px; }
.ny-card__t { margin: 6px 0 0; font-family: var(--display); font-size: 28px; line-height: 1.1; font-weight: 400; }
.ny-card__num { margin-top: 14px; font-family: var(--display); font-size: 44px; line-height: 1; color: var(--lamp-ink); }
.ny-card__lab { margin-top: 6px; font-size: 15px; line-height: 1.35; }
.ny-card__p { margin-top: 12px; color: var(--fg-2); font-size: 14px; line-height: 1.45; }
.ny-card__code { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 10px 14px; border: 1.5px dashed var(--lamp-ink); border-radius: 10px; }
.ny-card__code span { color: var(--fg-2); font-size: 13px; }
.ny-card__code b { font-family: var(--meas); font-size: 19px; font-weight: 500; letter-spacing: .08em; }
.ny-card__act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ny-card__act .btn { padding: 13px 20px; }

/* телефон: над нижней панелью «Позвонить / Записаться» */
@media (max-width: 720px) {
  .ny-dm { width: 80px; left: -4px; bottom: calc(59px + env(safe-area-inset-bottom, 0px)); }
  .ny-tip { left: 78px; bottom: calc(59px + 60px + env(safe-area-inset-bottom, 0px)); font-size: 13px; max-width: 180px; }
  .ny-card { left: 12px; width: calc(100vw - 24px); bottom: calc(59px + 92px + env(safe-area-inset-bottom, 0px)); max-height: calc(100svh - 59px - 120px); }
  .ny-card__t { font-size: 24px; }
  .ny-card__num { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .ny-dm, .ny-dm img, .ny-tip, .ny-card { transition: none; }
}

/* ---------- весь сайт: еловые ветки вместо ботанического узора ----------
   Узор .leaf стоит на всех страницах (первый экран, разделы, подвал, шапки прайса и блога).
   На праздники вместо листьев рисуется еловая ветка со снегом и огоньками. */
.ny-on .leaf {
  color: transparent;
  opacity: .9;
  background: url(./ny/fir-spray.webp) center / contain no-repeat;
}
.ny-on .leaf use { display: none; }
/* за текстом первого экрана ветка тише, чтобы не мешать читать */
.ny-on .leaf--hero-l { opacity: .45; }

/* ---------- огоньки под шапкой, на всех страницах ---------- */
.ny-on .head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -16px;
  height: 20px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='20'%3E%3Cdefs%3E%3CradialGradient id='g'%3E%3Cstop offset='0' stop-color='%23fff6d8' stop-opacity='.9'/%3E%3Cstop offset='1' stop-color='%23fff6d8' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M0 2 Q40 12 80 2 T160 2' fill='none' stroke='%23303a2c' stroke-width='1.2'/%3E%3Cg%3E%3Ccircle cx='20' cy='9' r='6' fill='url(%23g)'/%3E%3Cellipse cx='20' cy='10' rx='2.6' ry='3.6' fill='%23f2c46d'/%3E%3Ccircle cx='60' cy='9' r='6' fill='url(%23g)'/%3E%3Cellipse cx='60' cy='10' rx='2.6' ry='3.6' fill='%23e0614f'/%3E%3Ccircle cx='100' cy='9' r='6' fill='url(%23g)'/%3E%3Cellipse cx='100' cy='10' rx='2.6' ry='3.6' fill='%237fbf6a'/%3E%3Ccircle cx='140' cy='9' r='6' fill='url(%23g)'/%3E%3Cellipse cx='140' cy='10' rx='2.6' ry='3.6' fill='%23f2c46d'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 160px 20px repeat-x;
}
@media (prefers-reduced-motion: no-preference) {
  .ny-on .head::after { animation: ny-twinkle 3.2s ease-in-out infinite; }
  @keyframes ny-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }
}

/* ---------- подвал: еловая гирлянда сверху и северный олень справа ---------- */
.ny-on .foot { padding-top: calc(var(--s6) + 64px); }
.ny-on .foot::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -4px;
  height: 84px;
  z-index: 1;
  pointer-events: none;
  background: url(./ny/garland.webp) 0 0 / auto 84px repeat-x;
}
.ny-deer {
  position: absolute;
  right: 4%;
  bottom: 24px;
  z-index: 1;
  width: 200px;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .5));
}

/* ---------- оленёнок в блоке акции, рядом с подарком «Оленёнок» ---------- */
.promo--dec .promo__text { position: relative; }
.ny-fawn {
  position: absolute;
  right: 0;
  bottom: -18px;
  width: 210px;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .45));
}

@media (max-width: 980px) {
  .ny-fawn { width: 150px; bottom: -8px; }
}
@media (max-width: 720px) {
  .ny-on .foot::after { height: 60px; background-size: auto 60px; }
  .ny-on .foot { padding-top: calc(var(--s6) + 40px); }
  .ny-deer { width: 84px; right: 6px; bottom: 6px; }
  .ny-fawn { width: 120px; bottom: 0; }
}

/* ---------- каждый раздел страниц: гирлянда по верхнему краю и еловая ветка в углу ----------
   Элементы ставит ny.js в каждый раздел внутри <main>, кроме первого экрана, шапок
   внутренних страниц и блока акции (у них своё оформление). Ветка в углу только там,
   где нет своего узора .leaf. */
.ny-sec { position: relative; overflow-x: clip; }
/* текст раздела всегда над веткой и снегом в углу */
.ny-sec > .wrap { position: relative; z-index: 2; }
.ny-band {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 52px;
  z-index: 3;
  pointer-events: none;
  background: url(./ny/garland.webp) 0 0 / auto 52px repeat-x;
}
.ny-corner {
  position: absolute;
  right: -70px;
  top: -92px;
  width: 170px;
  height: 212px;
  z-index: 0;
  pointer-events: none;
  opacity: .92;
  background: url(./ny/fir-spray.webp) center / contain no-repeat;
  transform: scaleX(-1) rotate(-8deg);
}
@media (max-width: 720px) {
  .ny-band { height: 36px; background-size: auto 36px; }
  .ny-corner { width: 96px; height: 120px; right: -34px; top: -34px; }
}

/* ---------- разделители v2: у каждого раздела своё украшение (рисует ny.js) ---------- */
.ny-dec { position: absolute; left: 0; right: 0; top: 0; z-index: 3; pointer-events: none; }
.ny-dec svg { display: block; overflow: visible; }
.ny-dec--garland { background: url(./ny/garland.webp) -137px 0 / auto 100% repeat-x; }
@media (prefers-reduced-motion: no-preference) {
  .ny-dec .tw { animation: ny-tw 2.6s ease-in-out infinite; }
  .ny-dec .sw { animation: ny-sw 4s ease-in-out infinite alternate; }
  .ny-dec.is-off .tw, .ny-dec.is-off .sw { animation-play-state: paused; }
  @keyframes ny-tw { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
  @keyframes ny-sw { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
}

/* ветки в углах: четыре разных */
.ny-corner--rowan { background-image: url(./ny/rowan.webp); width: 150px; height: 226px; transform: scaleX(-1) rotate(-6deg); }
.ny-corner--holly { background-image: url(./ny/holly.webp); width: 130px; height: 218px; transform: scaleX(-1) rotate(-12deg); }
.ny-corner--cones { background-image: url(./ny/cones.webp); width: 180px; height: 155px; top: -64px; right: -46px; transform: rotate(-6deg); }
@media (max-width: 720px) {
  .ny-corner--rowan { width: 84px; height: 127px; }
  .ny-corner--holly { width: 76px; height: 127px; }
  .ny-corner--cones { width: 104px; height: 89px; top: -34px; right: -26px; }
}

/* ---------- узор по разделам: длинная ветка с шаром на конце убрана совсем (двусмысленный силуэт) ----------
   Вместо неё круглый еловый букет; рядом с мастерами и на шапках внутренних страниц рябина,
   в «О нас» и подвале остролист, у KV-1 шишки. */
.ny-on .leaf--about, .ny-on .leaf--foot { background-image: url(./ny/holly.webp); }
.ny-on .leaf--crew, .ny-on .leaf--pr { background-image: url(./ny/rowan.webp); }
.ny-on .leaf--kv { background-image: url(./ny/cones.webp); }
.ny-corner--fir { width: 220px; height: 136px; transform: none; }
@media (max-width: 720px) {
  .ny-corner--fir { width: 120px; height: 74px; }
}
/* разделы обрезают всё выше своего края, поэтому ветки в углах лежат горизонтально и целиком
   помещаются в верхний отступ (ny.js уменьшает их под высоту отступа) */
.ny-corner--rowan { background-image: url(./ny/rowan-h.webp); width: 232px; height: 132px; right: -46px; transform: none; }
.ny-corner--holly { background-image: url(./ny/holly-h.webp); width: 232px; height: 125px; right: -40px; transform: none; }
.ny-corner--cones { transform: none; }
@media (max-width: 720px) {
  .ny-corner--rowan { width: 128px; height: 73px; right: -24px; }
  .ny-corner--holly { width: 128px; height: 69px; right: -22px; }
}
