/* Watch Needs Love — движение по всему сайту:
   переходы между страницами, появление первого экрана, маска у заголовков,
   плавные аккордеоны, раскрывающееся видео и карусель работ. */

/* ---------- Переход между страницами ---------- */
/* Браузеры с View Transitions: старая страница уходит вверх и гаснет,
   новая поднимается снизу из-под шторки. Шапка остаётся на месте. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-group(site-header) { animation: none; }
::view-transition-old(root) { animation: pt-out 0.45s cubic-bezier(0.4, 0, 0.2, 1) both; }
::view-transition-new(root) { animation: pt-in 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@keyframes pt-out { to { opacity: 0; transform: translateY(-48px) scale(0.985); } }
@keyframes pt-in {
  from { opacity: 0.4; transform: translateY(90px); clip-path: inset(100% 0 0 0); }
  to { opacity: 1; transform: none; clip-path: inset(0); }
}

/* Остальные браузеры: то же самое скриптом (js/motion.js) */
.pt-curtain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: var(--c-bg);
  transform: translateY(100%);
}
.pt-curtain::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-accent-hover), transparent);
}

.no-vt.pt-leave .pt-curtain { animation: pt-curtain-in 0.5s cubic-bezier(0.65, 0, 0.35, 1) forwards; }
@keyframes pt-curtain-up { to { transform: translateY(-100%); } }
@keyframes pt-curtain-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.no-vt.pt-leave main { transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s; transform: translateY(-40px); opacity: 0.4; }

/* ---------- Первый экран внутренних страниц ---------- */
/* Линия у надзаголовка прорисовывается, заголовок поднимается из-под маски,
   фото открывается шторкой и медленно уменьшается до своего масштаба. */
.page-hero__eyebrow::before { transform-origin: left; transition: transform 1s var(--ease) 0.35s; }
.page-hero__heading:not(.is-visible) .page-hero__eyebrow::before { transform: scaleX(0); }
.page-hero__title { transition: clip-path 1.3s var(--ease) 0.15s, transform 1.3s var(--ease) 0.15s; }
.page-hero__heading:not(.is-visible) .page-hero__title { clip-path: inset(0 0 100% 0); transform: translateY(0.5em); }
.page-hero__heading.reveal { transform: none; }
.page-hero__photo img { transition: clip-path 1.3s cubic-bezier(0.65, 0, 0.35, 1) 0.3s, transform 2.2s var(--ease) 0.3s; }
.page-hero__photo:not(.is-visible) img { clip-path: inset(100% 0 0 0); transform: scale(1.35); }
.page-hero__photo.reveal { transform: none; }
/* Лёгкий параллакс: при прокрутке фото уходит медленнее текста */
/* Фото в шапке не двигаем: при прокрутке оно наезжало на текст (правка заказчика) */
.page-hero__photo { translate: none; }
.page-hero__heading { translate: none; }

/* ---------- Заголовки секций поднимаются из-под маски ---------- */
.reveal .h-section,
.h-section.reveal { transition: clip-path 1.2s var(--ease) 0.1s, transform 1.2s var(--ease) 0.1s, opacity 1.1s var(--ease); }
.reveal:not(.is-visible) .h-section { clip-path: inset(0 0 100% 0); transform: translateY(0.45em); }

/* ---------- Плавное открытие вопросов и прайса ---------- */
:root { interpolate-size: allow-keywords; }
.faq-item::details-content,
.plist__item::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.55s var(--ease), content-visibility 0.55s allow-discrete;
}
.faq-item[open]::details-content,
.plist__item[open]::details-content { block-size: auto; }

/* ---------- Раскрывающееся видео (как у Submariner на rolex.com) ---------- */
/* Секция в 2,4 экрана: видео закреплено и за прокрутку растёт из окна во весь экран,
   затем темнеет и на нём проявляется текст. --p от 0 до 1 задаёт js/motion.js */
