/* ================================================================
   Главная (2026-11) — только то, чего нет на других страницах:
   hero со сменой ниш и промо-окном, лента ниш, вкладки витрины,
   устройства в «Что внутри», цифры каталога. Всё общее (кнопки,
   секции, карточки, шаги, форма, шапка и подвал) — в ui.css.
   ================================================================ */

@property --hx-n { syntax: '<integer>'; inherits: false; initial-value: 0; }
@property --hx-p { syntax: '<integer>'; inherits: false; initial-value: 0; }

/* --- Hero --- */
.hx-hero { position: relative; isolation: isolate; overflow: hidden; background: var(--hx-night); color: #e7ebf7; }
.hx-hero__body { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr); gap: 56px; align-items: center; padding: 64px 0 88px; }
.hx-hero__copy > * { animation: hx-rise 1s cubic-bezier(.2,.7,.2,1) both; }
.hx-hero__copy > :nth-child(2) { animation-delay: .08s; }
.hx-hero__copy > :nth-child(3) { animation-delay: .16s; }
.hx-hero__copy > :nth-child(4) { animation-delay: .24s; }
.hx-hero__copy > :nth-child(5) { animation-delay: .32s; }
.hx-h1 { margin-top: 22px; font-size: 50px; line-height: 1.1; font-weight: 700; color: #fff; }
.hx-rot { display: inline-grid; margin-top: 4px; white-space: nowrap; }
.hx-rot__w { grid-area: 1 / 1; color: var(--hx-accent); opacity: 0; animation: hx-rot 12s cubic-bezier(.4,0,.2,1) infinite; }
.hx-rot__w:nth-child(2) { animation-delay: 3s; }
.hx-rot__w:nth-child(3) { animation-delay: 6s; }
.hx-rot__w:nth-child(4) { animation-delay: 9s; }
@keyframes hx-rot { 0% { opacity: 0; transform: translateY(.42em); filter: blur(8px); } 5%, 21% { opacity: 1; transform: none; filter: blur(0); } 26%, 100% { opacity: 0; transform: translateY(-.42em); filter: blur(8px); } }
.hx-hero__sub { margin-top: 24px; max-width: 540px; font-size: 18px; line-height: 1.6; color: #b6bfd6; }

/* промо-окно браузера */
.hx-promo { position: relative; padding: 30px 24px 40px; perspective: 1600px; animation: hx-rise 1.2s .2s cubic-bezier(.2,.7,.2,1) both; }
.hx-shot { position: absolute; left: 0; top: 0; width: 100%; height: auto; opacity: 0; animation: hx-shot 12s linear infinite; }
.hx-shot:nth-child(2) { animation-delay: 3s; }
.hx-shot:nth-child(3) { animation-delay: 6s; }
.hx-shot:nth-child(4) { animation-delay: 9s; }
@keyframes hx-shot { 0% { opacity: 0; transform: translateY(0) scale(1.03); } 5% { opacity: 1; } 21% { opacity: 1; transform: translateY(-13%) scale(1); } 26%, 100% { opacity: 0; transform: translateY(-15%) scale(1); } }
.hx-f-cart { left: -10px; top: 96px; animation-delay: -1.5s; }
.hx-f-domain { right: -8px; top: 46%; animation-delay: -4s; }
.hx-f-domain .hx-ic { background: #ecfdf5; color: #059669; }
.hx-f-price { right: 34px; top: -4px; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 18px; background: var(--hx-accent); color: var(--hx-accent-ink); animation-delay: -2.5s; }
.hx-f-price small { color: rgba(11,16,32,.72); }
.hx-f-price strong { font: 700 20px/1.1 'Unbounded', sans-serif; }
.hx-launch { left: 4px; bottom: 0; width: 250px; flex-direction: column; align-items: stretch; gap: 10px; white-space: normal; animation-delay: -3s; }
.hx-launch__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hx-launch__pct { --hx-p: 100; counter-reset: hxp var(--hx-p); font: 700 14px/1 'Unbounded', sans-serif; color: var(--hx-blue-2); animation: hx-pct 6s ease-in-out infinite; }
.hx-launch__pct::after { content: counter(hxp) '%'; }
@keyframes hx-pct { 0% { --hx-p: 0; } 70%, 100% { --hx-p: 100; } }
.hx-launch__bar { height: 8px; border-radius: 99px; background: #e8edf7; overflow: hidden; }
.hx-launch__bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--hx-blue), var(--hx-sky)); transform-origin: left; animation: hx-fill 6s ease-in-out infinite; }
@keyframes hx-fill { 0% { transform: scaleX(.04); } 70%, 100% { transform: scaleX(1); } }
.hx-toast { right: -14px; bottom: 64px; animation: hx-toast 9s ease-in-out infinite; }
.hx-toast .hx-ic { background: #fff7e6; color: #d97706; }
@keyframes hx-toast { 0%, 10% { opacity: 0; transform: translateY(14px) scale(.96); } 16%, 64% { opacity: 1; transform: none; } 72%, 100% { opacity: 0; transform: translateY(-10px) scale(.98); } }

/* лента ниш */
.hx-niches { padding: 26px 0 34px; border-top: 1px solid rgba(255,255,255,.07); }
.hx-niches__label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-bottom: 16px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #8f9ab8; font-weight: 600; }
.hx-niches__label span { display: inline-flex; align-items: center; gap: 8px; letter-spacing: .02em; text-transform: none; font-weight: 500; }
.hx-niches__label span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--hx-sky); }
.hx-niches__label span.svc::before { background: var(--hx-accent); }
.hx-marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.hx-marquee + .hx-marquee { margin-top: 10px; }
.hx-marquee__track { display: flex; width: max-content; animation: hx-marquee 90s linear infinite; }
.hx-marquee--rev .hx-marquee__track { animation-direction: reverse; animation-duration: 110s; }
.hx-marquee:hover .hx-marquee__track, .hx-marquee:focus-within .hx-marquee__track { animation-play-state: paused; }
@keyframes hx-marquee { to { transform: translateX(-50%); } }
.hx-niche { display: inline-flex; align-items: center; gap: 9px; margin-right: 10px; padding: 9px 16px; border-radius: 999px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,.09); color: #d5dbec; font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.hx-niche:hover { color: #fff; background: rgba(255,255,255,.1); }
.hx-niche::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--hx-sky); }
.hx-niche--svc::before { background: var(--hx-accent); }

