/* ============================================================
   Ustim — дизайн-система сайта
   Светлая тема, аккуратные карточки, спокойные акценты
   ============================================================ */

:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-soft: #f1f3fa;
    --ink: #141a2e;
    --ink-soft: #3c455c;
    --muted: #6c7488;
    --line: #e5e8f2;
    --line-strong: #d6dbea;

    --brand: #4f46e5;
    --brand-dark: #4338ca;
    --brand-light: #818cf8;
    --brand-soft: #eef0ff;
    --brand-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --rose: #e11d48;
    --rose-soft: #fff1f4;
    --green: #0f9d6e;
    --green-soft: #e9f9f3;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;

    --shadow-sm: 0 1px 2px rgba(20, 26, 46, .05);
    --shadow: 0 2px 4px rgba(20, 26, 46, .04), 0 12px 28px -16px rgba(20, 26, 46, .22);
    --shadow-lg: 0 4px 8px rgba(20, 26, 46, .04), 0 28px 48px -28px rgba(20, 26, 46, .32);

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PT Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-soft);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4 {
    color: var(--ink);
    line-height: 1.22;
    letter-spacing: -.02em;
    margin: 0;
    font-weight: 700;
}

p { margin: 0; }

::selection { background: rgba(99, 102, 241, .18); }

/* ---------- Сетка ---------- */
.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}
.main { flex: 1 0 auto; padding: 40px 0 72px; }

/* ---------- Шапка ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.01em;
    color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--brand-grad);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .8);
}
.brand-mark span { color: #fff; }
.brand-text small {
    display: block;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: -2px;
}

.site-nav { display: flex; align-items: center; gap: 26px; }
.nav-link {
    position: relative;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-soft);
    padding: 6px 0;
}
.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--brand);
    transform: scaleX(0);
    transition: transform .2s ease;
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--ink); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 11px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 0;
}
.nav-toggle i {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.is-open i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open i:nth-child(2) { opacity: 0; }
.nav-toggle.is-open i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--brand-grad);
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(79, 70, 229, .85);
}
.btn-primary:hover { color: #fff; box-shadow: 0 14px 26px -12px rgba(79, 70, 229, .95); }
.btn-outline {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}
.btn-outline:hover { border-color: var(--brand-light); color: var(--brand-dark); }
.btn-soft {
    background: var(--brand-soft);
    color: var(--brand-dark);
}
.btn-soft:hover { background: #e5e8ff; color: var(--brand-dark); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { cursor: not-allowed; opacity: .55; box-shadow: none; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(760px 320px at 88% -10%, rgba(139, 92, 246, .18), transparent 60%),
        radial-gradient(620px 300px at 4% 0%, rgba(99, 102, 241, .13), transparent 62%),
        var(--surface);
    border-bottom: 1px solid var(--line);
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(20, 26, 46, .05) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 70%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 70%);
    pointer-events: none;
}
.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.02fr .98fr;
    gap: 56px;
    align-items: center;
    padding: 64px 0 68px;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border: 1px solid #dfe2ff;
    border-radius: 999px;
    padding: 6px 12px;
    margin-bottom: 18px;
}
.hero-eyebrow .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}
.hero h1 {
    font-size: clamp(30px, 3.4vw, 46px);
    font-weight: 800;
    letter-spacing: -.035em;
    margin-bottom: 18px;
    color: var(--ink);
}
.hero h1 em {
    font-style: normal;
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-sub {
    font-size: 16px;
    line-height: 1.7;
    color: var(--muted);
    max-width: 48ch;
    margin-bottom: 26px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }

.hero-stats {
    display: flex;
    gap: 34px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    max-width: 420px;
}
.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -.03em;
    line-height: 1.1;
}
.stat-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

/* ---------- Слайдер ---------- */
.hero-media { position: relative; }
.hero-slider {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #dfe3f5;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16 / 11.4;
    border: 1px solid rgba(255, 255, 255, .7);
}
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .55s ease, visibility .55s ease, transform .8s ease;
    transform: scale(1.02);
}
.hero-slide.is-active { opacity: 1; visibility: visible; transform: scale(1); }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }

