/* ============================================================
   Главная (/). Поверх uslugi.css (токены us-*, ритм блоков, кнопки, общие блоки), vrachi.css (ленты и
   просмотр фото) и info.css (строки контактов kt-*, карта). Разметка — lib/home.php, классы hm-*.
   Движение то же, что на страницах услуг: тихое появление блока при прокрутке и отклик на наведение.
   Видео первого экрана — реальная съёмка клиники, без звука, на телефоне своя вертикальная версия.
   ============================================================ */

main.usl-home { padding-top: 0; }

/* ---------- 1. первый экран ---------- */
.hm-hero { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between;
  min-height: min(calc(100svh - 114px), 900px); overflow: hidden; }
.hm-hero-media { position: absolute; inset: 0; z-index: -2; background: #0d0e10;
  -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }
.hm-hero-media img, .hm-hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hm-hero-video { opacity: 0; transition: opacity .8s ease; }
.hm-hero-video.is-on { opacity: 1; }
.hm-hero-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 38%, rgba(13, 14, 16, .44) 0%, rgba(13, 14, 16, .7) 62%, rgba(13, 14, 16, .9) 100%),
    linear-gradient(180deg, rgba(13, 14, 16, .62) 0%, rgba(13, 14, 16, .32) 30%, rgba(13, 14, 16, .66) 72%, rgba(13, 14, 16, 0) 100%); }
main.usl > .hm-hero + .us-sec > .container::before { display: none; }
.hm-hero-in { display: flex; flex-direction: column; align-items: center; text-align: center;
  padding-top: clamp(56px, 9vh, 112px); padding-bottom: clamp(36px, 5vh, 56px); }
