/* Оформление одной только главной страницы.
   Файл подключается из index.html и нигде больше — остальные страницы
   и админка продолжают жить на style.css. Все правила привязаны к body.home,
   поэтому даже при случайном подключении они не заденут другие разделы. */

.home {
  /* Поверхности */
  --h-bg:          #ffffff;
  --h-bg-soft:     #fbfbfc;
  --h-bg-muted:    #f4f5f7;
  --h-surface:     #ffffff;
  --h-header-bg:   rgba(255, 255, 255, .82);

  /* Линии */
  --h-line:        #ebecf0;
  --h-line-strong: #dcdee5;

  /* Текст */
  --h-text:        #12141a;
  --h-text-2:      #5b6070;
  --h-text-3:      #8f95a5;

  /* Акцент */
  --h-accent:      #0ea5f0;
  --h-accent-hover:#0b8fd4;
  --h-accent-soft: #e6f6fe;
  --h-accent-line: #bde6fa;

  --h-ok:          #0f9960;

  /* Заливки внутри иллюстраций */
  --h-art-1:       #e9eaf2;
  --h-art-2:       #f1f2f6;
  --h-art-3:       #f4f5f8;

  --h-r-sm: 8px;
  --h-r:    12px;
  --h-r-lg: 18px;

  --h-shadow-sm: 0 2px 8px -2px rgba(18, 20, 26, .07);
  --h-shadow:    0 10px 34px -14px rgba(18, 20, 26, .18);

  --h-header-h: 68px;
  --h-maxw: 1200px;
  --h-ease: cubic-bezier(.22, .61, .36, 1);
}

/* Тёмная тема: системная и выбранная вручную — два одинаковых набора,
   чтобы переключатель выигрывал в обе стороны. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .home {
    --h-bg:          #0f1115;
    --h-bg-soft:     #13161c;
    --h-bg-muted:    #1b1f27;
    --h-surface:     #171a21;
    --h-header-bg:   rgba(15, 17, 21, .82);
    --h-line:        #262a34;
    --h-line-strong: #343a48;
    --h-text:        #e9ecf3;
    --h-text-2:      #a4abbb;
    --h-text-3:      #79808f;
    --h-accent:      #29b6f6;
    --h-accent-hover:#4cc3f8;
    --h-accent-soft: #10293a;
    --h-accent-line: #1d4761;
    --h-ok:          #34d399;
    --h-art-1:       #262a34;
    --h-art-2:       #1f2430;
    --h-art-3:       #1b1f29;
    --h-shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, .5);
    --h-shadow:    0 10px 34px -14px rgba(0, 0, 0, .7);
  }
}

:root[data-theme="dark"] .home {
  --h-bg:          #0f1115;
  --h-bg-soft:     #13161c;
  --h-bg-muted:    #1b1f27;
  --h-surface:     #171a21;
  --h-header-bg:   rgba(15, 17, 21, .82);
  --h-line:        #262a34;
  --h-line-strong: #343a48;
  --h-text:        #e9ecf3;
  --h-text-2:      #a4abbb;
  --h-text-3:      #79808f;
  --h-accent:      #29b6f6;
  --h-accent-hover:#4cc3f8;
  --h-accent-soft: #10293a;
  --h-accent-line: #1d4761;
  --h-ok:          #34d399;
  --h-art-1:       #262a34;
  --h-art-2:       #1f2430;
  --h-art-3:       #1b1f29;
  --h-shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, .5);
  --h-shadow:    0 10px 34px -14px rgba(0, 0, 0, .7);
}

/* ---------- База ---------- */
body.home {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--h-text);
  background: var(--h-bg);
}
.home h1, .home h2, .home h3 { margin: 0; font-weight: 600; letter-spacing: -.021em; line-height: 1.22; }
.home h1 { font-size: 40px; }
.home h2 { font-size: 28px; }
.home h3 { font-size: 19px; }
.home p { margin: 0; }
.home a { color: inherit; text-decoration: none; }
.home a:hover { text-decoration: none; }
.home ::selection { background: var(--h-accent-soft); color: var(--h-accent); }
.home :focus-visible { outline: 2px solid var(--h-accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Раскладка ---------- */
.home .container { width: 100%; max-width: var(--h-maxw); margin: 0 auto; padding: 0 24px; }
.home .container--narrow { max-width: 780px; }

.home .section { padding: 88px 0; }
.home .section--tight { padding: 56px 0; }
.home .section--soft { background: var(--h-bg-soft); border-block: 1px solid var(--h-line); }

.home .section-head { max-width: 620px; margin-bottom: 40px; }
.home .section-head--center { margin-inline: auto; text-align: center; }
.home .section-head p { color: var(--h-text-2); margin-top: 12px; font-size: 16px; }

.home .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--h-accent); background: var(--h-accent-soft);
  padding: 6px 12px; border-radius: 100px; margin-bottom: 16px;
}

