/* ==================================================
   ШРИФТЫ (Inter, локально — fontsource 5.2.5)
   ================================================== */

@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 400; src: url('/fonts/inter-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 400; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 500; src: url('/fonts/inter-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 500; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 600; src: url('/fonts/inter-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 600; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 700; src: url('/fonts/inter-cyrillic-700-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 700; src: url('/fonts/inter-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 800; src: url('/fonts/inter-cyrillic-800-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 800; src: url('/fonts/inter-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Запасной шрифт с подогнанными метриками — убирает сдвиг макета при подгрузке Inter */
@font-face {
    font-family: 'Inter Fallback';
    src: local('Arial');
    ascent-override: 90%;
    descent-override: 22.43%;
    line-gap-override: 0%;
    size-adjust: 107.4%;
}

/* ==================================================
   ПЕРЕМЕННЫЕ И СБРОС СТИЛЕЙ
   ================================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg:            #0b0b0f;
    --bg-card:       #111118;
    --bg-card-hover: #16161f;
    --bg-elevated:   #1c1c28;

    --border:        rgba(255, 255, 255, 0.07);
    --border-hover:  rgba(255, 255, 255, 0.14);
    --border-accent: rgba(139, 92, 246, 0.35);

    --accent-purple: #8b5cf6;
    --accent-blue:   #3b82f6;
    --gradient:      linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    --gradient-text: linear-gradient(135deg, #a78bfa 0%, #60a5fa 100%);
    --glow:          0 0 40px rgba(139, 92, 246, 0.18);
    --glow-strong:   0 0 60px rgba(139, 92, 246, 0.3);

    --text:          #f0f0f5;
    --text-2:        #8f8fa8;
    --text-3:        #52525e;

    --r-xs:  8px;
    --r-sm:  12px;
    --r-md:  18px;
    --r-lg:  24px;
    --r-xl:  32px;

    --max-w:  1200px;
    --pad-x:  24px;

    --ease:   cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast: 0.15s var(--ease);
    --t:      0.25s var(--ease);
    --t-slow: 0.5s  var(--ease);

    --font: 'Inter', 'Inter Fallback', system-ui, -apple-system, sans-serif;
    --header-h: 68px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ==================================================
   УТИЛИТЫ
   ================================================== */

.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad-x);
}

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 16px;
}

.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 64px;
}

.section-header h2 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.section-header p {
    font-size: 17px;
    color: var(--text-2);
    line-height: 1.6;
}

/* ==================================================
   КНОПКИ
   ================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    border-radius: var(--r-sm);
    transition: var(--t);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn--lg { padding: 14px 28px; font-size: 16px; }
.btn--md { padding: 11px 22px; font-size: 15px; }
.btn--sm { padding: 9px 18px; font-size: 14px; }

.btn--primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}
.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.45);
}
.btn--primary:active { transform: translateY(0); }

.btn--secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--border-hover);
}
.btn--secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.btn--outline-accent {
    background: rgba(139, 92, 246, 0.08);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.35);
}
.btn--outline-accent:hover {
    background: rgba(139, 92, 246, 0.15);
    transform: translateY(-1px);
}

/* ==================================================
   ХЕДЕР
   ================================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-h);
    border-bottom: 1px solid transparent;
    transition: background var(--t), border-color var(--t), backdrop-filter var(--t);
}

.header.scrolled {
    background: rgba(11, 11, 15, 0.85);
    border-color: var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header__inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}
.logo__img {
    width: 36px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.logo__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
}
.logo__tagline {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-2);
    letter-spacing: 0.01em;
}
.logo__accent { color: var(--accent-purple); }

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav__link {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    border-radius: var(--r-xs);
    transition: var(--t-fast);
}
.nav__link:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    padding: 4px;
}
.burger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-2);
    border-radius: 2px;
    transition: var(--t);
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==================================================
   HERO
   ================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 60px) 0 80px;
    overflow: hidden;
}

.hero__blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: floatBlob 10s ease-in-out infinite;
}
.blob--purple {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #7c3aed, transparent 70%);
    top: -100px;
    left: -150px;
    animation-duration: 12s;
}
.blob--blue {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #2563eb, transparent 70%);
    bottom: -100px;
    right: -100px;
    animation-duration: 9s;
    animation-delay: -4s;
}

@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(30px, -40px) scale(1.05); }
    66%       { transform: translate(-20px, 30px) scale(0.97); }
}

.hero__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: 60px;
    align-items: center;
}

.hero__content { max-width: 580px; }

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 6px 14px;
    margin-bottom: 28px;
}
.badge-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.7; transform: scale(1.2); }
}

.hero__title {
    font-size: clamp(38px, 5.5vw, 64px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 22px;
}

.hero__subtitle {
    font-size: clamp(16px, 2vw, 19px);
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 36px;
    max-width: 480px;
}

.hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-2);
}
.trust-item svg { color: var(--accent-purple); flex-shrink: 0; }

/* Chat Demo Widget */

.chat-demo {
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--glow), 0 30px 80px rgba(0,0,0,0.5);
}

