* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #16171a;
  --accent: #33424E; /* Moonlit Ocean, Pantone 19-4111 TCX */
  --plaster: #f8efe5;
  --pad: 26px;
  --bar: 74px;
}

html { scroll-behavior: auto; }

body {
  background: var(--plaster);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* Канвас с рельефом лежит под контентом и не перехватывает жесты. */
#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: block;
  z-index: 0;
  touch-action: none;
  pointer-events: none;
}

main, .nav, .bar { position: relative; z-index: 1; }

/* --- Экраны --- */
.screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--bar) + 20px) var(--pad);
}
/* Портрет и фраза больше не занимают по целому экрану: между текстовыми
   вставками было слишком много воздуха. */
.screen--portrait,
.screen--statement { min-height: auto; padding-top: 8vh; padding-bottom: 8vh; }
.screen--statement { align-items: flex-start; }
.screen__body { width: 100%; max-width: 1100px; }

/* Главный экран: текст поднят к верху (сразу под «Выбери свою операцию»),
   фотография — в нижней части. */
.screen--hero {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: calc(var(--bar) + 22px);
  padding-bottom: 3vh;
}
.screen--hero .screen__body { flex: none; }

/* Фотография-«ткань» внизу героя. */
.hero-photo {
  margin: auto 0 0;              /* прижата к низу экрана */
  width: 100%;
  display: flex;
  justify-content: flex-end;     /* к правому краю, слева — заголовок */
  pointer-events: none;
  /* Собственное проявление на загрузке — не зависит от JS-цикла reveal,
     который блокируется тяжёлой инициализацией WebGL-фона. */
  opacity: 0;
  animation: heroPhotoIn 1.8s cubic-bezier(0.445, 0.05, 0.55, 0.95) 0.4s forwards;
}
@keyframes heroPhotoIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-photo { animation: none; opacity: 1; }
}
.hero-photo__frame {
  position: relative;
  width: min(38vw, 440px);
  aspect-ratio: 853 / 682;
}
.hero-photo__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Слой краёв (позади): фильтр «ткань» рвёт и колышет контур, лёгкое
   размытие даёт акварельную мягкость, маска-кольцо оставляет только края —
   центр этого слоя прозрачен, поэтому человек не двоится и не движется. */
