@font-face {
  font-family: "Spectral Fallback";
  font-style: italic;
  font-weight: 400;
  src: local("Georgia Italic"), local("Georgia-Italic");
  size-adjust: 88.06%;
}

@font-face {
  font-family: "Spectral";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/spectral-italic-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Spectral";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/spectral-italic-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.home-page .promo-box.home-hero {
  --home-hero-side-inset: clamp(40px, calc(7.692vw - 58.46px), 80px);
  --home-hero-title-photo-gap: clamp(40px, calc(11.78vw - 56.7px), 120px);
  --home-hero-font-size: clamp(44px, 3.6vw, 62px);
  /* Fixed three-line heading: its final Spectral advance, including tracking.
     Geometry must not depend on the current fallback font or deferred JS. */
  --home-hero-title-width: calc(7.725 * var(--home-hero-font-size));
  --home-hero-narrowing: clamp(0, tan(atan2(calc(100vw - 820px), 780px)), 1);
  --home-hero-group-shift: clamp(0px, calc((100vw - 820px) * 0.2), 80px);
  --home-hero-base-photo: calc(var(--home-hero-side-inset) + var(--home-hero-title-width) + var(--home-hero-title-photo-gap));
  --home-hero-photo-start: calc(var(--home-hero-base-photo) +
    (100cqw - var(--home-hero-side-inset) - var(--home-hero-group-shift) - var(--home-hero-base-photo)) *
    0.2 * var(--home-hero-narrowing));
  --home-hero-group-translate: calc(-1 * var(--home-hero-group-shift));
  --home-hero-content-shift: calc(max(0px, var(--home-hero-photo-start) -
    var(--home-hero-side-inset) - var(--home-hero-title-width)) - var(--home-hero-group-shift));
  container-type: inline-size;
  position: relative;
  height: clamp(330px, calc(66.667svh - 160px), 560px) !important;
  min-height: clamp(330px, calc(66.667svh - 160px), 560px) !important;
  max-height: clamp(330px, calc(66.667svh - 160px), 560px);
  margin-bottom: 0 !important;
  overflow: hidden;
  color: #18352d;
  background: transparent;
}

.home-page .home-hero .container {
  position: relative;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0 !important;
  display: flex;
  align-items: center;
  padding-inline: var(--home-hero-side-inset);
}

.home-hero__content {
  position: relative;
  z-index: 2;
  width: 47%;
  padding: 22px 0;
  transform: translateX(var(--home-hero-content-shift, 0px));
}

.home-hero__visual {
  position: absolute;
  z-index: 1;
  inset: 0 var(--home-hero-side-inset) 0
    var(
      --home-hero-photo-start,
      calc(var(--home-hero-title-end, 50%) + var(--home-hero-title-photo-gap))
    );
  display: flex;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: 0 34px 34px 0;
  transform: translateX(var(--home-hero-group-translate, 0px));
}

.home-hero__visual img {
  width: 100%;
  max-width: none;
  height: 100%;
  display: block;
  margin-left: auto;
  object-fit: cover;
  object-position: center center;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgb(0 0 0 / 15%) 5%, rgb(0 0 0 / 38%) 12%, rgb(0 0 0 / 70%) 20%, #000 28%);
  mask-image: linear-gradient(to right, transparent 0%, rgb(0 0 0 / 15%) 5%, rgb(0 0 0 / 38%) 12%, rgb(0 0 0 / 70%) 20%, #000 28%);
}

.home-hero__title {
  width: var(--home-hero-title-width);
  max-width: 690px;
  margin: 0;
  font-family: "Spectral", "Spectral Fallback", Georgia, "Times New Roman", serif;
  font-size: var(--home-hero-font-size);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-align: left;
  text-wrap: balance;
  white-space: nowrap;
}

.home-hero__description {
  width: 18.6225em;
  max-width: 620px;
  margin: 16px 0 0;
  margin-left: var(--home-hero-description-offset, 0px);
  color: #59615e;
  font: 400 19px/1.4 var(--second-family);
  text-align: left;
}

.home-hero__description > span {
  display: block;
  white-space: nowrap;
}

.home-hero__messengers {
  display: none;
}

.home-hero__controls {
  width: var(--home-hero-title-width, auto);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 20px;
  margin-left: var(--home-hero-title-offset, 0px);
}

.home-hero__button {
  min-width: 212px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 12px;
  border: 1px solid #536b43;
  border-radius: 999px;
  color: #fff;
  background: #536b43;
  font: 600 16px/1 var(--second-family);
  letter-spacing: -0.015em;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, transform 0.2s;
}

.home-hero__button:hover,
.home-hero__button:focus-visible {
  color: #fff;
  background: #405534;
  transform: translateY(-1px);
}

.home-hero__button--outline {
  min-width: 220px;
  color: #263e3b;
  background: rgb(248 247 242 / 72%);
  backdrop-filter: blur(5px);
}

.home-hero__button--outline:hover,
.home-hero__button--outline:focus-visible {
  color: #fff;
  background: #536b43;
}

.home-doctors {
  padding: 18px 0 clamp(38px, 5vw, 70px);
  background: transparent;
}

.home-doctors .container {
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.home-doctors__heading {
  display: none;
}

.home-doctors__grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 64px) / 5);
  grid-template-columns: none;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 0 14px;
  scroll-behavior: auto;
  scroll-snap-type: none;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

