/* Курсор-прицел (включается скриптом cursor.js только на устройствах с мышью) */
html.has-cur, html.has-cur * { cursor: none !important; }

.cur {
  position: fixed; inset: auto; left: 0; top: 0; width: 0; height: 0; margin: 0; padding: 0; border: 0;
  background: none; overflow: visible; pointer-events: none; color: #C9A36B;
  opacity: 0; transition: opacity .3s ease;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
.cur.on { opacity: 1; }

/* кольцо-прицел: позиция задаётся скриптом, размер и форма — состоянием */
.cur-ring {
  --w: 30px; --h: 30px; --r: 50%;
  position: absolute; left: 0; top: 0; width: 0; height: 0; display: block; will-change: transform;
}
.cur-ring::before {                               /* сама окружность / рамка */
  content: ''; position: absolute; left: 50%; top: 50%; width: var(--w); height: var(--h);
  transform: translate(-50%, -50%); border: 1px solid rgba(201, 163, 107, .78); border-radius: var(--r);
  box-shadow: 0 0 0 1px rgba(10, 9, 8, .35), 0 0 18px rgba(201, 163, 107, .12);
  transition: width .45s var(--ease), height .45s var(--ease), border-radius .45s var(--ease), border-color .3s, background .3s, opacity .3s;
}
.cur-ring::after { content: ''; position: absolute; left: 50%; top: 50%; opacity: 0; transition: opacity .3s, transform .45s var(--ease); }

/* четыре короткие риски прицела */
.cur-ring .t { position: absolute; left: 0; top: 0; background: #C9A36B; opacity: .95; transition: transform .45s var(--ease), opacity .3s, height .3s, width .3s; }
.cur-ring .t.n, .cur-ring .t.s { width: 1px; height: 9px; margin-left: -.5px; }
.cur-ring .t.e, .cur-ring .t.w { height: 1px; width: 9px; margin-top: -.5px; }
.cur-ring .t.n { transform: translate(0, calc(var(--h) / -2 - 4px)); }
.cur-ring .t.s { transform: translate(0, calc(var(--h) / 2 - 5px)); }
.cur-ring .t.e { transform: translate(calc(var(--w) / 2 - 5px), 0); }
.cur-ring .t.w { transform: translate(calc(var(--w) / -2 - 4px), 0); }

/* центральная точка идёт строго за указателем */
.cur-dot {
  position: absolute; left: -2.5px; top: -2.5px; width: 5px; height: 5px; border-radius: 50%;
  background: #F3E3B3; box-shadow: 0 0 8px rgba(243, 227, 179, .85); will-change: transform;
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background .3s, opacity .3s;
}

/* подпись рядом с кольцом */
.cur-lbl {
  position: absolute; left: calc(var(--w) / 2 + 12px); top: 0; transform: translate(-6px, -50%);
  font: 600 10px/1 'Manrope', system-ui, sans-serif; letter-spacing: .05em; white-space: nowrap;
  color: #F3E3B3; text-shadow: 0 1px 8px rgba(10, 9, 8, .9), 0 0 2px rgba(10, 9, 8, .9);
  opacity: 0; transition: opacity .3s, transform .45s var(--ease); pointer-events: none;
}
.cur.has-lbl .cur-lbl { opacity: 1; transform: translate(0, -50%); }

/* ---------- состояния ---------- */
/* чтение текста: прицел съёживается и затихает */
.cur[data-s=text] .cur-ring { --w: 16px; --h: 16px; }
.cur[data-s=text] .cur-ring::before { opacity: .5; }
.cur[data-s=text] .cur-ring .t { height: 5px; }
.cur[data-s=text] .cur-ring .t.e, .cur[data-s=text] .cur-ring .t.w { height: 1px; width: 5px; }
.cur[data-s=text] .cur-dot { width: 3px; height: 3px; left: -1.5px; top: -1.5px; }

/* ссылка: кольцо сжимается и поворачивается на 45° (риски превращаются в диагональный «x») */
.cur[data-s=link] .cur-ring { --w: 22px; --h: 22px; }
.cur[data-s=link] .cur-ring::before { border-color: #F3E3B3; transform: translate(-50%, -50%) rotate(45deg); border-radius: 4px; }
.cur[data-s=link] .cur-dot { background: #C9A36B; }

/* захват: рамка точно по границам элемента, риски убираются */
.cur.snap .cur-ring { --w: var(--sw, 60px); --h: var(--sh, 40px); --r: var(--sr, 8px); }
.cur.snap .cur-ring::before { border-color: rgba(243, 227, 179, .9); }
.cur.snap .cur-ring .t { opacity: 0; }
.cur.snap .cur-dot { width: 3px; height: 3px; left: -1.5px; top: -1.5px; }
.cur.snap .cur-lbl { left: calc(var(--w) / 2 + 12px); }
.cur.lbl-l .cur-lbl { left: auto; right: calc(var(--w) / 2 + 12px); transform: translate(6px, -50%); }
.cur.lbl-l.has-lbl .cur-lbl { transform: translate(0, -50%); }
.cur.fill .cur-ring::before { background: rgba(201, 163, 107, .16); border-color: #C9A36B; box-shadow: 0 0 26px rgba(201, 163, 107, .35); }
.cur.pulse .cur-ring::before { animation: cur-pulse 1.4s ease-out infinite; }

/* видео: большой круг с треугольником «play» */
.cur[data-s=play] .cur-ring { --w: 78px; --h: 78px; }
.cur[data-s=play] .cur-ring::before { background: rgba(10, 9, 8, .45); border-color: #F3E3B3; }
.cur[data-s=play] .cur-ring::after { opacity: 1; width: 0; height: 0; margin: -9px 0 0 -6px; border-left: 17px solid #F3E3B3; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.cur[data-s=play] .cur-ring .t, .cur[data-s=zoom] .cur-ring .t, .cur[data-s=close] .cur-ring .t, .cur[data-s=prev] .cur-ring .t, .cur[data-s=next] .cur-ring .t, .cur[data-s=drag] .cur-ring .t { opacity: 0; }
.cur[data-s=play] .cur-dot, .cur[data-s=zoom] .cur-dot, .cur[data-s=close] .cur-dot, .cur[data-s=prev] .cur-dot, .cur[data-s=next] .cur-dot, .cur[data-s=drag] .cur-dot { opacity: 0; }

/* фото и масштаб: кольцо с плюсом */
.cur[data-s=zoom] .cur-ring { --w: 56px; --h: 56px; }
.cur[data-s=zoom] .cur-ring::before { background: rgba(10, 9, 8, .4); border-color: #F3E3B3; }
.cur[data-s=zoom] .cur-ring::after { opacity: 1; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  background: linear-gradient(#F3E3B3, #F3E3B3) center / 100% 1.5px no-repeat, linear-gradient(#F3E3B3, #F3E3B3) center / 1.5px 100% no-repeat; }

/* закрыть: кольцо с крестом, при наведении поворачивается */
.cur[data-s=close] .cur-ring { --w: 48px; --h: 48px; }
.cur[data-s=close] .cur-ring::before { background: rgba(10, 9, 8, .5); border-color: #F3E3B3; }
.cur[data-s=close] .cur-ring::after { opacity: 1; width: 16px; height: 16px; margin: -8px 0 0 -8px; transform: rotate(45deg);
  background: linear-gradient(#F3E3B3, #F3E3B3) center / 100% 1.5px no-repeat, linear-gradient(#F3E3B3, #F3E3B3) center / 1.5px 100% no-repeat; }

/* листание: кольцо со стрелкой нужного направления */
.cur[data-s=prev] .cur-ring, .cur[data-s=next] .cur-ring { --w: 52px; --h: 52px; }
.cur[data-s=prev] .cur-ring::before, .cur[data-s=next] .cur-ring::before { background: rgba(10, 9, 8, .45); border-color: #F3E3B3; }
.cur[data-s=prev] .cur-ring::after, .cur[data-s=next] .cur-ring::after { opacity: 1; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-left: 1.5px solid #F3E3B3; border-bottom: 1.5px solid #F3E3B3; }
.cur[data-s=prev] .cur-ring::after { transform: translateX(2px) rotate(45deg); }
.cur[data-s=next] .cur-ring::after { transform: translateX(-2px) rotate(-135deg); }

/* перетаскивание/лента: вытянутое кольцо со стрелками по бокам */
.cur[data-s=drag] .cur-ring { --w: 74px; --h: 40px; --r: 20px; }
.cur[data-s=drag] .cur-ring::before { background: rgba(10, 9, 8, .4); border-color: #F3E3B3; }
.cur[data-s=drag] .cur-ring::after { opacity: 1; width: 40px; height: 9px; margin: -4.5px 0 0 -20px;
  background:
    linear-gradient(135deg, transparent 46%, #F3E3B3 46% 54%, transparent 54%) left center / 9px 9px no-repeat,
    linear-gradient(45deg, transparent 46%, #F3E3B3 46% 54%, transparent 54%) right center / 9px 9px no-repeat; }

/* нажатие и «выстрел» */
.cur.down .cur-ring::before { border-color: #fff; }
.cur.down .cur-dot { width: 8px; height: 8px; left: -4px; top: -4px; background: #fff; }
.cur.shot .cur-ring::before { animation: cur-shot .5s var(--ease); }
@keyframes cur-shot {
  0% { transform: translate(-50%, -50%) scale(1); }
  28% { transform: translate(-50%, -50%) scale(.62); box-shadow: 0 0 0 1px rgba(10, 9, 8, .35), 0 0 30px rgba(243, 227, 179, .65); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
@keyframes cur-pulse {
  0% { box-shadow: 0 0 0 0 rgba(201, 163, 107, .5); }
  100% { box-shadow: 0 0 0 16px rgba(201, 163, 107, 0); }
}
/* в покое кольцо «дышит» */
.cur.idle .cur-ring::before { animation: cur-breathe 2.8s ease-in-out infinite; }
@keyframes cur-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .8; }
  50% { transform: translate(-50%, -50%) scale(1.14); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cur.idle .cur-ring::before, .cur.pulse .cur-ring::before, .cur.shot .cur-ring::before { animation: none; }
  .cur-ring::before, .cur-ring .t, .cur-lbl { transition-duration: .01s; }
}