.chat-demo__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.chat-demo__avatar {
    width: 38px;
    height: 38px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-demo__name {
    font-size: 14px;
    font-weight: 600;
}
.chat-demo__status {
    font-size: 12px;
    color: #22c55e;
    display: flex;
    align-items: center;
    gap: 4px;
}
.chat-demo__status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
}

.chat-demo__messages {
    min-height: 200px;
    max-height: 280px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.chat-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    animation: msgIn 0.3s var(--ease) both;
}
.chat-msg--bot {
    align-self: flex-start;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}
.chat-msg--user {
    align-self: flex-end;
    background: var(--gradient);
    color: #fff;
    border-bottom-right-radius: 4px;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-demo__options {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 145px;
}

.chat-opt {
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--r-xs);
    text-align: left;
    transition: var(--t-fast);
    cursor: pointer;
}
.chat-opt:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.5);
}
.chat-opt.disabled { opacity: 0.4; pointer-events: none; }

.chat-typing {
    display: flex;
    gap: 5px;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
}
.chat-typing span {
    width: 7px;
    height: 7px;
    background: var(--text-3);
    border-radius: 50%;
    animation: typingDot 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 80%, 100% { transform: scale(1); opacity: 0.4; }
    40%            { transform: scale(1.3); opacity: 1; }
}

/* ==================================================
   USE CASES (ДЛЯ КОГО)
   ================================================== */

.section {
    padding: 100px 0;
}
.section--alt { background: linear-gradient(180deg, transparent, rgba(255,255,255,0.015), transparent); }

.tasks__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 28px 24px;
    transition: var(--t);
}
.task-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-3px);
    box-shadow: var(--glow);
    background: var(--bg-card-hover);
}

.task-card__icon {
    width: 48px;
    height: 48px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--accent-purple);
}

.task-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}
.task-card p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.55;
    margin-bottom: 12px;
}
.task-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 100px;
    background: rgba(255,255,255,0.06);
    color: var(--text-2);
    border: 1px solid var(--border);
}

/* ==================================================
   WHY ME (ПОЧЕМУ ЧАСТНЫЙ РАЗРАБОТЧИК)
   ================================================== */

.whyme {
    padding: 80px 0;
}

.whyme__inner {
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.08) 0%,
        rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--r-xl);
    padding: 56px 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.whyme__left h2 {
    font-size: clamp(26px, 3.5vw, 36px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}
.whyme__left p {
    font-size: 16px;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 28px;
}

.whyme__points {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.whyme-point {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px;
}
.whyme-point__icon {
    font-size: 22px;
    margin-bottom: 8px;
}
.whyme-point h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}
.whyme-point p {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
    margin: 0;
}

/* ==================================================
   УСЛУГИ
   ================================================== */

.services__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 32px 28px;
    transition: var(--t);
    display: flex;
    flex-direction: column;
}
.service-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--glow);
    transform: translateY(-4px);
}
.service-card--featured {
    border-color: rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(59,130,246,0.04));
    position: relative;
    overflow: hidden;
}
.service-card--featured::before {
    content: 'Популярно';
    position: absolute;
    top: 20px; right: -28px;
    background: var(--gradient);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 36px;
    transform: rotate(45deg);
    letter-spacing: 0.05em;
}

.service-card__icon {
    width: 56px;
    height: 56px;
    background: var(--gradient);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #fff;
}

.service-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}
.service-card > p {
    font-size: 15px;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}
.service-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.service-list li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 14px;
    color: var(--text-2);
}
.service-list li::before {
    content: '';
    flex-shrink: 0;
    margin-top: 6px;
    width: 5px;
    height: 5px;
    background: var(--accent-purple);
    border-radius: 50%;
}

/* ==================================================
   КЕЙСЫ
   ================================================== */

.cases__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.case-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: var(--t);
}
.case-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.case-card__visual {
    height: 180px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.case-visual-bg {
    position: absolute;
    inset: 0;
}

.case-visual-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.case-card__body { padding: 24px; }
.case-card__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

.case-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    letter-spacing: 0.05em;
}
.case-tag--tg  { background: rgba(0, 136, 204, 0.15); color: #38bdf8; border: 1px solid rgba(0,136,204,0.2); }
.case-tag--max { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139,92,246,0.2); }
.case-tag--ai  { background: rgba(34, 197, 94, 0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.case-tag--crm { background: rgba(251, 146, 60, 0.12); color: #fb923c; border: 1px solid rgba(251,146,60,0.2); }

.case-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.case-card p  { font-size: 14px; color: var(--text-2); line-height: 1.55; margin-bottom: 16px; }

.case-card__metrics {
    display: flex;
    gap: 20px;
}
.metric { }
.metric__val {
    font-size: 22px;
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}
.metric__label { font-size: 12px; color: var(--text-2); }

/* ==================================================
   ПРОЦЕСС
   ================================================== */

.process__timeline {
    position: relative;
}

.process__track {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    position: relative;
}

.process__track::before {
    content: '';
    position: absolute;
    top: 28px;
    left: 28px;
    right: 28px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
    opacity: 0.3;
    z-index: 0;
}

.process-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 8px;
    position: relative;
    z-index: 1;
}

.process-step__num {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 16px;
    transition: var(--t);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.process-step.active .process-step__num,
.process-step:hover .process-step__num {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.process-step h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}
.process-step p {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.5;
}

/* ==================================================
   ИНТЕГРАЦИИ
   ================================================== */

.integrations__logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 56px;
}

.integration-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--t-fast);
}
.integration-badge:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}
.integration-badge__icon {
    font-size: 18px;
}