/* Видеослайд: плеер вместо картинки */
.hero-slide--video { background: #0b0d18; }
.hero-slide-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-slide-video {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: #0b0d18;
}
.hero-slide-video iframe { width: 100%; height: 100%; border: 0; display: block; }
/* У видео своя панель управления: затемнение и подпись ей только мешают */
.hero-slide.hero-slide--video::after { display: none; }
.hero-slide--video .hero-slide-caption { display: none; }
.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 12, 26, 0) 38%, rgba(9, 12, 26, .82) 100%);
}
.hero-slide-caption {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 22px;
    z-index: 2;
    color: #fff;
}
.hero-slide-caption h3 {
    color: #fff;
    font-size: 19px;
    margin-bottom: 4px;
}
.hero-slide-caption p {
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
}
.hero-dots {
    position: absolute;
    right: 18px;
    top: 16px;
    z-index: 3;
    display: flex;
    gap: 6px;
}
.hero-dot {
    width: 7px; height: 7px;
    border: 0;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .45);
    cursor: pointer;
    transition: width .25s ease, background .25s ease;
}
.hero-dot.is-active { width: 22px; background: #fff; }

.hero-note {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: var(--shadow);
    font-size: 12px;
    color: var(--ink-soft);
    transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
}
/* На видеослайде плашка закрывает таймкод и звук плеера */
.hero-note.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
}
.hero-note strong { color: var(--ink); }
.hero-note .pulse {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(15, 157, 110, .15);
}

/* ---------- Заголовки секций ---------- */
.section { margin-top: 56px; }
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}
.section-eyebrow {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 6px;
}
.section-head h2 { font-size: 25px; letter-spacing: -.025em; }
.section-head p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.section-link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    padding-bottom: 3px;
}
.section-link:hover { gap: 8px; }

/* ---------- Раскладка: контент + колонка ---------- */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 306px;
    gap: 40px;
    align-items: start;
    margin-top: 44px;
}
/* Первая секция колонки контента встаёт по строке заголовка верхней карточки
   сайдбара: её padding 18px + рамка 1px. Иначе «Проекты» уезжают вниз на 56px
   (.section margin-top) и колонки перестают читаться как одна строка сетки. */
.layout-main > .section:first-child { margin-top: 19px; }
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 92px;
}
.side-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}
.side-card h3 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.side-card h3 span { color: var(--muted); font-weight: 500; letter-spacing: 0; text-transform: none; }
.side-about p { font-size: 13px; line-height: 1.65; color: var(--muted); }
.side-about .btn { margin-top: 14px; }

.side-links { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-soft);
    background: var(--surface-soft);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 5px 11px;
}
.chip:hover { background: var(--brand-soft); color: var(--brand-dark); }
.chip .count { color: var(--muted); font-size: 11px; }

/* ---------- Компактные комментарии в колонке ---------- */
.mini-comments { display: flex; flex-direction: column; }
.mini-comment {
    display: flex;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}
.mini-comment:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-comment:first-child { padding-top: 0; }
.avatar {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
}
.mini-comment-body { min-width: 0; }
.mini-comment-top {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 1px;
}
.mini-comment-name {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mini-comment-date { font-size: 10.5px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.mini-comment-text {
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mini-comment-link { font-size: 11px; color: var(--brand); }
.side-empty { font-size: 12.5px; color: var(--muted); }

/* ---------- Карточки проектов ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: #cfd4f7;
}
.project-cover {
    position: relative;
    height: 132px;
    display: grid;
    place-items: center;
    background: var(--brand-grad);
    overflow: hidden;
}
.project-cover.tone-2 { background: linear-gradient(135deg, #0ea5e9 0%, #4f46e5 100%); }
.project-cover.tone-3 { background: linear-gradient(135deg, #14b8a6 0%, #6366f1 100%); }
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.project-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px);
    background-size: 16px 16px;
    opacity: .5;
}
.project-cover .initials {
    position: relative;
    z-index: 1;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.04em;
    color: rgba(255, 255, 255, .95);
    text-shadow: 0 2px 14px rgba(20, 26, 46, .25);
}
.project-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { font-size: 16.5px; margin-bottom: 7px; }
.project-body h3 a { color: var(--ink); }
.project-body h3 a:hover { color: var(--brand-dark); }
.project-body p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: 6px;
    padding: 3px 7px;
    letter-spacing: .01em;
}
.card-foot {
    margin-top: auto;
    padding-top: 13px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 600;
}
.card-foot a { color: var(--brand); }
.card-foot .ext { color: var(--muted); font-weight: 500; display: flex; gap: 12px; }
.card-foot .ext a { color: var(--muted); font-weight: 500; }
.card-foot .ext a:hover { color: var(--ink); }

/* ---------- Новости ---------- */
.news-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.news-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #f3ccd5;
}
.news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--muted);
    margin-bottom: 10px;
}
.news-meta .badge { margin-right: 2px; }
.news-card h3 { font-size: 15.5px; line-height: 1.4; margin-bottom: 7px; }
.news-card h3 a { color: var(--ink); }
.news-card h3 a:hover { color: var(--rose); }
.news-card p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card .card-foot { font-size: 12px; }

