/* ==========================================================================
   Визуальные эффекты. Подключается после style.css.
   Всё декоративное отключается при prefers-reduced-motion.
   ========================================================================== */

/* ---------- Полоса прогресса прокрутки ---------- */
/* Длину задаёт effects.js через transform: scaleX(доля прокрутки) — без пересчёта раскладки на каждом кадре */
.progress-top { position: fixed; left: 0; top: 0; z-index: 90; height: 3px; width: 100%; transform: scaleX(0); transform-origin: 0 50%; background: var(--yellow); box-shadow: 0 0 12px rgba(255, 196, 0, .7); pointer-events: none; transition: transform .08s linear; }

/* ---------- Зерно поверх страницы ---------- */
.noise {
  position: fixed; inset: 0; z-index: 45; pointer-events: none; opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
/* На сенсорных экранах зерна нет: слой во весь экран со смешиванием пересчитывается на каждом кадре прокрутки */
@media (hover: none), (pointer: coarse) { .noise { display: none; } }

/* ---------- Шапка при прокрутке ---------- */
.header { transition: box-shadow .3s, background .3s; }
.header.is-scrolled { box-shadow: 0 10px 30px rgba(0, 0, 0, .5); background: rgba(16, 16, 16, .96); }
.header.is-scrolled .header__in { min-height: 64px; }
.header__in { transition: min-height .3s var(--ease); }
.live { display: none; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
/* Шапка не шире своей колонки: до 1440px меню плотнее, с 1440px колонка шапки шире (1480px) и меню обычное,
   строка с часами работы появляется только там, где ей хватает места (с 1600px) */
@media (min-width: 1280px) { .nav { gap: 16px; font-size: 15px; } }
@media (min-width: 1440px) { .nav { gap: 26px; font-size: 16px; } .header__in { max-width: 1480px; } }
@media (min-width: 1600px) { .live { display: inline-flex; } }
.live i { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.live i::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--green); animation: ping 1.6s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }

/* ---------- Кнопки: блик ---------- */
.btn { position: relative; overflow: hidden; }
.btn::after { content: ''; position: absolute; top: -40%; left: -60%; width: 40%; height: 180%; background: rgba(255, 255, 255, .35); transform: skewX(-24deg); transition: left .5s var(--ease); pointer-events: none; }
.btn:hover::after { left: 130%; }
.btn--ghost::after { background: rgba(255, 196, 0, .18); }

/* ---------- Штриховка «лента-ограждение» бежит ---------- */
/* Штриховку рисует ::before и едет через transform: сдвиг фона (background-position) перерисовывал полосу на каждом кадре */
.stripe { position: relative; overflow: hidden; background: none; }
.stripe::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: -62px; right: 0;
  background: repeating-linear-gradient(135deg, var(--yellow) 0 22px, var(--bg) 22px 44px); background-size: 62px 100%;
  animation: stripes 1.6s linear infinite;
}
@keyframes stripes { to { transform: translateX(62px); } }

