/* ==========================================================================
   СИТИ ДЕНТАЛ · дизайн-система «Эксперт-досье», ревизия 2
   Вход — вопрос врача, а не самопрезентация. Один акцент — шалфей.
   ========================================================================== */

/* ---------- 0. Токены ---------- */
:root {
  /* палитра (согласована, не менять) */
  --bg: #FFFFFF;
  --bg-soft: #FBFCFC;
  --ink: #1D2224;
  --text: #5B6367;
  --accent: #5D7D6D;
  --accent-dark: #43604F;
  --accent-light: #E3EAE6;
  --accent-mist: #F1F5F2;

  /* производные */
  --line: #E7EAEA;
  --ph-bg: #EDEDEB;
  --ph-text: #9A9C97;
  --shadow-soft: 0 2px 6px rgba(29, 34, 36, .04);
  --shadow-lift: 0 14px 34px -12px rgba(29, 34, 36, .16);

  /* типографика */
  --font-body: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  /* editorial-сериф: Georgia (Win/mac) → локальные аналоги (Linux).
     DejaVu Serif раньше Liberation Serif намеренно: Liberation — клон Times,
     а именно «дефолтный Times» и убивает вид; DejaVu ближе к Georgia по духу. */
  --font-display: Georgia, "Century Schoolbook L", "DejaVu Serif", "Liberation Serif", "Noto Serif", serif;

  /* сетка и ритм */
  --container: 1160px;
  --gutter: clamp(20px, 4vw, 40px);
  --section-y: clamp(64px, 9vw, 120px);
  --radius: 14px;
  --radius-lg: 20px;

  --ease: cubic-bezier(.22, .8, .3, 1);
}

/* ---------- 1. База ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: hidden;              /* важно: именно на html */
  scroll-behavior: smooth;
  scroll-padding-top: 88px;        /* якоря не ныряют под фикс-шапку */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  padding-top: 74px;               /* компенсация фиксированной шапки */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--ink); font-family: var(--font-display); font-weight: 500; line-height: 1.18; margin: 0 0 .5em; }
/* крупные кегли (40px+) — легче и плотнее: намеренный editorial-сериф */
h1, h2 { font-weight: 400; letter-spacing: -.015em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; display: block; }
b, strong { color: var(--ink); font-weight: 600; }
small { font-size: .82em; }
button { font: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: 880px; }

.section { padding: var(--section-y) 0; }

/* секции-«карты»: мягкий фон, большое скругление, объём */
.section--soft {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: clamp(24px, 3vw, 36px);
  margin: 0 clamp(8px, 1.4vw, 24px);
  box-shadow: 0 24px 60px -44px rgba(29, 34, 36, .22);
  overflow: hidden;   /* фолбэк */
  overflow: clip;     /* clip, а не hidden: фокус/скролл-чейнинг не сдвинет секцию */
}
/* деликатные декоративные формы в фоне карт-секций */
.section--soft::before {
  content: "";
  position: absolute; top: -140px; right: -120px;
  width: 380px; height: 380px; border-radius: 50%;
  background: var(--accent-mist);
}
.section--soft::after {
  content: "";
  position: absolute; bottom: -170px; left: -110px;
  width: 330px; height: 330px; border-radius: 50%;
  border: 1.5px solid var(--accent-light);
}
.section--soft > .container { position: relative; z-index: 1; }