.home-doctors__grid::-webkit-scrollbar {
  display: none;
}

.home-doctors__grid[data-wheel-active="true"] {
  cursor: ew-resize;
}

.home-doctors__card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  color: #213b33;
  background: rgb(247 244 236 / 88%);
  box-shadow: 0 16px 40px rgb(54 70 47 / 7%);
  transition: transform 0.2s, box-shadow 0.2s;
  scroll-snap-align: start;
}

.home-doctors__card:hover,
.home-doctors__card:focus-visible {
  color: #213b33;
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgb(54 70 47 / 12%);
}

.home-doctors__photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  overflow: hidden;
  background: linear-gradient(145deg, #eef0e7, #e2e5da);
}

.home-doctors__photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 22%;
}

.home-doctors__photo--logo {
  display: grid;
  place-items: center;
}

.home-doctors__photo img.home-doctors__logo {
  width: min(78%, 190px);
  height: auto;
  max-height: 72%;
  object-fit: contain;
}

.home-doctors__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #586d46;
  font: 500 42px/1 Georgia, "Times New Roman", serif;
}

.home-doctors__card-body {
  min-height: 76px;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  padding: 7px 13px;
}

.home-doctors__card-body strong {
  font: 600 14px/1.2 var(--second-family);
}

.home-doctors__card-body > span {
  color: #63725a;
  font: 500 12px/1.2 var(--second-family);
}

.home-doctors__card-body > .home-doctors__experience,
.home-doctors__card-body > .home-doctors__degree {
  margin-top: auto;
  color: #526547;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.1;
}

.home-certificates {
  padding: clamp(42px, 5vw, 78px) 0 clamp(54px, 6vw, 92px);
  background: transparent;
}

.home-certificates .container {
  padding-inline: clamp(18px, 4.1vw, 80px);
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.home-certificates__heading {
  margin-bottom: clamp(22px, 2.4vw, 38px);
  text-align: center;
}

.home-certificates__heading h2 {
  margin: 0;
  color: #173b34;
  font: 400 clamp(38px, 4vw, 64px)/1.05 "Spectral", Georgia, serif;
}

.home-certificates__heading p {
  margin: 8px 0 0;
  color: #60705d;
  font: 500 clamp(15px, 1.2vw, 19px)/1.4 var(--second-family);
}

.home-certificates__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 54px) / 4);
  grid-template-columns: none;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 18px;
  scroll-behavior: auto;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

.home-certificates__track::-webkit-scrollbar {
  display: none;
}

.home-certificates__track[data-wheel-active="true"] {
  cursor: ew-resize;
}

.home-certificates__card {
  min-width: 0;
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgb(83 107 67 / 14%);
  border-radius: 22px;
  background: rgb(247 244 236 / 72%);
  box-shadow: 0 16px 42px rgb(54 70 47 / 8%);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease,
    background-color 0.22s ease;
}

.home-certificates__card:hover,
.home-certificates__card:focus-visible {
  transform: translateY(-3px);
  background: rgb(231 234 219 / 82%);
  box-shadow: 0 20px 46px rgb(54 70 47 / 13%);
}