.home .grid { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home .row { display: flex; align-items: center; gap: 12px; }
.home .row--between { justify-content: space-between; }
.home .stack { display: flex; flex-direction: column; gap: 16px; }
.home .spacer { flex: 1; }
.home .muted { color: var(--h-text-3); }
.home .small { font-size: 13px; }

/* ---------- Шапка (разметку рисует общий app.js, здесь только вид) ---------- */
.home header.top {
  position: sticky; top: 0; z-index: 50;
  background: var(--h-header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--h-line);
}
.home .top-inner { max-width: var(--h-maxw); padding: 0 24px; min-height: var(--h-header-h); gap: 28px; }
.home .logo { font-size: 25px; font-weight: 700; letter-spacing: -.045em; color: var(--h-text); }

/* Сама надпись описана в style.css и работает на всех страницах.
   Здесь только подгонка под палитру и крупный размер главной. */
.home .wordmark__a { color: var(--h-text); }
.home .logo .wordmark { font-size: inherit; }
.home footer.bottom .wordmark { font-size: 15px; }
.home footer.bottom .wordmark__a { color: var(--h-text-2); }
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .home .wordmark__b { color: var(--h-accent); background: none; }
}
.home nav.main { gap: 4px; flex: none; }
.home nav.main a {
  padding: 8px 12px; border-radius: var(--h-r-sm); font-size: 14.5px; color: var(--h-text-2);
  transition: background .16s var(--h-ease), color .16s var(--h-ease);
}
.home nav.main a:hover { color: var(--h-text); background: var(--h-bg-muted); }
.home nav.main a.active { color: var(--h-text); font-weight: 550; background: none; }
.home .top-right { gap: 10px; margin-left: auto; }
.home .balance {
  padding: 7px 14px; border-radius: 100px;
  border: 1px solid var(--h-line); background: var(--h-bg-soft);
  font-size: 14px; font-weight: 550; color: var(--h-text);
}
.home .icon-btn {
  width: 36px; height: 36px; border-radius: var(--h-r-sm);
  border: 1px solid var(--h-line); background: var(--h-surface); color: var(--h-text-2);
  transition: color .16s var(--h-ease), border-color .16s var(--h-ease);
}
.home .icon-btn:hover { color: var(--h-text); border-color: var(--h-line-strong); background: var(--h-surface); }
.home .top-right > a:not(.btn) { color: var(--h-text-2); font-size: 14px; }