.integrations__features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.int-feature {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 24px 20px;
    transition: var(--t);
}
.int-feature:hover {
    border-color: var(--border-accent);
    transform: translateY(-3px);
}
.int-feature__icon {
    font-size: 28px;
    margin-bottom: 12px;
}
.int-feature h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.int-feature p  { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* ==================================================
   ТАРИФЫ
   ================================================== */

.pricing__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

.price-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 36px 30px;
    transition: var(--t);
    position: relative;
}
.price-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.price-card--popular {
    border-color: rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, rgba(139,92,246,0.09), rgba(59,130,246,0.04));
    transform: scale(1.02);
}
.price-card--popular:hover { transform: scale(1.02) translateY(-4px); }

.price-popular-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 100px;
    white-space: nowrap;
}

.price-card__name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-2);
    margin-bottom: 8px;
}
.price-card__price {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
    line-height: 1.1;
}
.price-card__price span {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-2);
    vertical-align: middle;
}
.price-card__note {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 6px;
}
.price-card__for {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.price-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}
.price-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.45;
}
.price-feature__check {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--accent-purple);
}

.price-card__timing {
    font-size: 13px;
    color: var(--text-2);
    margin-top: 10px;
    text-align: center;
    opacity: 0.8;
}

/* ==================================================
   FAQ
   ================================================== */

.faq__list {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: border-color var(--t);
}
.faq-item.open {
    border-color: var(--border-accent);
}

.faq-item__q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    text-align: left;
    color: var(--text);
    padding: 20px 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    transition: color var(--t-fast);
}
.faq-item__q:hover { color: var(--accent-purple); }

.faq-item__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--t);
    color: var(--text-2);
}
.faq-item.open .faq-item__icon {
    background: var(--gradient);
    color: #fff;
    transform: rotate(45deg);
}

.faq-item__a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease), padding 0.3s var(--ease);
}
.faq-item.open .faq-item__a {
    max-height: 400px;
}
.faq-item__a-inner {
    padding: 0 24px 20px;
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.7;
}

/* ==================================================
   КОНТАКТ / ФИНАЛЬНЫЙ CTA
   ================================================== */

.contact__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.contact__left h2 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}
.contact__left p {
    font-size: 16px;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 28px;
}

.contact__direct {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-size: 15px;
    font-weight: 500;
    transition: var(--t);
}
.contact-link:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
}
.contact-link__icon {
    font-size: 22px;
}

.contact-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 36px;
}
.contact-form h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}
.contact-form > p {
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 11px 14px;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color var(--t-fast);
    resize: none;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-3); }

.form-checkboxes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-2);
    padding: 7px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    transition: var(--t-fast);
    user-select: none;
}
.form-checkbox input { display: none; }
.form-checkbox.checked {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.4);
    color: var(--accent-purple);
}

.form-status {
    margin-top: 12px;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}
.form-status.success { color: #22c55e; }
.form-status.error   { color: #f87171; }

/* ==================================================
   ФУТЕР
   ================================================== */

.footer {
    border-top: 1px solid var(--border);
    padding: 48px 0 32px;
}

.footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.footer__brand p {
    font-size: 14px;
    color: var(--text-2);
    margin-top: 10px;
    max-width: 260px;
    line-height: 1.6;
}

.footer__links h5 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 12px;
}
.footer__links a {
    display: block;
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 8px;
    transition: color var(--t-fast);
}
.footer__links a:hover { color: var(--text); }

.footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-3);
    flex-wrap: wrap;
    gap: 16px 24px;
}

.footer__bottom-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer__legal {
    font-size: 11px;
    line-height: 1.55;
    color: var(--text-3);
    max-width: 320px;
}

.footer__bottom-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
}

.footer__bottom-links a {
    color: var(--text-3);
    transition: color var(--t-fast);
}
.footer__bottom-links a:hover { color: var(--text-2); }

/* ==================================================
   ЮРИДИЧЕСКИЕ СТРАНИЦЫ
   ================================================== */