/* ---------- 2. Атомы: кикер, заголовки, кнопки, бейджи, ссылки ---------- */
.kicker {
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-title { font-size: clamp(28px, 3.6vw, 42px); letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.section-lead { font-size: 19px; }
.section-more { margin-top: clamp(28px, 4vw, 44px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-weight: 600; font-size: 16px; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(67, 96, 79, .5); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn--lg { padding: 16px 32px; font-size: 17px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--accent-mist); color: var(--ink);
  font-size: 14px; line-height: 1.4;
}
.badge b { font-weight: 650; }
.badge--rating { border: 1px solid var(--accent-light); }
.badge--time { background: var(--accent-light); color: var(--accent-dark); font-weight: 600; font-size: 13px; }

.link-arrow { font-weight: 600; font-size: 17px; }
.link-arrow::after { content: "→"; margin-left: 8px; transition: margin .25s var(--ease); }
.link-arrow:hover::after { margin-left: 13px; }

.avatar {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-light); color: var(--accent-dark);
  font-weight: 650; font-size: 18px;
}

/* ---------- 3. Фото-заглушки (.ph) — заменяются на <img> без перевёрстки ---------- */
.ph {
  position: relative;
  width: 100%;
  background: linear-gradient(150deg, #F0F0EE 0%, var(--ph-bg) 55%, #E6E6E3 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; align-items: flex-end;
  box-shadow: 0 18px 40px -26px rgba(29, 34, 36, .28);
}
.ph::before {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 44px; height: 36px;
  border: 2px solid #D2D3CF; border-radius: 8px;
  background:
    radial-gradient(circle at 30% 35%, #D2D3CF 4.5px, transparent 5px),
    linear-gradient(to top right, transparent 46%, #D2D3CF 47%, #D2D3CF 53%, transparent 54%);
}
/* едва заметная служебная подпись в углу — не плашка */
.ph__label {
  position: absolute; z-index: 1;
  left: 14px; bottom: 12px;
  margin: 0; padding: 0;
  background: none;
  color: var(--ph-text);
  font-size: 10px; line-height: 1.4;
  letter-spacing: .12em; text-transform: uppercase;
  opacity: .75;
}
.ph--round { border-radius: 50%; }
.ph--round .ph__label { margin: 0 auto 16%; }
.ph--portrait { border-radius: var(--radius-lg); background: linear-gradient(160deg, var(--accent-mist) 0%, var(--ph-bg) 60%, #E6E6E3 100%); }

/* ---------- 4. Header ---------- */
.header {
  /* fixed, а не sticky: overflow-x:hidden на html/body ломает sticky.
     без backdrop-filter: он делает header containing block'ом для fixed-шторки меню */
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: #fff;
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
/* тонкая линия + тень появляются только после начала скролла (JS: scrollY > 40) */
.header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -18px rgba(29, 34, 36, .18);
}
.header__in { display: flex; align-items: center; gap: 24px; min-height: 74px; }

.logo { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo__mark { width: 36px; height: 36px; color: var(--accent); flex: 0 0 auto; }
.logo__text { font-family: var(--font-display); font-size: 20px; line-height: 1.05; display: flex; flex-direction: column; }
.logo__text small { font-family: var(--font-body); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text); margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.nav__link { color: var(--ink); font-size: 15.5px; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav__link:hover { color: var(--accent-dark); border-bottom-color: var(--accent-light); }
.nav__extra { display: none; }

/* пункт с выпадашкой */
.nav__item { position: relative; }
.nav__toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  cursor: pointer; padding: 6px 0;
}
.nav__caret { width: 11px; height: 11px; flex: 0 0 auto; transition: transform .25s var(--ease); }
.nav__item.is-open .nav__caret { transform: rotate(180deg); }
.nav__drop {
  position: absolute; top: calc(100% + 12px); left: -14px; z-index: 70;
  min-width: 236px;
  display: flex; flex-direction: column; gap: 2px;
  background: #fff;
  border: 1px solid var(--line); border-radius: 14px;
  padding: 10px;
  box-shadow: 0 26px 54px -22px rgba(29, 34, 36, .3);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s .25s;
}
/* невидимый «мостик» между пунктом и панелью — ховер не рвётся */
.nav__drop::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.nav__item.is-open > .nav__drop {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.nav__drop a {
  display: block; padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink); font-size: 15px; font-weight: 500; line-height: 1.35;
}
.nav__drop a:hover { background: var(--accent-mist); color: var(--accent-dark); }

/* «Дети» — капсула */
.nav__link--pill {
  background: var(--accent-light); color: var(--accent-dark);
  padding: 7px 18px; border-radius: 999px; border-bottom: 0;
  font-weight: 600;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.nav__link--pill:hover { background: var(--accent); color: #fff; border-bottom-color: transparent; }

.header__phone { color: var(--ink); font-weight: 600; font-size: 15.5px; white-space: nowrap; }
.header__phone:hover { color: var(--accent-dark); }
.header__cta { padding: 10px 22px; font-size: 15px; }

.burger { display: none; }

/* ---------- 4a. Шапка поверх hero: прозрачное состояние до скролла ---------- */
.header:not(.is-scrolled) { background: transparent; }
.header:not(.is-scrolled) .logo,
.header:not(.is-scrolled) .logo:hover { color: #fff; }
.header:not(.is-scrolled) .logo__mark { color: #fff; }
.header:not(.is-scrolled) .logo__text small { color: rgba(255, 255, 255, .72); }
.header:not(.is-scrolled) .nav__link { color: #fff; }
.header:not(.is-scrolled) .nav__link:hover { color: var(--accent-light); border-bottom-color: rgba(255, 255, 255, .35); }
.header:not(.is-scrolled) .nav__link--pill { background: rgba(255, 255, 255, .14); color: #fff; border: 0; }
.header:not(.is-scrolled) .nav__link--pill:hover { background: var(--accent-light); color: var(--accent-dark); }
.header:not(.is-scrolled) .header__phone { color: #fff; }
.header:not(.is-scrolled) .header__phone:hover { color: var(--accent-light); }
.header:not(.is-scrolled) .header__cta {
  background: transparent; color: #fff;
  border-color: rgba(255, 255, 255, .8);
}
.header:not(.is-scrolled) .header__cta:hover { background: #fff; color: var(--ink); box-shadow: none; }
.header:not(.is-scrolled) .burger span { background: #fff; }
/* открытая мобильная шторка — всегда на белом: возвращаем тёмные цвета */
.header:not(.is-scrolled) .nav.is-open .nav__link { color: var(--ink); }
.header:not(.is-scrolled) .nav.is-open .nav__link--pill { background: var(--accent-light); color: var(--accent-dark); }

/* ---------- 5. Hero — фото-фон, текст поверх ---------- */
.hero {
  position: relative;
  min-height: 85vh;
  margin-top: -74px;               /* фото заезжает под прозрачную шапку */
  display: flex; align-items: center;
  overflow: hidden;
  color: #fff;
}
.hero__bg {
  position: absolute; inset: 0;
  border-radius: 0; box-shadow: none;
  /* осмысленный фон-фолбэк: глубокий графитово-шалфейный градиент.
     Слот data-photo сохранён — фото ляжет поверх без перевёрстки. */
  background: linear-gradient(115deg, #242B2E 0%, #2E3739 45%, #3B4644 78%, #46524D 100%);
}
/* деликатный паттерн: тонкие концентрические дуги в шалфее, правый край */
.hero__bg::before {
  content: "";
  position: absolute; inset: auto;
  width: auto; height: auto; margin: 0;
  border: 0; border-radius: 0;
  top: -40%; right: -22%; bottom: -40%; left: 30%;
  background: repeating-radial-gradient(
    circle at 78% 46%,
    transparent 0,
    transparent 76px,
    rgba(158, 189, 172, .07) 76px,
    rgba(158, 189, 172, .07) 78px
  );
}
/* мягкое световое пятно за текстом */
.hero__bg::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 75% at 22% 42%, rgba(93, 125, 109, .28) 0%, rgba(93, 125, 109, .10) 45%, transparent 72%);
}
.hero__bg .ph__label { display: none; }
.hero__shade {
  position: absolute; inset: 0;
  /* контент hero стоит слева — темним левую часть кадра, справа фото дышит */
  background:
    linear-gradient(90deg, rgba(29, 34, 36, .82) 0%, rgba(29, 34, 36, .6) 42%, rgba(29, 34, 36, .22) 74%, rgba(29, 34, 36, .05) 100%),
    linear-gradient(0deg, rgba(29, 34, 36, .5) 0%, rgba(29, 34, 36, 0) 40%),
    linear-gradient(180deg, rgba(29, 34, 36, .35) 0%, rgba(29, 34, 36, 0) 22%);
}
.hero__in {
  position: relative; z-index: 1;
  width: 100%;
  padding-top: calc(clamp(56px, 8vw, 110px) + 74px); /* +74px — компенсация заезда под шапку */
  padding-bottom: clamp(56px, 8vw, 110px);
}
.hero__content { max-width: 640px; }
.hero__kicker {
  color: var(--accent-light); font-size: 13px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: clamp(16px, 2.4vw, 28px);
}
.hero__title {
  color: #fff;
  font-size: clamp(38px, 4.8vw, 68px);
  letter-spacing: -.015em;
  margin: 0 0 18px;
  text-shadow: 0 2px 24px rgba(29, 34, 36, .35);
}
.hero__lead { color: rgba(255, 255, 255, .88); font-size: clamp(16px, 1.4vw, 19px); max-width: 520px; margin-bottom: clamp(24px, 3vw, 36px); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.btn--white { background: #fff; color: var(--ink); }
.btn--white:hover { background: var(--accent-mist); color: var(--ink); transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(29, 34, 36, .45); }
.hero__note { margin-top: clamp(18px, 2.4vw, 26px); font-size: 15px; color: rgba(255, 255, 255, .75); }
.hero__note a { color: #fff; font-weight: 600; white-space: nowrap; }
.hero__note a:hover { color: var(--accent-light); }

/* метрика-чип поверх фото, справа-снизу */
.hero__chip {
  /* сдвинут левее угла: справа-снизу живёт плавающая кнопка (.fab) */
  position: absolute; right: calc(var(--gutter) + 76px); bottom: clamp(24px, 4vw, 48px);
  display: flex; align-items: center; gap: 14px;
  background: #fff; color: var(--ink);
  border-radius: 16px;
  padding: 14px 22px;
  box-shadow: 0 18px 44px -18px rgba(29, 34, 36, .45);
}
.hero__chip-num {
  font-family: var(--font-display);
  font-size: 34px; line-height: 1;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}
.hero__chip-text { font-size: 13px; line-height: 1.35; color: var(--text); }

/* ---------- 5c. Услуги — бенто с офферами ---------- */
.serv {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "big big a b"
    "big big c d"
    "e   e   f f";
  gap: clamp(14px, 1.6vw, 20px);
  perspective: 1400px;
}
.serv__tile {
  position: relative; display: flex; flex-direction: column;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: clamp(20px, 2.2vw, 30px);
  overflow: hidden;
  box-shadow: 0 14px 38px -24px rgba(29, 34, 36, .28), 0 2px 6px rgba(29, 34, 36, .04);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
  transform-style: preserve-3d;
  will-change: transform;
}
.serv__tile:hover { box-shadow: 0 30px 60px -26px rgba(29, 34, 36, .32), 0 2px 6px rgba(29, 34, 36, .05); }
.serv__tile:nth-child(2) { grid-area: a; }
.serv__tile:nth-child(3) { grid-area: b; }
.serv__tile:nth-child(4) { grid-area: c; }
.serv__tile:nth-child(5) { grid-area: d; }
.serv__tile:nth-child(6) { grid-area: e; }
.serv__tile:nth-child(7) { grid-area: f; }

.serv__title {
  font-size: clamp(21px, 1.9vw, 26px);
  line-height: 1.22;
  margin: 0 0 10px;
}
.serv__text { font-size: 14.5px; line-height: 1.55; margin: 0 0 16px; }
.serv__link { margin-top: auto; font-weight: 600; font-size: 15px; color: var(--accent-dark); }
.serv__link::after { content: "→"; margin-left: 7px; display: inline-block; transition: transform .25s var(--ease); }
.serv__tile:hover .serv__link::after { transform: translateX(4px); }

/* большая плитка с фото */
.serv__tile--big { grid-area: big; padding: 0; }
.serv__ph { flex: 1 1 auto; min-height: 240px; border-radius: 0; box-shadow: none; }
.serv__big-body { padding: clamp(20px, 2.2vw, 30px); display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.serv__title--big { font-size: clamp(24px, 2.2vw, 30px); margin: 0; }

/* чередование «кожи» плиток: графит / шалфей / дымка / белая */
.serv__tile--ink { background: var(--ink); border-color: var(--ink); }
.serv__tile--ink .serv__title { color: #fff; }
.serv__tile--ink .serv__text { color: rgba(255, 255, 255, .78); }
.serv__tile--ink .serv__link { color: var(--accent-light); }
.serv__tile--accent { background: var(--accent); border-color: var(--accent); }
.serv__tile--accent .serv__title { color: #fff; }
.serv__tile--accent .serv__text { color: rgba(255, 255, 255, .88); }
.serv__tile--accent .serv__link { color: #fff; }
.serv__tile--mist { background: var(--accent-mist); border-color: var(--accent-light); }
.serv__tile--light { background: var(--accent-light); border-color: transparent; }
.serv__tile--wide { flex-direction: column; justify-content: center; }

/* ---------- 5a. Лента фактов (marquee) ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 15px 0;
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee-run 40s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group {
  display: flex; align-items: center; gap: 34px;
  padding-right: 34px;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 16.5px; color: var(--ink);
}
.marquee__dot { color: var(--accent); font-weight: 700; }
@keyframes marquee-run { to { transform: translateX(-50%); } }

/* ---------- 6. Карточки (.card) и сетки ---------- */
.cards-grid { display: grid; gap: clamp(18px, 2.4vw, 28px); }
.cards-grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.4vw, 28px);
  box-shadow: var(--shadow-soft);
}
.card__title { font-size: 21px; margin-bottom: 10px; }
.card__text { font-size: 15.5px; color: var(--text); margin-bottom: 18px; }
.card__link { color: var(--accent); font-weight: 600; font-size: 15px; }
.card__link::after { content: "→"; margin-left: 7px; display: inline-block; transition: transform .25s var(--ease); }

/* симптомная карточка: спокойный ховер — подъём, тень, шалфейная рамка */
.card--symptom { transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease); }
.card--symptom:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lift);
}
.card--symptom:hover .card__link { color: var(--accent-dark); }
.card--symptom:hover .card__link::after { transform: translateX(4px); }

.card--flat { background: transparent; border: 0; box-shadow: none; padding: 0; }
.card__icon {
  width: 56px; height: 56px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 16px;
  background: var(--accent-light); color: var(--accent-dark);
  margin-bottom: 18px;
}
.card__icon svg { width: 30px; height: 30px; }
/* подложки иконок нарочно разные — не «штамп» */
.card__icon--mist { background: var(--accent-mist); border: 1px solid var(--accent-light); border-radius: 50%; }
.card__icon--light { background: var(--accent-light); border-radius: 16px; }
.card__icon--outline { background: var(--bg); border: 1.5px solid var(--accent-light); border-radius: 16px; color: var(--accent); }

/* стоп-сигнал: пасхалка */
.card__icon--stop { cursor: pointer; transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease); }
.card__icon--stop:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.06); }
.card__hint { font-size: 13px; color: var(--accent-dark); opacity: .75; margin-top: 10px; }
html.is-paused *, html.is-paused *::before, html.is-paused *::after {
  animation-play-state: paused !important;
  transition-duration: 0s !important;
}

/* ---------- 7. Основатель: фото + карточка-цитата внахлёст ---------- */
.founder {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.founder__text .section-title { font-size: clamp(26px, 3vw, 38px); line-height: 1.28; }
.founder__media { position: relative; padding: 0 0 clamp(48px, 6vw, 72px) 0; }
.founder__photo {
  width: min(78%, 460px);
  margin-left: auto;
}
.founder__photo .ph__label { top: 12px; bottom: auto; } /* подпись сверху — не под карточкой */
.founder__card {
  position: absolute; left: 0; bottom: 0;
  max-width: min(62%, 420px);
  margin: 0;
  background: var(--accent-dark); color: #fff;
  border-radius: 20px;
  padding: clamp(20px, 2.4vw, 30px);
  box-shadow: 0 26px 54px -22px rgba(29, 34, 36, .45);
}
.founder__card p {
  font-family: var(--font-display);
  font-size: clamp(15.5px, 1.3vw, 17.5px);
  line-height: 1.55;
  color: #fff;
  margin: 0 0 14px;
}
.founder__card footer { font-size: 14.5px; font-weight: 600; color: var(--accent-light); line-height: 1.4; }
.founder__card footer small { font-weight: 400; color: rgba(255, 255, 255, .72); }

/* ---------- 8. Цифры — компактная полоса карточек (.stat-card) ---------- */
.section--stats { padding: clamp(20px, 3vw, 36px) 0; }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 1.6vw, 20px);
}
.stat-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-soft);
}
.stat-card__num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(32px, 3vw, 42px);
  letter-spacing: -.015em;
  color: var(--ink); line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}
.stat-card__text { display: block; font-size: 13.5px; line-height: 1.5; }

/* ---------- 8a. Технологии (.tech) ---------- */
.section--tech { padding-top: clamp(36px, 5vw, 64px); }
.tech__top {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.tech__top .section-head { margin-bottom: 0; }
.tech__manifest {
  background: var(--ink);
  border-radius: 20px;
  padding: clamp(24px, 2.8vw, 34px);
  box-shadow: 0 26px 54px -28px rgba(29, 34, 36, .5);
}
.tech__manifest p {
  font-family: var(--font-display);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.5;
  color: #fff;
  margin: 0;
}
.tech-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.4vw, 28px);
  box-shadow: var(--shadow-soft);
}
.tech-card__text { font-size: 15px; line-height: 1.6; margin: 0; }

/* ---------- 9. Врачи — сетка портретных карточек (.team-card) ---------- */
.team-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2vw, 24px);
}
.team-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 12px 20px;
  box-shadow: var(--shadow-soft);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.team-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-light);
  box-shadow: var(--shadow-lift);
}
.team-card__photo { border-radius: 16px; }
.team-card__photo .ph__label { display: none; }
.team-card__body { padding: 16px 8px 0; }
.team-card__name { font-size: clamp(19px, 1.6vw, 22px); margin: 0 0 4px; }
.team-card__role { font-size: 13.5px; line-height: 1.5; margin: 0 0 12px; }
.team-card__quote {
  font-size: 13.5px; line-height: 1.55; color: var(--ink);
  padding-left: 12px; border-left: 3px solid var(--accent-light);
  margin: 0;
  transition: border-color .25s var(--ease);
}
.team-card:hover .team-card__quote { border-left-color: var(--accent); }

/* ---------- 10. Триаж — фирменная сцена «честного плана» ---------- */
.triage__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.4vw, 28px); }
.triage__col {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.4vw, 28px);
  box-shadow: var(--shadow-soft);
  border-top: 3px solid var(--line);
}
.triage__col-title {
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.triage__col--urgent { border-top-color: var(--ink); }
.triage__col--urgent .triage__col-title { color: var(--ink); }
.triage__col--wait { border-top-color: var(--accent); }
.triage__col--wait .triage__col-title { color: var(--accent-dark); }
.triage__col--skip { background: var(--accent-mist); border-color: var(--accent-light); border-top-color: var(--accent); }
.triage__col--skip .triage__col-title { color: var(--accent-dark); border-bottom-color: var(--accent-light); }

.triage-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 12px;
  font-size: 15px; line-height: 1.5; color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.triage-card:last-child { margin-bottom: 0; }
.triage-card__meta { display: block; margin-top: 5px; font-size: 13px; color: var(--text); }
.triage__col--skip .triage-card { border-color: var(--accent-light); }
.triage__col--skip .triage-card__meta { color: var(--accent-dark); }
.triage__note { margin-top: 26px; font-size: 15px; color: var(--text); text-align: center; }

/* карточки заметно, но спокойно раскладываются по стопкам */
.triage.is-in .triage-card { animation: triage-drop .8s var(--ease) both; }
.triage.is-in .triage__col:nth-child(1) .triage-card:nth-of-type(1) { animation-delay: .05s; }
.triage.is-in .triage__col:nth-child(1) .triage-card:nth-of-type(2) { animation-delay: .22s; }
.triage.is-in .triage__col:nth-child(2) .triage-card:nth-of-type(1) { animation-delay: .42s; }
.triage.is-in .triage__col:nth-child(2) .triage-card:nth-of-type(2) { animation-delay: .58s; }
.triage.is-in .triage__col:nth-child(3) .triage-card:nth-of-type(1) { animation-delay: .78s; }
.triage.is-in .triage__col:nth-child(3) .triage-card:nth-of-type(2) { animation-delay: .95s; }
.triage:not(.is-in) .triage-card { opacity: 0; }
@keyframes triage-drop {
  0%   { opacity: 0; transform: translateY(-30px) scale(.97); }
  60%  { opacity: 1; transform: translateY(3px) scale(1); }
  100% { opacity: 1; transform: none; }
}

/* ---------- 11. Таймлайн первого визита (.visit) ---------- */
.visit__track { position: relative; }
.visit__line {
  position: absolute; left: 0; right: 0; top: 21px; height: 3px;
  background: var(--line); border-radius: 3px; overflow: hidden;
}
.visit__line-fill {
  display: block; height: 100%; width: 0%;
  background: var(--accent);
  transition: width .5s linear;
}
.visit__steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
}
.visit__step { position: relative; padding-top: 64px; }
.visit__dot {
  position: absolute; top: 0; left: 0;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line);
  color: var(--text); font-weight: 650; font-size: 17px;
  font-family: var(--font-display);
  transition: background .4s var(--ease), border-color .4s var(--ease), color .4s var(--ease), box-shadow .4s var(--ease);
}
.visit__step.is-active .visit__dot {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 0 0 6px var(--accent-mist);
}
.visit__step-title { font-size: 21px; margin: 14px 0 6px; }
.visit__step-text { font-size: 15px; }

/* ---------- 12. Отзывы: editorial-цитата + компактные карточки + рейтинги ---------- */
.review-feature {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 56px) clamp(24px, 5vw, 72px);
  margin-bottom: clamp(18px, 2.4vw, 28px);
  box-shadow: 0 26px 54px -28px rgba(29, 34, 36, .5);
}
.review-feature__text {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 29px);
  line-height: 1.45;
  letter-spacing: -.01em;
  color: #fff;
  margin: 0 0 clamp(20px, 3vw, 30px);
  max-width: 21em;
}
.review-feature__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.review-feature__name { font-weight: 600; color: #fff; font-size: 15.5px; }
.avatar--onink { background: rgba(255, 255, 255, .14); color: var(--accent-light); }
.badge--source {
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .18);
  color: var(--accent-light);
  font-weight: 600; font-size: 13px;
}
.cards-grid--2 { grid-template-columns: repeat(2, 1fr); }
.ratings { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.ratings--after { margin-top: clamp(20px, 2.6vw, 28px); }
.review__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.review__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.review__name { font-weight: 600; color: var(--ink); font-size: 15.5px; line-height: 1.3; }
.review__meta { font-size: 12.5px; color: var(--text); line-height: 1.4; }
.review__text { font-size: 15px; line-height: 1.66; }

/* ---------- 12a. Карусель отзывов (архитектура под ~20 карточек) ---------- */
.rev-carousel { position: relative; }
.rev-carousel__track {
  display: flex; gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 2px 8px;             /* воздух под тени карточек */
  outline: none;
}
.rev-carousel__track::-webkit-scrollbar { display: none; }
.rev-carousel__track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.rev-carousel__slide {
  flex: 0 0 calc((100% - 40px) / 3); /* ~3 карточки на десктопе */
  scroll-snap-align: start;
  display: flex; flex-direction: column;
  margin: 0;
}
.rev-carousel__nav { display: flex; gap: 12px; margin-top: 20px; }
.rev-carousel__btn {
  width: 46px; height: 46px;
  border: 0; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .25s var(--ease), transform .25s var(--ease), opacity .25s var(--ease);
}
.rev-carousel__btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.rev-carousel__btn:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 3px; }
.rev-carousel__btn:disabled { opacity: .35; cursor: default; background: var(--accent); transform: none; }
.rev-carousel__btn svg { width: 18px; height: 18px; }