/* ---------- Первый экран ---------- */
.hero__photo { perspective: 900px; }
.hero__photo img { transition: transform .15s ease-out; transform-style: preserve-3d; }
.hero__photo::after { content: ''; position: absolute; inset: 0; z-index: 2; background: radial-gradient(60% 70% at 70% 30%, rgba(255, 196, 0, .12), transparent 70%); pointer-events: none; mix-blend-mode: screen; }
/* backwards: до старта слово скрыто первым кадром, после конца анимация снимается (слово не остаётся отдельным слоем) */
.hero__copy .h1 .w { display: inline-block; animation: wordIn .7s var(--ease) backwards; animation-delay: calc(.08s + var(--i) * .07s); }
@keyframes wordIn { from { opacity: 0; transform: translateY(28px) rotate(2deg); } }
.hero__watermark { animation: wmIn 1.6s var(--ease) backwards; }
@keyframes wmIn { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
.trust__item { position: relative; overflow: hidden; }
.trust__item::before { content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 3px; background: var(--yellow); transform: scaleY(0); transform-origin: top; transition: transform .4s var(--ease); }
.trust__item:hover::before { transform: scaleY(1); }
.trust__num { display: inline-block; transition: transform .3s var(--ease), color .3s; }
.trust__item:hover .trust__num { transform: translateX(6px); color: var(--yellow-2); }

/* ---------- Бегущая строка ---------- */
.marquee { overflow: hidden; background: var(--yellow); color: var(--ink); border-top: 1px solid #000; border-bottom: 1px solid #000; }
.marquee__track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group { display: flex; align-items: center; gap: 36px; padding: 14px 18px; font-family: var(--display); text-transform: uppercase; font-size: 15px; letter-spacing: .06em; white-space: nowrap; }
.marquee__group span { display: inline-flex; align-items: center; gap: 36px; }
.marquee__group span::after { content: ''; width: 9px; height: 9px; background: var(--ink); transform: rotate(45deg); }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee--dark { background: var(--bg-3); color: var(--yellow); border-color: var(--line); }
.marquee--dark .marquee__group span::after { background: var(--yellow); }

/* ---------- Водяные знаки секций ---------- */
/* --wm-y пишет effects.js на секцию при прокрутке. Свойство не наследуется: его берёт только ::before,
   иначе на каждом кадре пересчитывались бы стили всех блоков секции */
@property --wm-y { syntax: '<length>'; inherits: false; initial-value: 0px; }
.section { overflow: hidden; }
.section[data-wm]::before {
  content: attr(data-wm); position: absolute; right: -1vw; top: 12px; z-index: 0;
  font-family: var(--display); font-size: clamp(70px, 13vw, 190px); line-height: 1; text-transform: uppercase; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .07); pointer-events: none; user-select: none;
  --wm-y: inherit;
  transform: translateY(var(--wm-y, 0));
}
.section--yellow[data-wm]::before { -webkit-text-stroke-color: rgba(0, 0, 0, .12); }
.section > .wrap { position: relative; z-index: 1; }

/* ---------- Косые края жёлтых секций ---------- */
@media (min-width: 700px) {
  .section--yellow { clip-path: polygon(0 0, 100% 2.5vw, 100% 100%, 0 calc(100% - 2.5vw)); padding-top: calc(clamp(56px, 8vw, 96px) + 2.5vw); padding-bottom: calc(clamp(56px, 8vw, 96px) + 2.5vw); }
  .cta-band { clip-path: polygon(0 2.5vw, 100% 0, 100% calc(100% - 2.5vw), 0 100%); padding-top: calc(clamp(36px, 5vw, 56px) + 2.5vw); padding-bottom: calc(clamp(36px, 5vw, 56px) + 2.5vw); }
}

/* ---------- Карточки: подсветка под курсором и наклон ---------- */
.card, .service, .spec, .quick, .form { position: relative; overflow: hidden; }
.card::after, .service::after, .spec::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 196, 0, .16), transparent 60%);
}
.card:hover::after, .service:hover::after, .spec:hover::after { opacity: 1; }
.card::before, .service::before { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--yellow); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.card:hover::before, .service:hover::before { transform: scaleX(1); }
.tilt { transform-style: preserve-3d; will-change: transform; }   /* переход transform/рамки — из правил .card и .service */
.card__icon, .service__icon { transition: transform .35s var(--ease); }
.card:hover .card__icon, .service:hover .service__icon { transform: translateY(-3px) rotate(-6deg) scale(1.08); }
.steps .step { transition: transform .3s var(--ease); }
.steps .step:hover { transform: translateY(-4px); }
.step__num { transition: transform .3s var(--ease); display: inline-block; }
.step:hover .step__num { transform: scale(1.15) translateX(4px); }

