/* ==========================================================================
   Главная страница (/) - верстка по термоэкодом.рф.
   Шрифт Montserrat (self-hosted, OFL), палитра рф: зеленый #729028,
   текст #4b4e4a, подсказки #ffee74.
   ========================================================================== */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/montserrat-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/montserrat-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;
}

.hm {
  --hm-green: #729028;
  --hm-green-dark: #5f7a1f;
  --hm-text: #4b4e4a;
  --hm-yellow: #ffee74;
  font-family: 'Montserrat', system-ui, sans-serif;
  color: var(--hm-text);
  background: #fff;
}

/* ---------- Первый экран ---------- */
.hm-hero { padding: 38px 20px 0; }
.hm-hero__frame { position: relative; max-width: 1200px; margin: 0 auto; }
.hm-hero__pic, .hm-hero__img { display: block; width: 100%; height: auto; }

.hm-header__logo { position: absolute; left: 2.6%; top: .3%; width: 19%; z-index: 3; }
.hm-header__logo img { display: block; width: 100%; height: auto; }

.hm-header__nav { position: absolute; left: 31.5%; top: 3.6%; z-index: 3; display: flex; gap: clamp(24px, 9vw, 130px); }
.hm-header__nav a,
.hm-header__phone {
  font-size: clamp(13px, 1.25vw, 18px); font-weight: 500; letter-spacing: .02em;
  color: var(--hm-text); text-decoration: none; text-transform: uppercase;
  line-height: 1.2; padding: 6px 0; transition: color .2s;
}
.hm-header__phone { position: absolute; right: 2.6%; top: 3.6%; z-index: 3; text-transform: none; white-space: nowrap; }
.hm-header__nav a:hover, .hm-header__phone:hover { color: var(--hm-green); }

/* Ссылки разделов поверх картинки - только на телефоне (как на рф). */
.hm-header__mnav { display: none; }

.hm-header__burger {
  display: none; position: absolute; right: 3%; top: 2%; z-index: 4;
  width: 44px; height: 44px; border: 0; border-radius: 9999px; cursor: pointer;
  background: rgba(255,255,255,.92); color: var(--hm-text);
  align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.hm-header__burger svg { width: 22px; height: 22px; }
.hm-header__menu {
  position: absolute; right: 3%; top: calc(2% + 52px); z-index: 5; min-width: 240px;
  background: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  padding: 10px; flex-direction: column;
}
.hm-header__menu:not(.hidden) { display: flex; }
.hm-header__menu a {
  display: block; padding: 12px 14px; border-radius: 10px; font-weight: 600; font-size: 15px;
  text-transform: uppercase; letter-spacing: .02em; color: var(--hm-text); text-decoration: none;
}
.hm-header__menu a:hover { background: #f3f5ee; }
.hm-header__menu .hm-header__menu-phone { text-transform: none; margin-top: 6px; background: var(--hm-green); color: #fff; text-align: center; }
.hm-header__menu .hm-header__menu-phone:hover { background: var(--hm-green-dark); }

/* Точки-подсказки */
.hm-spot { position: absolute; left: var(--x); top: var(--y); z-index: 2; transform: translate(-50%, -50%); }
.hm-spot__btn {
  width: 40px; height: 40px; border-radius: 9999px; border: 0; cursor: pointer; padding: 0;
  background: var(--hm-yellow); color: #3a3a3a;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.18); transition: transform .2s;
}
.hm-spot__btn svg { width: 22px; height: 22px; }
.hm-spot:hover .hm-spot__btn, .hm-spot:focus-within .hm-spot__btn { transform: scale(1.1); }
.hm-spot__tip {
  position: absolute; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%);
  width: max-content; max-width: 260px; padding: 12px 16px; border-radius: 10px;
  background: #fff; color: #000; font-size: 14px; line-height: 1.5; text-align: left;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.hm-spot__tip a { color: var(--hm-green); text-decoration: none; border-bottom: 1px solid var(--hm-green); }
.hm-spot:hover .hm-spot__tip, .hm-spot:focus-within .hm-spot__tip { opacity: 1; visibility: visible; }

/* ---------- Текст и карточки направлений ---------- */
.hm-about { max-width: 1120px; margin: 0 auto; padding: 80px 20px 64px; }
/* Текст по ширине сетки карточек под ним, H1 - заголовок над текстом. */
.hm-about__intro { margin: 0 0 80px; text-align: center; font-size: 18px; font-weight: 400; line-height: 1.6; }
.hm-about__intro h1 {
  margin: 0 0 28px; font-size: 32px; font-weight: 800; line-height: 1.25; letter-spacing: .01em;
  text-transform: uppercase; color: var(--hm-text);
}
.hm-about__intro p { margin: 0 0 1.5em; }
.hm-about__intro p:last-child { margin-bottom: 0; }

.hm-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 80px; }
.hm-card { display: flex; flex-direction: column; }
.hm-card__img img { display: block; width: 100%; height: auto; }
.hm-card__body { flex: 1; padding: 40px 0 32px; }
.hm-card__title { margin: 0 0 1.4em; font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--hm-text); }
.hm-card__text { font-size: 17px; line-height: 1.6; }
.hm-card__text p { margin: 0 0 1.4em; }
.hm-card__text p:last-child { margin-bottom: 0; }
.hm-card__btn {
  display: flex; align-items: center; justify-content: center; height: 56px; border-radius: 12px;
  background: var(--hm-green); color: #fff; font-size: 17px; font-weight: 600; text-decoration: none;
  transition: background-color .2s;
}
.hm-card__btn:hover { background: var(--hm-green-dark); }

/* ---------- Адаптив ---------- */
@media (max-width: 899px) {
  .hm-header__nav, .hm-header__phone { display: none; }
  .hm-header__burger { display: flex; }
}
@media (max-width: 639px) {
  .hm-hero { padding: 12px 12px 0; }
  .hm-header__logo { left: 3%; top: 0; width: 44%; }
  .hm-header__burger { top: 1.2%; }
  .hm-header__menu { top: calc(1.2% + 52px); left: 3%; right: 3%; min-width: 0; }
  .hm-header__mnav {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; position: absolute; left: 4%; right: 4%; top: 24%; z-index: 3;
  }
  .hm-header__mnav a {
    font-size: 14px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--hm-text); text-decoration: none;
    padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.85); box-shadow: 0 2px 10px rgba(0,0,0,.08);
  }
  .hm-spot { left: var(--mx); top: var(--my); }
  .hm-spot--desktop { display: none; }
  .hm-spot__btn { width: 34px; height: 34px; }
  .hm-spot__tip { max-width: 220px; font-size: 13px; }
  .hm-spot--left .hm-spot__tip { left: auto; right: -12px; transform: none; }
  .hm-about { padding: 56px 16px 48px; }
  .hm-about__intro { font-size: 16px; margin-bottom: 56px; }
  .hm-about__intro h1 { margin-bottom: 20px; font-size: 22px; }
  .hm-cards { grid-template-columns: 1fr; gap: 56px; }
  .hm-card { text-align: center; }
  .hm-card__body { padding: 28px 0 24px; }
  .hm-card__title, .hm-card__text { font-size: 16px; }
}
@media (min-width: 640px) {
  .hm-spot--left .hm-spot__tip { left: auto; right: -12px; transform: none; }
}
