/* Новая главная, «Приложения» и 404 (v2). Общий файл. Тона и шрифты — из site-nav.css (--sn-*).
   Классы начинаются с hm- (не ad-, не banner, не promo). Телефон до 1023px, компьютер от 1024px. */

body.hm {
  margin: 0;
  background: var(--sn-bg);
  color: var(--sn-ink);
  font-family: var(--sn-font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hm-main {
  display: block;
  font-family: var(--sn-font);
  color: var(--sn-ink);
}
.hm-main .sn-wrap { box-sizing: border-box; }
.hm-main :where(h1, h2, h3, p) { margin: 0; }
.hm-main :where(a) { color: inherit; text-decoration: none; }
.hm-main a:focus-visible {
  outline: 3px solid var(--sn-blue);
  outline-offset: 3px;
  border-radius: 12px;
}
.hm-main svg { flex: none; display: block; }

/* Показ по ширине экрана: .hm-d — компьютер, .hm-m — телефон */
.hm-m, .hm-lead-m { display: inline; }
.hm-d, .hm-lead-d { display: none; }
@media (min-width: 1024px) {
  .hm-m, .hm-lead-m { display: none; }
  .hm-d, .hm-lead-d { display: inline; }
}

/* ---- Заголовок страницы ---- */
.hm-hero { padding: 28px 0 22px; }
.hm-hero h1 {
  font-family: var(--sn-font-head);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 820px;
}
.hm-lead {
  margin-top: 14px;
  font-size: 17px;
  color: #3D4566;
  max-width: 680px;
}
@media (min-width: 1024px) {
  .hm-hero { padding: 64px 0 40px; }
  .hm-hero h1 { font-size: 60px; line-height: 1.05; }
  .hm-lead { margin-top: 20px; font-size: 20px; }
}
.hm-hero-in { padding-top: 24px; }
@media (min-width: 1024px) {
  .hm-hero-in { padding: 24px 0 0; }
  .hm-hero-in .hm-lead { margin-top: 12px; max-width: 620px; }
}

/* ---- Две задачи ---- */
.hm-two-in {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hm-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 20px;
  border-radius: 24px;
}
.hm-panel-light { background: var(--sn-white); border: 1px solid var(--sn-line); }
.hm-panel-dark { background: var(--sn-ink); color: #fff; }
.hm-panel-head { display: flex; flex-direction: column; gap: 6px; }
.hm-kicker { font-size: 14px; font-weight: 600; color: var(--sn-blue-ink); }
.hm-panel-dark .hm-kicker { color: var(--sn-foot-label); }
.hm-panel h2 {
  font-family: var(--sn-font-head);
  font-size: 26px;
  line-height: 1.15;
  font-weight: 600;
}
.hm-rows { display: flex; flex-direction: column; }
.hm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 6px 0;
  border-top: 1px solid var(--sn-line-soft);
}
.hm-rows .hm-row:last-child { border-bottom: 1px solid var(--sn-line-soft); }
.hm-panel-dark .hm-row { border-top-color: var(--sn-foot-line); }
.hm-panel-dark .hm-rows .hm-row:last-child { border-bottom-color: var(--sn-foot-line); }
.hm-row-t { display: flex; flex-direction: column; min-width: 0; }
.hm-row-t strong { font-weight: 600; font-size: 17px; line-height: 1.35; }
.hm-row-t > span { font-size: 14px; color: var(--sn-muted); }
.hm-panel-dark .hm-row-t > span { color: var(--sn-foot-muted); }
.hm-row svg { color: var(--sn-blue); }
.hm-panel-dark .hm-row svg { color: var(--sn-foot-label); }
.hm-arr { display: none !important; }
.hm-row:hover .hm-row-t strong { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.hm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 17px;
  text-align: center;
}
.hm-btn-blue { background: var(--sn-blue); color: #fff !important; }
.hm-btn-white { background: #fff; color: var(--sn-ink) !important; }
.hm-btn:hover { opacity: .9; }
.hm-main .hm-btn-blue:focus-visible { outline-color: var(--sn-ink); }
.hm-main .hm-panel-dark a:focus-visible { outline-color: var(--sn-foot-label); }

@media (min-width: 1024px) {
  .hm-two-in { flex-direction: row; gap: 24px; align-items: stretch; }
  .hm-panel { flex: 1 1 0; min-width: 0; gap: 24px; padding: 40px; border-radius: 28px; }
  .hm-panel-head { gap: 10px; }
  .hm-panel h2 { font-size: 34px; }
  .hm-row { min-height: 88px; padding: 0; }
  .hm-row-t strong { font-size: 19px; }
  .hm-row-t > span { font-size: 15px; }
  .hm-arr { display: block !important; }
  .hm-chev { display: none !important; }
  .hm-btn { align-self: flex-start; padding: 14px 24px; min-height: 0; font-size: 17px; }
  .hm-panel .hm-rows { flex: none; }
}
@media (max-width: 1023px) {
  .hm-chev { display: block; }
}

/* ---- Новое ---- */
.hm-new { padding: 32px 0 8px; }
.hm-h3 {
  font-family: var(--sn-font-head);
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 12px;
}
.hm-new-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 0 16px 8px;
  scroll-snap-type: x proximity;
}
.hm-mini {
  flex: 0 0 248px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--sn-white);
  border: 1px solid var(--sn-line);
  border-radius: 20px;
  scroll-snap-align: start;
}
.hm-mini-t { display: flex; flex-direction: column; min-width: 0; }
.hm-mini-t strong { font-weight: 600; }
.hm-mini-t span { font-size: 14px; color: var(--sn-muted); }
.hm-mini .hm-tile { width: 48px; height: 48px; border-radius: 14px; font-size: 20px; }
.hm-mini:hover { border-color: #C5CBE3; }
@media (min-width: 1024px) {
  .hm-new { padding: 72px 0 88px; }
  .hm-h3 { font-size: 24px; margin-bottom: 20px; }
  .hm-new-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; overflow: visible; margin: 0; padding: 0; }
  .hm-mini { flex: none; gap: 16px; padding: 20px; }
  .hm-mini-t span { font-size: 15px; }
  .hm-mini .hm-tile { width: 52px; height: 52px; font-size: 22px; }
}

/* ---- Значки приложений: буква или настоящая иконка ---- */
.hm-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-family: var(--sn-font-head);
  font-weight: 700;
  font-size: 22px;
  flex: none;
}
.hm-tile-ink { background: var(--sn-ink); color: #fff; }
.hm-tile-blue { background: var(--sn-blue); color: #fff; }
.hm-tile-soft { background: var(--sn-blue-soft); color: var(--sn-blue-ink); }
img.hm-tile { object-fit: cover; background: transparent; }

/* ---- Приложения ---- */
.hm-apps { padding: 28px 0 0; }
.hm-apps-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.hm-app {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 20px;
  background: var(--sn-white);
  border: 1px solid var(--sn-line);
  border-radius: 24px;
}
.hm-app .hm-tile { width: 64px; height: 64px; border-radius: 18px; font-size: 27px; }
.hm-app-t { display: flex; flex-direction: column; gap: 6px; }
.hm-app-t strong { font-family: var(--sn-font-head); font-weight: 600; font-size: 24px; line-height: 1.2; }
.hm-app-t span { color: #3D4566; }
.hm-chips { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 600; }
.hm-chip { background: var(--sn-chip); border-radius: 999px; padding: 5px 12px; }
.hm-chip-new { background: var(--sn-blue-soft); color: var(--sn-blue-ink); }
.hm-more { margin-top: auto; color: var(--sn-blue); font-weight: 600; }
.hm-app:hover { border-color: #C5CBE3; }
.hm-app:hover .hm-more { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 1024px) {
  .hm-apps { padding: 48px 0 0; }
  .hm-apps-in { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .hm-app { gap: 20px; padding: 32px; border-radius: 28px; }
  .hm-app .hm-tile { width: 72px; height: 72px; border-radius: 20px; font-size: 30px; }
  .hm-app-t strong { font-size: 28px; }
}

.hm-more-sec { padding: 40px 0 32px; }
.hm-h3-l { font-size: 22px; }
.hm-more-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.hm-big {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 20px;
  border-radius: 24px;
}
.hm-big-t { display: flex; flex-direction: column; }
.hm-big-t strong { font-family: var(--sn-font-head); font-weight: 600; font-size: 22px; line-height: 1.25; }
.hm-big-dark { background: var(--sn-ink); color: #fff; }
.hm-big-dark .hm-big-t span { color: var(--sn-foot-muted); }
.hm-big-light { background: var(--sn-white); border: 1px solid var(--sn-line); }
.hm-big-light .hm-big-t span { color: var(--sn-muted); }
.hm-big svg { color: var(--sn-blue); }
.hm-big-dark svg { color: var(--sn-foot-label); }
.hm-big .hm-arr { display: none !important; }
.hm-big .hm-chev { display: block !important; }
.hm-main .hm-big-dark:focus-visible { outline-color: var(--sn-foot-label); }
@media (min-width: 1024px) {
  .hm-more-sec { padding: 72px 0 88px; }
  .hm-h3-l { font-size: 26px; margin-bottom: 20px; }
  .hm-more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .hm-big { padding: 28px 32px; }
  .hm-big-t strong { font-size: 24px; }
  .hm-big .hm-arr { display: block !important; width: 24px; height: 24px; }
  .hm-big .hm-chev { display: none !important; }
}

/* ---- 404 ---- */
.hm-nf { padding: 32px 0 0; }
.hm-nf-code {
  font-family: var(--sn-font-head);
  font-weight: 700;
  font-size: 72px;
  line-height: 1;
  color: var(--sn-blue);
  letter-spacing: -0.04em;
}
.hm-nf h1 {
  margin-top: 16px;
  font-family: var(--sn-font-head);
  font-size: 32px;
  line-height: 1.1;
  font-weight: 600;
}
.hm-nf .hm-lead { margin-top: 10px; }
.hm-nf-links { padding: 32px 0 56px; }
.hm-nf-q { font-size: 18px; font-weight: 600; color: #3D4566; margin-bottom: 16px; }
.hm-nf-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.hm-nf-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px 20px;
  border-radius: 24px;
}
.hm-nf-card strong { font-family: var(--sn-font-head); font-weight: 600; font-size: 24px; line-height: 1.2; }
.hm-nf-light { background: var(--sn-white); border: 1px solid var(--sn-line); }
.hm-nf-light span:last-child { color: var(--sn-muted); }
.hm-nf-dark { background: var(--sn-ink); color: #fff; }
.hm-nf-dark .hm-kicker { color: var(--sn-foot-label); }
.hm-nf-dark span:last-child { color: var(--sn-foot-muted); }
.hm-main .hm-nf-dark:focus-visible { outline-color: var(--sn-foot-label); }
.hm-nf-foot { margin-top: 24px; color: #3D4566; }
.hm-nf-foot a { color: var(--sn-blue) !important; font-weight: 600; }
@media (min-width: 1024px) {
  .hm-nf { padding: 56px 0 0; }
  .hm-nf-code { font-size: 96px; }
  .hm-nf h1 { margin-top: 18px; font-size: 44px; }
  .hm-nf .hm-lead { margin-top: 10px; }
  .hm-nf-links { padding: 40px 0 88px; }
  .hm-nf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-nf-card { padding: 28px 32px; }
  .hm-nf-card strong { font-size: 26px; }
}
/* Язык на 404: показываем только активную строку */
.hm-nf [data-lang] { display: none; }
.hm-nf [data-lang].lang-active { display: inline; }
/* Крошек на 404 по макету нет */
body[data-sn-page="404.html"] .sn-crumbs { display: none; }

@media (prefers-reduced-motion: reduce) {
  .hm-main * { transition: none !important; }
}