.vexpand { position: relative; height: 240vh; --p: 0; }
.vexpand__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.vexpand__media {
  position: absolute;
  inset: 0;
  clip-path: inset(calc((1 - var(--p)) * 22%) calc((1 - var(--p)) * 30%) round calc((1 - var(--p)) * 6px));
  will-change: clip-path;
}
.vexpand__media video,
.vexpand__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(calc(1.25 - var(--p) * 0.25));
}
.vexpand__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(6, 5, 11, 0.9), rgba(6, 5, 11, 0.25) 60%, rgba(6, 5, 11, 0.4));
  opacity: calc(var(--p) * 1.4 - 0.4);
}
.vexpand__label {
  position: absolute;
  left: 50%;
  top: calc(22% - 54px);
  translate: -50% 0;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-muted);
  opacity: calc(1 - var(--p) * 3);
}
.vexpand__text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(40px, 9vh, 96px);
  opacity: calc(var(--p) * 4 - 2.9);
  transform: translateY(calc((1 - var(--p)) * 120px));
}
.vexpand__text .container { display: grid; gap: 18px; max-width: var(--container); }
.vexpand__text .h-section { max-width: 820px; }
.vexpand__text p { max-width: 560px; font-size: clamp(14px, 1.2vw, 16px); font-weight: 300; line-height: 1.5; color: rgba(255, 255, 255, 0.82); }
.vexpand__text .btn { justify-self: start; margin-top: 6px; }
.vpause {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(40px, 9vh, 96px);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(6, 5, 11, 0.35);
  backdrop-filter: blur(6px);
  transition: border-color 0.2s var(--ease);
}
.vpause:hover { border-color: #fff; }
.vpause svg { width: 14px; height: 14px; fill: #fff; }
.vpause .i-play { display: none; }
.vpause.is-paused .i-play { display: block; }
.vpause.is-paused .i-pause { display: none; }
@media (max-width: 640px) {
  .vexpand { height: 200vh; }
  .vexpand__media { clip-path: inset(calc((1 - var(--p)) * 18%) calc((1 - var(--p)) * 12%) round calc((1 - var(--p)) * 4px)); }
  .vexpand__label { top: calc(18% - 40px); font-size: 11px; }
  .vexpand__text { bottom: 96px; }
  .vpause { bottom: 32px; }
}

/* ---------- Карусель работ с видео (как карусель моделей на rolex.com) ---------- */
.vcar { position: relative; }
.vcar__viewport { position: relative; overflow: hidden; padding-block: 8px; touch-action: pan-y; cursor: grab; }
.vcar__viewport.is-drag { cursor: grabbing; }
/* Высоту ленте задаёт активный слайд, остальные стоят поверх неё со сдвигом --x */
.vcar__track { display: grid; justify-items: center; }
.vcar__slide {
  grid-area: 1 / 1;
  position: relative;
  width: min(62vw, 860px);
  margin: 0;
  opacity: 0.38;
  transform: translateX(var(--x, 0)) scale(0.84);
  transition: transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.9s var(--ease);
  user-select: none;
}
.vcar__slide.is-active { opacity: 1; transform: translateX(var(--x, 0)); }
.vcar__viewport.is-drag .vcar__slide { transition: none; }
.vcar__media { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: var(--c-bg-2); }
.vcar__media::before { content: ""; position: absolute; z-index: 2; top: 0; left: 18px; width: 48px; height: 2px; background: var(--c-accent); }
.vcar__media video,
.vcar__media img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform 6s linear; }
.vcar__slide.is-active .vcar__media video { transform: scale(1.06); }
.vcar__cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease) 0.25s, transform 0.6s var(--ease) 0.25s;
}
.vcar__slide.is-active .vcar__cap { opacity: 1; transform: none; }
.vcar__num { font-size: 12px; letter-spacing: 0.14em; color: var(--c-accent-hover); }
.vcar__title { font-size: clamp(15px, 1.4vw, 20px); font-weight: 400; text-transform: uppercase; }
.vcar__text { margin-top: 6px; max-width: 520px; font-size: 13px; font-weight: 300; line-height: 1.45; color: var(--c-muted); }
.vcar__nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 26px; }
.vcar__btn { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--c-line); border-radius: 50%; transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease); }
.vcar__btn:hover { border-color: #fff; background: rgba(255, 255, 255, 0.05); }
.vcar__btn svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.5; }
.vcar__dots { display: flex; gap: 8px; }
.vcar__dot { position: relative; width: 34px; height: 2px; overflow: hidden; background: rgba(255, 255, 255, 0.2); }
.vcar__dot::after { content: ""; position: absolute; inset: 0; background: var(--c-accent-hover); transform: scaleX(0); transform-origin: left; }
.vcar__dot.is-active::after { animation: vcar-progress var(--vcar-time, 7s) linear forwards; }
.vcar.is-paused .vcar__dot.is-active::after { animation-play-state: paused; }
@keyframes vcar-progress { to { transform: scaleX(1); } }
@media (max-width: 640px) {
  .vcar__slide { width: 80vw; transform: translateX(var(--x, 0)) scale(0.9); }
  .vcar__cap { flex-direction: column; gap: 6px; }
}