/* подвал секции отзывов: пилюли площадок + кнопка «Оставить отзыв» */
.rev-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 24px;
  margin-top: clamp(20px, 2.6vw, 28px);
}
.rev-foot .ratings { margin-top: 0; align-items: center; }
.rev-foot__label { width: 100%; font-size: 13.5px; color: var(--text); }
.badge--link { color: var(--ink); transition: border-color .25s var(--ease), background .25s var(--ease); }
.badge--link:hover { border-color: var(--accent); background: var(--accent-light); color: var(--ink); }

/* ---------- 13. История пациента + шторка до/после (.ba) ---------- */
.story {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.story__quote { margin: 26px 0 0; padding: 22px 26px; background: var(--accent-mist); border-radius: var(--radius); border-left: 3px solid var(--accent); }
.story__quote p { font-size: 16.5px; color: var(--ink); margin-bottom: 10px; }
.story__quote footer { font-size: 14.5px; color: var(--accent-dark); font-weight: 600; }

.ba { position: relative; }
.ba__frame { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-soft); }
.ba__after, .ba__before { border-radius: 0; }
.ba .ph__label { display: none; } /* роли слоёв подписаны тегами До/После */
.ba__before {
  position: absolute; inset: 0;
  clip-path: inset(0 calc(100% - var(--ba, 50%)) 0 0);
  background: linear-gradient(150deg, #E9E7E2 0%, #E2E0DB 60%, #DAD8D2 100%);
}
.ba__handle {
  position: absolute; top: 0; bottom: 0; left: var(--ba, 50%);
  width: 2px; margin-left: -1px;
  background: #fff; box-shadow: 0 0 0 .5px rgba(29,34,36,.15);
}
.ba__grip {
  position: absolute; top: 50%; left: 50%;
  width: 40px; height: 40px; transform: translate(-50%, -50%);
  border-radius: 50%; background: #fff;
  box-shadow: 0 4px 14px rgba(29,34,36,.22);
}
.ba__grip::before {
  content: "◂ ▸"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-dark); font-size: 12px; letter-spacing: 1px;
}
.ba__range {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: ew-resize; margin: 0;
  touch-action: none;
}
.ba__tags { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; pointer-events: none; }
.ba__tags span {
  background: rgba(255,255,255,.85); border-radius: 8px;
  padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--ink);
}

