/* =====================================================================
   NextClient Plus — тема поверх классической (style.css грузится первым:
   её шрифты, кнопки, заголовки секций, плитки сборок, карточки, карусель).
   Здесь — только палитра светлой/тёмной схемы и своя компоновка главной.
   Сдержанно: небольшие скругления, без градиентов, одна живая деталь —
   «дышащий» круг за витриной.
   ===================================================================== */

/* ── Палитра: светлая ──────────────────────────────────────────────── */
/* мягкие тона карточек (светлые; тёмная схема переопределяет их ниже) и ширина страницы */
:root {
    --container:     1360px;
    --circle:        rgba(31, 111, 209, 0.16);
    --tint-blue:   #e8effa;  --ink-blue:   #1f6fd1;
    --tint-violet: #efebfa;  --ink-violet: #5b44c4;
    --tint-mint:   #e4f3ec;  --ink-mint:   #17795a;
    --tint-peach:  #f8ede3;  --ink-peach:  #b0581a;
    --tint-sky:    #e3f0f7;  --ink-sky:    #17709c;
    --tint-rose:   #f7e8ed;  --ink-rose:   #b03a62;
}
/* основные цвета классической темы — только для светлой схемы, иначе они перебили бы её тёмную */
:root[data-theme="light"] {
    --bg:            #f4f6fa;
    --card-bg:       #ffffff;
    --bg-section:    #ebeff6;
    --bg-elevated:   #e7ecf4;
    --bg-2:          #dce3ee;
    --text:          #111723;
    --text-muted:    #4b5567;
    --text-soft:     #7b8597;
    --langbtcol:     #e7ecf4;
    --border:        #dde3ed;
    --border-strong: #c3ccdb;
    --accent:        #1f6fd1;
    --accent-hover:  #185fb8;
    --accent-soft:   rgba(31, 111, 209, 0.10);
    --accent-strong: rgba(31, 111, 209, 0.18);
}
@media (prefers-color-scheme: light) {
    :root[data-theme="auto"] {
        --bg:            #f4f6fa;
        --card-bg:       #ffffff;
        --bg-section:    #ebeff6;
        --bg-elevated:   #e7ecf4;
        --bg-2:          #dce3ee;
        --text:          #111723;
        --text-muted:    #4b5567;
        --text-soft:     #7b8597;
        --langbtcol:     #e7ecf4;
        --border:        #dde3ed;
        --border-strong: #c3ccdb;
        --accent:        #1f6fd1;
        --accent-hover:  #185fb8;
        --accent-soft:   rgba(31, 111, 209, 0.10);
        --accent-strong: rgba(31, 111, 209, 0.18);
    }
}

/* ── Палитра: тёмная (выбрана или системная) ───────────────────────── */
[data-theme="dark"] {
    --circle:      rgba(59, 141, 237, 0.13);
    --tint-blue:   #172133;  --ink-blue:   #6fa6f0;
    --tint-violet: #1d1b31;  --ink-violet: #a08ff0;
    --tint-mint:   #13261f;  --ink-mint:   #4fc597;
    --tint-peach:  #2a1f17;  --ink-peach:  #f0a05f;
    --tint-sky:    #13232d;  --ink-sky:    #5bb7e3;
    --tint-rose:   #2a1820;  --ink-rose:   #ef7fa3;
}
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --circle:      rgba(59, 141, 237, 0.13);
        --tint-blue:   #172133;  --ink-blue:   #6fa6f0;
        --tint-violet: #1d1b31;  --ink-violet: #a08ff0;
        --tint-mint:   #13261f;  --ink-mint:   #4fc597;
        --tint-peach:  #2a1f17;  --ink-peach:  #f0a05f;
        --tint-sky:    #13232d;  --ink-sky:    #5bb7e3;
        --tint-rose:   #2a1820;  --ink-rose:   #ef7fa3;
    }
}

/* ── Витрина ───────────────────────────────────────────────────────── */
.px-hero { position: relative; overflow: hidden; padding: 96px 0 56px; }
/* круг за витриной медленно «дышит»; слой с кругом к низу витрины плавно растворяется —
   иначе край витрины резал бы круг ровной линией над полосой сборок */
.px-hero-bg {
    position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
}
.px-hero-circle {
    position: absolute; right: -340px; top: -420px;
    width: 1100px; height: 1100px; border-radius: 50%;
    background: var(--circle); pointer-events: none;
    transform-origin: 70% 30%;
    animation: px-breathe 15s ease-in-out infinite alternate;
}
@keyframes px-breathe { from { transform: scale(1); } to { transform: scale(.82); } }