/* ---------- Лента блога ---------- */
.post-list { display: flex; flex-direction: column; gap: 10px; }
.post-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.post-item:hover {
    border-color: #cfd4f7;
    box-shadow: var(--shadow);
    transform: translateX(2px);
}
.post-item-date {
    flex: 0 0 52px;
    text-align: center;
    border-right: 1px solid var(--line);
    padding-right: 14px;
}
.post-item-date .d { display: block; font-size: 18px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.post-item-date .m { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.post-item-body { min-width: 0; flex: 1; }
.post-item-body h3 { font-size: 15px; margin-bottom: 3px; }
.post-item-body h3 a { color: var(--ink); }
.post-item-body h3 a:hover { color: var(--brand-dark); }
.post-item-body p {
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.post-item-thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--line);
}
.post-item-arrow { color: var(--line-strong); font-size: 18px; transition: color .18s ease, transform .18s ease; }
.post-item:hover .post-item-arrow { color: var(--brand); transform: translateX(2px); }

/* ---------- Бейджи и крошки ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 3px 9px;
}
.badge-news { background: var(--rose-soft); color: var(--rose); }
.badge-blog { background: var(--brand-soft); color: var(--brand-dark); }
.badge-gray { background: var(--surface-soft); color: var(--muted); }

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 18px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .sep { color: var(--line-strong); }

/* ---------- Список статей ---------- */
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: clamp(27px, 3vw, 36px); margin-bottom: 8px; }
.page-head p { color: var(--muted); max-width: 62ch; }
.filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 22px 0 24px;
}
.filter-tabs { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; box-shadow: var(--shadow-sm); }
.filter-tab {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 9px;
    padding: 7px 14px;
    transition: background .16s ease, color .16s ease;
}
.filter-tab:hover { color: var(--ink); background: var(--surface-soft); }
.filter-tab.is-active { background: var(--brand); color: #fff; }
.filter-tab.is-active:hover { color: #fff; }
.search-form { display: flex; gap: 8px; }
.search-form input {
    height: 40px;
    min-width: 220px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    border-radius: 10px;
    padding: 0 13px;
    font: inherit;
    font-size: 13.5px;
    color: var(--ink);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.search-form input:focus { border-color: var(--brand-light); box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }

.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.post-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cfd4f7; }
.post-card-cover { height: 148px; object-fit: cover; width: 100%; background: var(--surface-soft); }
.post-card-cover.placeholder {
    display: grid;
    place-items: center;
    background:
        radial-gradient(400px 180px at 80% 0%, rgba(139, 92, 246, .22), transparent 60%),
        var(--brand-soft);
    color: var(--brand);
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -.03em;
}
.post-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.post-card-body h2 { font-size: 17px; margin: 8px 0 7px; }
.post-card-body h2 a { color: var(--ink); }
.post-card-body h2 a:hover { color: var(--brand-dark); }
.post-card-body p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.62;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
}
.post-card-meta { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }

.empty-state {
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 44px 24px;
    text-align: center;
    color: var(--muted);
}
.empty-state h3 { font-size: 17px; margin-bottom: 6px; }

/* ---------- Пагинация ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 30px; flex-wrap: wrap; }
.page-btn {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 13.5px;
    font-weight: 600;
}
.page-btn:hover { border-color: var(--brand-light); color: var(--brand-dark); }
.page-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-btn.is-active:hover { color: #fff; }
.page-btn.is-disabled { opacity: .45; pointer-events: none; }

/* ---------- Статья ---------- */
.article { max-width: 780px; margin: 0 auto; }
.article-head { margin-bottom: 26px; }
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 14px;
}
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.article h1 { font-size: clamp(27px, 3.6vw, 40px); letter-spacing: -.03em; margin-bottom: 14px; }
.article-lead {
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink-soft);
    border-left: 3px solid var(--brand);
    padding-left: 16px;
    margin: 20px 0 0;
}
.article-cover {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    margin: 26px 0 0;
}