.hm-h1 { margin: 0; max-width: 15em; font-family: var(--font-heading); font-weight: 400; font-size: clamp(2.5rem, 5.2vw, 4.75rem);
  line-height: 1.02; letter-spacing: .005em; color: #fff; text-wrap: balance; text-shadow: 0 2px 30px rgba(0, 0, 0, .35); }
.hm-logo { display: block; width: clamp(190px, 24vw, 340px); height: auto; margin: clamp(18px, 2.4vw, 30px) auto 0; }
.hm-lead { max-width: 40em; margin: clamp(16px, 2vw, 24px) auto 0; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.6;
  color: rgba(255, 255, 255, .88); text-wrap: pretty; }
.hm-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; }
.hm-badges a, .hm-badges .hm-badge-in { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: rgba(13, 14, 16, .45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: 14.5px; color: #fff; text-decoration: none; }
.hm-badges a:hover { border-color: rgba(129, 210, 255, .55); color: #fff; }
.hm-badges svg { flex: none; color: var(--us-link); }
.hm-badges li:nth-child(2) svg { color: #ffc83d; }
.hm-cta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: clamp(24px, 3vw, 34px); }
.us-btn--lg { min-height: 56px; padding: 0 30px; font-size: 16.5px; }
.hm-cta-tel { background: rgba(13, 14, 16, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hm-msg { display: flex; gap: 8px; }
.hm-msg a { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%;
  background: rgba(13, 14, 16, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hm-msg a:hover { border-color: rgba(129, 210, 255, .6); }
.hm-msg img { display: block; width: 24px; height: 24px; border-radius: 6px; }
/* первый экран: сам значок мессенджера и есть круг */
.hm-msg:not(.hm-msg--sm) a { overflow: hidden; padding: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  transition: box-shadow .2s ease; }
.hm-msg:not(.hm-msg--sm) a:hover { box-shadow: 0 0 0 2px rgba(129, 210, 255, .7); }
.hm-msg:not(.hm-msg--sm) img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hm-msg span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 2. цифры внизу первого экрана ---------- */
.hm-stats-wrap { padding-bottom: clamp(24px, 3.4vw, 44px); }
.hm-stats-h { margin: 0 0 14px; font-family: var(--font-body); font-weight: 500; }
.hm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none;
  border-top: 1px solid rgba(255, 255, 255, .16); }
.hm-stats li { padding: 22px 20px 0; border-left: 1px solid rgba(255, 255, 255, .12); text-align: center; }
.hm-stats li:first-child { border-left: 0; }
.hm-stats b { font-family: var(--font-heading); font-weight: 400; font-size: clamp(2.3rem, 3.8vw, 3.5rem); line-height: 1; color: #fff; white-space: nowrap; }
.hm-stat-u { margin-left: 8px; font-size: 16px; color: var(--accent); }
.hm-stat-d { display: block; margin: 10px auto 0; max-width: 18em; font-size: 14.5px; line-height: 1.45; color: rgba(255, 255, 255, .72); }

/* ---------- шапки блоков главной ---------- */
.hm-head .us-answer { align-self: end; }
.hm-more { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 18px; font-size: 15px; color: var(--us-link); }
.hm-more svg { transition: transform .2s ease; }

/* ---------- 3. с чем помогаем ---------- */
.hm-help-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.hm-help-card { position: relative; display: flex; flex-direction: column; height: 100%; padding: 28px 28px 26px; border: 1px solid var(--us-panel-line);
  border-radius: 18px; background: var(--us-panel); color: inherit; text-decoration: none; }
.hm-help-card:hover { border-color: rgba(129, 210, 255, .42); background: rgba(129, 210, 255, .045); color: inherit; }
.hm-help-card:hover .hm-more svg, .hm-svc-card:hover .hm-more svg { transform: translateX(3px); }
.hm-sticker { display: grid; place-items: center; flex: none; width: 52px; height: 52px; margin-bottom: 18px; border-radius: 15px;
  border: 1px solid rgba(129, 210, 255, .28); background: linear-gradient(140deg, rgba(129, 210, 255, .2) 0%, rgba(52, 99, 182, .26) 100%);
  color: #9fdcff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.hm-help-card:hover .hm-sticker { border-color: rgba(129, 210, 255, .5); }
.hm-help-card h3 { margin: 0 0 10px; font-family: var(--font-body); font-weight: 600; font-size: 19px; line-height: 1.35; color: #fff; }
.hm-help-card p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--us-muted); }

/* ---------- 4. популярные услуги и цены ---------- */
.hm-svc-box .us-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.hm-svc-box .us-head .us-kicker { grid-column: 1 / -1; }
.hm-svc-nav { grid-column: 2; }
.hm-svc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.hm-svc-card { position: relative; isolation: isolate; display: flex; align-items: stretch; height: 100%; min-height: 470px; overflow: hidden;
  border: 1px solid var(--us-panel-line); border-radius: 18px; background: #15171a; color: #fff; text-decoration: none; }
.hm-svc-ph { position: absolute; inset: 0; z-index: -2; }
.hm-svc-ph img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.16, 1, .3, 1), filter .3s ease;
  filter: saturate(.92) brightness(.92); }
.hm-svc-card::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(13, 14, 16, 0) 0%, rgba(13, 14, 16, .3) 26%, rgba(13, 14, 16, .88) 44%, rgba(13, 14, 16, .97) 100%); }
.hm-svc-card:hover { border-color: rgba(129, 210, 255, .45); color: #fff; }
.hm-svc-card:hover .hm-svc-ph img { transform: scale(1.04); filter: saturate(1) brightness(1); }
.hm-svc-body { display: flex; flex-direction: column; width: 100%; padding: 168px 22px 20px; }
.hm-svc-price { align-self: flex-start; margin-bottom: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(13, 14, 16, .62); border: 1px solid rgba(129, 210, 255, .35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; }
.hm-svc-card h3 { min-height: 2.24em; margin: 0 0 8px; font-family: var(--font-heading); font-weight: 400; font-size: clamp(1.35rem, 1.8vw, 1.6rem); line-height: 1.12; color: #fff; }
.hm-svc-d { font-size: 14.5px; line-height: 1.5; color: rgba(255, 255, 255, .78); }
.hm-svc-card .hm-more { padding-top: 14px; }
.hm-svc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin: 28px 0 0; font-size: 13px; color: var(--us-muted); }

/* ---------- 5. бесплатная консультация ---------- */
.hm-consult { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 64px); align-items: stretch;
  padding: clamp(32px, 4.4vw, 60px); border: 1px solid rgba(129, 210, 255, .22); border-radius: 22px;
  background: linear-gradient(118deg, rgba(52, 99, 182, .26) 0%, rgba(52, 99, 182, .08) 46%, rgba(129, 210, 255, .04) 100%); }
.hm-consult .us-kicker { margin-bottom: 16px; }
.hm-consult-text { margin: 18px 0 0; max-width: 34em; font-size: 17.5px; line-height: 1.6; color: rgba(255, 255, 255, .86); }
.hm-consult--solo { grid-template-columns: minmax(0, 1fr); }
.hm-consult-body { display: flex; flex-direction: column; justify-content: center; }
.hm-consult-act { display: flex; flex-direction: column; align-items: stretch; gap: 14px; max-width: 34em; margin-top: 28px; }
.hm-consult-act .us-btn { width: 100%; }
.hm-consult-ph { margin: 0; min-height: 300px; overflow: hidden; border-radius: 16px; background: var(--us-ph); }
.hm-consult-ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hm-consult-note { margin: 0; max-width: 34em; font-size: 13px; line-height: 1.55; color: rgba(183, 183, 183, .62); }
main.usl > .hm-consult-sec > .container::before, main.usl > .hm-consult-sec + .us-sec > .container::before { display: none; }

/* ---------- 6. о клинике и слово врача ---------- */
.hm-about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 80px); align-items: stretch; }
.hm-about-grid--solo { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.hm-about-ph { position: relative; margin: 0; min-height: 380px; overflow: hidden; border-radius: 20px; background: var(--us-ph); }
/* фото по высоте текста рядом, лишний фон над головой срезан */
.hm-about-ph img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22% !important; }
.hm-about-body { display: flex; flex-direction: column; justify-content: center; }
.hm-about-text { margin: 20px 0 0; font-size: 17px; line-height: 1.65; color: var(--us-muted); max-width: 36em; }
.hm-quote { position: relative; margin: clamp(26px, 3vw, 40px) 0 0; padding: 0 0 0 clamp(22px, 2.6vw, 34px); border-left: 2px solid var(--accent); }
.hm-quote p { margin: 0; font-family: var(--font-heading); font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.35; color: #fff; }
.hm-quote footer { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; font-size: 15px; }
.hm-quote footer a { color: #fff; font-weight: 600; text-decoration: none; }
.hm-quote footer a:hover { color: var(--us-link); }
.hm-quote footer span { color: var(--us-muted); }

/* ---------- 7. почему доверяют ---------- */
.hm-trust-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px clamp(24px, 3vw, 48px); margin: 0; padding: 0; list-style: none; }
.hm-trust-grid li { padding-top: 22px; border-top: 1px solid var(--us-line-2); }
.hm-trust-grid .hm-sticker { width: 48px; height: 48px; margin-bottom: 16px; border-radius: 14px; }
.hm-trust-grid h3 { margin: 0 0 8px; font-family: var(--font-body); font-weight: 600; font-size: 18.5px; line-height: 1.35; color: #fff; }
.hm-trust-grid p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--us-muted); }

/* ---------- 13. технологии ---------- */
/* общая сетка строк для всех карточек (subgrid): фото, тип, название, текст и «Где используется» на одном уровне */
.hm-tech-rail { grid-template-rows: repeat(5, auto); row-gap: 0; }
.hm-tech-card { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.hm-tech-card .us-eq-text { margin-bottom: 14px; }
.hm-tech-name { margin: 6px 0 0; font-family: var(--font-body); font-weight: 600; font-size: 18px; line-height: 1.3; color: #fff; }
.hm-tech-use { margin: 0; align-self: start; padding-top: 12px; border-top: 1px solid var(--us-line); font-size: 13.5px; line-height: 1.5; color: var(--us-muted); }
.hm-tech-use span { color: rgba(255, 255, 255, .55); }
.hm-tech-use a { color: var(--us-link); }

/* ---------- 14. клиника изнутри: ролики и фото ---------- */
.hm-reels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.hm-reel { position: relative; aspect-ratio: 9 / 16; overflow: hidden; border: 1px solid var(--us-panel-line); border-radius: 18px; background: #000; }
.hm-reel-video { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
.hm-reel-play { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 12px;
  padding: 16px; border: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, .72) 100%); cursor: pointer; color: #fff; text-align: left; font: inherit; }
.hm-reel-ic { display: grid; place-items: center; width: 54px; height: 54px; padding-left: 3px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 50%;
  background: rgba(13, 14, 16, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background-color .2s ease, border-color .2s ease; }
.hm-reel-play:hover .hm-reel-ic { background: var(--us-blue); border-color: var(--us-blue); }
.hm-reel-play:focus-visible { outline: 2px solid var(--us-link); outline-offset: -4px; }
.hm-reel-cap { font-size: 15px; font-weight: 600; line-height: 1.35; color: #fff; }
.hm-reel-dur { position: absolute; top: 12px; right: 12px; padding: 4px 9px; border-radius: 999px; background: rgba(13, 14, 16, .6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 12.5px; color: #fff; pointer-events: none; }
.hm-reel.is-playing .hm-reel-play, .hm-reel.is-playing .hm-reel-dur { display: none; }
.hm-photos-box { margin-top: 16px; }
.hm-photos-nav { display: flex; justify-content: flex-end; margin-top: 12px; }
.hm-photos-nav .us-eq-nav[hidden] + * { display: none; }
.dr-docs.hm-photos { grid-auto-columns: calc((100% - 3 * 16px) / 4.2); }
.hm-photos .dr-doc { aspect-ratio: 4 / 3; border-radius: 14px; }

.us-promo .us-accent { white-space: nowrap; }

/* ---------- 18. адрес ---------- */
.hm-addr-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 64px); align-items: stretch; }
.hm-addr-grid--solo { grid-template-columns: minmax(0, 1fr); }
.hm-addr-facts { grid-template-columns: minmax(0, 1fr); margin-top: 26px; }
.hm-addr-act { margin-top: 28px; }
.hm-addr-map { height: auto; min-height: 460px; }

/* ---------- 19. запись: телефон и мессенджеры ---------- */
.hm-bk-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 24px; position: relative; }
.hm-bk-tel { font-size: 21px; font-weight: 700; color: #fff; text-decoration: none; white-space: nowrap; }
.hm-bk-tel:hover { color: var(--us-link); }
.hm-msg--sm a { width: auto; height: 40px; padding: 0 14px 0 10px; gap: 8px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 14px; color: #fff; text-decoration: none; }
.hm-msg--sm img { width: 20px; height: 20px; }
.hm-msg--sm span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }

/* ---------- адаптив ---------- */
@media (min-width: 961px) and (max-height: 860px) {
  .hm-hero-in { padding-top: clamp(28px, 5vh, 56px); padding-bottom: 20px; }
  .hm-logo { width: clamp(150px, 15vw, 230px); margin-top: 12px; }
  .hm-lead { margin-top: 12px; }
  .hm-badges { margin-top: 16px; }
  .hm-cta { margin-top: 18px; }
  .hm-stats li { padding-top: 14px; }
  .hm-stats b { font-size: clamp(2rem, 3vw, 2.6rem); }
  .hm-stat-d { margin-top: 6px; }
}
@media (max-width: 1100px) {
  .hm-svc { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hm-reels { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 960px) {
  .hm-help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-svc { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: calc((100% - 2 * 16px) / 2.4); overflow-x: auto;
    scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
  .hm-svc::-webkit-scrollbar { display: none; }
  .hm-svc > li { scroll-snap-align: start; }
  .hm-consult { grid-template-columns: minmax(0, 1fr); }
  .hm-about-grid { grid-template-columns: minmax(0, 1fr); }
  .hm-about-ph { max-width: 420px; min-height: 0; aspect-ratio: 1 / 1; }
  .hm-reels { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: calc((100% - 2 * 12px) / 2.6); overflow-x: auto;
    scroll-snap-type: x mandatory; scrollbar-width: none; }
  .hm-reels::-webkit-scrollbar { display: none; }
  .hm-reels > li { scroll-snap-align: start; }
  .dr-docs.hm-photos { grid-auto-columns: calc((100% - 16px) / 2.2); }
  .hm-addr-grid { grid-template-columns: minmax(0, 1fr); }
  .hm-addr-map { min-height: 380px; }
  .hm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-stats li { padding: 18px 18px 0; }
  .hm-stats li:nth-child(3) { border-left: 0; }
  .hm-stats li:nth-child(n+3) { margin-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); }
}
@media (min-width: 641px) and (max-width: 960px) {
  .hm-about-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
  .hm-about-ph { max-width: none; min-height: 380px; aspect-ratio: auto; }
}
@media (max-width: 640px) {
  .hm-hero { min-height: 0; }
  .hm-hero-in { padding-top: 40px; padding-bottom: 28px; }
  .hm-h1 { font-size: clamp(2.15rem, 9.4vw, 2.8rem); }
  .hm-logo { width: 190px; }
  .hm-lead { font-size: 16px; }
  .hm-badges { gap: 8px; margin-top: 20px; }
  .hm-badges a, .hm-badges .hm-badge-in { min-height: 44px; padding: 0 14px; font-size: 13.5px; }
  .hm-cta { width: 100%; }
  .hm-cta .us-btn { flex: 1 1 100%; }
  .hm-msg { justify-content: center; width: 100%; }
  .hm-msg:not(.hm-msg--sm) a { width: 52px; height: 52px; }
  .hm-msg--sm a { height: 44px; }
  .us-btn--lg { padding: 0 18px; font-size: 16px; white-space: nowrap; }
  .hm-stats li { min-width: 0; }
  .hm-stat-u { display: block; margin: 6px 0 0; font-size: 14px; }
  .hm-quote footer a { display: inline-block; padding: 10px 0; margin: -10px 0; }
  .hm-bk-tel { display: inline-flex; align-items: center; min-height: 44px; }
  .hm-consult-ph { order: -1; min-height: 0; aspect-ratio: 16 / 10; }
  .hm-stats b { font-size: 2.3rem; }
  .hm-stat-d { font-size: 13.5px; }
  .hm-help-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .hm-help-card { padding: 22px 20px; }
  .hm-svc { grid-auto-columns: 78%; gap: 12px; margin: 0 calc(-1 * var(--us-pad)); padding: 0 var(--us-pad) 4px; scroll-padding: 0 var(--us-pad); }
  .hm-svc-card { min-height: 390px; }
  .hm-consult { padding: 26px 20px; border-radius: 18px; }
  .hm-consult-act .us-btn { width: 100%; }
  .hm-trust-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .hm-reels { grid-auto-columns: 62%; margin: 0 calc(-1 * var(--us-pad)); padding: 0 var(--us-pad); scroll-padding: 0 var(--us-pad); }
  .dr-docs.hm-photos { grid-auto-columns: 78%; }
  .hm-addr-map { min-height: 340px; }
  .hm-bk-contact { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-hero-video { display: none; }
  .hm-svc-ph img { transition: none; }
}