.hero-photo__edge {
  filter: url(#clothWave);
  -webkit-mask-image: radial-gradient(64% 64% at 50% 44%, transparent 46%, #000 68%, #000 82%, transparent 98%);
  mask-image: radial-gradient(64% 64% at 50% 44%, transparent 46%, #000 68%, #000 82%, transparent 98%);
}

/* Слой центра (поверх): резкий, без фильтров и без анимации — человек
   и середина фото неподвижны. К краям мягко тает, передавая эстафету
   колышущемуся слою краёв. */
.hero-photo__still {
  -webkit-mask-image: radial-gradient(64% 64% at 50% 44%, #000 0%, #000 56%, transparent 84%);
  mask-image: radial-gradient(64% 64% at 50% 44%, #000 0%, #000 56%, transparent 84%);
}

/* --- Типографика --- */
.eyebrow {
  margin-bottom: 26px;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.title,
.statement {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.06;
}

.title { font-size: clamp(38px, 10.5vw, 96px); }
.statement { font-size: clamp(28px, 7.6vw, 62px); line-height: 1.14; max-width: 20ch; }

.scroll { margin-top: 30px; font-size: 13px; opacity: 0.62; text-transform: uppercase; letter-spacing: 0.08em; }

/* --- Навигация и нижняя панель --- */
.nav {
  position: fixed;
  top: 0;
  right: 0;
  padding: 20px var(--pad);
  /* Выше main: у обоих был z-index 1, и прокручиваемый контент, идущий позже
     в DOM, перекрывал ссылку — клик по «Выбери свою операцию» не проходил. */
  z-index: 3;
}
.nav__l2 { border-bottom: 1px solid rgba(22, 23, 26, 0.35); padding-bottom: 2px; }
.nav__link, .bar__cta {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}

/* Ступенька вниз-вправо: первая строка не дотягивается до правого края,
   вторая упирается в него. */
.nav__link {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  line-height: 1.25;
  opacity: 0.85;
}
.nav__l1 { margin-right: 38px; }

.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bar);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Плавное растворение к низу — иначе текст «лежит» на рельефе. */
  background: linear-gradient(to top, rgba(248, 239, 229, 0.92), rgba(248, 239, 229, 0));
}
.bar__cta {
  border-bottom: 1px solid rgba(22, 23, 26, 0.35);
  padding-bottom: 3px;
  /* Ореол цвета фона вокруг букв: текст контента, проезжающий под кнопкой,
     гаснет ровно там, где лежит «Записаться на приём». Слои складываются —
     ореол получается плотным, а не полупрозрачным. */
  text-shadow:
    0 0 8px var(--plaster), 0 0 8px var(--plaster), 0 0 8px var(--plaster),
    0 0 5px var(--plaster), 0 0 5px var(--plaster), 0 0 3px var(--plaster);
}
/* На тёмном финале фон бара тёмный — светлый ореол там не нужен. */
body.theme-dark .bar__cta { text-shadow: none; }

.bar__progress { width: 54px; height: 1px; background: rgba(22, 23, 26, 0.22); }
.bar__progress i { display: block; height: 100%; width: 0%; background: var(--ink); }

/* --- Проявление --- */
/* Строка режется маской, слово выезжает снизу — так же устроен вступительный
   загрузчик у референса. */
.line {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  /* Маска иначе срезает хвосты у «у», «р», «д» — компенсируем запасом снизу. */
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
}
.word {
  display: inline-block;
  will-change: transform;
  /* Как их вступительный заголовок: слово целиком выезжает из-под маски
     строки, БЕЗ прозрачности — край среза чёткий, буквы «рождаются» из
     невидимой щели. Тайминги из их кода: 1.2s, sine.inOut, стаггер 0.1s. */
  transform: translateY(115%);
}
.is-in .word {
  transform: translateY(0);
  transition: transform 1.2s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
  /* sine.inOut — единственная кривая в их CSS. */
  transition: opacity 1.2s cubic-bezier(0.445, 0.05, 0.55, 0.95),
              transform 1.2s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

@media (prefers-reduced-motion: reduce) {
  .word, [data-reveal] { transition: none !important; transform: none !important; opacity: 1 !important; }
}

@media (max-width: 640px) {
  :root { --pad: 20px; }
  .statement { max-width: none; }
  /* Видео не в полный экран, а вплотную к тексту: расстояние сверху и снизу
     примерно вдвое меньше. */
  .screen--video { min-height: auto; padding-top: 3vh; padding-bottom: 3vh; }
  .screen--statement { padding-bottom: 4vh; }
  /* На телефоне фото героя — по центру внизу, шире. */
  .hero-photo { justify-content: center; }
  .hero-photo__frame { width: min(84vw, 400px); }
}

/* ============ Акварельный портрет ============ */
.defs { position: absolute; width: 0; height: 0; }

.portrait { display: flex; justify-content: center; }

.photo {
  position: relative;
  width: min(78vw, 420px);
  aspect-ratio: 853 / 1280;
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Нижний слой — фон в акварели: рвём край турбулентностью и уводим в тёплую
   гамму сайта. Сама Олеся Викторовна этим слоем закрыта сверху. */
.photo__bg {
  filter: url(#watercolor) saturate(0.3) sepia(0.3) contrast(1.04) brightness(1.08);
  -webkit-mask-image: radial-gradient(112% 106% at 50% 44%, #000 40%, rgba(0, 0, 0, 0.7) 63%, transparent 86%);
  mask-image: radial-gradient(112% 106% at 50% 44%, #000 40%, rgba(0, 0, 0, 0.7) 63%, transparent 86%);
}

/* Верхний слой — человек, без единого фильтра, в цвете. Маска овалом по
   силуэту: сегментации у меня нет, поэтому граница подобрана вручную. */
.photo__fg {
  -webkit-mask-image: radial-gradient(46% 52% at 50% 52%, #000 62%, rgba(0, 0, 0, 0.6) 82%, transparent 97%);
  mask-image: radial-gradient(46% 52% at 50% 52%, #000 62%, rgba(0, 0, 0, 0.6) 82%, transparent 97%);
}

/* ============ Секции ============ */
.block { padding: 10vh var(--pad); }
.block__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}
.block__title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(26px, 6vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.block__title--lead { max-width: 16ch; }

/* ============ Карусель ============ */
.arrows { display: flex; gap: 8px; flex: none; }
.arrows--certs { justify-content: flex-end; margin-bottom: 14px; }
.arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(22, 23, 26, 0.18);
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.25s, opacity 0.25s;
}
.arrow:hover { background: rgba(255, 255, 255, 0.95); }
.arrow[disabled] { opacity: 0.3; cursor: default; }

.carousel {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* Вылезаем за поля секции, чтобы карточки уходили под край экрана. */
  margin: 0 calc(var(--pad) * -1);
  padding: 4px var(--pad) 24px;
  scroll-padding-left: var(--pad);
}
.carousel::-webkit-scrollbar { display: none; }

.carousel__track { display: flex; gap: 16px; list-style: none; }

.card {
  scroll-snap-align: start;
  flex: none;
  width: clamp(260px, 74vw, 340px);
  min-height: 440px;
  padding: 26px 24px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(22, 23, 26, 0.07);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;

  /* Каскадное появление: задержка задаётся из JS по индексу. */
  opacity: 0;
  transform: translateY(28px) scale(0.97);
}
.carousel.is-in .card {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.card__num {
  font-size: 11px;
  letter-spacing: 0.16em;
  opacity: 0.4;
  margin-bottom: 14px;
}
.card__title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.15;
  margin-bottom: 18px;
}
.card__list { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.card__list li {
  font-size: 13.5px;
  line-height: 1.45;
  padding-left: 14px;
  position: relative;
  opacity: 0.78;
}
.card__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.45;
}
.card__list em { font-style: normal; opacity: 0.6; }

/* ============ Места приёма ============ */
.places { display: grid; gap: 14px; }
@media (min-width: 720px) { .places { grid-template-columns: 1fr 1fr; } }

.place {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(22, 23, 26, 0.07);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.25s, transform 0.25s;
}
.place:hover { background: rgba(255, 255, 255, 0.9); transform: translateY(-2px); }
.place__kind { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.45; }
.place__name { font-family: Georgia, serif; font-size: 20px; line-height: 1.2; }
.place__addr { font-size: 13px; opacity: 0.62; }
.place__go { font-size: 13px; margin-top: 8px; opacity: 0.85; }

/* ============ Аккордеон ============ */
.acc { border-top: 1px solid rgba(22, 23, 26, 0.12); }
.acc__item { border-bottom: 1px solid rgba(22, 23, 26, 0.12); }
.acc__sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  font-size: 17px;
  cursor: pointer;
  list-style: none;
}
.acc__sum::-webkit-details-marker { display: none; }
/* Плюс, который становится минусом. */
.acc__sum i { position: relative; width: 13px; height: 13px; flex: none; opacity: 0.55; }
.acc__sum i::before, .acc__sum i::after {
  content: "";
  position: absolute;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.acc__sum i::before { left: 0; right: 0; top: 6px; height: 1px; }
.acc__sum i::after { top: 0; bottom: 0; left: 6px; width: 1px; }
.acc__item[open] .acc__sum i::after { transform: scaleY(0); opacity: 0; }

.acc__body { padding-bottom: 24px; }
.acc__list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.acc__list li { font-size: 14px; line-height: 1.5; padding-left: 16px; position: relative; opacity: 0.8; }
.acc__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.4;
}

.edu { display: grid; grid-template-columns: 62px 1fr; gap: 12px 16px; }
.edu dt { font-size: 13px; opacity: 0.45; font-variant-numeric: tabular-nums; }
.edu dd { font-size: 14px; line-height: 1.5; opacity: 0.85; }

/* Подзаголовок под «Выбирай хирурга сердцем». */
.block__sub {
  margin-top: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(15px, 3.6vw, 20px);
  line-height: 1.45;
  opacity: 0.6;
  max-width: 26ch;
}

/* ============ Сертификаты ============ */
/* Альбом: одна строка, листается смахиванием и стрелками. */
.certs {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin: 0 calc(var(--pad) * -1);
  padding: 6px var(--pad) 20px;
  scroll-padding-left: var(--pad);
}
.certs::-webkit-scrollbar { display: none; }
.cert { flex: none; width: clamp(240px, 68vw, 320px); scroll-snap-align: start; }
.cert {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  /* Тонкая рамка и мягкая тень вместо «фотки в альбоме» — так документ
     читается как документ. */
  border: 1px solid rgba(22, 23, 26, 0.1);
  box-shadow: 0 1px 2px rgba(22, 23, 26, 0.04), 0 12px 28px -12px rgba(22, 23, 26, 0.22);
  cursor: zoom-in;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
}
.cert:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(22,23,26,0.05), 0 20px 40px -14px rgba(22,23,26,0.3); }
.cert img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============ Отзывы: ссылки на реальные карточки ============ */
/* Карусель отзывов — как услуги и сертификаты: одна строка, снап, стрелки. */
.revs {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin: 0 calc(var(--pad) * -1);
  padding: 4px var(--pad) 20px;
  scroll-padding-left: var(--pad);
}
.revs::-webkit-scrollbar { display: none; }
.rev {
  flex: none;
  width: clamp(260px, 78vw, 340px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(22, 23, 26, 0.07);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.25s, transform 0.25s;
}
.rev:hover { background: rgba(255, 255, 255, 0.9); transform: translateY(-2px); }
.rev__name { font-family: Georgia, serif; font-size: 17px; }
.rev__go { font-size: 12px; opacity: 0.5; }

/* ============ Модалка записи ============ */
.card__list li { cursor: pointer; transition: opacity 0.2s; }
.card__list li:hover { opacity: 1; }

dialog.book {
  border: none;
  padding: 0;
  border-radius: 22px;
  width: min(92vw, 440px);
  background: var(--plaster);
  color: var(--ink);
  /* Глобальный сброс `* { margin: 0 }` убивает UA-центрирование диалога —
     без явного margin: auto окно прилипает к левому верхнему углу. */
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  max-height: 92dvh;
  overflow: auto;
}
dialog.book[open] {
  /* Раскрытие как у видео-блока: карточка «разворачивается» из подрезанной
     маски — тот же приём, что unveil у референса. */
  animation: bookIn 0.9s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}
@keyframes bookIn {
  from { opacity: 0; transform: translateY(16px) scale(0.965); clip-path: inset(6% 6% 6% 6% round 22px); }
  to   { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 22px); }
}
dialog.book::backdrop { background: rgba(22, 23, 26, 0.35); backdrop-filter: blur(4px); }
dialog.book[open]::backdrop { animation: bookDim 0.6s cubic-bezier(0.445, 0.05, 0.55, 0.95); }
@keyframes bookDim { from { opacity: 0; } to { opacity: 1; } }
.book__in { padding: 30px 26px 26px; }

/* Заголовок формы — те же строки-маски, что у остальных заголовков сайта:
   слово выезжает из-под щели без прозрачности. Класс is-in вешает openBook. */
.book__head {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.12;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.book__head .word { transition-delay: 0.15s; }
.book__head .line:nth-of-type(2) .word { transition-delay: 0.27s; }
.word--accent { color: var(--accent); }
.book__sub { font-size: 14.5px; opacity: 0.65; margin-bottom: 20px; }

/* Кнопки мессенджеров: раскладка как в присланном макете, подача — сайтовая. */
.book__btns { display: flex; flex-direction: column; gap: 10px; }
.bkbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 18px;
  border: none;
  border-radius: 14px;
  font: inherit;
  font-size: 15.5px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.445, 0.05, 0.55, 0.95), filter 0.25s;
}
.bkbtn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.bkbtn--wa { background: linear-gradient(180deg, #4ecb5c, #2bb741); }
.bkbtn--tg { background: linear-gradient(180deg, #54b0e8, #2f96d8); }
.bkbtn--call { background: var(--ink); }

/* Проявление содержимого после раскрытия карточки: мягкий подъём со стаггером. */
.book__sub, .book__btns .bkbtn, .book__alt, .book__svc {
  opacity: 0;
  transform: translateY(14px);
}
.book.is-in .book__sub, .book.is-in .book__btns .bkbtn, .book.is-in .book__alt, .book.is-in .book__svc {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s cubic-bezier(0.445, 0.05, 0.55, 0.95),
              transform 0.9s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}
.book.is-in .book__sub { transition-delay: 0.2s; }
.book.is-in .bkbtn--wa { transition-delay: 0.3s; }
.book.is-in .bkbtn--tg { transition-delay: 0.4s; }
.book.is-in .bkbtn--call { transition-delay: 0.5s; }
.book.is-in .book__alt { transition-delay: 0.6s; }

/* Форма «Заказать звонок» — выпадает под кнопками. */
.book__call { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; animation: bookDim 0.5s cubic-bezier(0.445, 0.05, 0.55, 0.95); }
.book__tel {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(22, 23, 26, 0.16);
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.03em;
}
.book__tel:focus { outline: none; border-color: rgba(22, 23, 26, 0.45); }
.book__alt { margin-top: 16px; font-size: 13.5px; opacity: 0.75; text-align: center; }
.book__alt-note { font-size: 11.5px; opacity: 0.65; }
.book__alt .book__phone { font-size: 15px; }

/* --- Отзыв с сайта --- */
.rev-add {
  border: none;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px solid rgba(22, 23, 26, 0.35);
  padding: 0 0 2px;
  cursor: pointer;
}
.book__call--rev { margin-top: 4px; }
.book__tel--name { text-align: left; letter-spacing: normal; }
.book__area {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(22, 23, 26, 0.16);
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  resize: vertical;
  min-height: 120px;
}
.book__area:focus { outline: none; border-color: rgba(22, 23, 26, 0.45); }
.book__note--err { color: #8a2f2f; opacity: 1; }
/* Карточка отзыва с сайта — как остальные, но это не ссылка. */
.rev--user { cursor: default; }
.rev__del {
  margin-top: 10px;
  align-self: flex-start;
  border: none;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  opacity: 0.45;
  border-bottom: 1px solid rgba(22, 23, 26, 0.3);
  padding: 0 0 1px;
  cursor: pointer;
}
.rev__del:hover { opacity: 0.8; }
.rev__badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}
.rev--pending { border: 1px dashed rgba(22, 23, 26, 0.3); }
.book__note--ok { color: #2e6b3f; opacity: 1; }

/* ============ Тёмный финал ============ */
/* Подпись от руки: Caveat (OFL), два сабсета — кириллица и латиница/пунктуация. */
@font-face {
  font-family: 'Caveat';
  src: url('./fonts/caveat-cyr.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Caveat';
  src: url('./fonts/caveat-lat.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}

/* Слой лежит над канвасом рельефа (оба z-index 0, этот позже в DOM), но под
   контентом. Прозрачностью управляет тайм-лайн в main.js (outroTick):
   чернота закрывает светлый рельеф, под ней канвас переключается в ночной
   режим, и чернота медленно отступает — под ней уже ночной сад. */
.outro-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
/* Видео ночного сада: между канвасом и чернотой (порядок в DOM), прозрачность
   ведёт тот же тайм-лайн. cover: портретный кадр заполняет любой экран. */
.outro-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}

/* Текст финала — по левому краю, у верха экрана: стандартный отступ секции
   начинается чуть ниже строк «Выбери свою операцию» в углу. */
.screen--outro { justify-content: flex-start; align-items: flex-start; text-align: left; }
.outro__body { width: 100%; max-width: 720px; margin: 0; }
.outro__statement {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 3vw, 33px);
  line-height: 1.45;
  color: #f2ece2;
}
/* При уходе с экрана слова прячутся быстро и без стаггера — инлайновые
   задержки перебиваются; появление идёт по общим правилам .is-in .cword. */
.screen--outro:not(.is-in) .cword {
  transition: opacity 0.5s cubic-bezier(0.445, 0.05, 0.55, 0.95),
              filter 0.5s cubic-bezier(0.445, 0.05, 0.55, 0.95),
              transform 0.5s cubic-bezier(0.445, 0.05, 0.55, 0.95);
  transition-delay: 0s !important;
}
.outro__sign {
  margin-top: 36px;
  font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', cursive;
  font-size: clamp(28px, 3.6vw, 40px);
  color: #e9decb;
  opacity: 0;
  transform: translateY(16px) rotate(-2deg);
  transition: opacity 0.6s cubic-bezier(0.445, 0.05, 0.55, 0.95),
              transform 0.6s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}
.screen--outro.is-in .outro__sign {
  opacity: 1;
  transform: rotate(-2deg);
  transition: opacity 1.2s cubic-bezier(0.445, 0.05, 0.55, 0.95) 3.6s,
              transform 1.2s cubic-bezier(0.445, 0.05, 0.55, 0.95) 3.6s;
}

/* На тёмном финале интерфейс перекрашивается в светлое — как кнопки у
   референса, у которых цвет лерпится при входе футера в кадр. */
.nav__link, .nav__l2, .bar__cta, .bar__progress, .bar__progress i {
  transition: color 1s cubic-bezier(0.445, 0.05, 0.55, 0.95),
              border-color 1s cubic-bezier(0.445, 0.05, 0.55, 0.95),
              background-color 1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}
body.theme-dark .nav__link { color: #f2ece2; }
body.theme-dark .nav__l2 { border-color: rgba(242, 236, 226, 0.45); }
body.theme-dark .bar__cta { color: #f2ece2; border-color: rgba(242, 236, 226, 0.45); }
body.theme-dark .bar__progress { background: rgba(242, 236, 226, 0.28); }
body.theme-dark .bar__progress i { background: #f2ece2; }
/* Светлую подложку бара на тёмном сменяет тёмная — градиенты не анимируются,
   поэтому поверх лежит слой с переходом прозрачности. */
.bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 9, 11, 0.92), rgba(8, 9, 11, 0));
  opacity: 0;
  transition: opacity 1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
  pointer-events: none;
}
body.theme-dark .bar::before { opacity: 1; }
.bar__cta, .bar__progress { position: relative; }
@media (prefers-reduced-motion: reduce) {
  dialog.book[open], dialog.book[open]::backdrop, .book__call { animation: none; }
}
.book__kicker { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.45; }
.book__svc { font-family: Georgia, serif; font-size: 21px; line-height: 1.25; margin: 8px 0 20px; }
.book__f { display: flex; flex-direction: column; gap: 10px; }
.book__f input {
  padding: 13px 14px;
  border-radius: 11px;
  border: 1px solid rgba(22, 23, 26, 0.16);
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.book__send {
  margin-top: 6px;
  padding: 14px;
  border: none;
  border-radius: 11px;
  background: var(--ink);
  color: var(--plaster);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.book__note { margin-top: 12px; font-size: 11.5px; line-height: 1.45; opacity: 0.5; }
.book__x {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: none;
  font-size: 20px;
  opacity: 0.4;
  cursor: pointer;
  color: var(--ink);
}

/* Подзаголовок внутри аккордеона — набран как и остальные годы,
   чтобы «Повышение квалификации» читалось единым блоком с «Образованием». */
.acc__sub {
  margin: 26px 0 14px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.45;
}

/* Плавное появление фотографии. */
.photo { opacity: 0; transform: translateY(26px) scale(0.985); }
.photo.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 1.4s ease, transform 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.rev__text {
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.82;
  /* Тексты разной длины: держим карточки одной высоты, длинный листается. */
  flex: 1;
  min-height: 0;
  max-height: 210px;
  overflow-y: auto;
}
.rev__text::-webkit-scrollbar { width: 0; }
.rev__meta { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.rev__who { font-family: Georgia, serif; font-size: 15px; }
.rev__when { font-size: 11.5px; opacity: 0.45; }
.rev__go { font-size: 12px; opacity: 0.5; margin-top: 8px; }

/* Мобильный: сертификаты — фотоальбом во всю ширину, по одному кадру. */
@media (max-width: 640px) {
  .certs { scroll-snap-type: x mandatory; gap: 10px; }
  .cert { width: calc(100vw - var(--pad) * 2); }
}

/* Инерционный скролл: контент закреплён и едет transform-ом за сглаженным
   скроллом — у референса так движется вся страница (их scrollSmooth). */
.smooth-on main {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  will-change: transform;
}

/* Заголовки — декорация: случайное перетаскивание мыши не должно
   заливать их синим выделением. Списки услуг и отзывы остаются копируемыми. */
.title, .statement, .block__title, .block__sub, .nav__link, .eyebrow, .scroll {
  -webkit-user-select: none;
  user-select: none;
}

/* Центрированный заголовок блока. */
.block__head--center { justify-content: center; text-align: center; }
.block__head--center .block__title--lead,
.block__head--center .block__sub { margin-left: auto; margin-right: auto; }

/* Фраза-манифест: медленное проявление, без вылета слов из-под маски. */
.statement[data-reveal] { transform: translateY(34px); }
.statement[data-reveal].is-in {
  transition: opacity 1.6s cubic-bezier(0.445, 0.05, 0.55, 0.95),
              transform 1.6s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

.rev-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 22px;
  font-size: 13px;
}
.rev-links__label { opacity: 0.45; }
.rev-links a { color: var(--ink); opacity: 0.75; text-decoration: underline; text-underline-offset: 3px; }

/* Хаотичное проявление: каждое слово всплывает из лёгкой размытости со своей
   случайной задержкой — порядок появления не совпадает с порядком чтения. */
.cword {
  display: inline-block;
  opacity: 0;
  filter: blur(7px);
  transform: translateY(12px);
  will-change: opacity, filter, transform;
}
.is-in .cword {
  opacity: 1;
  filter: blur(0);
  transform: none;
  transition:
    opacity 1.4s cubic-bezier(0.445, 0.05, 0.55, 0.95),
    filter 1.4s cubic-bezier(0.445, 0.05, 0.55, 0.95),
    transform 1.4s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

/* Десктоп: «Выбирай хирурга сердцем» — одной строкой, подзаголовок — двумя.
   Ширина 31ch ломает его ровно после «сохранить». */
@media (min-width: 641px) {
  .block__head--center .block__title--lead { max-width: none; }
  .block__head--center .block__sub { max-width: 31ch; }
}

/* WebGL-заголовок героя (мобильные): канвас рисует текст сам, CSS-строки
   прячутся, но продолжают держать высоту блока. */
.title--gl { position: relative; }
.title--gl .line { visibility: hidden; }
.title__gl {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  pointer-events: none;
}

/* Кнопка в баре — тот же вид, что был у ссылки. */
button.bar__cta {
  background: none;
  border: none;
  border-bottom: 1px solid rgba(22, 23, 26, 0.35);
  padding: 0 0 3px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.book__title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 24px;
  margin: 6px 0 14px;
}
.book__text { font-size: 15px; line-height: 1.7; margin-bottom: 18px; }
.book__phone {
  font-family: Georgia, serif;
  font-size: 21px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.book__who { font-size: 13px; opacity: 0.55; }
.book__f textarea {
  padding: 13px 14px;
  border-radius: 11px;
  border: 1px solid rgba(22, 23, 26, 0.16);
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  resize: vertical;
}

/* hidden у элементов с собственным display в CSS иначе не работает:
   display из таблицы стилей перебивает браузерный display:none атрибута. */
[hidden] { display: none !important; }

/* ============ Цена на карточке услуги ============ */
.card__price {
  display: inline-block;
  margin: -6px 0 16px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  opacity: 0.75;
}
.price-note { margin-top: 14px; font-size: 12px; line-height: 1.5; opacity: 0.5; max-width: 60ch; }

/* ============ FAQ: текст ответа + подзаголовок ============ */
.acc__text { font-size: 14.5px; line-height: 1.65; opacity: 0.82; max-width: 68ch; }
.block__subhead {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(20px, 4.5vw, 30px);
  opacity: 0.9;
}

/* ============ Как проходит приём: шаги ============ */
.steps { list-style: none; display: grid; gap: 4px; max-width: 720px; }
.step {
  display: flex;
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid rgba(22, 23, 26, 0.1);
  opacity: 0;
  transform: translateY(16px);
}
.step.is-in { opacity: 1; transform: none; transition: opacity 0.8s ease, transform 0.9s cubic-bezier(0.22,1,0.36,1); }
.step__num {
  flex: none;
  font-family: Georgia, serif;
  font-size: 22px;
  opacity: 0.4;
  font-variant-numeric: tabular-nums;
  min-width: 34px;
}
.step__title { font-family: Georgia, serif; font-weight: 400; font-size: 20px; margin-bottom: 6px; }
.step__text { font-size: 14px; line-height: 1.6; opacity: 0.75; max-width: 56ch; }

/* ============ Юридический дисклеймер ============ */
.legal { margin-top: 40px; font-size: 11.5px; line-height: 1.6; opacity: 0.45; max-width: 72ch; }

/* ============ Мессенджеры ============ */
.msgs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); max-width: 820px; }
.msg {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(22, 23, 26, 0.08);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.25s, transform 0.25s;
}
.msg:hover { background: rgba(255, 255, 255, 0.95); transform: translateY(-2px); }
.msg svg { flex: none; opacity: 0.8; }
.msg__l { display: flex; flex-direction: column; gap: 2px; }
.msg__l b { font-weight: 500; font-size: 15px; }
.msg__l em { font-style: normal; font-size: 12.5px; opacity: 0.55; }

/* ============ SEO-фолбэк без JS ============ */
.seo-fallback { max-width: 720px; margin: 40px auto; padding: 0 24px; font-family: Georgia, serif; line-height: 1.6; }

/* ============ Видео ============ */
.videowrap {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: rgba(22, 23, 26, 0.04);
  box-shadow: 0 24px 60px -24px rgba(22, 23, 26, 0.35);
}
.video,
.videowrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}
.video { object-fit: cover; }

/* Кнопка звука — в стиле остальных «пилюль» на фоне видео. */
.video__sound {
  position: absolute;
  bottom: 16px;
  right: 16px;
  padding: 9px 16px;
  border: none;
  border-radius: 999px;
  background: rgba(248, 239, 229, 0.85);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s;
}
.video__sound:hover { background: rgba(248, 239, 229, 0.98); }

/* ============ СМИ: кнопки с темой видео ============ */
.media { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 820px; }
.media__btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(22, 23, 26, 0.08);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.25s, transform 0.25s;
}
.media__btn:hover { background: rgba(255, 255, 255, 0.95); transform: translateY(-2px); }
.media__play { flex: none; opacity: 0.7; }
.media__txt { display: flex; flex-direction: column; gap: 3px; }
.media__txt b { font-weight: 500; font-size: 15px; line-height: 1.3; }
.media__txt em { font-style: normal; font-size: 12.5px; opacity: 0.55; }

/* ============ Акцентный цвет заголовков — Iced Aqua 13-5410 TCX ============ */
.block__title,
.block__subhead,
.card__title,
.step__title { color: var(--accent); }

/* ============ Hero-видео (на месте фото) ============ */
.screen--video { align-items: center; padding-top: 6vh; padding-bottom: 6vh; }
.videostage { display: flex; justify-content: center; }
.videowrap--hero {
  width: min(92vw, 860px);
  aspect-ratio: 16 / 9;
  margin: 0;
  /* Раскрытие «из-под шторки», как медиа у immersive-g: кадр чуть крупнее,
     приоткрыт по краям и всплывает — при появлении смыкается в полный. */
  opacity: 0;
  transform: scale(1.05);
  clip-path: inset(7% 7% 7% 7% round 22px);
  will-change: opacity, transform, clip-path;
}
.videowrap--hero.is-in {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0 round 22px);
  transition:
    opacity 1.3s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.6s cubic-bezier(0.22, 1, 0.36, 1),
    clip-path 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Согласие на обработку ПДн в форме записи. */
.book__consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; opacity: 0.75; }
.book__consent input { margin-top: 2px; flex: none; width: 16px; height: 16px; accent-color: var(--ink); }
.book__consent a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* Телефон крупно в окне записи. */
.book__phone--big { display: inline-block; margin: 6px 0 4px; font-size: 26px; }