/* вкладки витрины */
.hx-tabs { display: flex; gap: 6px; padding: 6px; border-radius: 16px; background: #eef1f7; }
.hx-tab { min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: transparent; color: var(--hx-muted); font: 600 15px/1 'Onest', sans-serif; cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s; white-space: nowrap; }
.hx-tab:hover { color: var(--hx-text); }
.hx-tab[aria-selected="true"] { background: #fff; color: var(--hx-text); box-shadow: 0 4px 14px -6px rgba(15,23,42,.25); }

/* устройства в «Что внутри» */
.hx-devices { position: relative; height: 210px; }
.hx-dev-desk { position: absolute; left: 0; right: 60px; top: 0; height: 178px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.15), 0 20px 40px -20px rgba(0,0,0,.6); overflow: hidden; }
.hx-dev-phone { position: absolute; right: 0; bottom: 0; width: 98px; height: 186px; border-radius: 18px; background: #fff; border: 4px solid #1e293b; box-shadow: 0 20px 40px -18px rgba(0,0,0,.7); overflow: hidden; animation: hx-bob 6s ease-in-out infinite; }
.hx-dev-desk img, .hx-dev-phone img { width: 100%; height: auto; }

/* цифры */
.hx-nums { background: var(--hx-night); color: #e7ebf7; }
.hx-nums__in { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 24px; padding: 72px 0; }
.hx-num { padding-left: 22px; border-left: 1px solid rgba(255,255,255,.12); }
.hx-num__v { font: 700 54px/1 'Unbounded', sans-serif; color: #fff; letter-spacing: -.03em; }
.hx-num__v em { font-style: normal; color: var(--hx-accent); }
.hx-num p { margin-top: 12px; color: #aab3cc; font-size: 15.5px; }
/* Счётчик: итоговое число и @keyframes hx-c{N} задаёт pages/home.php (число — из каталога) */
/* counter-reset — на самом элементе: --hx-n ненаследуемое, ::after его не видит */
.hx-count { counter-reset: hxn var(--hx-n); }
.hx-count::after { content: counter(hxn); }
.hx-count--anim { animation-duration: 2.4s; animation-timing-function: cubic-bezier(.2,.7,.2,1); animation-fill-mode: both; }

@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        .hx-count--anim { animation-timeline: view(); animation-range: entry 20% cover 45%; animation-duration: auto; }
    }
}
@media (prefers-reduced-motion: reduce) {
    .hx .hx-rot__w:first-child, .hx .hx-shot:first-child { opacity: 1; transform: none; filter: none; }
    .hx .hx-toast { opacity: 1; }
}

/* --- Планшет --- */
@media (max-width: 1100px) {
    .hx-hero__body { grid-template-columns: minmax(0,1fr); gap: 40px; padding: 48px 0 64px; }
    .hx-promo { max-width: 620px; width: 100%; margin: 0 auto; }
    .hx-nums__in { grid-template-columns: repeat(2, minmax(0,1fr)); row-gap: 40px; }
}

/* --- Телефон --- */
@media (max-width: 720px) {
    .hx-hero__body { padding: 30px 0 44px; }
    .hx-eyebrow { font-size: 13px; }
    .hx-h1 { font-size: 29px; }
    .hx-hero__sub { font-size: 16px; margin-top: 18px; }
    .hx-promo { padding: 20px 4px 30px; }
    .hx-browser { transform: none; animation: none; }
    .hx-f-cart { left: -2px; top: 52px; }
    .hx-f-domain { display: none; }
    .hx-f-price { right: 8px; top: -6px; padding: 8px 12px; }
    .hx-f-price strong { font-size: 14px; }
    .hx-launch { width: 190px; left: -2px; bottom: -2px; }
    .hx-toast { right: -2px; bottom: 40px; }
    .hx-niches { padding: 20px 0 26px; }
    .hx-niche { font-size: 13px; padding: 8px 13px; }
    /* три вкладки влезают в 360–375px; на более узких — прокрутка ряда */
    .hx-tabs { width: 100%; overflow-x: auto; gap: 4px; padding: 4px; }
    .hx-tab { flex: 1 0 auto; padding: 0 9px; font-size: 14px; }
    .hx-devices { display: none; }
    .hx-nums__in { padding: 56px 0; gap: 30px 16px; }
    .hx-num { padding-left: 14px; }
    .hx-num__v { font-size: 34px; }
    .hx-num p { font-size: 14px; }
}
