/* scene.css — «Иришка»: живая кошка кодом (стол первого экрана, веер форм K3), блик K1, пик K4 (design/scene.md).
   Двигаются только transform и opacity; каждая подвижная часть кошки — свой маленький слой. */

/* ── скелет кошки: слои-части (координаты в style — из cat-src/build.py) ── */
.cat { position: absolute; pointer-events: none; }
.cat__l { position: absolute; }
.cat__l > svg, .tip__l, .desk__props { display: block; overflow: visible; }
.cat__l > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cat__forego, .cat__pawgo, .cat__pupil, .cat__lid { position: absolute; inset: 0; }
.cat__pupil > svg, .cat__lid > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cat__lid { transform: scaleY(0); }
.cat__pupil { transform-origin: 50% 50%; transition: transform .5s var(--ease-out); }
.cat__tool--brush { opacity: 0; }
/* свечение изумрудного глаза — кодом, цветом --accent (в картинки ChatGPT не вшито; task-scene-night.md) */
.cat__eye::before { content: ""; position: absolute; inset: -55% -45%; border-radius: 50%; --eye-glow: #6FAF98; /* ночной --accent: кошки стоят на молочных островах, где --accent тёмный */ background: radial-gradient(closest-side, color-mix(in oklab, var(--eye-glow) 58%, transparent), color-mix(in oklab, var(--eye-glow) 16%, transparent) 55%, transparent); pointer-events: none; }

/* «живость» — петли на видеокарте (CSS), стоят, когда сцена вне экрана */
html.scene .cat__tail { animation: catTail 3.6s ease-in-out infinite alternate; }
html.scene .cat__ear { animation: catEar 7.3s linear infinite; }
html.scene .cat__lid { animation: catBlink 5.4s linear infinite; }
html.scene .is-filing .cat__pawgo { animation: catFile .44s ease-in-out infinite alternate; }
html.scene .is-filing .cat__forego { animation: catFore .44s ease-in-out infinite alternate; }
html.scene .cat__eye::before { animation: catGlow 5.4s linear infinite; }   /* гаснет вместе с веком */
html.scene .is-off .cat__l, html.scene .is-off .cat__eye::before, html.scene .is-off .tip__dust { animation-play-state: paused; }
@keyframes catTail { from { transform: rotate(-2.6deg); } to { transform: rotate(2deg); } }
@keyframes catEar { 0%, 90%, 94%, 98%, 100% { transform: none; } 92% { transform: rotate(-13deg); } 96% { transform: rotate(-8deg); } }
@keyframes catGlow { 0%, 93.5%, 98.5%, 100% { opacity: 1; } 95.5%, 96.3% { opacity: .25; } }
@keyframes catBlink { 0%, 93.5%, 98.5%, 100% { transform: scaleY(0); } 95.5%, 96.3% { transform: scaleY(1); } }
/* пилка ходит вдоль своей оси (853,387 → 921,523 на холсте M2), ±12 px холста */
@keyframes catFile { from { transform: translate(-4.2%, -5%); } to { transform: translate(4.2%, 5%); } }
@keyframes catFore { from { transform: rotate(-1.1deg); } to { transform: rotate(.9deg); } }

/* ── K0 первый экран: маникюрный стол (единица — ширина стола, 100cqw) ── */
.hero.is-pin, .hero:has(.desk) { overflow-x: clip; }
.hero__stage--desk { display: flex; align-items: flex-end; justify-content: flex-end; }
/* стол — молочный остров, уходит вправо до края экрана (direction.md) */
.hero__stage--desk.island { padding: var(--space-5); box-shadow: 0 0 0 100vmax var(--surface); clip-path: inset(0 -100vmax 0 0); }
.desk { position: relative; container-type: inline-size; width: min(100%, var(--desk-max, 100%)); aspect-ratio: 1; }
.desk__stage { position: absolute; inset: 0; }
.desk__props { position: absolute; left: 0; top: 0; width: 100cqw; height: 100cqw; }
.tip { position: absolute; }
.tip__l { position: absolute; inset: 0; width: 100%; height: 100%; }
.tip__star { transform-origin: 14.5% 7.1%; }
.tip__dust { position: absolute; width: .7cqw; height: .7cqw; margin: -.35cqw; border-radius: 50%; background: var(--plane); opacity: 0; }
.is-filing .tip__dust { animation: tipDust 1.7s var(--d) linear infinite; }
@keyframes tipDust { 0% { opacity: 0; transform: none; } 8% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), 33cqw); } }
/* до первого кадра скрипта — исходное положение (p = 0); без скрипта и в reduced-motion — итог (все ценники висят) */
html.scene .tip__new, html.scene .tip__eye, html.scene .tip__star { opacity: 0; }
html.scene .tag { transform: translateY(-101%); }