.legal-page {
    padding: calc(var(--header-h) + 48px) 0 80px;
    min-height: 60vh;
}
.legal-page h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}
.legal-page__meta {
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 36px;
}
.legal-content {
    max-width: 760px;
    font-size: 15px;
    color: var(--text-2);
    line-height: 1.75;
}
.legal-content h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 32px 0 12px;
}
.legal-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 20px 0 8px;
}
.legal-content p { margin-bottom: 12px; }
.legal-content ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin-bottom: 12px;
}
.legal-content li { margin-bottom: 6px; }
.legal-content a {
    color: var(--accent-purple);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ==================================================
   404 / 500
   ================================================== */

.error-page {
    padding: calc(var(--header-h) + 64px) 0 96px;
    min-height: 70vh;
    text-align: center;
}

.error-page__code {
    font-size: clamp(72px, 18vw, 120px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.error-page h1 {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.error-page__lead {
    max-width: 520px;
    margin: 0 auto 32px;
    font-size: 17px;
    color: var(--text-2);
    line-height: 1.65;
}

.error-page__path {
    font-size: 0.92em;
    color: var(--text);
    background: var(--bg-elevated);
    padding: 2px 8px;
    border-radius: var(--r-xs);
    word-break: break-all;
}

.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 48px;
}

.error-page__nav {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}

.error-page__nav-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.error-page__links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.error-page__links a {
    font-size: 15px;
    font-weight: 500;
    color: var(--accent-purple);
}

.error-page__links a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ==================================================
   HTML-КАРТА САЙТА
   ================================================== */

.sitemap-page {
    padding: calc(var(--header-h) + 48px) 0 80px;
    min-height: 60vh;
}

.sitemap-page h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.sitemap-page__lead {
    font-size: 16px;
    color: var(--text-2);
    max-width: 640px;
    margin-bottom: 40px;
    line-height: 1.6;
}

.sitemap-page__lead a {
    color: var(--accent-purple);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sitemap-page__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 28px;
}

.sitemap-page__block {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}

.sitemap-page__block h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.sitemap-page__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sitemap-page__list a {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-2);
    transition: color var(--t-fast);
}

.sitemap-page__list a:hover {
    color: var(--accent-purple);
}

/* ==================================================
   ВИДЖЕТ ПОДДЕРЖКИ
   ================================================== */

.telegram-fab {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 200;
    display: block;
    line-height: 0;
    transition: transform var(--t), filter var(--t);
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}
.telegram-fab:hover {
    transform: scale(1.06);
    filter: drop-shadow(0 12px 28px rgba(59, 130, 246, 0.35));
}
.telegram-fab img {
    display: block;
    width: auto;
    height: 56px;
    max-width: min(140px, 40vw);
    object-fit: contain;
}

.support-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 200;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    box-shadow: var(--glow-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--t), box-shadow var(--t);
}
.support-fab:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.45);
}
.support-fab svg { width: 26px; height: 26px; }

.support-panel {
    position: fixed;
    right: 24px;
    bottom: 92px;
    z-index: 199;
    width: min(380px, calc(100vw - 32px));
    max-height: min(520px, calc(100vh - 120px));
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.96);
    transition: opacity var(--t), transform var(--t), visibility var(--t);
}
.support-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.support-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}
.support-panel__head h3 {
    font-size: 15px;
    font-weight: 700;
}
.support-panel__head p {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 2px;
}
.support-panel__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    transition: background var(--t-fast);
}
.support-panel__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.support-panel__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
    max-height: 340px;
}

.support-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.support-msg--user {
    align-self: flex-end;
    background: var(--gradient);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.support-msg--admin {
    align-self: flex-start;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}
.support-msg--system {
    font-size: 13px;
    color: var(--text-2);
    border-color: rgba(251, 191, 36, 0.25);
    background: rgba(251, 191, 36, 0.08);
}
.support-msg__time {
    display: block;
    font-size: 10px;
    opacity: 0.65;
    margin-top: 4px;
}

.support-msg a,
.form-status a {
    color: var(--accent-purple);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.support-msg a:hover,
.form-status a:hover {
    color: #a78bfa;
}

.support-panel__form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
}
.support-panel__form input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text);
    outline: none;
}
.support-panel__form input:focus {
    border-color: var(--accent-purple);
}
.support-panel__form button {
    width: 42px;
    height: 42px;
    border-radius: var(--r-sm);
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity var(--t-fast);
}
.support-panel__form button:disabled { opacity: 0.5; cursor: not-allowed; }

.support-panel__hint {
    font-size: 11px;
    color: var(--text-3);
    text-align: center;
    padding: 0 12px 10px;
}
.support-panel__hint a {
    color: var(--accent-purple);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .telegram-fab { left: 16px; bottom: 16px; }
    .telegram-fab img { height: 48px; }
    .support-fab { right: 16px; bottom: 16px; }
    .support-panel { right: 16px; bottom: 80px; }
    .logo__tagline { display: none; }
}

/* ==================================================
   SCROLL REVEAL АНИМАЦИЯ
   ================================================== */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ==================================================
   АДАПТИВ
   ================================================== */

@media (max-width: 1024px) {
    .hero__inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero__content { max-width: 100%; }
    .hero__subtitle { max-width: 100%; }
    .hero__actions  { justify-content: center; }
    .trust-row      { justify-content: center; }
    .hero__demo     { max-width: 460px; margin: 0 auto; }

    .tasks__grid { grid-template-columns: repeat(2, 1fr); }
    .process__track { grid-template-columns: repeat(3, 1fr); row-gap: 32px; }
    .process__track::before { display: none; }
    .integrations__features { grid-template-columns: repeat(2, 1fr); }
    .whyme__inner { grid-template-columns: 1fr; gap: 32px; padding: 40px 36px; }
}