/* ---------- Таблица цен ---------- */
.price tbody tr { transition: background .2s; }
.price tbody tr:hover { background: rgba(255, 196, 0, .06); }
.badge { position: relative; display: inline-block; margin-left: 10px; padding: 3px 8px; font: 700 11px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); background: var(--yellow); vertical-align: middle; }
/* В таблице цен метка стоит отдельной строкой под названием, вровень с текстом: в строке она отрывала последнее слово */
.price tbody th .badge { display: table; margin: 6px 0 0; }
/* Пульс — ореол на ::after, меняется только прозрачность: анимация box-shadow перерисовывала метку на каждом кадре */
.badge::after { content: ''; position: absolute; inset: 0; box-shadow: 0 0 0 5px rgba(255, 196, 0, .3); opacity: 0; pointer-events: none; animation: badge 2.2s ease-in-out infinite; }
@keyframes badge { 50% { opacity: 1; } }

/* ---------- Блок техники ---------- */
.machine__photo img { transition: transform 8s linear; }
.machine__photo:hover img { transform: scale(1.06); }
.spec__val { transition: transform .3s var(--ease), text-shadow .3s; display: inline-block; }
.spec:hover .spec__val { transform: translateX(4px); text-shadow: 0 0 18px rgba(255, 196, 0, .55); }

/* ---------- Появление: разные направления ---------- */
/* Откуда выезжает блок: начальный сдвиг для анимации reveal (style.css) */
.cards > .reveal:nth-child(even), .services > .reveal:nth-child(even) { --reveal-from: translateY(34px); }
.split > .reveal:first-child { --reveal-from: translateX(-26px); }
.split > .reveal:last-child { --reveal-from: translateX(26px); }
.gallery > .reveal { --reveal-from: scale(.92); }

/* ---------- FAQ ---------- */
.faq .faq__body { animation: faqIn .35s var(--ease); }
@keyframes faqIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.faq summary { transition: color .2s, padding-left .25s var(--ease); }
.faq details[open] summary, .faq summary:hover { color: var(--yellow); padding-left: 6px; }

/* ---------- Лайтбокс галереи ---------- */
.gallery__item a { cursor: zoom-in; }   /* размеры ссылки — в style.css, рядом с плиткой */
.lightbox { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; padding: 16px; }
.lightbox.is-open { display: flex; }
.lightbox__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .9); backdrop-filter: blur(6px); }
.lightbox__box { position: relative; max-width: min(1400px, 96vw); max-height: 92vh; display: flex; flex-direction: column; gap: 10px; animation: pop .25s var(--ease); }
/* С 900px стрелки стоят снаружи фото: оставляем им по 90px с каждой стороны, иначе уезжают за край окна */
@media (min-width: 900px) { .lightbox__box { max-width: min(1400px, calc(100vw - 180px)); } }
/* Высота фото — с запасом под крестик над ним и подпись под ним, чтобы на низком экране крестик не уходил за верхний край */
.lightbox__box img {
  max-width: 100%; max-height: min(82vh, calc(100vh - 160px)); max-height: min(82dvh, calc(100dvh - 160px));
  object-fit: contain; display: block; box-shadow: var(--shadow);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.lightbox__media { display: flex; justify-content: center; min-width: 200px; min-height: 120px; }
.lightbox__cap { color: var(--text-2); font-size: 15px; text-align: center; }
/* z-index: clip-path у фото создаёт свой слой, без него стрелка «назад» оказывалась под фото */
.lightbox__btn { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); width: 52px; height: 52px; border: 0; background: var(--yellow); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.lightbox__btn svg { width: 24px; height: 24px; }
.lightbox__btn--prev { left: -8px; } .lightbox__btn--next { right: -8px; }
@media (min-width: 900px) { .lightbox__btn--prev { left: -70px; } .lightbox__btn--next { right: -70px; } }
.lightbox__close { position: absolute; right: 0; top: -48px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--text); font-size: 32px; cursor: pointer; }

/* ---------- Плавающая кнопка звонка (десктоп) ---------- */
/* Нажимается только круг: у ссылки pointer-events выключены, иначе невидимая подпись слева от круга
   перехватывала клики по кнопкам и ссылкам под ней */