/* ---------- 14. Прайс (.price-table) ---------- */
.price-table { border-top: 1px solid var(--line); }
.price-row {
  display: flex; align-items: baseline; gap: 16px;
  padding: 20px 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 10px;
  transition: background .25s var(--ease);
}
.price-row:hover { background: var(--accent-mist); }
.price-row__name { color: var(--ink); font-size: 17px; }
.price-row__name small { display: block; color: var(--text); font-size: 13.5px; margin-top: 3px; }
.price-row__dots { flex: 1; border-bottom: 1.5px dotted var(--line); transform: translateY(-4px); min-width: 30px; }
.price-row:hover .price-row__dots { border-color: var(--accent-light); }
.price-row__value { font-weight: 650; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.prices__note { margin-top: 26px; font-size: 15.5px; max-width: 640px; }

/* ---------- 15. Жизнь клиники — живая сетка-галерея (.life) ---------- */
.interior__line { font-family: var(--font-display); font-size: clamp(20px, 2.2vw, 26px); line-height: 1.5; color: var(--ink); max-width: 640px; }
.life {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: clamp(12px, 1.6vw, 18px);
}
.life__item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  height: clamp(180px, 24vw, 340px);
  box-shadow: 0 18px 40px -26px rgba(29, 34, 36, .28);
}
.life__item .ph {
  position: absolute; inset: 0;
  height: 100%;
  border-radius: 0; box-shadow: none;
  transition: transform .8s var(--ease);
}
.life__item:hover .ph { transform: scale(1.045); }
/* верхний ряд ~60/40 — крупнее, нижний — три слота */
.life__item--a { grid-column: span 6; height: clamp(240px, 30vw, 420px); }
.life__item--b { grid-column: span 4; height: clamp(240px, 30vw, 420px); }
.life__item--c { grid-column: span 4; }
.life__item--d { grid-column: span 3; }
.life__item--e { grid-column: span 3; }