.home-certificates__card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transform: rotate(var(--certificate-rotation, 0deg));
}

.home-certificates__card[data-certificate-rotation="90"] img,
.home-certificates__card[data-certificate-rotation="270"] img {
  width: 75%;
}

@media (max-width: 900px) {
  .home-certificates__track {
    grid-auto-columns: calc((100% - 14px) / 2);
    gap: 14px;
  }
}

@media (max-width: 560px) {
  .home-certificates__track {
    grid-auto-columns: min(86vw, 340px);
  }
}

@media (max-width: 1500px) {
  .home-page .promo-box.home-hero {
    --home-hero-font-size: clamp(40px, 3.4vw, 50px);
  }

  .home-hero__content {
    width: 45%;
    padding-block: 18px;
  }

  .home-hero__title {
    font-size: var(--home-hero-font-size);
  }

  .home-hero__description {
    max-width: 500px;
    margin-top: 13px;
    font-size: 11.9px;
  }

  .home-hero__controls {
    gap: 13px;
    margin-top: 16px;
  }

  .home-hero__button {
    min-width: 178px;
    min-height: 41px;
    padding-inline: 10px;
    font-size: 16px;
  }

  .home-hero__button--outline {
    min-width: 178px;
  }
}

@media (max-width: 1020px) {
  .home-page .promo-box.home-hero {
    --home-hero-font-size: 40px;
  }

  .home-hero__content {
    width: 46%;
  }

  .home-hero__title {
    font-size: var(--home-hero-font-size);
  }

  .home-hero__description {
    max-width: 340px;
  }

}

@media (min-width: 821px) {
  .home-doctors__card[data-doctor-id="migura-anna"] .home-doctors__photo img {
    object-position: center 12%;
  }

  .home-doctors__card[data-doctor-id="migura-sergey"] .home-doctors__photo img {
    object-position: center 45%;
  }

  .home-doctors__card[data-doctor-id="gurman"] .home-doctors__photo img {
    object-position: center calc(22% + 22px);
  }

  .home-doctors__card[data-doctor-id="gurman"] .home-doctors__photo {
    background: #f0f0ef;
  }
}