.call-fab { position: fixed; right: 28px; bottom: 28px; z-index: 70; display: none; align-items: center; gap: 12px; text-decoration: none; pointer-events: none; }
@media (min-width: 900px) { .call-fab { display: flex; } }
.call-fab { transition: opacity .3s ease, transform .3s var(--ease), visibility 0s linear 0s; }
.call-fab.is-hidden { opacity: 0; transform: translateY(16px); visibility: hidden; transition: opacity .3s ease, transform .3s var(--ease), visibility 0s linear .3s; }
.call-fab__btn { position: relative; width: 64px; height: 64px; border-radius: 50%; background: var(--yellow); color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 30px rgba(255, 196, 0, .35); transition: transform .25s var(--ease); pointer-events: auto; }
.call-fab.is-hidden .call-fab__btn { pointer-events: none; }
.call-fab__btn svg { width: 28px; height: 28px; animation: ring 2.4s ease-in-out infinite; }
/* pointer-events: расходящиеся кольца не перехватывают клики рядом с кругом */
.call-fab__btn::before, .call-fab__btn::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--yellow); animation: ping 2.4s ease-out infinite; pointer-events: none; }
.call-fab__btn::after { animation-delay: 1.2s; }
/* 900–1279px: колонка страницы доходит почти до края окна, и круг 64px вставал поверх полей и кнопки формы.
   Здесь он меньше и стоит в самом углу: левый край круга (50px от края окна) правее полей формы (55px и дальше).
   1280–1339px: круг обычный, но ближе к краю — до кнопки формы остаётся около 20px, кольца её не задевают */
@media (min-width: 900px) and (max-width: 1279px) {
  .call-fab { right: 6px; bottom: 20px; }
  .call-fab__btn { width: 44px; height: 44px; box-shadow: 0 8px 20px rgba(255, 196, 0, .35); }
  .call-fab__btn svg { width: 22px; height: 22px; }
}
@media (min-width: 1280px) and (max-width: 1339px) { .call-fab { right: 14px; } }
.call-fab:hover .call-fab__btn { transform: scale(1.08); }
.call-fab__label { background: var(--bg-3); border: 1px solid var(--line); color: var(--text); padding: 10px 14px; font-size: 14px; opacity: 0; transform: translateX(10px); transition: opacity .3s, transform .3s var(--ease); white-space: nowrap; }
.call-fab:hover .call-fab__label, .call-fab:focus-visible .call-fab__label { opacity: 1; transform: none; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-14deg); } 20% { transform: rotate(12deg); } 30% { transform: rotate(-8deg); } 40% { transform: rotate(0); } }

/* ---------- Курсор-кольцо (только мышь) ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 200; width: 26px; height: 26px; border: 2px solid var(--yellow); border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%); opacity: 0; transition: width .2s, height .2s, opacity .3s, background .2s; mix-blend-mode: difference; }
.cursor.is-on { opacity: .9; }
.cursor.is-link { width: 46px; height: 46px; background: rgba(255, 196, 0, .25); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Форма: свечение при фокусе ---------- */
.field input:focus, .field textarea:focus { box-shadow: 0 0 0 3px rgba(255, 196, 0, .18); }
.form::before { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 4px; background: linear-gradient(90deg, var(--yellow), transparent); }

/* ---------- Подвал ---------- */
.footer a { position: relative; }
.footer a::after { content: ''; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0; background: var(--yellow); transition: width .25s var(--ease); }
.footer a:hover::after { width: 100%; }

/* ---------- Отключение для тех, кто просил меньше движения ---------- */
@media (prefers-reduced-motion: reduce) {
  .noise, .cursor, .call-fab__btn::before, .call-fab__btn::after { display: none; }
  .stripe::before, .marquee__track, .badge::after, .live i::after, .call-fab__btn svg { animation: none; }
  .hero__copy .h1 .w { animation: none; }
  .hero__watermark { animation: none; }
  .tilt { transform: none !important; }
}