.px-hero-grid {
    display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    gap: 72px; align-items: center;
}
.px-hero .hero-title { font-size: clamp(1.6rem, 1rem + 1.9vw, 2.5rem); max-width: none; }
.px-hero .hero-badge { margin-bottom: 28px; }
.px-hero .hero-title { margin-bottom: 26px; }
.px-hero .hero-title .accent { display: block; font-size: 1.75em; line-height: 1.05; margin-top: 12px; }
.px-hero .hero-cta { justify-content: flex-start; flex-wrap: nowrap; }
.px-hero .hero-lead { max-width: 520px; margin-bottom: 44px; line-height: 1.7; }

.px-btn-download { align-items: center; }
.px-btn-download { padding-top: 11px; padding-bottom: 11px; }
.px-btn-download i { font-size: 1.15rem; }
.btn .px-btn-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.btn .px-btn-text > span { display: block; font-size: 1.02rem; }
.btn .px-btn-text small { display: block; font-size: .74rem; font-weight: 500; opacity: .85; margin-top: 3px; letter-spacing: .02em; }

.px-facts { display: flex; flex-wrap: nowrap; gap: 16px 0; margin-top: 56px; }
.px-facts > div { padding: 0 clamp(16px, 2.1vw, 30px); border-left: 1px solid var(--border-strong); }
.px-facts > div:first-child { padding-left: 0; border-left: 0; }
.px-facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-soft); font-weight: 700; }
.px-facts dd { margin-top: 8px; white-space: nowrap; font-family: 'Moderustic', var(--font-sans); font-weight: 800; font-size: 1.3rem; color: var(--text); }

.px-hero-visual { position: relative; perspective: 1600px; padding: 36px 28px 44px; }
.px-shot {
    margin: 0; border-radius: var(--radius-lg); overflow: hidden;
    border: 1px solid var(--border); background: var(--card-bg);
    box-shadow: var(--shadow-lg), 0 0 0 6px color-mix(in srgb, var(--card-bg) 70%, transparent);
    transform: rotateY(-9deg) rotateX(3deg) rotate(1.2deg);
    transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.px-hero-visual:hover .px-shot { transform: rotateY(-4deg) rotateX(1deg) rotate(.5deg); }
.px-shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; cursor: zoom-in; }

/* плашки возможностей поверх скриншота */
.px-float {
    position: absolute; z-index: 2; display: flex; align-items: center; gap: 12px;
    padding: 10px 16px 10px 10px; border-radius: var(--radius);
    background: var(--card-bg); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
    animation: px-float 7s ease-in-out infinite;
}
.px-float b { display: block; font-family: 'Moderustic', var(--font-sans); font-weight: 800; font-size: .92rem; color: var(--text); line-height: 1.2; }
.px-float small { display: block; font-size: .76rem; color: var(--text-soft); }
.px-float-icon {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--accent-soft); color: var(--accent); font-size: 1.05rem;
}
.px-float-a { left: -8px; bottom: 6px; }
.px-float-b { right: -6px; top: 0; animation-delay: -2.3s; }
.px-float-b .px-float-icon { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.px-float-c { right: 18px; bottom: -14px; animation-delay: -4.6s; }
.px-float-c .px-float-icon { background: var(--accent-2-soft); color: var(--accent-2); }
@keyframes px-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.px-hero { padding-bottom: 88px; }

/* ── Сборки на выбор: отдельная полоса под витриной ────────────────── */
.px-builds-band { position: relative; padding: 0 0 24px; }
.px-builds-panel.hero-builds {
    margin-top: 0; padding: 26px 28px 28px; border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--card-bg) 92%, transparent);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.px-builds-top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.px-builds-icon {
    flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px;
    border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); font-size: 1.1rem;
}
.px-builds-titles { min-width: 0; }
.px-builds-titles h2 { font-family: 'Moderustic', var(--font-sans); font-weight: 800; font-size: 1.15rem; line-height: 1.2; color: var(--text); }
.px-builds-titles p { margin-top: 2px; font-size: .88rem; color: var(--text-soft); }
.px-builds-all {
    margin-left: auto; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--border);
    color: var(--text); font-weight: 600; font-size: .9rem; text-decoration: none;
    transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.px-builds-all:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.px-builds-count { padding: 1px 8px; border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text-muted); font-size: .78rem; font-weight: 700; }
.px-builds-all i { font-size: .8rem; transition: transform var(--transition); }
.px-builds-all:hover i { transform: translateX(3px); }
.px-builds-row.hero-builds-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.px-builds-row .hero-build-tile { width: auto; height: 124px; }
.px-builds-row .hero-build-tile-name { font-size: .95rem; }