@media (max-width: 820px) {
  .home-page .promo-box.home-hero {
    height: auto !important;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }

  .home-page .home-hero .container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 25px 18px 0;
  }

  .home-hero__content {
    display: contents;
  }

  .home-hero__visual {
    position: relative;
    inset: auto;
    z-index: 1;
    width: calc(100% + 36px);
    min-height: 390px;
    order: 2;
    margin-top: 10px;
    margin-inline: -18px;
    border-radius: 0;
    -webkit-mask-image: none;
    mask-image: none;
    transform: none;
  }

  .home-hero__visual img {
    width: 100%;
    min-width: 100%;
    height: 100% !important;
    margin-left: 0;
    object-fit: cover;
    object-position: 56% center;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .home-hero__title {
    width: calc(100% - 40px);
    max-width: 650px;
    order: 1;
    margin-inline: auto;
    font-size: clamp(32px, 8.16vw, 46.4px);
    font-weight: 500;
    line-height: 0.833;
  }

  .home-hero__description {
    width: calc(100% - 40px);
    max-width: 650px;
    order: 4;
    margin-right: auto;
    margin-top: 10px;
    margin-bottom: 26px;
    margin-left: auto;
    font-size: 17px;
    line-height: 1.12;
  }

  .home-hero__description > span {
    display: inline;
    white-space: normal;
  }

  .home-hero__messengers {
    width: calc(100% - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    order: 5;
    gap: 10px;
    margin: -6.8px auto 18px;
  }

  .home-hero__messenger {
    width: 46.8px;
    height: 46.8px;
    display: inline-flex;
    flex: 0 0 46.8px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 5px 12px rgb(52 71 45 / 12%);
    cursor: pointer;
  }

  .home-hero__messenger img {
    width: 26px;
    height: 26px;
    display: block;
    filter: brightness(0) invert(1);
  }

  .home-hero__messenger--telegram { background: #2aabee; }
  .home-hero__messenger--whatsapp { background: #25d366; }

  .home-hero__controls {
    display: grid;
    width: calc(100% - 65px);
    max-width: 625px;
    grid-template-columns: 1fr;
    order: 3;
    gap: 11px;
    margin: 5.6px auto 0;
  }

  .home-hero__button,
  .home-hero__button--outline {
    width: 100%;
    min-width: 0;
    min-height: 37px;
    padding: 9px 14px;
    font-size: 15px;
  }

  .home-doctors {
    padding: 14px 0 38px;
  }

  .home-doctors .container {
    padding-inline: 18px;
  }

  .home-doctors__heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
  }

  .home-doctors__heading h2 {
    margin: 0;
    color: #213b33;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 41px;
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1;
    white-space: nowrap;
  }

  .home-doctors__heading > a {
    display: none;
  }

  .home-doctors__grid {
    grid-auto-columns: minmax(245px, 82vw);
    gap: 14px;
    scroll-snap-type: x mandatory;
  }

  .home-doctors__card {
    scroll-snap-align: start;
  }

  .home-doctors__photo {
    aspect-ratio: 4 / 3;
  }

  .home-doctors__photo img {
    object-position: center top;
  }

  .home-doctors__card-body {
    min-height: 98px;
    gap: 7px;
    padding: 15px 16px 18px;
  }

  .home-doctors__card-body strong {
    font-size: 16px;
    line-height: 1.25;
  }

  .home-doctors__card-body > span {
    font-size: 13px;
    line-height: 1.35;
  }

  .home-doctors__card-body > .home-doctors__experience {
    display: block;
  }

  .home-page .home-doctors__card {
    height: 317px;
  }

  .home-page .home-doctors__photo {
    min-height: 0;
    flex: 1 1 auto;
    aspect-ratio: auto;
  }

  .home-page .home-doctors__card-body {
    height: 108px;
    min-height: 108px;
    flex: 0 0 108px;
    justify-content: flex-end;
    gap: 3px;
    padding: 8px 13px 10px;
  }

  .home-page .home-doctors__card-body strong {
    font-size: 16px;
    line-height: 1.2;
  }

  .home-page .home-doctors__card-body > span {
    font-size: 13px;
    line-height: 1.25;
  }

  .home-page .home-doctors__card-body > .home-doctors__experience,
  .home-page .home-doctors__card-body > .home-doctors__degree {
    margin-top: 0;
    font-size: 10px;
    line-height: 1.1;
  }

  .home-page .home-doctors__card[data-doctor-id="migura-andrey"] .home-doctors__photo img {
    object-position: center -28px;
  }

  .home-page .home-doctors__card[data-doctor-id="migura-anna"] .home-doctors__photo img {
    object-position: center top;
  }

  .home-doctors__card[data-doctor-id="migura-sergey"] .home-doctors__photo img {
    object-position: center 45%;
  }

  .home-page .home-doctors__card[data-doctor-id="vahrushev"] .home-doctors__photo img {
    object-position: center -22px;
  }

  .home-page .home-doctors__card[data-doctor-id="gurman"] .home-doctors__photo img {
    object-position: center -7px;
  }

  .home-page .home-doctors__card[data-doctor-id="klochkova"] .home-doctors__photo img {
    object-position: center -16px;
  }

  .home-page .home-doctors__card[data-doctor-id="pivovarova"] .home-doctors__photo img {
    object-position: center -18px;
  }

  .home-page .home-doctors__card[data-doctor-id="pahomova"] .home-doctors__photo img {
    object-position: center -17px;
  }

}

@media (max-width: 520px) {
  .home-page .home-hero .container {
    padding-top: 20px;
  }

  .home-hero__title {
    font-size: clamp(30.4px, 9.2vw, 39.2px);
  }

  .home-hero__controls {
    grid-template-columns: 1fr;
  }

  .home-hero__visual {
    min-height: clamp(280px, 75vw, 320px);
  }

  .home-hero__visual img {
    transform: scale(1.44);
    transform-origin: 56% center;
  }

}

/* A wide mobile viewport is used by tablets in portrait orientation.
   Without an explicit height the source image keeps its natural 4:3 ratio
   here, making the hero photo too tall and pushing the messenger buttons
   below the first screen. */
@media (min-width: 521px) and (max-width: 820px) {
  .home-hero__visual {
    height: clamp(260px, 36vw, 300px);
    min-height: 0;
  }
}