@media (max-width: 768px) {
    :root {
        --pad-x: 16px;
        --header-h: 60px;
    }
    .section { padding: 72px 0; }
    .section-header { margin-bottom: 44px; }

    .nav { display: none; flex-direction: column; gap: 4px; }
    .nav.open {
        display: flex;
        position: fixed;
        top: var(--header-h);
        left: 0; right: 0;
        background: rgba(11,11,15,0.97);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        padding: 16px 16px 24px;
        z-index: 99;
    }
    .nav__link { padding: 12px 16px; font-size: 16px; }
    .header__actions .btn--secondary { display: none; }
    .burger { display: flex; }

    .hero { min-height: auto; padding: calc(var(--header-h) + 40px) 0 60px; }
    .hero__title { font-size: 36px; }

    .tasks__grid        { grid-template-columns: 1fr; }
    .services__grid     { grid-template-columns: 1fr; }
    .cases__grid        { grid-template-columns: 1fr; }
    .pricing__grid      { grid-template-columns: 1fr; }
    .integrations__features { grid-template-columns: repeat(2, 1fr); }
    .contact__inner     { grid-template-columns: 1fr; }

    .process__track { grid-template-columns: 1fr 1fr; }
    .whyme__points  { grid-template-columns: 1fr; }
    .whyme__inner   { padding: 32px 24px; }

    .price-card--popular { transform: none; }
    .price-card--popular:hover { transform: translateY(-4px); }

    .footer__inner { flex-direction: column; gap: 28px; }
    .footer__bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .hero__actions { flex-direction: column; width: 100%; }
    .hero__actions .btn { width: 100%; justify-content: center; }
    .integrations__features { grid-template-columns: 1fr; }
    .process__track { grid-template-columns: 1fr; }
    .process__track::before { display: none; }
}

/* ==================================================
   БЛОГ — СЕТКА КАРТОЧЕК
   ================================================== */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--t), transform var(--t);
}

.blog-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

.blog-card__img-wrap {
    display: block;
    overflow: hidden;
    aspect-ratio: 16/8.5;
}

.blog-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease);
}

.blog-card:hover .blog-card__img {
    transform: scale(1.04);
}

.blog-card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.blog-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.blog-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-2);
    line-height: 1.3;
}

.blog-card__badge--video { border-color: rgba(239, 68, 68, 0.35); color: #f87171; }
.blog-card__badge--audio { border-color: rgba(59, 130, 246, 0.35); color: #60a5fa; }
.blog-card__badge--poll  { border-color: rgba(139, 92, 246, 0.35); color: var(--accent-purple); }
.blog-card__badge--code  { border-color: rgba(34, 197, 94, 0.35); color: #4ade80; }

.blog-card__img-wrap--placeholder {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(59, 130, 246, 0.12) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card__placeholder-letter {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-purple);
    opacity: 0.55;
    line-height: 1;
    user-select: none;
}

.blog-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.blog-card__cat {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.22);
    transition: background var(--t-fast), color var(--t-fast);
}

.blog-card__cat:hover {
    background: rgba(139, 92, 246, 0.22);
    color: #c4b5fd;
}

.blog-grid--home {
    grid-template-columns: repeat(3, 1fr);
}

.blog-lazy-trigger {
    height: 1px;
    width: 100%;
    pointer-events: none;
    visibility: hidden;
}

.blog-section--pending {
    visibility: hidden;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 0;
}

.blog-section--empty {
    display: none;
}

.blog-card__date {
    font-size: 12px;
    color: var(--text-3);
    font-weight: 500;
}

.blog-card__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.blog-card__title a {
    color: var(--text);
    transition: color var(--t-fast);
}

.blog-card__title a:hover {
    color: var(--accent-purple);
}

.blog-card__excerpt {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__read {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-purple);
    margin-top: 4px;
    transition: opacity var(--t-fast);
}

.blog-card__read:hover { opacity: 0.8; }

/* Рубрики на странице блога */
.blog-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.blog-cats__item {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-2);
    transition: var(--t);
}

.blog-cats__item:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.blog-cats__item.active {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.35);
    color: var(--accent-purple);
}

/* Страница блога */
.blog-page {
    padding: calc(var(--header-h) + 48px) 0 80px;
    min-height: 60vh;
}

.blog-pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 40px;
}

.blog-pagination__btn {
    padding: 8px 16px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-2);
    transition: var(--t);
}

.blog-pagination__btn:hover,
.blog-pagination__btn.active {
    background: rgba(139,92,246,.12);
    border-color: rgba(139,92,246,.3);
    color: var(--accent-purple);
}

/* ==================================================
   СТАТЬЯ — СТРАНИЦА
   ================================================== */

.article-preview-banner {
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    background: rgba(245, 158, 11, 0.12);
    border-bottom: 1px solid rgba(245, 158, 11, 0.28);
    backdrop-filter: blur(10px);
}

.article-preview-banner__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 0;
    font-size: 14px;
    color: #fcd34d;
}