/* ---------- Кнопки ---------- */
.home .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 18px; height: 42px; min-height: 42px; border-radius: var(--h-r);
  border: 1px solid var(--h-line); background: var(--h-surface); color: var(--h-text-2);
  font-size: 14.5px; font-weight: 550; white-space: nowrap;
  transition: background .16s var(--h-ease), border-color .16s var(--h-ease),
              color .16s var(--h-ease), transform .12s var(--h-ease);
}
.home .btn:hover { background: var(--h-bg-muted); color: var(--h-text); border-color: var(--h-line-strong); }
.home .btn:active { transform: translateY(1px); }
.home .btn.primary {
  background: var(--h-accent); border-color: transparent; color: #fff;
}
.home .btn.primary:hover { background: var(--h-accent-hover); color: #fff; }
.home .btn--soft { background: var(--h-accent-soft); color: var(--h-accent); border-color: transparent; }
.home .btn--soft:hover { background: var(--h-accent-line); color: var(--h-accent); }
.home .btn--lg { height: 50px; min-height: 50px; padding: 0 26px; font-size: 15.5px; border-radius: 14px; }
.home .btn--sm, .home .btn.sm { height: 34px; min-height: 34px; padding: 0 13px; font-size: 13.5px; border-radius: var(--h-r-sm); }
.home .btn svg { flex: none; }
.home .link { color: var(--h-accent); font-weight: 500; }
.home .link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Поля ---------- */
.home .input {
  width: 100%; height: 44px; padding: 11px 14px;
  border: 1px solid var(--h-line-strong); border-radius: var(--h-r);
  background: var(--h-surface); color: var(--h-text); font-size: 14.5px;
  transition: border-color .16s var(--h-ease), box-shadow .16s var(--h-ease);
}
.home .input::placeholder { color: var(--h-text-3); }
.home .input:focus { outline: none; border-color: var(--h-accent); box-shadow: 0 0 0 3.5px var(--h-accent-soft); }

/* ---------- Карточки ---------- */
.home .card {
  background: var(--h-surface); border: 1px solid var(--h-line);
  border-radius: var(--h-r-lg); padding: 24px;
}

/* ---------- Герой ---------- */
.home .hero { padding: 76px 0 72px; position: relative; overflow: hidden; border: 0; }
.home .hero::before {
  content: ''; position: absolute; top: -260px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 520px;
  background: radial-gradient(ellipse at center, var(--h-accent-soft), transparent 66%);
  opacity: .75; pointer-events: none;
}
.home .hero__grid {
  position: relative; display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 56px; align-items: center;
}
.home .hero h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -.032em; max-width: none; }
.home .hero h1 em { font-style: normal; color: var(--h-accent); }
.home .hero__lead { margin-top: 20px; font-size: 17.5px; color: var(--h-text-2); max-width: 520px; }
.home .hero__cta { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
.home .hero__trust { margin-top: 34px; display: flex; gap: 28px; flex-wrap: wrap; }
.home .hero__trust div strong { display: block; font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.home .hero__trust div span { font-size: 13px; color: var(--h-text-3); }
.home .hero__art { position: relative; }
.home .hero__img { display: block; width: 100%; height: auto; }
/* По умолчанию (светлая тема) показываем светлую картинку. */
.home .hero__img--dark { display: none; }
.home .hero__svg { display: none; }

/* Тёмная тема: системная и выбранная вручную. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .home .hero__img--light { display: none; }
  :root:not([data-theme="light"]) .home .hero__img--dark { display: block; }
}
:root[data-theme="dark"] .home .hero__img--light { display: none; }
:root[data-theme="dark"] .home .hero__img--dark { display: block; }

/* Запасной вариант, если PNG не загрузились: прячем картинки, показываем SVG. */
.home .hero__art--svg .hero__img { display: none !important; }
.home .hero__art--svg .hero__svg { display: block; }

/* ---------- Преимущества ---------- */
.home .feature {
  padding: 26px; border: 1px solid var(--h-line); border-radius: var(--h-r-lg);
  background: var(--h-surface);
  transition: border-color .18s var(--h-ease), transform .18s var(--h-ease), box-shadow .18s var(--h-ease);
}
.home .feature:hover { border-color: var(--h-line-strong); transform: translateY(-2px); box-shadow: var(--h-shadow-sm); }
.home .feature__icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--h-accent-soft); color: var(--h-accent); margin-bottom: 18px;
}
.home .feature h3 { font-size: 16.5px; margin-bottom: 8px; }
.home .feature p { color: var(--h-text-2); font-size: 14.5px; }

/* ---------- Шаги ---------- */
.home .step { position: relative; padding-left: 60px; }
.home .step__num {
  position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; background: var(--h-text); color: var(--h-bg);
  font-weight: 600; font-size: 15px;
}
.home .step h3 { font-size: 16.5px; margin-bottom: 7px; }
.home .step p { color: var(--h-text-2); font-size: 14.5px; }

/* ---------- Карточка товара ---------- */
.home .product-card {
  display: flex; flex-direction: column; height: 100%; position: relative;
  padding: 22px; border: 1px solid var(--h-line); border-radius: var(--h-r-lg);
  background: var(--h-surface); color: var(--h-text);
  transition: border-color .18s var(--h-ease), transform .18s var(--h-ease), box-shadow .18s var(--h-ease);
}
.home .product-card:hover { border-color: var(--h-line-strong); transform: translateY(-3px); box-shadow: var(--h-shadow); }
.home .product-card__top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.home .product-card__icon {
  width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: var(--h-bg-muted); color: var(--h-text-2);
  transition: background .18s var(--h-ease), color .18s var(--h-ease);
}
.home .product-card:hover .product-card__icon { background: var(--h-accent-soft); color: var(--h-accent); }
.home .product-card h3 { font-size: 16px; margin-bottom: 4px; }
.home .product-card__desc {
  color: var(--h-text-2); font-size: 14px; margin-bottom: 18px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.home .product-card__foot {
  display: flex; align-items: flex-end; gap: 12px;
  padding-top: 16px; border-top: 1px solid var(--h-line);
}
.home .price { font-size: 21px; font-weight: 650; letter-spacing: -.02em; }
.home .price small { font-size: 13px; font-weight: 400; color: var(--h-text-3); text-decoration: line-through; margin-left: 7px; }
.home .stock-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--h-text-3); }
.home .stock-line .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--h-ok); margin: 0; }
.home .stock-line.is-out .dot { background: var(--h-text-3); }