.prose {
    font-size: 15.5px;
    line-height: 1.78;
    color: var(--ink-soft);
    margin-top: 30px;
}
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 16px; }
.prose h2 { font-size: 22px; margin: 34px 0 12px; letter-spacing: -.02em; }
.prose h3 { font-size: 18px; margin: 28px 0 10px; }
.prose h4 { font-size: 16px; margin: 24px 0 8px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--brand-light); }
.prose a { color: var(--brand); text-decoration: underline; text-decoration-color: rgba(79, 70, 229, .3); text-underline-offset: 2px; }
.prose a:hover { text-decoration-color: var(--brand); }
.prose strong { color: var(--ink); }
.prose blockquote {
    margin: 20px 0;
    padding: 14px 18px;
    background: var(--brand-soft);
    border-left: 3px solid var(--brand-light);
    border-radius: 0 10px 10px 0;
    color: var(--ink-soft);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
    font-family: var(--mono);
    font-size: 13px;
    background: #f1f2f8;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1px 5px;
    color: #4338ca;
}
.prose pre {
    background: #12172b;
    color: #e6e9f5;
    border-radius: 12px;
    padding: 16px 18px;
    overflow-x: auto;
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.65;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: 13px; }
.prose img { border-radius: 12px; margin: 18px 0; border: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { background: var(--surface-soft); color: var(--ink); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.prose figure { margin: 20px 0; }
.prose figcaption { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 8px; }

/* Встроенные видео: peervideo.ru (PeerTube), YouTube, VK Video */
.video-embed {
    margin: 22px 0;
    aspect-ratio: 16 / 9;
    background: #0b0d18;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}
.video-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-embed--vertical {
    aspect-ratio: 9 / 16;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.article-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

/* ---------- Компактные комментарии в статье ---------- */
.comments {
    max-width: 780px;
    margin: 40px auto 0;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}
.comments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.comments-head h2 { font-size: 17px; }
.comments-head .count {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: 999px;
    padding: 3px 9px;
    margin-left: 4px;
}
.comments-list { display: flex; flex-direction: column; }
.comment {
    display: flex;
    gap: 11px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}
.comment:last-child { border-bottom: 0; }
.comment .avatar { width: 30px; height: 30px; font-size: 12px; }
.comment-body { min-width: 0; flex: 1; }
.comment-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.comment-name { font-size: 13.5px; font-weight: 650; color: var(--ink); }
.comment-date { font-size: 11px; color: var(--muted); }
.comment-text { font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.comments-empty { font-size: 13px; color: var(--muted); padding: 4px 0 10px; }

/* ---------- Формы ---------- */
.form-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    margin-top: 18px;
}
.form-card h3 { font-size: 15px; margin-bottom: 3px; }
.form-hint { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { margin-bottom: 10px; }
.field label {
    display: block;
    font-size: 11.5px;
    font-weight: 650;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 5px;
}
.field input[type="text"],
.field input[type="email"],
.field textarea,
.form-card input[type="text"],
.form-card input[type="email"],
.form-card textarea {
    width: 100%;
    font: inherit;
    font-size: 13.5px;
    color: var(--ink);
    background: #fbfbfe;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 9px 12px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.form-card textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.field input:focus,
.field textarea:focus,
.form-card input:focus,
.form-card textarea:focus {
    background: #fff;
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
.field .errorlist { list-style: none; margin: 5px 0 0; padding: 0; font-size: 12px; color: var(--rose); }
.form-errors {
    background: var(--rose-soft);
    border: 1px solid #f6c6d2;
    color: #9f1239;
    font-size: 12.5px;
    border-radius: 10px;
    padding: 9px 12px;
    margin-bottom: 12px;
}
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-note { font-size: 11.5px; color: var(--muted); }

/* ---------- Капча-ползунок ---------- */
.captcha { margin-bottom: 12px; }
.captcha-track {
    position: relative;
    height: 38px;
    background: #f4f5fb;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    user-select: none;
}
.captcha-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: linear-gradient(90deg, rgba(99, 102, 241, .16), rgba(99, 102, 241, .3));
    transition: width .08s linear;
}
.captcha-text {
    position: relative;
    z-index: 1;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    pointer-events: none;
}
.captcha input[type="range"] {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: grab;
    margin: 0;
}
.captcha.is-done .captcha-fill { background: rgba(15, 157, 110, .28); }
.captcha.is-done .captcha-text { color: #065f46; font-weight: 600; }

/* ---------- Сообщения (тосты) ---------- */
.messages {
    position: fixed;
    top: 84px;
    right: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
}
.message {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13px;
    color: var(--ink-soft);
    box-shadow: var(--shadow);
    animation: message-in .25s ease both;
}
.message.success { border-left-color: var(--green); }
.message.error { border-left-color: var(--rose); }
@keyframes message-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Проект ---------- */
.project-hero {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}
.project-hero h1 { font-size: clamp(26px, 3.4vw, 38px); margin: 10px 0 10px; }
.project-hero .lead { color: var(--muted); font-size: 15px; max-width: 70ch; margin-bottom: 20px; }
.project-cover-lg {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    margin-bottom: 28px;
}
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* ---------- Контакты ---------- */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 36px;
    align-items: start;
}
.contact-info h1 { font-size: clamp(28px, 3.6vw, 40px); margin-bottom: 12px; letter-spacing: -.03em; }
.contact-info > p { color: var(--muted); font-size: 15px; line-height: 1.7; margin-bottom: 24px; max-width: 42ch; }
.contact-list { display: flex; flex-direction: column; gap: 10px; }
.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
}
.contact-item .ic {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    display: grid;
    place-items: center;
    font-size: 15px;
}
.contact-item .lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.contact-item .val { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.contact-form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.contact-form-card h2 { font-size: 19px; margin-bottom: 4px; }
.contact-form-card > p { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

/* ---------- Подвал ---------- */
.site-footer {
    background: #10142a;
    color: #a7aec9;
    margin-top: auto;
    padding: 46px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 36px;
    padding-bottom: 34px;
}
.site-footer .brand { color: #fff; }
.site-footer .brand:hover { color: #fff; }
.site-footer .brand-text small { color: #7f88a8; }
.footer-about { font-size: 13px; line-height: 1.7; color: #9aa2bf; max-width: 38ch; margin-top: 14px; }
.footer-col h4 {
    color: #fff;
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: #a7aec9; font-size: 13.5px; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .09);
    padding: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #7f88a8;
}
.footer-bottom a { color: #a7aec9; }

/* ---------- Адаптивность ---------- */
@media (max-width: 1024px) {
    .hero-inner { grid-template-columns: 1fr; gap: 34px; padding: 48px 0 54px; }
    .hero-media { max-width: 640px; }
    .layout { grid-template-columns: 1fr; }
    .layout-main > .section:first-child { margin-top: 0; }
    .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
    .sidebar .side-card { flex: 1 1 260px; }
    .card-grid, .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .contact-layout { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 760px) {
    .container { padding: 0 18px; }
    .header-inner { height: 62px; }
    .nav-toggle { display: inline-flex; }
    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        padding: 8px 18px 16px;
        box-shadow: var(--shadow);
    }
    .site-nav.is-open { display: flex; }
    .nav-link { padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
    .nav-link:last-child { border-bottom: 0; }
    .nav-link::after { display: none; }
    .header-actions .btn { display: none; }
    .hero-inner { padding: 36px 0 44px; }
    .hero h1 { font-size: 29px; }
    .hero-sub { font-size: 14.5px; }
    .hero-stats { gap: 22px; }
    .stat-value { font-size: 19px; }
    .hero-slider { aspect-ratio: 16 / 12; }
    .hero-note { left: 10px; bottom: 12px; font-size: 11px; padding: 8px 11px; }
    .section { margin-top: 42px; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
    .card-grid, .post-grid, .related-grid { grid-template-columns: 1fr; }
    .main { padding: 26px 0 52px; }
    .article h1 { font-size: 26px; }
    .prose { font-size: 15px; }
    .form-row { grid-template-columns: 1fr; }
    .messages { left: 16px; right: 16px; top: 74px; max-width: none; }
    .filter-tabs { width: 100%; overflow-x: auto; }
    .search-form { width: 100%; }
    .search-form input { flex: 1; min-width: 0; }
    .footer-grid { grid-template-columns: 1fr; gap: 26px; padding-bottom: 26px; }
    .sidebar { flex-direction: column; }
    .project-hero { padding: 20px; }
    .contact-form-card { padding: 18px; }
}

/* ---------- Категории публикаций ---------- */
.cat-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 14px 0 22px;
}
.cat-filter-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 2px;
}
.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 12px;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.cat-chip:hover { color: var(--brand-dark); border-color: var(--brand); background: var(--brand-soft); }
.cat-chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-chip.is-active:hover { color: #fff; }
.cat-chip-count { font-size: 11px; font-weight: 600; color: var(--muted); }
.cat-chip.is-active .cat-chip-count { color: rgba(255, 255, 255, .75); }
a.tag { color: var(--brand-dark); }
a.tag:hover { background: var(--brand); color: #fff; }
.post-card-cats { margin: 10px 0 0; }
.article-cats { margin: 10px 0 14px; }

/* Темы по разделам: у блога и новостей свои наборы категорий */
.cat-filter-group {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 2px 0 8px;
}
.side-topics { display: flex; flex-direction: column; gap: 12px; }
.side-topic-title {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}