/* ---------- Без анимаций для тех, кто их отключил ---------- */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .pt-curtain { display: none; }
  .page-hero__heading:not(.is-visible) .page-hero__title,
  .reveal:not(.is-visible) .h-section { clip-path: none; transform: none; }
  .page-hero__photo:not(.is-visible) img { clip-path: none; transform: scale(1.08); }
  .page-hero__photo, .page-hero__heading { translate: none; }
  .vexpand { height: auto; }
  .vexpand__sticky { position: relative; height: 80vh; }
  .vexpand { --p: 1 !important; }
  .vcar__track, .vcar__slide { transition: none; }
}

/* Шторка при входе на новую страницу (без View Transitions): есть сразу, до загрузки скриптов */
.no-vt.pt-enter::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: var(--c-bg);
  border-bottom: 2px solid var(--c-accent-hover);
  animation: pt-curtain-up 0.8s cubic-bezier(0.65, 0, 0.35, 1) 0.1s forwards;
}
@media (prefers-reduced-motion: reduce) { .no-vt.pt-enter::after { display: none; } }
.h-section.reveal:not(.is-visible) { clip-path: inset(0 0 100% 0); }
@media (prefers-reduced-motion: reduce) { .h-section.reveal:not(.is-visible) { clip-path: none; } }

/* ==========================================================================
   Фишки главных блоков страниц
   ========================================================================== */

/* ---------- Блик за курсором на стеклянных карточках (все страницы) ---------- */
.spot {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.09), rgba(193, 35, 32, 0.06) 40%, transparent 70%);
  transition: opacity 0.4s var(--ease);
}
.glass:hover > .spot { opacity: 1; }

/* ---------- «Магнитные» кнопки (все страницы, только мышь) ---------- */
.is-magnetic { transition: translate 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease); }