/* ---------- 16. Форма и контакты ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(36px, 5vw, 80px); }
.contact .section-title { font-size: clamp(24px, 2.8vw, 34px); margin-bottom: 30px; }

.form { position: relative; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form__field { display: block; margin-bottom: 18px; }
.form__label { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.form__label em { display: block; font-style: normal; font-weight: 400; color: var(--text); font-size: 13px; margin-top: 2px; }
.form__input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: 16px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.form__input::placeholder { color: #A6ACAF; }
.form__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-mist); }
.form__input--area { resize: vertical; min-height: 88px; }
.form__input--select {
  appearance: none; -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 49%, var(--text) 51%),
    linear-gradient(135deg, var(--text) 49%, transparent 51%);
  background-position: calc(100% - 21px) 50%, calc(100% - 16px) 50%;
  background-size: 5.5px 5.5px;
  background-repeat: no-repeat;
  padding-right: 42px;
  cursor: pointer;
}
.form__input.is-error { border-color: #B4635A; }
.form__submit { margin-top: 6px; min-width: 220px; }

.form__success[hidden] { display: none; }
.form__success {
  display: flex; gap: 16px; align-items: flex-start;
  margin-top: 22px; padding: 20px 24px;
  background: var(--accent-mist); border: 1px solid var(--accent-light); border-radius: var(--radius);
  color: var(--text);
}
.form__success svg { width: 40px; height: 40px; flex: 0 0 40px; color: var(--accent); }
.form__success p { font-size: 15px; }
.form.is-sent .form__row, .form.is-sent .form__field, .form.is-sent .form__submit { display: none; }

.contact__list { margin: 0 0 30px; }
.contact__item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact__item:first-child { padding-top: 0; }
.contact__item dt { font-size: 13px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.contact__item dd { margin: 0; color: var(--ink); font-size: 16.5px; }
.contact__item dd small { color: var(--text); }
.contact__phone { font-family: var(--font-display); font-size: 24px; color: var(--ink); }
.contact__phone:hover { color: var(--accent-dark); }

.guarantee { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px 28px; }
.guarantee__title { font-size: 20px; }
.guarantee p { font-size: 14.5px; }

/* ---------- 17. Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 44px 0; }
.footer__in { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 48px; }
.logo--footer .logo__text { font-size: 18px; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer__nav a { color: var(--text); font-size: 14.5px; }
.footer__nav a:hover { color: var(--accent-dark); }
.footer__note { margin-left: auto; font-size: 13px; color: var(--text); text-align: right; }

/* ---------- 17a. Плавающая кнопка-веер (.fab) ---------- */
/* скрим-подложка: гасит контент (включая чип 4.9 и marquee), но лежит ниже пилюль */
.fab-scrim {
  position: fixed; inset: 0;
  z-index: 80;                       /* контент/шапка ниже, .fab (90) выше */
  background: rgba(29, 34, 36, .35);
  opacity: 0; visibility: hidden;
  cursor: pointer;
  transition: opacity .3s var(--ease), visibility 0s .3s;
}
.fab-scrim.is-visible {
  opacity: 1; visibility: visible;
  transition: opacity .3s var(--ease);
}
.fab {
  position: fixed;
  right: clamp(16px, 2.6vw, 28px);
  bottom: clamp(16px, 2.6vw, 28px);
  z-index: 90;                       /* над контентом и шапкой, под модалкой */
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 12px;
}
.fab__btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 16px 34px -12px rgba(67, 96, 79, .6);
  transition: background .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.fab__btn:hover { background: var(--accent-dark); transform: translateY(-2px); }