/* то, что двигает скрипт при прокрутке, — на своих слоях (без перерисовки); стол — первый экран, слои маленькие */
html.scene .tag, html.scene .tip__old, html.scene .tip__new, html.scene .tip__eye, html.scene .tip__star, html.scene .cat__tool, html.scene .cat--desk .cat__paw, html.scene .cat--desk .cat__fore { will-change: transform, opacity; }

/* ценники на нитках из-под столешницы */
.desk__tags { position: absolute; left: 0; width: 100cqw; height: 40cqw; margin: 0; padding: 0; list-style: none; clip-path: inset(0 -20cqw -20cqw -20cqw); }
.tag { --w: 18cqw; position: absolute; top: 0; left: calc(var(--x) - var(--w) / 2); width: var(--w); transform-origin: 50% 0; }
.tag::before { content: ""; position: relative; z-index: 1; display: block; width: 1.5px; height: calc(var(--len) + 1.5cqw); margin: 0 auto calc(-1.5cqw); background: var(--ink); }
.tag__card { position: relative; display: block; padding: 2.1cqw .5cqw 1.3cqw; background: #fff; border: 1.5px solid var(--tush); border-radius: .6cqw .6cqw 1.4cqw 1.4cqw; text-align: center; box-shadow: 0 .8cqw 1.6cqw -1cqw color-mix(in oklab, var(--tush) 25%, transparent); } /* ценники белые — на молочном острове (палитра 26.11) */
.tag__card::before { content: ""; position: absolute; top: .7cqw; left: 50%; width: .9cqw; height: .9cqw; margin-left: -.45cqw; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--surface); }
.tag__name { display: block; font-weight: 700; font-size: max(12px, 1.95cqw); line-height: 1.2; }
.tag__price { display: block; margin-top: .35em; color: var(--ink-muted); font-size: max(11px, 1.6cqw); line-height: 1.25; }
.tag__price--sum { color: var(--ink); font-family: var(--font-display); font-size: max(13px, 2.3cqw); letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag:nth-child(1) { --x: 10cqw; --len: 3cqw; } .tag:nth-child(2) { --x: 29.2cqw; --len: 10cqw; } .tag:nth-child(3) { --x: 48.4cqw; --len: 4.5cqw; }
.tag:nth-child(4) { --x: 67.6cqw; --len: 12cqw; } .tag:nth-child(5) { --x: 86.8cqw; --len: 6cqw; }

/* закреплённый первый экран — с первой отрисовки (CLS: раньше ждал scene.js ~1,8 с); scene.js лишь уточняет --hdr/--hs и высоту */
html.scene { --hdr: calc(var(--header-h, 72px) + 1px); --hs: calc(100svh - var(--hdr)); }
html.scene .hero { height: calc(var(--hs) * 1.6); padding-block: 0; }   /* 1 + run .35 + rest .25 */
html.scene .hero .hero__grid { position: sticky; top: var(--hdr); height: var(--hs); min-height: 0; padding-block: var(--space-5) var(--space-6); box-sizing: border-box; }
html.scene .hero .desk { --desk-max: calc(var(--hs) - var(--space-5) - var(--space-6) - 2 * var(--space-5)); }

/* ── K1 — блик за пальцем: своя полоса после первого экрана; на видеокарте только 2 соседних стадии ── */
.glare-band { padding-block: var(--space-7) var(--space-6); } /* молочное паспарту вокруг фото */
.glare-band .glare { min-height: 0; }
.glare-band .hero__hint { position: static; margin-top: var(--space-3); padding: 0; background: none; }
/* жемчужная полоса блика: ходит за пальцем от края до края, гаснет в покое; без overlay и с мягкими краями — коробка не видна (Критик full1 №1) */
.glare__sheen { position: absolute; top: -10%; bottom: -10%; left: -21%; width: 42%; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease-out); will-change: transform, opacity;
  background: linear-gradient(104deg, transparent 28%, rgb(255 226 166 / .10) 40%, rgb(255 233 190 / .32) 47%, color-mix(in oklab, var(--pearl) 72%, transparent) 50%, rgb(255 233 190 / .32) 53%, rgb(255 226 166 / .10) 60%, transparent 72%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24%, #000 76%, transparent); mask-image: linear-gradient(90deg, transparent, #000 24%, #000 76%, transparent); }
.glare__sheen.is-live { opacity: .8; }
.glare__layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 55%; opacity: 0; visibility: hidden; pointer-events: none; }

/* ── K3 — лапа M5 листает веер типс ── */
.extend__paw--live { position: relative; margin: 0; aspect-ratio: 4 / 3; --cat-w: 62; --cat-l: 1cqw; --cat-b: 8cqh; --fan-h: 54%; --fan-r: 18deg; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
/* кошка M5 лежит, вытянутая лапа держит веер: основание веера — в кончике лапы (--pfx/--pfy — доли ширины кошки, из desk.py) */
.paw5 { position: absolute; inset: 0; container-type: size; }
.cat--paw { left: var(--cat-l); bottom: var(--cat-b); width: calc(var(--cat-w) * 1cqw); }
.fan { position: absolute; left: calc(var(--cat-l) + var(--cat-w) * var(--pfx) * 1cqw); bottom: calc(var(--cat-b) + var(--cat-w) * var(--pfy) * 1cqw);
  height: var(--fan-h); aspect-ratio: 136 / 360; transform: translate(-50%, 3%) rotate(var(--fan-r)); transform-origin: 50% 97%; }
.fan__tip { position: absolute; inset: 0; transform-origin: 50% 97%; }
.fan__tip svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fan__nail { fill: var(--pearl); }
.fan__eye { opacity: 0; }
.fan__tip.is-on .fan__nail { fill: var(--accent); }
.fan__tip.is-on .fan__eye { opacity: 1; }

/* ── K4 — пик «ноготь → глаз кошки» (без изменений с пробы #1913) ── */
.peak.is-scene .peak__nail, .peak.is-scene .peak__eye { display: none; }
.k4 { grid-column: 1 / -1; grid-row: 1 / 6; position: relative; height: calc(var(--hs) * 1.6); margin-top: calc(-1 * var(--section) + var(--space-5)); }
.k4__stage { position: sticky; top: var(--hdr); height: var(--hs); margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); overflow: hidden; }
.k4__img { position: absolute; left: 0; top: 0; width: var(--box); height: var(--box); transform-origin: 50% 50%; will-change: transform; z-index: 2; pointer-events: none; }
/* маски — у каждого снимка своя: ноготь мягким кругом; глаз без головы (маска по форме глаза, из снимка); голова целиком — края снимка мягкие, уши (6 % сверху) не задеты */
.k4__img .k4__m6 { -webkit-mask-image: radial-gradient(closest-side, #000 64%, transparent 100%); mask-image: radial-gradient(closest-side, #000 64%, transparent 100%); }
.k4__img .k4__eye { -webkit-mask: url(images/m7-eye-mask.png) 0 0 / 100% 100% no-repeat; mask: url(images/m7-eye-mask.png) 0 0 / 100% 100% no-repeat; }
.k4__img .k4__m7 { --mx: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); --my: linear-gradient(180deg, transparent, #000 4.5%, #000 92%, transparent);
  -webkit-mask-image: var(--mx), var(--my); -webkit-mask-composite: source-in; mask-image: var(--mx), var(--my); mask-composite: intersect; }
/* подложка-ночь под заголовком: контур головы проходит под буквами, а не через них (Критик, проба-1 №1); место задаёт scene.js */
.k4__veil { position: absolute; z-index: 2; background: var(--night); box-shadow: 0 0 28px 22px var(--night); border-radius: 40px; opacity: 0; will-change: opacity; pointer-events: none; }
/* свечение за ногтем-глазом, как на обложке бота: едет вместе со снимком, не перерисовывается */
.k4__img::before { content: ""; position: absolute; inset: -18%; background: radial-gradient(closest-side, var(--glow-peak), transparent); pointer-events: none; }
.k4__img img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.k4.is-near .k4__img img { will-change: opacity; }   /* слои снимков — только когда пик близко */
.k4__img img:first-child { opacity: 1; }
.k4__stage .peak__corner { position: absolute; top: 3.5%; right: var(--gutter); margin: 0; z-index: 3; }
.k4__stage .peak__title { position: absolute; top: 5%; left: var(--gutter); margin: 0; z-index: 3; }
.k4__stage .peak__say { position: absolute; left: var(--gutter); bottom: 7%; max-width: 30ch; margin: 0; z-index: 3; }
.k4__stage .peak__list { position: absolute; left: 58%; right: var(--gutter); bottom: 7%; margin: 0; z-index: 3; opacity: 0; will-change: opacity, transform; }

/* телефон: пока список пика внизу экрана, липкая кнопка уходит — строки списка сами записывают */
.sticky-cta.is-on.is-yield { transform: translateY(calc(100% + 2 * var(--gutter))); }

@media (max-width: 900px) {
  .k4__stage .peak__corner, .k4__stage .peak__say { will-change: opacity; }
  /* телефон: стол на всю ширину под заголовком, кошка крупнее (сцена ×1,2 от края столешницы), ценники в два яруса */
  .hero__stage--desk { margin: var(--space-3) calc(-1 * var(--gutter)) 0; width: auto; align-self: stretch; justify-content: stretch; }
  .hero__stage--desk.island { padding: var(--space-3) 0; box-shadow: none; clip-path: none; }
  /* в закреплённой сцене стол уезжает вверх — молочная полоса едет с ним и под ценники */
  html.scene .hero .hero__stage--desk.island { background: transparent; }
  html.scene .hero .desk { background: var(--milk); box-shadow: 0 0 0 100vmax var(--milk); clip-path: inset(-4% -100vmax calc(-43vw * var(--u, 0) - var(--space-3)) -100vmax); }   /* ценники ≈ 43vw под столом — от высоты стола нельзя: на высоком телефоне она больше */
  .hero .desk { width: 100%; aspect-ratio: 1000 / 720; z-index: 1; margin-inline: auto; }
  /* стол по высоте экрана до scene.js (остальное на экране ≈ 257px + 27vw, низкий — без Instagram 207px) */
  html.scene .hero .desk { width: min(100%, max(200px, calc((var(--hs) - 257px - 27vw) / .72))); }
  .desk__stage { transform: scale(1.15); transform-origin: 0 64cqw; }
  .desk__tags { top: 70.9cqw !important; }
  /* высокий телефон (Критик full1 №2): стол забирает свободную высоту экрана, кошка крупнее до ×1,3 (рост съедает пустое поле слева, лампа на месте);
     линия стола — 8cqw от низа, как раньше, поэтому ценники после подъёма не доходят до кнопки; на обычном телефоне --ws = 115cqw — всё как было */
  html.scene .hero .hero__stage--desk, html.scene .hero .desk { flex: 1 0 auto; }
  html.scene .hero .desk { container-type: size; --ws: clamp(115cqw, 100cqh + 43cqw, 130cqw); --tl: calc(100cqh - 8cqw); }
  html.scene .hero .desk__stage { inset: auto; left: calc((115cqw - var(--ws)) * .7); top: calc(var(--tl) - .64 * var(--ws)); width: var(--ws); height: var(--ws); transform: none; container-type: inline-size; }
  html.scene .hero .desk__tags { top: calc(var(--tl) + .06 * var(--ws)) !important; }
  .hero__title, .hero__corner--a { position: relative; z-index: 2; }
  .tag { --w: 31cqw; }
  .tag:nth-child(1) { --x: 17cqw; --len: 2.5cqw; } .tag:nth-child(2) { --x: 33.5cqw; --len: 25cqw; } .tag:nth-child(3) { --x: 50cqw; --len: 2.5cqw; }
  .tag:nth-child(4) { --x: 66.5cqw; --len: 25cqw; } .tag:nth-child(5) { --x: 83cqw; --len: 2.5cqw; }
  .tag__card { padding: 3.4cqw 1.2cqw 2cqw; border-radius: 1.2cqw 1.2cqw 2.4cqw 2.4cqw; }
  .tag__card::before { top: 1.1cqw; width: 1.6cqw; height: 1.6cqw; margin-left: -.8cqw; }
  .tag::before { height: calc(var(--len) + 2.4cqw); margin-bottom: -2.4cqw; }
  .extend__paw--live { aspect-ratio: 1; --cat-w: 64; --cat-l: 0cqw; --cat-b: 8cqh; --fan-h: 44%; --fan-r: 18deg; }

  .k4__stage .peak__title { top: 2.5%; right: var(--gutter); }
  .k4__stage .peak__corner { top: auto; bottom: calc(var(--cta) + 52px + 3.6em); right: auto; left: var(--gutter); }
  .k4__stage .peak__say { bottom: calc(var(--cta) + 52px); max-width: none; right: var(--gutter); }
}

@media (prefers-reduced-motion: reduce) {
  .cat__l, .cat__eye::before, .tip__dust { animation: none !important; }
  .cat__tool--file { opacity: 0; } .cat__tool--brush { opacity: 1; }   /* итог: кисть в лапе, ноготь готов */
  .tip__old { opacity: 0; }
  .fan__tip { transition: none; }
}
@media (max-width: 900px) and (max-height: 760px) { html.scene .hero .hero__ig { display: none; }
  html.scene .hero .desk { width: min(100%, max(200px, calc((var(--hs) - 207px - 27vw) / .72))); } }   /* низкий телефон: Instagram — в меню и контактах */
@media (prefers-reduced-motion: reduce) and (max-width: 900px) {   /* без сцены ценники — в потоке под столом; стол по высоте экрана — кнопка записи на первом экране (Критик проба-2 №4) */
  .hero .desk { aspect-ratio: 1000 / 1100; width: min(100%, calc((100svh - 340px) / 1.1)); }
}
@container (max-width: 330px) {   /* узкий стол (320): ценники мельче и шире, второй ярус ниже трёхстрочных названий */
  .tag { --w: 32.6cqw; } .tag__card { padding-inline: .6cqw; }
  .tag__name { font-size: 11px; line-height: 1.15; } .tag__price { font-size: 11px; } .tag__price--sum { font-size: 12px; }   /* не мельче 11 px (Критик проба-2 №5) */
  .tag:nth-child(2), .tag:nth-child(4) { --len: 29cqw; }
}

/* M8 «спит под лампой» на ночи: молочный свет лампы сверху на полотенце, под изумрудным свечением за кошкой (#1925) */
.slot--cut.contacts__cat:not(.is-empty) { background: radial-gradient(ellipse 42% 46% at 64% 30%, color-mix(in oklab, var(--milk) 16%, transparent), transparent 72%) no-repeat; }