.article-preview-banner__link {
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.article-preview-banner__link:hover {
    color: #fde68a;
}

.article-page {
    padding-top: calc(var(--header-h) + 32px);
    padding-bottom: 80px;
}

.article-page__header {
    padding-bottom: 28px;
}

.article-breadcrumb {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 20px;
}

.article-breadcrumb a {
    color: var(--text-3);
    transition: color var(--t-fast);
}

.article-breadcrumb a:hover { color: var(--accent-purple); }

.article-page__title {
    font-size: clamp(26px, 4.5vw, 44px);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.18;
    margin-bottom: 18px;
    max-width: 820px;
}

.article-page__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-2);
    flex-wrap: wrap;
}

.article-page__cover {
    margin-bottom: 32px;
}

.article-page__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    align-items: start;
}

/* Основной контент статьи */
.article-page__content {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-2);
}

.article-page__content p { margin-bottom: 18px; }

.article-page__content h1,
.article-page__content h2,
.article-page__content h3,
.article-page__content h4 {
    color: var(--text);
    font-weight: 700;
    line-height: 1.3;
    margin: 32px 0 14px;
}

.article-page__content h1 { font-size: clamp(24px, 3.5vw, 32px); letter-spacing: -0.01em; }
.article-page__content h2 { font-size: clamp(20px, 3vw, 26px); letter-spacing: -0.01em; }
.article-page__content h3 { font-size: 20px; }
.article-page__content h4 { font-size: 17px; }

.article-page__content a {
    color: var(--accent-purple);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-page__content ul,
.article-page__content ol {
    margin: 0 0 18px 1.25em;
    padding-left: 1.5em;
    color: var(--text-2);
}

.article-page__content ul { list-style: disc; }
.article-page__content ol { list-style: decimal; }

/* Quill: маркированные списки через data-list */
.article-page__content ol:has(> li[data-list="bullet"]) {
    list-style: none;
    margin-left: 1.25em;
    padding-left: 0.5em;
}

.article-page__content li[data-list="bullet"] {
    list-style: none;
    position: relative;
    padding-left: 2em;
}

.article-page__content li[data-list="bullet"]::before {
    content: "•";
    position: absolute;
    left: 0.5em;
    color: var(--accent-purple);
    font-weight: 700;
}

.article-page__content li[data-list="ordered"] {
    list-style: none;
    counter-increment: art-list;
    position: relative;
    padding-left: 2em;
}

.article-page__content ol:has(> li[data-list="ordered"]) {
    list-style: none;
    margin-left: 1.25em;
    padding-left: 0.5em;
    counter-reset: art-list;
}

.article-page__content li[data-list="ordered"]::before {
    content: counter(art-list) ".";
    position: absolute;
    left: 0.5em;
    color: var(--accent-purple);
    font-weight: 600;
}

.article-page__content li { margin-bottom: 6px; }

/* Выравнивание (Quill) */
.article-page__content .ql-align-center,
.article-page__content [style*="text-align: center"],
.article-page__content [style*="text-align:center"] { text-align: center; }

.article-page__content .ql-align-right,
.article-page__content [style*="text-align: right"],
.article-page__content [style*="text-align:right"] { text-align: right; }

.article-page__content .ql-align-justify,
.article-page__content [style*="text-align: justify"],
.article-page__content [style*="text-align:justify"] { text-align: justify; }

.article-page__content u { text-decoration: underline; }
.article-page__content s { text-decoration: line-through; }

.article-page__content blockquote {
    border-left: 3px solid var(--accent-purple);
    background: var(--bg-card);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    padding: 14px 20px;
    margin: 18px 0;
    color: var(--text-2);
    font-style: italic;
}

.article-page__content pre:not(.article-code-block) {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 16px 20px;
    overflow-x: auto;
    margin-bottom: 18px;
    max-width: 100%;
    white-space: pre-wrap;
}

/* ── Блок кода: контейнер ── */
.article-code-wrap {
    position: relative;
    margin: 24px auto;
    max-width: 640px;
    width: 100%;
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

/* Кнопка «Копировать» — позиционируется поверх прокрутки */
.article-code-wrap__copy {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
    white-space: nowrap;
}
.article-code-wrap__copy:hover { color: #fff; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25); }
.article-code-wrap__copy.is-copied { color: #3fb950; border-color: #3fb950; background: rgba(63,185,80,.08); }

/* Прокручиваемый pre — скролл встроен в сам pre */
.article-code-wrap pre.article-code-block,
.article-page__content .article-code-block {
    display: block;
    max-height: 300px;
    overflow: auto;
    margin: 0;
    padding: 42px 16px 16px;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 13px;
    line-height: 1.6;
}

.article-code-wrap pre.article-code-block code,
.article-page__content .article-code-block code {
    display: block;
    background: none;
    padding: 0;
    color: #e6edf3;
    font-family: ui-monospace, 'Cascadia Code', 'Fira Code', Consolas, monospace;
    font-size: inherit;
    white-space: pre;
    overflow-wrap: normal;
    word-break: normal;
}

/* ── Quill code block (не конвертированный) ── */
.article-page__content .ql-code-block-container {
    position: relative;
    display: block;
    margin: 24px auto;
    max-width: 640px;
    max-height: 300px;
    overflow: auto;
    padding: 42px 16px 16px;
    background: #0d1117;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e6edf3;
}

.article-page__content .ql-code-block {
    white-space: pre-wrap;
}

/* Разделитель *** */
.article-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 36px 0;
    user-select: none;
    pointer-events: none;
}

.article-divider__stars {
    font-size: 30px;
    line-height: 1;
    letter-spacing: 0.35em;
    color: var(--text-3);
}

/* Опрос */
.article-page__content .article-poll {
    max-width: 380px;
    margin: 20px 0;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: var(--r-md);
    padding: 14px 16px;
}

.article-poll__head {
    display: none;
}

.article-poll__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    outline: none;
    user-select: none;
    cursor: default;
    pointer-events: none;
}

.article-poll__option-text {
    display: none;
}

.article-poll__status {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-3);
}

.article-poll__status[data-type="error"] {
    color: #f87171;
}

.article-poll__title[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: var(--text-3);
    font-weight: 400;
    pointer-events: none;
}

.article-page__content .article-poll__options {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.article-poll__option {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-poll__option-input {
    display: none;
}

.article-poll__option-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-2);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}

.article-poll__option-btn:hover:not(:disabled) {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.06);
}