.fab__btn:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 3px; }
.fab__icon { width: 22px; height: 22px; transition: transform .35s var(--ease); }
.fab.is-open .fab__icon { transform: rotate(45deg); }   /* плюс становится крестиком */
.fab__menu { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab__action {
  visibility: hidden; opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  display: inline-flex; align-items: center; gap: 12px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 22px 7px 7px;
  font-weight: 600; font-size: 15px; line-height: 1.2;
  white-space: nowrap; cursor: pointer;
  box-shadow: 0 16px 38px -18px rgba(29, 34, 36, .4);
  transition: opacity .3s var(--ease), transform .3s var(--ease),
              border-color .25s var(--ease), color .25s var(--ease), visibility 0s .3s;
}
.fab.is-open .fab__action {
  visibility: visible; opacity: 1; transform: none; pointer-events: auto;
  transition: opacity .3s var(--ease), transform .3s var(--ease),
              border-color .25s var(--ease), color .25s var(--ease);
}
/* stagger: нижняя пилюля (ближе к кнопке) раскрывается первой */
.fab.is-open .fab__action:nth-child(4) { transition-delay: 0s; }
.fab.is-open .fab__action:nth-child(3) { transition-delay: .07s; }
.fab.is-open .fab__action:nth-child(2) { transition-delay: .14s; }
.fab.is-open .fab__action:nth-child(1) { transition-delay: .21s; }
.fab__action:hover { border-color: var(--accent); color: var(--accent-dark); }
.fab__action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* круглый значок слева в пилюле */
.fab__action-ico {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  transition: background .25s var(--ease);
}
.fab__action-ico svg { width: 20px; height: 20px; }
.fab__action:hover .fab__action-ico { background: var(--accent-dark); }

/* ---------- 17b. Модалка записи (.modal) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  visibility: hidden;
  transition: visibility 0s .35s;
}
.modal.is-open { visibility: visible; transition: none; }
.modal__overlay {
  position: absolute; inset: 0;
  background: rgba(29, 34, 36, .55);
  opacity: 0;
  transition: opacity .3s var(--ease);
  cursor: pointer;
}
.modal.is-open .modal__overlay { opacity: 1; }
.modal__card {
  position: relative;
  width: 100%; max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  padding: clamp(24px, 4vw, 32px);
  box-shadow: 0 34px 90px -24px rgba(29, 34, 36, .5);
  opacity: 0; transform: translateY(16px) scale(.98);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.modal.is-open .modal__card { opacity: 1; transform: none; }
.modal__close {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line); border-radius: 50%;
  cursor: pointer;
  transition: color .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.modal__close:hover { color: var(--ink); border-color: var(--accent); background: var(--accent-mist); }
.modal__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal__close svg { width: 18px; height: 18px; }
.modal__title { font-size: 26px; margin: 0 36px 6px 0; }
.modal__sub { font-size: 14.5px; margin-bottom: 20px; }
.modal__agree {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; line-height: 1.5; color: var(--text);
  margin: 2px 0 16px;
  cursor: pointer;
}
.modal__check {
  width: 18px; height: 18px; flex: 0 0 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.modal__check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal__submit { width: 100%; }
.modal__submit:disabled {
  opacity: .45; cursor: not-allowed;
  transform: none; box-shadow: none;
  background: var(--accent);
}
.modal__success[hidden] { display: none; }
.modal__success { display: flex; gap: 14px; align-items: flex-start; color: var(--text); }
.modal__success svg { width: 40px; height: 40px; flex: 0 0 40px; color: var(--accent); }
.modal__success p { font-size: 15px; margin: 0; }
body.modal-lock { overflow: hidden; }

/* ---------- 18. Появление при скролле (.reveal) ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal--d1 { transition-delay: .08s; }
.reveal--d2 { transition-delay: .16s; }
.reveal--d3 { transition-delay: .24s; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 19. Адаптив ---------- */
/* узкий десктоп: телефон в шапке прячем, чтобы меню не переносилось */
@media (min-width: 1025px) and (max-width: 1140px) {
  .header__phone { display: none; }
}

@media (max-width: 1024px) {
  .nav { display: none; }
  .burger {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    flex: 0 0 44px; width: 44px; height: 44px; padding: 10px;
    margin-left: 4px;
    background: none; border: 0; cursor: pointer;
  }
  .burger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s var(--ease); }
  .burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger.is-open span:nth-child(2) { opacity: 0; }
  .burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .header__phone { margin-left: auto; }

  /* мобильное меню-шторка */
  .nav.is-open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    position: fixed; top: 74px; left: 0; right: 0; bottom: 0; z-index: 49;
    background: var(--bg);
    padding: 28px var(--gutter) 40px;
    overflow-y: auto;
    animation: nav-in .35s var(--ease);
  }
  .nav.is-open .nav__link { font-size: 22px; font-family: var(--font-display); padding: 10px 0; border: 0; }
  .nav.is-open .nav__extra { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; margin-top: 26px; }
  .nav__phone { font-family: var(--font-display); font-size: 24px; color: var(--ink); }

  /* дропдауны в шторке — аккордеоны */
  .nav.is-open .nav__item { width: 100%; }
  .nav.is-open .nav__toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; }
  .nav.is-open .nav__caret { width: 15px; height: 15px; color: var(--accent); }
  .nav.is-open .nav__drop {
    position: static; min-width: 0;
    display: none;
    opacity: 1; visibility: visible; transform: none;
    background: transparent; border: 0; box-shadow: none;
    padding: 0 0 8px 4px;
    transition: none;
  }
  .nav.is-open .nav__drop::before { display: none; }
  .nav.is-open .nav__item.is-open .nav__drop { display: flex; }
  .nav.is-open .nav__drop a { font-size: 17px; font-family: var(--font-body); padding: 9px 10px; color: var(--text); }
  .nav.is-open .nav__link--pill {
    font-family: var(--font-body); font-size: 18px; font-weight: 600;
    padding: 10px 24px; margin-top: 10px; align-self: flex-start;
  }

  @keyframes nav-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
  body.nav-lock { overflow: hidden; }

  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .rev-carousel__slide { flex-basis: calc((100% - 20px) / 2); }
}

