/* =====================================================================
   home.css — стили ТОЛЬКО для главной страницы (подключается из index.html).
   style.css не меняется, поэтому остальные страницы не затронуты.
   Всё ограничено классом body.home.
   ===================================================================== */

.home {
  --home-glass: rgba(246, 247, 255, 0.88);
  --home-edge: rgba(190, 220, 255, 0.6);
  --home-shadow: 0 10px 40px rgba(5, 10, 40, 0.3);
  --home-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Шапка главной ----------
   Товары, тренер, пульт и т.д. — это карточки прямо под шапкой, поэтому на главной
   в меню всегда 4 основных пункта: ничего не обрезается и не уезжает за край.
   Меню — одна «стеклянная» капсула-переключатель, как в iOS/macOS. */
.home .nav .nav__extra { display: none; }

.home .site-header {
  background: rgba(10, 16, 48, 0.5);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(160, 200, 255, 0.14);
}
.home .site-header__inner {
  max-width: 88rem;
  height: auto;
  min-height: 4rem;
  padding: 0.5rem 0.75rem;
  gap: 1rem;
}
.home .site-header__spacer { display: none; }

.home .nav {
  width: 100%;
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  overflow: visible;
  border: 1px solid rgba(170, 210, 255, 0.22);
  border-radius: 1.125rem;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.home .nav a {
  flex: 1 1 auto;
  min-width: 0;
  height: 3.25rem;
  padding: 0 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border: 0;
  border-radius: 0.875rem;
  background: transparent;
  box-shadow: none;
  color: rgba(235, 243, 255, 0.78);
  font-size: min(0.6875rem, 2.9vw);
  line-height: 1.1;
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease-out;
}
.home .nav a span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
}
.home .nav a svg { width: 1.25rem; height: 1.25rem; }
.home .nav a:active { transform: scale(0.96); }
.home .nav a[aria-current="true"] {
  border: 0;
  color: #fff;
  background: rgba(150, 215, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 10px rgba(5, 10, 40, 0.25);
}
@media (hover: hover) {
  .home .nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }
  .home .nav a[aria-current="true"]:hover { background: rgba(150, 215, 255, 0.3); }
}

/* планшет и компьютер: капсула по центру, иконка и подпись в строку */
@media (min-width: 640px) {
  .home .site-header__inner { min-height: 4.5rem; padding: 0.625rem 1.5rem; }
  .home .nav { width: auto; flex: 0 0 auto; border-radius: 999px; }
  .home .nav a {
    flex: 0 0 auto;
    flex-direction: row;
    height: 2.5rem;
    padding: 0 1.125rem;
    gap: 0.5rem;
    border-radius: 999px;
    font-size: 0.875rem;
  }
  .home .nav a svg { width: 1.125rem; height: 1.125rem; }
}
/* компьютер: логотип слева, меню справа */
@media (min-width: 900px) {
  .home .site-header__inner { justify-content: space-between; padding: 0.625rem 2rem; }
  .home .site-logo { height: auto; font-size: 1.375rem; line-height: 1.05; letter-spacing: -0.01em; }
}

/* ---------- Каркас ---------- */
.home-main {
  width: 100%;
  text-align: center;
  padding-bottom: 2.5rem;
}

/* ---------- Карточки товаров: все видны сразу, неполный ряд по центру ----------
   телефон: 3 в ряд (3+3+3) · планшет: 5 в ряд (5+4) · широкий экран: все 9 в ряд */
.home-products {
  --cols: 3;
  --gap: 0.5rem;
  --img-h: 3.75rem;
  width: 100%;
  max-width: 88rem;
  margin: 0 auto;
  padding: 1rem 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
  animation: home-materialize 0.9s var(--home-ease) both;
}

.p-card {
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.625rem 0.375rem 0.75rem;
  border: 1px solid rgba(190, 220, 255, 0.8);
  border-radius: 1.125rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(236, 240, 255, 0.74));
  box-shadow: 0 10px 30px rgba(5, 10, 40, 0.32), inset 0 1px 0 #fff;
  color: var(--kachi);
  scroll-margin-top: 6rem;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s var(--home-ease), box-shadow 0.25s ease;
}
/* отклик сразу при нажатии, а не после отпускания */
.p-card:active { transform: scale(0.97); transition-duration: 0.1s; }
@media (hover: hover) {
  .p-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(5, 10, 40, 0.42), 0 0 24px rgba(120, 220, 255, 0.3), inset 0 1px 0 #fff;
  }
  .p-card:hover:active { transform: translateY(-1px) scale(0.98); }
}