/* ---------- Этапы: линия прогресса заполняется по мере прокрутки ---------- */
/* Оплата, Контакты, Гарантия, Цены */
.topics--steps .topic::after { width: calc(var(--sp, 0) * 100%); transition: none; }
.topics--steps .topic:hover::after { width: calc(var(--sp, 0) * 100%); }
.topics--steps .topic__num {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(193, 35, 32, 0.55);
  border-radius: 50%;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.topics--steps .topic.is-passed .topic__num { background: var(--c-accent); border-color: var(--c-accent); color: #fff; transform: scale(1.08); }
.topics--steps .topic__title { transition: color 0.4s var(--ease); }
.topics--steps .topic:not(.is-passed) .topic__title { color: rgba(255, 255, 255, 0.55); }
@media (max-width: 640px) { .topics--steps .topic__num { width: 30px; height: 30px; font-size: 11px; } }

/* ---------- Услуги: крупное превью услуги следует за курсором ---------- */
.svc-preview {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  width: 300px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  pointer-events: none;
  border: 1px solid var(--c-line-soft);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  opacity: 0;
  scale: 0.85;
  transition: opacity 0.3s var(--ease), scale 0.4s var(--ease);
}
.svc-preview::before { content: ""; position: absolute; z-index: 2; top: 0; left: 14px; width: 40px; height: 2px; background: var(--c-accent); }
.svc-preview.is-on { opacity: 1; scale: 1; }
.svc-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.35s var(--ease); }
.svc-row { transition: background-color 0.3s var(--ease); }
@media (hover: hover) and (pointer: fine) and (min-width: 1101px) {
  .svc-row:hover { background: rgba(255, 255, 255, 0.025); }
  .svc-row:hover .svc-row__title { color: var(--c-accent-hover); }
  .svc-row__title { transition: color 0.3s var(--ease); }
}

/* ---------- Гарантия: печать-штамп вращается при прокрутке ---------- */
.seal {
  position: absolute;
  right: clamp(16px, 3vw, 40px);
  bottom: clamp(16px, 3vw, 40px);
  z-index: 3;
  width: clamp(110px, 11vw, 150px);
  aspect-ratio: 1;
  pointer-events: none;
}
.seal svg { width: 100%; height: 100%; overflow: visible; }
.seal__ring { transform-origin: 50% 50%; rotate: calc(var(--seal, 0) * 1deg); }
.seal__ring text { fill: #fff; font-size: 8.4px; letter-spacing: 0.22em; text-transform: uppercase; }
.seal__core { fill: var(--c-accent); }
.seal__mark { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.seal__bg { fill: rgba(6, 5, 11, 0.55); stroke: rgba(255, 255, 255, 0.25); }
.split__media { position: relative; }

/* ---------- Отзывы: карточки въезжают попеременно слева и справа ---------- */
.rcards .rcard.reveal:nth-child(odd):not(.is-visible) { transform: translateX(-70px); }
.rcards .rcard.reveal:nth-child(even):not(.is-visible) { transform: translateX(70px); }
.rcard__quote { transition: clip-path 1.4s var(--ease) 0.25s; }
.rcard:not(.is-visible) .rcard__quote { clip-path: inset(0 0 100% 0); }

/* ---------- FAQ: поиск по вопросам ---------- */
.faq-search { position: relative; display: block; max-width: 620px; margin-bottom: 8px; }
.faq-search svg { position: absolute; z-index: 1; left: 16px; top: 50%; width: 18px; height: 18px; fill: none; stroke: var(--c-muted); stroke-width: 1.5; transform: translateY(-50%); pointer-events: none; }
.faq-search .field { padding-left: 46px; }
.faq-search__count { margin-top: 10px; font-size: 12px; font-weight: 300; color: var(--c-muted); }
.faq-item mark { background: none; color: var(--c-accent-hover); }
.faq--group[hidden], .faq-item[hidden] { display: none; }

/* ---------- Контакты: копирование адреса и телефонов ---------- */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.25);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.copy-btn:hover { color: #fff; border-color: var(--c-accent-hover); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 9999;
  padding: 14px 22px;
  border: 1px solid var(--c-line-soft);
  border-top: 2px solid var(--c-accent);
  background: rgba(14, 15, 22, 0.94);
  font-size: 13px;
  font-weight: 300;
  translate: -50% 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), translate 0.4s var(--ease);
}
.toast.is-on { opacity: 1; translate: -50% 0; }

@media (prefers-reduced-motion: reduce) {
  .rcards .rcard.reveal:not(.is-visible) { transform: none; }
  .rcard:not(.is-visible) .rcard__quote { clip-path: none; }
  .seal__ring { rotate: none; }
}

/* ---------- Хлебные крошки ---------- */
.crumbs { margin-bottom: clamp(14px, 1.6vw, 22px); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 12px; font-weight: 300; letter-spacing: 0.02em; color: rgba(255, 255, 255, 0.5); }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before {
  content: "";
  width: 5px;
  height: 5px;
  margin: 0 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  border-right: 1px solid rgba(255, 255, 255, 0.4);
  transform: rotate(45deg);
}
.crumbs a { position: relative; color: rgba(255, 255, 255, 0.7); transition: color 0.25s var(--ease); }
.crumbs a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: var(--c-accent-hover); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease); }
.crumbs a:hover { color: #fff; }
.crumbs a:hover::after { transform: scaleX(1); }
.crumbs [aria-current="page"] { color: var(--c-accent-hover); }
@media (max-width: 640px) { .crumbs ol { font-size: 11px; } .crumbs li + li::before { margin: 0 9px; } }