/* ---------- Нижний призыв ---------- */
.home .cta-card { text-align: center; padding: 56px 32px; background: var(--h-bg-soft); }
.home .cta-card h2 { margin-bottom: 12px; }
.home .cta-card p { color: var(--h-text-2); max-width: 520px; margin: 0 auto 28px; }
.home .cta-card__btns { justify-content: center; flex-wrap: wrap; }

/* ---------- Вопросы ---------- */
.home .accordion {
  border: 1px solid var(--h-line); border-radius: var(--h-r-lg);
  overflow: hidden; background: var(--h-surface);
}
.home .accordion__item + .accordion__item { border-top: 1px solid var(--h-line); }
.home .accordion__btn {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 19px 22px;
  border: 0; background: none; cursor: pointer; text-align: left;
  font: inherit; font-size: 15.5px; font-weight: 550; color: var(--h-text);
}
.home .accordion__btn:hover { background: var(--h-bg-soft); }
.home .accordion__btn svg { margin-left: auto; flex: none; color: var(--h-text-3); transition: transform .2s var(--h-ease); }
.home .accordion__item.is-open .accordion__btn svg { transform: rotate(180deg); }
.home .accordion__panel { padding: 0 22px 20px; color: var(--h-text-2); font-size: 14.5px; line-height: 1.7; }

/* ---------- Пустое состояние ---------- */
.home .empty { text-align: center; padding: 56px 24px; color: var(--h-text-3); font-size: 14px; }

/* ---------- Подвал ---------- */
.home footer.bottom {
  border-top: 1px solid var(--h-line); background: var(--h-bg-soft);
  padding: 40px 0 36px; margin-top: 0; color: var(--h-text-3); font-size: 13px;
}
.home footer.bottom .wrap { max-width: var(--h-maxw); padding: 0 24px; }
.home footer.bottom a { color: var(--h-text-2); }
.home footer.bottom a:hover { color: var(--h-text); }

/* ---------- Адаптивность ---------- */
@media (max-width: 1080px) {
  .home .hero__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .home .hero__art { max-width: 520px; }
}

@media (max-width: 900px) {
  .home .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .grid, .home .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  /* Мобильная шапка работает на общей логике бургера из style.css. */
  .home .top-inner {
    padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    min-height: 60px; gap: 12px;
  }
  .home nav.main { flex-direction: column; gap: 2px; border-top: 1px solid var(--h-line); }
  .home nav.main a { padding: 11px 10px; font-size: 15px; }
  .home .logo { font-size: 22px; }
  .home .top-right { gap: 8px; }
  .home .balance { padding: 6px 11px; font-size: 13px; }
  .home footer.bottom .wrap {
    padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  }
  .home footer.bottom { padding-bottom: calc(36px + env(safe-area-inset-bottom)); }
}

@media (max-width: 720px) {
  .home .container {
    padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  }
  .home .section { padding: 52px 0; }
  .home .section--tight { padding: 36px 0; }
  .home h1 { font-size: 28px; }
  .home h2 { font-size: 22px; }
  .home h3 { font-size: 17px; }

  .home .grid, .home .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .home .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .grid { gap: 14px; }

  .home .hero { padding: 40px 0 48px; }
  .home .hero__cta { margin-top: 26px; gap: 10px; }
  .home .hero__cta .btn { flex: 1 1 auto; justify-content: center; }
  .home .hero__trust {
    margin-top: 28px; gap: 14px 20px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }
  .home .hero__trust div strong { font-size: 19px; }
  .home .section-head { margin-bottom: 28px; }
  .home .section-head p { font-size: 15px; }
  .home .card { padding: 18px; }
  .home .cta-card { padding: 32px 18px; }
  .home .cta-card__btns .btn { flex: 1 1 200px; }
  .home .feature { padding: 20px; }
  .home .step { padding-left: 52px; }
}

@media (max-width: 420px) {
  .home .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .home .logo { font-size: 19px; }
  .home .top-inner { gap: 8px; }
  .home .hero { padding: 32px 0 40px; }
  .home .hero__lead { font-size: 16px; }
  .home .hero__cta .btn--lg { width: 100%; height: 48px; min-height: 48px; }
  .home .hero__trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .section { padding: 44px 0; }
  .home .accordion__btn { padding: 16px 16px; font-size: 15px; }
  .home .accordion__panel { padding: 0 16px 18px; }
  .home .product-card { padding: 18px; }
  .home .product-card__foot { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .home * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