.p-card__img {
  width: 100%;
  height: var(--img-h);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}
.p-card__img img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.p-card__img img:not(.tv-neon) { filter: drop-shadow(0 8px 14px rgba(8, 25, 45, 0.28)); }

.p-card__title {
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.p-card__meta {
  display: none;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted);
  text-wrap: balance;
}

@media (min-width: 560px) {
  .home-products { --gap: 0.75rem; --img-h: 5.5rem; padding: 1.25rem 1.25rem 0; }
  .p-card { padding: 1rem 0.625rem 1.125rem; border-radius: 1.25rem; }
  .p-card__title { font-size: 0.9375rem; }
  .p-card__meta { display: block; }
}
@media (min-width: 720px) {
  .home-products { --cols: 5; }
}
@media (min-width: 1200px) {
  .home-products { --cols: 9; --gap: 0.875rem; --img-h: 6.25rem; padding: 1.5rem 1.5rem 0; }
  .p-card__title { font-size: 0.9375rem; }
}

/* ---------- Заголовок ---------- */
.home-hero {
  max-width: 64rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) 1.25rem clamp(2rem, 5vw, 3.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 4vw, 3rem);
  scroll-margin-top: 6rem;
}
.home-hero__text {
  min-width: 0;
  text-align: left;
  animation: home-materialize 1.4s var(--home-ease) 0.1s both;
}
.home-hero__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 7.5vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 0 24px rgba(120, 220, 255, 0.45), 0 2px 18px rgba(10, 10, 60, 0.5);
}
.home-hero__subtitle {
  margin-top: 0.5rem;
  font-size: clamp(0.9375rem, 1.6vw, 1.25rem);
  letter-spacing: 0.01em;
  color: rgba(220, 235, 255, 0.88);
}
.home-hero__logo {
  flex: none;
  width: clamp(6rem, 24vw, 15rem);
  pointer-events: none;
  animation: home-materialize 1.6s var(--home-ease) 0.35s both;
}
.home-hero__logo img { filter: drop-shadow(0 0 18px rgba(90, 160, 255, 0.45)); }

/* ---------- Разделы: отдельные «стеклянные» карточки ----------
   телефон — в одну колонку; компьютер — сетка в две колонки */
.home-sections {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 0.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}
.home-sections .section {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.25rem 2.25rem;
  border: 1px solid var(--home-edge);
  border-radius: 1.5rem;
  background: var(--home-glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--home-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.home-sections .section__title {
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.home-sections .stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.home-sections .stack > * { max-width: 100%; }
.home-sections .prose { width: 100%; max-width: 34rem; }
.home-sections .lead { letter-spacing: -0.01em; }
.home-sections .deck-teaser { display: block; width: 100%; }
.home-sections .btn { transition: transform 0.1s ease-out; }
.home-sections .btn:active { transform: scale(0.97); }

@media (min-width: 560px) {
  .home-sections { padding: 0 1.25rem; }
  .home-sections .section { padding: 2.5rem 2rem 2.75rem; }
}
@media (min-width: 900px) {
  .home-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: 0 1.5rem; }
  .home-sections .section--wide { grid-column: 1 / -1; }
  .home-sections .section--wide .prose { max-width: 40rem; }
}

/* ---------- Подвал ---------- */
.home .site-footer { margin-top: 3rem; padding: 0 1.25rem; }

/* ---------- Появление: материал «проявляется» (размытие + прозрачность) ---------- */
@keyframes home-materialize {
  from { opacity: 0; filter: blur(10px); transform: scale(0.985); }
  to   { opacity: 1; filter: none; transform: none; }
}

/* ---------- Доступность ---------- */
@media (prefers-reduced-motion: reduce) {
  .home-products, .home-hero__text, .home-hero__logo { animation: none; }
  .p-card, .home .nav a, .home-sections .btn { transition: none; }
  .p-card:hover, .p-card:active, .home .nav a:active, .home-sections .btn:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .home .site-header { background: #0f1638; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .home-sections .section { background: #f6f7ff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .p-card { background: #f4f6ff; }
}
@media (prefers-contrast: more) {
  .p-card, .home-sections .section { border-color: rgba(8, 25, 45, 0.5); }
}