.article-poll__option-btn:disabled {
    cursor: default;
}

.article-poll__option-btn.is-voted {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.1);
    color: var(--text);
}

.article-poll__bar-wrap {
    margin-top: 4px;
    height: 3px;
    background: var(--bg-elevated);
    border-radius: 2px;
    overflow: hidden;
}

.article-poll__bar {
    height: 100%;
    background: var(--accent-purple);
    border-radius: 2px;
    transition: width 0.4s var(--ease);
}

.article-poll__pct {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 3px;
}

.article-poll__add-btn {
    display: none;
}

/* Аудио / видео */
.article-page__content .article-media,
.article-page__content figure.article-media--audio,
.article-page__content figure.article-media--video {
    margin: 24px auto;
    max-width: 640px;
    width: 100%;
    border-radius: var(--r-lg);
    overflow: hidden;
}

.article-media--audio {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 16px 20px;
}

.article-media--audio audio {
    width: 100%;
}

.article-media--video .article-media__embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
    border-radius: var(--r-lg);
    overflow: hidden;
}

.article-media--video iframe,
.article-media--video video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--r-lg);
}

.article-media--video video {
    object-fit: contain;
    background: #000;
}

.article-page__content code {
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-page__content pre code { background: none; padding: 0; }

.article-page__content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--r-md);
    margin: 18px 0;
}

.article-page__content img[data-article-size="wide"] {
    display: block;
    width: 100%;
    height: auto;
    margin: 18px 0;
}

.article-page__content img[data-article-size="narrow"] {
    display: block;
    width: 100%;
    max-width: min(100%, 340px);
    max-height: min(72vh, 720px);
    object-fit: contain;
    margin: 24px auto;
    cursor: zoom-in;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--r-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.article-page__content figure.article-figure {
    margin: 28px 0;
    padding: 0;
    clear: both;
}

.article-page__content figure.article-figure--wide {
    margin: 28px 0;
    max-width: none;
}

.article-page__content figure.article-figure--wide img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: unset;
}

.article-page__content figure.article-figure--narrow {
    max-width: min(100%, 340px);
    margin: 28px auto;
    padding: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.article-page__content figure.article-figure img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    border-radius: var(--r-md);
}

.article-page__content figure.article-figure--narrow img {
    max-height: min(72vh, 720px);
    object-fit: contain;
    cursor: zoom-in;
    margin: 0;
    border: none;
    background: none;
    box-shadow: none;
    border-radius: calc(var(--r-md) - 4px);
}

.article-page__content figure.article-figure > figcaption,
.article-page__content .article-figure__caption {
    display: block;
    margin: 10px auto 0;
    padding: 0 8px;
    max-width: min(100%, 560px);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 400;
    color: var(--text-3);
    text-align: center;
    font-style: italic;
    letter-spacing: 0.02em;
}

/* Лайтбокс для увеличения скриншотов */
.article-img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(6, 6, 10, 0.92);
    backdrop-filter: blur(8px);
    cursor: zoom-out;
    animation: article-lightbox-in 0.2s ease;
}

.article-img-lightbox__img {
    display: block;
    max-width: min(100%, 520px);
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--r-md);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    cursor: default;
}

.article-img-lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

@keyframes article-lightbox-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Таблицы в статьях */
.article-page__content .article-table-wrap {
    margin: 28px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-card);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    max-width: 100%;
}

.article-page__content .article-table-wrap::after {
    content: '';
    position: sticky;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.article-page__content table {
    width: 100%;
    min-width: min(100%, 480px);
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.55;
}

.article-page__content thead th,
.article-page__content tbody th {
    background: var(--bg-elevated);
    color: var(--text);
    font-weight: 700;
    text-align: left;
    border-bottom: 1px solid var(--border-hover);
}

.article-page__content th,
.article-page__content td {
    padding: 12px 16px;
    border: 1px solid var(--border);
    vertical-align: top;
    color: var(--text-2);
}

.article-page__content tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.015);
}