@media (max-width: 880px) {
  .hero { min-height: 74vh; }
  .serv {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "big big"
      "a   b"
      "c   d"
      "e   e"
      "f   f";
  }
  .serv__ph { min-height: 220px; }
  .founder { grid-template-columns: 1fr; }
  .founder__photo { width: 100%; margin: 0; }
  .founder__media { padding-bottom: 0; }
  .founder__card {
    position: relative; z-index: 1;    /* карточка гарантированно поверх фото */
    max-width: none;
    margin-top: -24px;                 /* лёгкий нахлёст — начало цитаты не прячется */
    width: calc(100% - clamp(16px, 6vw, 48px));
  }
  .cards-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .story { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tech__top { grid-template-columns: 1fr; gap: 24px; }
  .life { grid-template-columns: 1fr 1fr; }
  .life__item--a { grid-column: 1 / -1; height: clamp(220px, 44vw, 360px); }
  .life__item--b, .life__item--c, .life__item--d, .life__item--e { grid-column: auto; height: clamp(150px, 30vw, 250px); }
  .triage__cols { grid-template-columns: 1fr; }
  .visit__line { display: none; }
  .visit__steps { grid-template-columns: 1fr; gap: 0; }
  .visit__step { padding: 0 0 30px 62px; }
  .visit__step::before { content: ""; position: absolute; left: 21px; top: 48px; bottom: 6px; width: 2px; background: var(--line); }
  .visit__step:last-child::before { display: none; }
  .visit__step.is-active::before { background: var(--accent); }
  .visit__step .badge--time { margin-bottom: 4px; }
  .visit__step-title { margin-top: 0; }
  .footer__note { margin-left: 0; text-align: left; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .cards-grid--3, .cards-grid--2 { grid-template-columns: 1fr; }
  .header__phone { display: none; }
  .header__in { gap: 10px; }        /* иначе бургер выталкивается за край 390px */
  .header__cta { margin-left: auto; padding: 9px 18px; font-size: 14px; }
  .logo__text small { display: none; }
  .hero { min-height: 0; }
  .hero__in { padding-top: calc(48px + 74px); padding-bottom: 64px; }
  .hero__actions .btn { width: 100%; }
  .serv { grid-template-columns: 1fr; grid-template-areas: "big" "a" "b" "c" "d" "e" "f"; }
  .serv__ph { min-height: 190px; }
  .marquee__group { font-size: 14px; gap: 22px; padding-right: 22px; }
  .team-card { padding: 8px 8px 16px; }
  .team-card__body { padding: 12px 6px 0; }
  /* ряды одной высоты, контент по центру — без пустых низов */
  .stats-grid { align-items: stretch; }
  .stat-card {
    padding: 16px 16px;
    min-height: 124px;
    display: flex; flex-direction: column; justify-content: center;
  }
  .stat-card__num { font-size: 30px; }
  .form__row { grid-template-columns: 1fr; gap: 0; }
  /* модалка — шторкой снизу на весь экран */
  .modal { padding: 0; align-items: flex-end; }
  .modal__card {
    max-width: none;
    max-height: 94vh;
    border-radius: 20px 20px 0 0;
    opacity: 1;
    transform: translateY(100%);
    padding-bottom: 30px;
  }
  .modal.is-open .modal__card { transform: none; }
  .form__submit { width: 100%; }
  .card__hint { display: none; }   /* пасхалка — только для десктопного ховера */
  /* карусель: ~1.2 карточки в кадре, свайп нативный */
  .rev-carousel__slide { flex-basis: 82%; }
  .rev-foot { flex-direction: column; align-items: flex-start; }
  .rev-foot .btn { width: 100%; }
}

@media (max-width: 480px) {
  .team-grid { grid-template-columns: 1fr; }
  .team-card__photo { aspect-ratio: 4/4.5 !important; } /* портрет чуть ниже на узком экране */
}

/* ---------- 20. Motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-delay: 0s !important;
    transition-duration: .001s !important;
    transition-delay: 0s !important;   /* глушит и stagger веера, и задержки reveal */
  }
  .reveal, .triage:not(.is-in) .triage-card { opacity: 1; transform: none; }
  .modal { transition: none; }
  .life__item:hover .ph { transform: none; }
  /* лента — статичная строка */
  .marquee__track { animation: none; width: auto; flex-wrap: wrap; justify-content: center; }
  .marquee__group { white-space: normal; flex-wrap: wrap; justify-content: center; padding-right: 0; }
  .marquee__group[aria-hidden] { display: none; }
}