/* ── О клиенте: карточки в мягких тонах ────────────────────────────── */
.px-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.px-feature {
    position: relative; padding: 28px 28px 30px; border-radius: var(--radius-lg);
    background: var(--tint, var(--bg-elevated)); border: 1px solid transparent;
    transition: border-color var(--transition), transform var(--transition);
}
.px-feature:hover { border-color: color-mix(in srgb, var(--ink, var(--accent)) 35%, transparent); transform: translateY(-2px); }
.px-feature-wide { grid-column: span 2; }
.px-feature { overflow: hidden; }
.px-feature-mark {
    position: absolute; right: -14px; bottom: -22px; font-size: 7.5rem; line-height: 1;
    color: var(--ink, var(--accent)); opacity: .07; pointer-events: none;
    transition: transform .4s ease, opacity .4s ease;
}
.px-feature:hover .px-feature-mark { transform: rotate(-8deg) scale(1.06); opacity: .12; }
.px-feature > *:not(.px-feature-mark) { position: relative; }
.px-feature-icon {
    display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px;
    border-radius: var(--radius); background: var(--card-bg); color: var(--ink, var(--accent));
    font-size: 1.3rem; box-shadow: var(--shadow-sm);
}
.px-feature h3 {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    font-family: 'Moderustic', var(--font-sans); font-weight: 800; font-size: 1.3rem; color: var(--text);
}
.px-feature p { margin-top: 10px; color: var(--text-muted); line-height: 1.65; }
.px-tint-blue   { --tint: var(--tint-blue);   --ink: var(--ink-blue); }
.px-tint-violet { --tint: var(--tint-violet); --ink: var(--ink-violet); }
.px-tint-mint   { --tint: var(--tint-mint);   --ink: var(--ink-mint); }
.px-tint-peach  { --tint: var(--tint-peach);  --ink: var(--ink-peach); }
.px-tint-sky    { --tint: var(--tint-sky);    --ink: var(--ink-sky); }
.px-tint-rose   { --tint: var(--tint-rose);   --ink: var(--ink-rose); }

/* ── Подписи секций: короткая черта перед меткой ──────────────────── */
.section-label { display: inline-flex; align-items: center; gap: 10px; }
.section-label::before { content: ''; width: 22px; height: 2px; background: currentColor; }
.px-center .section-label::after { content: ''; width: 22px; height: 2px; background: currentColor; }

/* ── Скриншоты ─────────────────────────────────────────────────────── */
.px-center { margin-left: auto; margin-right: auto; text-align: center; }
.px-gallery { max-width: 1000px; margin: 0 auto; text-align: center; }
.px-gallery-screen {
    border-radius: var(--radius-lg); overflow: hidden; background: #000;
    border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.px-gallery-screen .carousel-slide { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; cursor: zoom-in; }
/* неактивные слайды app.js прячет атрибутом hidden — он должен побеждать display:block */
.px-gallery-screen .carousel-slide[hidden] { display: none; }
.px-gallery-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.px-gallery-hint { margin-top: 10px; font-size: .85rem; color: var(--text-soft); }

/* ── Три шага ──────────────────────────────────────────────────────── */
.px-steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; position: relative; }
.px-steps li { position: relative; }
.px-steps li:not(:last-child)::after {
    content: ''; position: absolute; top: 44px; right: -17px; width: 18px; height: 2px; background: var(--accent);
}
.px-steps li {
    padding: 26px 26px 28px; border-radius: var(--radius-lg);
    background: var(--card-bg); border: 1px solid var(--border);
}
.px-step-num { font-family: 'csfont', var(--font-sans); font-size: 2rem; color: var(--accent); line-height: 1; }
.px-steps h3 { margin-top: 16px; font-family: 'Moderustic', var(--font-sans); font-weight: 800; font-size: 1.15rem; color: var(--text); }
.px-steps p { margin-top: 8px; color: var(--text-muted); line-height: 1.6; }

/* ── Что нового: лента с точками ───────────────────────────────────── */
.px-timeline { position: relative; padding-left: 28px; }
.px-timeline::before { content: ''; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; background: var(--border-strong); }
.px-timeline .changelog-entry { position: relative; }
.px-timeline .changelog-entry::before {
    content: ''; position: absolute; left: -28px; top: 26px; width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 4px var(--bg);
}

/* ── Что нового: сборки внутри версии ──────────────────────────────────
   Карточка 2.5.4: сверху самая свежая сборка целиком, ниже — прежние сборки и сам выпуск
   строками-раскрывашками (<details>). Цвета только из переменных — светлая и тёмная схемы сами */
