/* ============================================================
   MOTION (js/motion.js) — Lenis + курсор-«софит».
   Словарь easing/длительностей — в :root style.css (--ease-*, --dur-write).
   ============================================================ */

/* ---------- Lenis ---------- */
html.lenis,
html.lenis body { height: auto; }
/* scroll-behavior: smooth из style.css дрался бы с Lenis за якоря */
html.lenis { scroll-behavior: auto; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }


/* ---------- Курсор-«софит» ----------
   Появляется только над ссылками/кнопками/медиа (.mcur-on ставит JS), в
   остальном — родной курсор. .has-mcur ставит первый mousemove, на время
   прелоадера не включается. В полях ввода — родная каретка. */
html.has-mcur.mcur-on:not(.pl-hold),
html.has-mcur.mcur-on:not(.pl-hold) * { cursor: none !important; }
html.has-mcur :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), textarea, [contenteditable="true"]) { cursor: text !important; }
html.has-mcur :is(iframe) { cursor: auto !important; }

.mcur {
  position: fixed;
  inset: 0;
  /* выше всех окон сайта: «Узнать стоимость» и рулетка — 99999, прелоадер — 100000.
     Было 9998 — над кнопками этих окон родной курсор скрыт (cursor: none), а кольцо
     оставалось под окном: курсор пропадал. */
  z-index: 100001;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s var(--ease-soft);
}
html.has-mcur.mcur-on:not(.pl-hold) .mcur { opacity: 1; }
.mcur.is-off,
.mcur.is-away { opacity: 0 !important; }

.mcur__r,
.mcur__d {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

/* кольцо: тонкая золотая обводка + тёплое пятно света внутри */
.mcur__ring {
  position: absolute;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 1.5px solid rgba(245, 177, 67, 0.85);
  background: radial-gradient(circle, rgba(255, 226, 170, 0.22) 0%, rgba(255, 226, 170, 0) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    width 0.5s var(--ease-spring), height 0.5s var(--ease-spring), margin 0.5s var(--ease-spring),
    background-color 0.3s var(--ease-soft), border-color 0.3s var(--ease-soft),
    box-shadow 0.4s var(--ease-soft), scale 0.35s var(--ease-spring);
}
.mcur__dot {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--color-gold);
  box-shadow: 0 0 8px rgba(245, 177, 67, 0.7);
  transition: scale 0.3s var(--ease-spring), opacity 0.2s ease;
}
.mcur__label {
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-brown-dark);
  opacity: 0;
  scale: 0.6;
  transition: opacity 0.25s var(--ease-soft), scale 0.4s var(--ease-spring);
}

/* ссылки и кнопки — кольцо раскрывается, свет ярче: «софит поймал» */
.mcur.is-link .mcur__ring {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-color: rgba(245, 177, 67, 1);
  background-color: rgba(255, 226, 170, 0.14);
  box-shadow: 0 0 30px rgba(245, 177, 67, 0.35);
}
.mcur.is-link .mcur__dot { scale: 0; }

/* медиа — плашка с подписью, тот же язык, что линза галереи (gal-fx.css) */
.mcur.is-label .mcur__ring {
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  border-color: rgba(245, 177, 67, 0.9);
  background-color: rgba(245, 238, 224, 0.92);
  box-shadow: 0 10px 28px rgba(59, 35, 20, 0.25);
}
.mcur.is-label .mcur__label { opacity: 1; scale: 1; }
.mcur.is-label .mcur__dot { opacity: 0; }

.mcur.is-down .mcur__ring { scale: 0.82; }
.mcur.is-down .mcur__dot { scale: 1.6; }

@media (max-width: 768px), (hover: none), (prefers-reduced-motion: reduce) {
  .mcur { display: none; }
}