/* ==========================================================================
   КАРТА КОМПОНЕНТОВ (для сборки остальных ~50 страниц)
   --------------------------------------------------------------------------
   Токены        :root — палитра, шрифты, ритм (--section-y, --gutter).
   Каркас        .container / .container--narrow, .section, .section--soft
                 (чередование белого и bg-soft задаёт ритм страницы).
   Атомы         .kicker, .section-head + .section-title + .section-lead,
                 .btn (--primary/--ghost/--lg), .badge (--rating/--time),
                 .link-arrow, .avatar.
   Вход-вопрос   .ask — фирменный hero: вопрос + симптомные карточки как
                 навигация; переносится на лендинги услуг («Что беспокоит
                 в улыбке?» и т.п.).
   Фото          .ph (+ data-photo, aspect-ratio инлайном) — заглушка,
                 заменяется на <img> без перевёрстки; варианты --portrait,
                 --round.
   Карточки      .cards-grid (--3) + .card (--symptom: ховер-подъём;
                 --flat: без рамки, с .card__icon).
   Манифест      .manifesto — полноширинная цитата с крупной кавычкой,
                 шаблон «цитаты врача» для внутренних страниц.
   Цифры         .stats-grid + .stat-card — компактная полоса опорных
                 фактов (js-count докручивает data-count).
   Врач          .team-card — портретная карточка (фото 3:4 + имя/роль +
                 цитата), сетка .team-grid 4/2/1.
   Технологии    .tech__top (заголовок + тёмный манифест) + .tech-card.
   Галерея       .life + .life__item (--a..--e) — живая сетка фото
                 с ховер-зумом, слоты data-photo="life-*".
   Окошки        .fab (кнопка-веер: пилюли .fab__action, stagger) и
                 .modal (запись: чекбокс-согласие, success, Esc/подложка).
   Триаж         .triage + .triage__col (--urgent/--wait/--skip) +
                 .triage-card — фирменная сцена «честного плана».
   Таймлайн      .visit__track + .visit__step (+ .is-active, #visitFill)
                 — шаблон «шагов» для страниц услуг.
   Отзыв         .review (на базе .card) + .ratings.
   До/после      .ba (шторка на input range + clip-path) — для кейсов.
   Прайс         .price-table + .price-row (ховер --accent-mist).
   Форма         .form (+ .is-sent), .form__input, .form__success.
   Контакты      .contact__list, .guarantee.
   Скролл-въезд  .reveal (+ --d1..--d3) — вешается на любой блок.
   Пауза         html.is-paused — стоп-сигнал останавливает мир на секунду.
   ========================================================================== */

/* История пациента: факты вместо до/после (вердикт владельца 13.08) */
.story-facts { display: grid; gap: 12px; }
.story-fact {
  background: var(--bg-soft); border: 1px solid rgba(29,34,36,.06);
  border-radius: 16px; padding: 18px 22px;
  display: flex; align-items: baseline; gap: 16px;
}
.story-fact b {
  font-family: var(--font-serif, Georgia, serif); font-weight: 400;
  font-size: 30px; color: var(--ink); white-space: nowrap;
  font-variant-numeric: tabular-nums; letter-spacing: -.015em;
  min-width: 128px;
}
.story-fact span { font-size: 14.5px; color: var(--text); line-height: 1.5; }
.story-fact--accent { background: var(--accent-mist); border-color: rgba(93,125,109,.18); }
.story-fact--accent b { color: var(--accent-dark); }
@media (max-width: 640px) {
  .story-fact { padding: 14px 16px; gap: 12px; }
  .story-fact b { font-size: 24px; min-width: 96px; }
}

/* Фото в слотах: подмена заглушек (position/overflow уже заданы базовым .ph;
   переопределять position здесь НЕЛЬЗЯ — ломает absolute у .hero__bg) */
.ph > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hero__bg > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Фото загружено: фолбэк-слои hero уходят, снимок виден, шейд читает текст */
.hero__bg:has(> img)::before,
.hero__bg:has(> img)::after { display: none; }
.hero__bg > img { z-index: 0; }
.hero__shade { z-index: 1; }
.hero__in { position: relative; z-index: 2; }

/* Портреты: не резать головы */
.ph > img { object-position: center top; }
[data-photo="hero-interior"] > img,
[data-photo="service-hero"] > img,
[data-photo="life-cabinet"] > img,
[data-photo="life-detail"] > img { object-position: center center; }