.px-cl-current { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -2px 0 12px; }
.px-cl-chip {
    display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent);
    font-family: var(--font-sans); font-size: .78rem; font-weight: 700; letter-spacing: .02em;
}
.px-cl-fresh {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--ink-mint); font-size: .78rem; font-weight: 600;
}
.px-cl-fresh::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.px-cl-history { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.px-cl-history-title {
    margin-bottom: 6px; color: var(--text-soft);
    font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.px-cl-row { border-radius: var(--radius); }
.px-cl-row + .px-cl-row { margin-top: 2px; }
.px-cl-row > summary {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius);
    color: var(--text-muted); font-size: .9rem; cursor: pointer; list-style: none;
    transition: background-color .15s ease, color .15s ease;
}
.px-cl-row > summary::-webkit-details-marker { display: none; }
.px-cl-row > summary:hover { background: var(--bg-section); color: var(--text); }
.px-cl-row > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.px-cl-chev { width: 12px; font-size: .7rem; color: var(--text-soft); transition: transform .2s ease; }
.px-cl-row[open] > summary .px-cl-chev { transform: rotate(90deg); color: var(--accent); }
.px-cl-num {
    min-width: 3.4em; color: var(--text);
    font-family: 'Moderustic', var(--font-sans); font-weight: 800;
}
.px-cl-kind {
    padding: 1px 7px; border-radius: var(--radius-sm); background: var(--tint-blue); color: var(--ink-blue);
    font-size: .7rem; font-weight: 700; letter-spacing: .03em;
}
.px-cl-date { white-space: nowrap; }
.px-cl-count { margin-left: auto; color: var(--text-soft); font-size: .84rem; white-space: nowrap; }
.px-cl-row[open] { background: var(--bg-section); }
.px-cl-row[open] > summary { color: var(--text); }
.px-cl-row > .changelog-items { padding: 2px 14px 14px 32px; animation: px-cl-open .2s ease both; }
@keyframes px-cl-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .px-cl-row > .changelog-items { animation: none; }
    .px-cl-chev { transition: none; }
}
@media (max-width: 560px) {
    .px-cl-row > summary { flex-wrap: wrap; row-gap: 2px; }
    .px-cl-date { order: 5; flex-basis: 100%; padding-left: 22px; font-size: .8rem; color: var(--text-soft); }
    .px-cl-row > .changelog-items { padding: 2px 10px 12px 12px; }
    .px-cl-row > .changelog-items :is(li, added, fixed, deleted) { text-align: left; }
}

/* ── Подвал ────────────────────────────────────────────────────────── */
.px-footer { padding: 56px 0 26px; background: var(--card-bg); border-top: 1px solid var(--border); }
.px-footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); gap: 32px; }
.px-footer-brand p { margin-top: 14px; color: var(--text-muted); line-height: 1.6; max-width: 360px; }
.px-footer-col { display: flex; flex-direction: column; gap: 9px; }
.px-footer-col h4 { font-family: 'Moderustic', var(--font-sans); font-weight: 800; font-size: .95rem; color: var(--text); margin-bottom: 4px; }
.px-footer-col a { color: var(--text-muted); text-decoration: none; }
.px-footer-col a:hover { color: var(--accent); }
.px-footer-bottom {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-soft); font-size: .9rem;
}

/* шапка: лёгкая тень, когда страница прокручена (plus.js) */
.site-header.px-scrolled { box-shadow: 0 6px 20px rgba(17, 23, 35, .07); }