.article-page__content tbody tr:hover td {
    background: rgba(139, 92, 246, 0.06);
}

.article-page__content table p {
    margin: 0;
}

.article-page__content table a {
    color: var(--accent-purple);
}

@media (max-width: 640px) {
    .article-page__content .article-table-wrap {
        margin: 20px -4px;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    .article-page__content th,
    .article-page__content td {
        padding: 10px 12px;
        font-size: 14px;
    }

    .article-page__content table {
        min-width: 520px;
    }
}

/* Сайдбар статьи */
.article-page__sidebar {
    position: sticky;
    top: calc(var(--header-h) + 20px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-page__cta {
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: var(--r-lg);
    padding: 22px;
}

.article-page__cta h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.article-page__cta p {
    font-size: 13px;
    color: var(--text-2);
}

.article-page__related {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
}

.article-page__related h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.article-page__related-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    transition: color var(--t-fast);
}

.article-page__related-item:last-child { border-bottom: none; }
.article-page__related-item:hover { color: var(--accent-purple); }

.article-page__related-item img {
    width: 48px;
    height: 48px;
    border-radius: var(--r-sm);
    object-fit: cover;
    flex-shrink: 0;
}

/* Хедер статьи — двухколоночный: текст + баннер у хлебных крошек */
.article-page__header-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.article-page__header-main {
    flex: 1;
    min-width: 0;
}

/* Desktop: промо справа от заголовка */
.article-page__header-spot--desktop {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 2px;
}

/* Mobile: промо над хлебными крошками */
.article-page__header-spot--mobile {
    display: none;
}

/* Промо в середине текста статьи */
.article-page__content .article-flow-spot {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 32px 0;
    padding: 20px 0;
    clear: both;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

/* Промо в сайдбаре */
.article-sidebar-spot {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Общий стиль промо-блока */
.site-spot {
    display: block;
    line-height: 0;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.site-spot img {
    display: block;
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

/* Crumb slot — горизонтальный 320×60 */
.site-spot--crumb {
    max-width: 320px;
}

.site-spot--crumb img {
    width: 320px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 32 / 6;
    object-fit: contain;
}

/* Rail slot — вертикальный 300×600 */
.site-spot--rail {
    width: 100%;
    max-width: 300px;
}

.site-spot--rail img {
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 1 / 2;
    object-fit: contain;
}

/* Flow slot — внутри текста статьи */
.site-spot--flow {
    width: 100%;
    max-width: 728px;
}

.site-spot--flow img {
    width: 100%;
    max-width: 728px;
    height: auto;
    aspect-ratio: 364 / 45;
    object-fit: contain;
}

/* Навигация в сайдбаре статьи */
.article-sidebar-nav {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px;
}

.article-sidebar-nav__title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 10px;
}

.article-sidebar-nav__cats,
.article-sidebar-nav__recent {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.article-sidebar-nav__cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-2);
    transition: background var(--t-fast), color var(--t-fast);
}

.article-sidebar-nav__cat:hover,
.article-sidebar-nav__cat.active {
    background: var(--bg-elevated);
    color: var(--accent-purple);
}

.article-sidebar-nav__cnt {
    font-size: 11px;
    background: var(--bg-elevated);
    border-radius: 10px;
    padding: 1px 6px;
    color: var(--text-3);
    font-weight: 600;
}

.article-sidebar-nav__recent-link {
    display: block;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.35;
    transition: background var(--t-fast), color var(--t-fast);
}

.article-sidebar-nav__recent-link:hover,
.article-sidebar-nav__recent-link.active {
    background: var(--bg-elevated);
    color: var(--accent-purple);
}

.article-page__footer {
    padding: 28px 0;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

.article-page__share {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-2);
}

@media (max-width: 900px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .article-page__layout { grid-template-columns: 1fr; }
    .article-page__sidebar { position: static; }
    .article-page__header-inner { flex-direction: column; gap: 0; }

    /* Mobile: показываем промо над хлебными крошками */
    .article-page__header-spot--mobile {
        display: flex;
        justify-content: center;
        width: 100%;
        order: -1;
        margin-bottom: 14px;
        padding: 0 4px;
    }

    .article-page__header-spot--desktop {
        display: none;
    }

    .site-spot--crumb {
        max-width: min(320px, calc(100vw - 48px));
    }

    .site-spot--flow {
        max-width: min(468px, calc(100vw - 48px));
    }

    .site-spot--flow img {
        aspect-ratio: 39 / 5;
    }

    .site-spot--rail {
        max-width: min(300px, calc(100vw - 48px));
    }
}

@media (max-width: 600px) {
    .blog-grid { grid-template-columns: 1fr; }
    .article-page__share { flex-wrap: wrap; }

    .article-page__header-spot--mobile {
        margin-bottom: 12px;
    }

    .site-spot--crumb {
        max-width: calc(100vw - 40px);
    }

    .site-spot--flow img {
        max-width: calc(100vw - 40px);
    }
}
