/* Контакты: кошка спит под лампой и просыпается от касания (Rasl 27.11). Та же кошка M8, поверх — глаз, хвост, бок и свет кодом.
   Координаты — в cqw фигуры: 1cqw = 16 px картинки 1600×1200. Двигаем только transform/opacity. */
.contacts__cat[data-wake] { container-type: inline-size; }
.wake { position: relative; height: 100%; transform-origin: 12% 100%; -webkit-tap-highlight-color: transparent; }
.wake > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wake { cursor: pointer; }
.is-still .wake { cursor: default; }

.wake > img { position: relative; }

/* сон (Rasl 27.11, #1949): глаза нет; дышит бок, изредка вздрагивает кончик хвоста, лампа светит и мерцает, в луче пылинки.
   Петли — CSS transform/opacity, идут только пока блок рядом (.is-near); проснулась — бок и хвост замирают. */
/* бок: копия картинки под мягкой маской (спина и бок, без головы и лампы), вдох 1,5 с — выдох 2,1 с; ось — линия полотенца */
.wake > .wake__breath { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transform-origin: 27.5% 58.3%;
  -webkit-mask-image: radial-gradient(28.75% 27.5% at 27.5% 43.3%, #000 62%, transparent 100%); mask-image: radial-gradient(28.75% 27.5% at 27.5% 43.3%, #000 62%, transparent 100%);
  animation: wake-breath 3.6s infinite; }
@keyframes wake-breath { 0%, 100% { transform: none; animation-timing-function: cubic-bezier(.45,0,.55,1); } 42% { transform: scale(1.004, 1.02); animation-timing-function: cubic-bezier(.4,0,.6,1); } }
/* кончик хвоста (завиток, 952…1232 × 835…1106): вздрагивает раз в ~11 с — дважды, второй раз слабее; ось (964, 866) — середина мягкого стыка 952…976 */
.wake__curl { position: absolute; left: 59.5%; top: 69.583%; width: 17.5%; height: 22.583%; transform-origin: 4.29% 11.44%; animation: wake-flick 11s infinite; }
.wake__curl img { display: block; width: 100%; height: 100%; max-width: none; }
@keyframes wake-flick {
  0%, 70% { transform: none; animation-timing-function: cubic-bezier(.3,0,.2,1); }
  72.5% { transform: rotate(-4.5deg); animation-timing-function: cubic-bezier(.4,0,.4,1); }
  75.5% { transform: rotate(1.2deg); animation-timing-function: ease-in-out; }
  78.5% { transform: rotate(-.5deg); animation-timing-function: ease-in-out; }
  82%, 90% { transform: none; animation-timing-function: cubic-bezier(.3,0,.2,1); }
  92% { transform: rotate(-2deg); animation-timing-function: ease-in-out; }
  95%, 100% { transform: none; }
}

.is-tailing .wake__curl { visibility: hidden; }

/* лампа: тёплый ореол за куполом, свет в проёме, три диода дышат вразнобой.
   #1960 (iPhone: кошка иногда пропадала): без mix-blend-mode и постоянных will-change, у фигуры нет .reveal — Safari не теряет слой; петли сами поднимают слой, пока идут */
.wake__halo { position: absolute; left: 61%; top: 17%; width: 38%; height: 54%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgb(255 222 150 / .34), rgb(255 222 150 / .12) 55%, transparent); animation: wake-glow 4.8s ease-in-out infinite alternate; }
.wake__lamp { position: absolute; inset: 0; pointer-events: none; }
.wake__lamp i { position: absolute; display: block; border-radius: 50%; }
.wake__beam { left: 68.5%; top: 36%; width: 23.5%; height: 19.5%; background: radial-gradient(closest-side, rgb(255 196 96 / .5), rgb(255 206 120 / .2) 60%, transparent); animation: wake-glow 4.8s ease-in-out infinite alternate; }
@keyframes wake-glow { 0% { opacity: .55; } 46% { opacity: .9; } 50% { opacity: .78; } 54%, 100% { opacity: 1; } }
.wake__led { width: 4.6%; height: 2.6%; margin: -1.3% 0 0 -2.3%; background: radial-gradient(closest-side, #FFF6C8, rgb(255 228 140 / .7) 45%, transparent); animation: wake-led 2.6s ease-in-out infinite alternate; }
.wake__led:nth-child(2) { left: 76.56%; top: 40.25%; }
.wake__led:nth-child(3) { left: 81.25%; top: 40.67%; animation-delay: -.9s; }
.wake__led:nth-child(4) { left: 85.63%; top: 42.92%; animation-delay: -1.7s; }
@keyframes wake-led { from { opacity: .25; } to { opacity: 1; } }
/* пылинки в луче у проёма: поднимаются и тают (над тёмной лапой и мордой — видно) */
.wake__mote { width: .55cqw; height: .55cqw; background: radial-gradient(closest-side, #FFF3D2, rgb(255 236 190 / .5) 60%, transparent); opacity: 0; animation: wake-mote 6.4s linear infinite; }
.wake__mote:nth-child(5) { left: 69%; top: 51%; }
.wake__mote:nth-child(6) { left: 72.5%; top: 48%; animation-duration: 7.6s; animation-delay: -2.4s; }
.wake__mote:nth-child(7) { left: 66.5%; top: 47%; animation-duration: 8.2s; animation-delay: -5s; width: .4cqw; height: .4cqw; }
.wake__mote:nth-child(8) { left: 74.5%; top: 52.5%; animation-duration: 6.9s; animation-delay: -3.7s; width: .45cqw; height: .45cqw; }
@keyframes wake-mote { 0% { opacity: 0; transform: none; } 18% { opacity: .9; } 70% { opacity: .7; } 100% { opacity: 0; transform: translate(-1.6cqw, -5cqw); } }

/* глаз — ровно на линии закрытого века (1047, 420), ось 53° */
.wake__eye {
  position: absolute; left: calc(65.44cqw - 2.75cqw); top: calc(26.25cqw - 1.625cqw);
  width: 5.5cqw; height: 2.5cqw; transform: rotate(53deg); transform-origin: 50% 65%;
  opacity: 0; transition: opacity .18s linear .42s; pointer-events: none;
}
.wake__lid { display: block; width: 100%; height: 100%; transform: scaleY(.08); transform-origin: 50% 65%; transition: transform .45s cubic-bezier(.5,0,.75,0); }
.wake__lid svg { display: block; width: 100%; height: 100%; overflow: visible; }
.is-awake .wake__eye { opacity: 1; transition-delay: 0s; }
.is-awake .wake__lid { transform: scaleY(1); animation: wake-open 1.15s cubic-bezier(.3,.7,.2,1); }
@keyframes wake-open { 0% { transform: scaleY(.08); } 30% { transform: scaleY(.42); } 52% { transform: scaleY(.34); } 100% { transform: scaleY(1); } }

/* хвост: пока тянется к Telegram, завиток картинки прячем (вырез x ≥ 820, y ≥ 826 — ниже полотенца только хвост)
   и рисуем его кодом — тот же контур, 48 звеньев; в покое снова картинка */
.wake__tail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; visibility: hidden; }
.is-tailing .wake__tail { visibility: visible; }
.is-tailing .wake > img { clip-path: polygon(0 0, 100% 0, 100% 68.83%, 51.25% 68.83%, 51.25% 100%, 0 100%); }

/* подсказка-кнопка: видна, когда кошка проснулась и её ещё не гладили */
.wake__hint {
  position: absolute; left: 2cqw; bottom: 4cqw; z-index: 2; min-height: 44px; padding: 0 var(--space-3);
  border: 1px solid color-mix(in oklab, var(--accent) 70%, transparent); border-radius: 999px; background: var(--tush, #0B0B0B);
  color: var(--accent); font: 700 var(--step--1)/1 var(--font-body, inherit); letter-spacing: var(--track-label); text-transform: uppercase;
  cursor: pointer; -webkit-tap-highlight-color: transparent; opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease-out), transform .4s var(--ease-out); pointer-events: none;
}
.wake__hint::after { content: " ↘"; }
@media (min-width: 901px) { /* ПК: крупнее, над спиной у головы, стрелка — на морду (Критик, проба-1 №2) */
  .wake__hint { left: clamp(0px, calc((100cqw - 420px) * .1), 6cqw); top: clamp(0px, calc((100cqw - 420px) * .1), 6cqw); bottom: auto; min-height: 48px; padding: 0 var(--space-4, 20px); border: 1.5px solid var(--accent);
    background: color-mix(in oklab, var(--accent) 14%, var(--tush, #0B0B0B)); font-size: var(--step-0, 1rem); letter-spacing: .01em; text-transform: none; }
}
.is-near:not(.is-petted):not(.is-still) .wake__hint { opacity: 1; transform: none; pointer-events: auto; transition-delay: .9s; }
.wake__hint:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; opacity: 1; transform: none; pointer-events: auto; }

/* строка Telegram отвечает: изумрудная полоса прокатывается слева, стрелка тянется */
#contacts .plate__row[data-tg] { position: relative; isolation: isolate; }
#contacts .plate__row[data-tg]::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in oklab, var(--accent) 22%, transparent);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .7s cubic-bezier(.2,.8,.2,1);
}
#contacts .plate__row[data-tg].is-called::before { transform: scaleX(1); }
#contacts .plate__row[data-tg].is-called .plate__key, #contacts .plate__row[data-tg].is-called .plate__arrow { color: var(--accent); }
#contacts .plate__row[data-tg].is-called .plate__arrow { transform: translateX(10px); }

/* пауза петель вне экрана и пока кошка не спит — после объявлений animation (их сокращение сбрасывает play-state) */
[data-wake]:not(.is-near) :is(.wake__breath, .wake__curl, .wake__lamp i, .wake__halo), [data-wake].is-awake :is(.wake__breath, .wake__curl) { animation-play-state: paused; }

@media (max-width: 900px) {
  .contacts__cat[data-wake] { width: 92%; }
  #contacts { overflow-x: clip; }   /* свечение за кошкой (inset −12 %) при ширине 92 % выходило за край на 2 px (768) */
  .wake__hint { left: 0; bottom: 1cqw; }
}

/* телефон: липкая «Записаться» уступает низ экрана контактам — там своя строка Telegram (Критик, проба-1 №3) */
.sticky-cta.is-on.is-yield-c { transform: translateY(calc(100% + 2 * var(--gutter))); }

/* без движения: кошка спит неподвижно — без глаза, хвост и лампа стоят, подсказка не нужна */
.is-still .wake__eye, .is-still .wake__tail, .is-still .wake__hint, .is-still .wake__breath, .is-still .wake__mote { display: none; }
.is-still .wake__curl, .is-still .wake__lamp i, .is-still .wake__halo { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .wake, .wake__lid, .wake__curl, .wake__lamp i, .wake__halo { animation: none !important; }
  .wake__eye, .wake__tail, .wake__hint, .wake__breath, .wake__mote { display: none; }
}