/* ── Адаптив ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .px-builds-row.hero-builds-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .px-hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .px-shot { max-width: 640px; }
    .px-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .px-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .px-builds-panel.hero-builds { padding: 16px; }
    .px-builds-titles p { display: none; }
    .px-builds-all > span:first-child { display: none; }
    .px-builds-row.hero-builds-row { display: flex; grid-template-columns: none; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
    .px-builds-row .hero-build-tile { width: 168px; height: 104px; flex: 0 0 auto; }
    .px-hero .hero-cta { flex-wrap: wrap; }
    .px-hero-visual { padding: 18px 6px; }
    .px-shot { transform: none; }
    .px-float-c { display: none; }
    .px-float { padding: 8px 12px 8px 8px; }
    .px-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
    .px-facts > div { padding: 0; border-left: 0; }
    .px-steps li:not(:last-child)::after { display: none; }
    .px-hero { padding: 36px 0 32px; }
    .px-hero-circle { width: 640px; height: 640px; right: -320px; top: -260px; }
    .px-features, .px-steps { grid-template-columns: 1fr; }
    .px-feature-wide { grid-column: auto; }
    .px-footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .px-hero-circle, .px-float { animation: none; }
    .px-shot, .px-feature-mark { transition: none; }
    .px-feature { transition: none; }
}

/* после полосы сборок «О клиенте» начинается ближе */
.px-builds-band + #about { padding-top: 72px; }
@media (max-width: 720px) { .px-builds-band + #about { padding-top: 48px; } }
/* полосы сборок нет (одна сборка) — «О клиенте» сразу под витриной, без пустоты */
.px-hero + #about { padding-top: 8px; }
@media (max-width: 720px) { .px-hero + #about { padding-top: 24px; } }

/* ── Готовая страница сразу: без «проявления» отрисованного сервером ───── */
/* текст и блоки видны с первого кадра — входные анимации классической темы выключены */
.hero-anim .hero-badge, .hero-anim .hero-title, .hero-anim .hero-lead,
.hero-anim .hero-cta, .hero-anim .hero-builds,
[data-reveal], [data-reveal].is-in,
.hero-build-tile, .hero-build-all { opacity: 1 !important; transform: none; animation: none !important; }
.hero-build-tile:hover { transform: translateY(-6px); }

/* ── Скелетоны картинок ────────────────────────────────────────────── */
/* пока картинка грузится, на её месте спокойный переливающийся блок нужного размера;
   прячем картинку только когда есть скрипт (.js), который её покажет */
:root { --skel: #e3e8f0; --skel-shine: rgba(255, 255, 255, .55); }
[data-theme="dark"] { --skel: #1f242c; --skel-shine: rgba(255, 255, 255, .05); }
@media (prefers-color-scheme: dark) { [data-theme="auto"] { --skel: #1f242c; --skel-shine: rgba(255, 255, 255, .05); } }

.px-skel, .px-builds-row .hero-build-tile, .build-card-media { background-color: var(--skel); }
.px-skel::before,
.px-builds-row .hero-build-tile:not(.is-loaded)::before,
.build-card-media:not(.is-loaded)::before {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: linear-gradient(100deg, transparent 30%, var(--skel-shine) 50%, transparent 70%) 0 0 / 220% 100%;
    animation: px-skel 1.4s ease-in-out infinite;
}
.px-skel { position: relative; }
.px-skel.is-loaded::before { display: none; }
@keyframes px-skel { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* картинки проявляются, когда загрузились (plus.js ставит .is-loaded) */
.js .px-skel img, .js .build-card-media img { opacity: 0; transition: opacity .35s ease; z-index: 1; }
.px-skel img { position: relative; }
.js .px-skel img.is-loaded, .js .build-card-media img.is-loaded { opacity: 1; }
.js .px-builds-row .hero-build-tile-img { opacity: 0; transition: opacity .35s ease, transform .45s ease; }
.js .px-builds-row .hero-build-tile.is-loaded .hero-build-tile-img { opacity: 1; }
.build-card-media { position: relative; }

@media (prefers-reduced-motion: reduce) {
    .px-skel::before, .px-builds-row .hero-build-tile::before, .build-card-media::before { animation: none; }
}

/* ── Внутренние страницы: единая шапка раздела и сетки под ширину 1360 ── */
/* шапка «Серверы / Программы / ReHLDS / Виджеты» — компактная, без рамки; содержимое сразу под ней */
.hero.hero-compact { padding: 56px 0 8px; border-bottom: 0; }
.hero.hero-compact + .section { padding-top: 32px; }
.hero.hero-compact .hero-lead { margin-bottom: 0; max-width: 720px; }
/* метка над заголовком — как у секций главной: синяя, с короткой чертой */
.hero.hero-compact .hero-badge {
    padding: 0; background: none; border-radius: 0; color: var(--accent);
    font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; gap: 10px;
}
.hero.hero-compact .hero-badge i { display: none; }
.hero.hero-compact .hero-badge::before { content: ''; width: 22px; height: 2px; background: currentColor; }
/* заголовки разделов одного размера; «Сборки» оформлены секцией — подтягиваем к тому же виду */
.hero.hero-compact .hero-title,
#buildsPage .section-header .section-title { font-size: clamp(1.9rem, 1.2rem + 2vw, 2.7rem); line-height: 1.12; margin: 14px 0 12px; }
#buildsPage { padding-top: 56px; }
#buildsPage .section-header { margin-bottom: 32px; }

/* серверы: три в ряд на широком экране */
@media (min-width: 1200px) { .servers-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
    .hero.hero-compact { padding: 36px 0 4px; }
    .hero.hero-compact + .section { padding-top: 24px; }
    #buildsPage { padding-top: 36px; }
}

/* точки и стрелки карусели под скриншотом стоят на фоне страницы — цвета по схеме, а не белые */
.px-gallery-nav .carousel-dot { background: var(--border-strong); }
.px-gallery-nav .carousel-dot.is-active, .px-gallery-nav .carousel-dot.active { background: var(--accent); }
.px-gallery-nav .carousel-arrow { color: var(--text); }

/* ── Что нового: переход на NextClient Plus ────────────────────────── */
.px-plus-note {
    display: flex; align-items: flex-start; gap: 14px; margin: -18px auto 28px; padding: 16px 18px;
    max-width: 928px; box-sizing: border-box;
    border-radius: var(--radius-lg); border: 1px solid var(--accent-strong); background: var(--accent-soft);
}
.px-plus-note-icon { color: var(--accent); font-size: 1.3rem; line-height: 1.4; }
.px-plus-note p { color: var(--text-muted); line-height: 1.6; }
.px-plus-note b { color: var(--text); }
.px-plus-tag {
    display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: var(--radius-sm);
    background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .04em;
    vertical-align: middle; font-family: var(--font-sans);
}

/* ── Метка Plus. В шапке и подвале (общие с default, через ::after): «NEXTCLIENT | PLUS» —
   тонкая черта и мелкая надпись разрядкой. В заголовке: оранжевый «+» сверху у слова NextClient.
   Плоско, без плашки, наклона и блика ── */
.site-header .logo-main::after,
.px-footer-brand .logo-main::after {
    content: 'PLUS';
    display: inline-block;
    margin-left: 9px;
    padding-left: 9px;
    border-left: 2px solid var(--border);
    color: #f28a00;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2em;
    line-height: 1;
    vertical-align: middle;
}
.px-plus-mark {
    margin-left: .04em;
    color: #f28a00;
    font-family: var(--font-sans);
    font-size: .75em;
    font-weight: 900;
    line-height: 0;
    vertical-align: .35em;
}
/* «+» рисуется стилем: в тексте заголовка для поисковика — «NextClient Plus» (слово в .visually-hidden рядом) */
.px-plus-mark::before { content: '+'; }
@media (max-width: 640px) {
    .site-header .logo-main::after { display: none; }
}

/* ── Выпадающие меню шапки (только десктоп; на телефоне — список в бургере из default) ──
   Панель с тенью и тонкой акцентной чертой сверху, у пунктов — цветные иконки по порядку,
   при наведении иконка заливается, слева появляется полоска, справа выезжает шеврон.
   Пункты появляются лесенкой. */
@media (min-width: 769px) {
    .nav-dropdown-panel,
    .nav-dropdown-right .nav-dropdown-panel {
        top: calc(100% + 12px);
        min-width: 360px;
        width: max-content;
        padding: 8px;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: var(--card-bg);
        box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 50px -12px rgba(0, 0, 0, .45), 0 4px 12px -4px rgba(0, 0, 0, .18);
        transform-origin: top right;
        transform: translateY(-8px) scale(.97);
        transition: opacity .2s ease, transform .24s cubic-bezier(.2, .8, .2, 1), visibility .2s;
    }
    .nav-dropdown-right.is-open .nav-dropdown-panel { transform: translateY(0) scale(1); }
    /* акцентная черта по верхнему краю */
    .nav-dropdown-panel::before {
        content: ''; position: absolute; top: -1px; left: 22px; right: 22px; height: 2px;
        border-radius: 0 0 2px 2px; background: var(--accent);
    }
    /* невидимый мостик над панелью — курсор не «проваливается» в зазор */
    .nav-dropdown-panel::after {
        content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px;
    }

    .nav-dropdown-item {
        position: relative; gap: 14px; padding: 11px 14px 11px 12px; border-radius: 9px;
        transition: background .18s ease;
    }
    .nav-dropdown-item + .nav-dropdown-item { margin-top: 2px; }
    .nav-dropdown-item:hover,
    .nav-dropdown-item.is-active { background: color-mix(in srgb, var(--text) 5%, transparent); }
    .nav-dropdown-item::before {
        content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0;
        background: var(--ink, var(--accent)); transform: scaleY(0); transition: transform .2s ease;
    }
    .nav-dropdown-item:hover::before,
    .nav-dropdown-item.is-active::before { transform: scaleY(1); }

    .nav-dropdown-item:nth-of-type(3n+1) { --ink: var(--ink-blue);   --tint: var(--tint-blue); }
    .nav-dropdown-item:nth-of-type(3n+2) { --ink: var(--ink-violet); --tint: var(--tint-violet); }
    .nav-dropdown-item:nth-of-type(3n+3) { --ink: var(--ink-mint);   --tint: var(--tint-mint); }
    .nav-dropdown-icon {
        width: 42px; height: 42px; border-radius: 10px; font-size: 16px;
        background: var(--tint); color: var(--ink);
        transition: background .2s ease, color .2s ease, transform .2s ease;
    }
    .nav-dropdown-item:hover .nav-dropdown-icon,
    .nav-dropdown-item.is-active .nav-dropdown-icon { background: var(--ink); color: var(--card-bg); transform: rotate(-6deg); }

    .nav-dropdown-item-text { gap: 3px; }
    .nav-dropdown-item-title { font-family: 'Moderustic', var(--font-sans); font-weight: 800; font-size: .95rem; }
    .nav-dropdown-item-desc  { font-size: .8rem; color: var(--text-soft); white-space: nowrap; }

    /* шеврон справа у внутренних ссылок, у внешних — их иконка «↗» ведёт себя так же */
    .nav-dropdown-item:not([target])::after {
        content: '\f054'; font-family: var(--fa-family-classic, 'Font Awesome 7 Free'); font-weight: 900; font-size: 11px;
        color: var(--ink, var(--accent)); opacity: 0; transform: translateX(-6px);
        transition: opacity .2s ease, transform .2s ease;
    }
    .nav-dropdown-external { align-self: center; margin-top: 0; opacity: 0; transform: translate(-4px, 4px); transition: opacity .2s ease, transform .2s ease; }
    .nav-dropdown-item:hover::after,
    .nav-dropdown-item.is-active::after { opacity: 1; transform: translateX(0); }
    .nav-dropdown-item:hover .nav-dropdown-external { opacity: 1; transform: none; color: var(--ink, var(--accent)); }

    /* «Все разделы документации» — нижняя полоса панели */
    .nav-dropdown-sep { display: none; }
    .nav-dropdown-link {
        margin: 8px -8px -8px; padding: 13px 22px; border-radius: 0 0 12px 12px;
        border-top: 1px solid var(--border); background: color-mix(in srgb, var(--text) 3%, transparent);
        font-weight: 600;
    }
    .nav-dropdown-link:hover { background: var(--accent-soft); }

    /* пункты появляются лесенкой */
    .nav-dropdown.is-open .nav-dropdown-item,
    .nav-dropdown.is-open .nav-dropdown-link { animation: px-dd-in .32s cubic-bezier(.2, .8, .2, 1) both; }
    .nav-dropdown.is-open .nav-dropdown-item:nth-of-type(2) { animation-delay: .04s; }
    .nav-dropdown.is-open .nav-dropdown-item:nth-of-type(3) { animation-delay: .08s; }
    .nav-dropdown.is-open .nav-dropdown-link { animation-delay: .12s; }
}
@keyframes px-dd-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .nav-dropdown.is-open .nav-dropdown-item, .nav-dropdown.is-open .nav-dropdown-link { animation: none; }
}

/* ── Синие кнопки: тёмная заливка с синей рамкой и свечением, правый край — стрелкой.
   Форма рисуется двумя псевдослоями (рамка и заливка, оба обрезаны многоугольником),
   а свечение — drop-shadow на самой кнопке, поэтому оно повторяет стрелку и не обрезается. ── */
.btn-primary {
    --tip: 14px;
    --fill: color-mix(in srgb, var(--accent) 14%, var(--card-bg));
    position: relative; isolation: isolate;
    border: 0; background: transparent;
    color: var(--text) !important;
    padding-right: calc(22px + var(--tip));
    font-weight: 700;
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 40%, transparent));
    transition: filter .25s ease, transform .15s ease;
}
.btn-primary.btn-sm { --tip: 10px; padding-right: calc(14px + var(--tip)); }
.btn-primary.btn-lg { --tip: 18px; padding-right: calc(26px + var(--tip)); }
.btn-primary::before,
.btn-primary::after {
    content: ''; position: absolute; pointer-events: none;
    clip-path: polygon(0 0, calc(100% - var(--tip)) 0, 100% 50%, calc(100% - var(--tip)) 100%, 0 100%);
}
.btn-primary::before { inset: 0; z-index: -2; border-radius: 8px 0 0 8px; background: var(--accent); }
.btn-primary::after  { inset: 1.5px 2px 1.5px 1.5px; z-index: -1; border-radius: 6.5px 0 0 6.5px; background: var(--fill); transition: background-color .25s ease; }
.btn-primary i { color: var(--accent); }
.btn-primary:hover:not(:disabled) {
    background: transparent; box-shadow: none;
    --fill: color-mix(in srgb, var(--accent) 26%, var(--card-bg));
    filter: drop-shadow(0 0 16px color-mix(in srgb, var(--accent) 60%, transparent));
    transform: translateX(2px);
}
.btn-primary:active:not(:disabled) { transform: translateX(1px) scale(.99); }
.btn-primary .fa-download { transition: transform .2s ease; }
.btn-primary:hover .fa-download { animation: px-nod .7s ease; }
@keyframes px-nod { 0%, 100% { transform: none; } 40% { transform: translateY(3px); } 70% { transform: translateY(-1px); } }
@media (prefers-reduced-motion: reduce) {
    .btn-primary:hover .fa-download { animation: none; }
    .btn-primary:hover:not(:disabled) { transform: none; }
}
/* стрелка в кружке справа (из варианта C): выезжает при наведении */
.btn-primary .btn-arrow {
    display: inline-grid; place-items: center; flex: 0 0 auto;
    width: 26px; height: 26px; margin-left: 6px; border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    font-size: .72rem;
    transition: background-color .25s ease, transform .25s ease;
}
.btn-primary .btn-arrow i { color: var(--accent); transition: color .25s ease; }
.btn-primary:hover:not(:disabled) .btn-arrow { background: var(--accent); transform: translateX(3px); }
.btn-primary:hover:not(:disabled) .btn-arrow i { color: #fff; }
.btn-primary.btn-lg .btn-arrow { width: 30px; height: 30px; margin-left: 10px; }
/* В ряду кнопок карточки общий стиль задаёт .btn свои отступы — возвращаем место под нос-стрелку.
   Когда ряд узкий (сетка сборок), стрелка в кружке лишняя, а «Яндекс.Диск» остаётся иконкой. */
:is(.build-actions, .soft-actions, .server-actions) { container-type: inline-size; }
:is(.build-actions, .soft-actions, .server-actions) .btn-primary { padding-left: 16px; padding-right: calc(12px + var(--tip)); min-width: 0; }
@container (max-width: 330px) {
    .btn-primary .btn-arrow { display: none; }
}
/* на телефоне кнопки встают в две строки — там подпись «Яндекс.Диск» не мешает */
@media (min-width: 721px) {
    @container (max-width: 430px) {
        .btn-secondary.download-btn { flex: 0 0 auto; min-width: 0; padding-left: 16px; padding-right: 16px; }
        .btn-secondary.download-btn > span { display: none; }
    }
}
/* стрелка в кружке всегда стоит у носа кнопки, текст — по центру оставшегося места */
.btn-primary:has(.btn-arrow) { padding-right: calc(var(--tip) + 46px); }
.btn-primary .btn-arrow { position: absolute; top: 50%; right: calc(var(--tip) + 8px); margin: -13px 0 0; }
.btn-primary.btn-lg .btn-arrow { margin-top: -15px; }
.btn-primary:hover:not(:disabled) .btn-arrow { transform: translateX(3px); }
:is(.build-actions, .soft-actions, .server-actions) .btn-primary:has(.btn-arrow) { padding-right: calc(var(--tip) + 44px); }
@container (max-width: 330px) {
    :is(.build-actions, .soft-actions, .server-actions) .btn-primary:has(.btn-arrow) { padding-right: calc(12px + var(--tip)); }
}

/* Переход к сборке по ссылке /#build-ID (пока /builds скрыт): карточка не прячется под шапкой
   и коротко подсвечивается, чтобы было видно, к какой пришли */
.build-card { scroll-margin-top: 130px; }
.build-card:target { animation: px-build-target 1.8s ease-out .3s both; }
@keyframes px-build-target {
    0%   { box-shadow: 0 0 0 0 var(--accent-strong), var(--shadow, 0 0 0 transparent); }
    25%  { box-shadow: 0 0 0 6px var(--accent-strong), var(--shadow, 0 0 0 transparent); }
    100% { box-shadow: 0 0 0 0 transparent, var(--shadow, 0 0 0 transparent); }
}
@media (prefers-reduced-motion: reduce) { .build-card:target { animation: none; outline: 2px solid var(--accent); } }

/* ── Кнопка «наверх» (создаёт plus.js) ─────────────────────────────────
   Круг в цвет карточек с синей стрелкой, по кругу — полоса прочитанного.
   При наведении заливается акцентом, как главные кнопки сайта */
.px-totop {
    position: fixed; right: 24px; bottom: 24px; z-index: 890;
    display: grid; place-items: center; width: 52px; height: 52px; padding: 0;
    border: 1px solid var(--border); border-radius: 50%;
    background: var(--card-bg); color: var(--accent); cursor: pointer;
    box-shadow: 0 10px 28px -10px rgba(17, 23, 35, .35), 0 2px 6px -2px rgba(17, 23, 35, .12);
    opacity: 0; visibility: hidden; transform: translateY(14px) scale(.9);
    transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1), visibility .25s,
                background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.px-totop.is-visible { opacity: 1; visibility: visible; transform: none; }
.px-totop i { position: relative; font-size: 1.05rem; transition: transform .25s ease; }
.px-totop-ring { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: rotate(-90deg); pointer-events: none; }
.px-totop-ring circle { fill: none; stroke-width: 2.5; }
.px-totop-track { stroke: transparent; }
.px-totop-bar { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .1s linear, stroke .2s ease; }
.px-totop:hover,
.px-totop:focus-visible {
    background: var(--accent); border-color: var(--accent); color: #fff;
    box-shadow: 0 14px 30px -10px var(--accent), 0 2px 6px -2px rgba(17, 23, 35, .15);
}
.px-totop:hover i,
.px-totop:focus-visible i { transform: translateY(-3px); }
.px-totop:hover .px-totop-bar,
.px-totop:focus-visible .px-totop-bar { stroke: rgba(255, 255, 255, .55); }
.px-totop:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 3px; }
.px-totop:active { transform: scale(.94); }
[data-theme="dark"] .px-totop { box-shadow: 0 10px 28px -10px rgba(0, 0, 0, .7); }
@media (max-width: 640px) {
    .px-totop { right: 16px; bottom: 16px; width: 46px; height: 46px; }
}
/* пока висит плашка про cookie, а экран узкий и она во всю ширину — кнопка над ней */
@media (max-width: 800px) {
    body:has(.cookie-consent:not([hidden])) .px-totop { bottom: 150px; }
}
@media (prefers-reduced-motion: reduce) {
    .px-totop, .px-totop i, .px-totop-bar { transition: none; }
}
