/* ==========================================================================
   Hello-Site.ru — тёмная адаптивная тема
   ========================================================================== */

:root {
    color-scheme: dark;
    --bg: #0b0e14;
    --bg-soft: #0f131b;
    --surface: #131824;
    --surface-2: #18202e;
    --border: #232c3d;
    --border-soft: #1b2331;
    --text: #e7ecf5;
    --text-dim: #b3bfd2;
    --muted: #8593a8;
    --accent: #5b8cff;
    --accent-2: #7ee0b8;
    --accent-soft: rgba(91, 140, 255, 0.14);
    --accent-hover: #8fb0ff;
    --on-accent: #06090f;
    --header-bg: rgba(11, 14, 20, 0.82);
    --footer-bg: linear-gradient(180deg, rgba(15, 19, 27, 0.6), rgba(9, 12, 18, 0.95));
    --glow-1: rgba(91, 140, 255, 0.16);
    --glow-2: rgba(126, 224, 184, 0.08);
    --hero-grad: linear-gradient(100deg, #ffffff 20%, #9db8ff 75%);
    --article-text: #d5dced;
    --code-bg: #22262b;
    --code-border: #363b41;
    --code-text: #d7ba7d;
    --mark-bg: rgba(255, 198, 109, 0.22);
    --mark-text: #ffd48a;
    --badge-media-bg: rgba(11, 14, 20, 0.74);
    --danger: #ff6b6b;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
    --container: 1180px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- Светлая тема ---------- */

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f6f8fc;
    --bg-soft: #eef2f8;
    --surface: #ffffff;
    --surface-2: #f1f5fb;
    --border: #d5dfec;
    --border-soft: #e2e9f3;
    --text: #16202f;
    --text-dim: #3c4a5f;
    --muted: #66748a;
    --accent: #2f63e6;
    --accent-2: #0f8a68;
    --accent-soft: rgba(47, 99, 230, 0.09);
    --accent-hover: #2452c4;
    --on-accent: #ffffff;
    --header-bg: rgba(246, 248, 252, 0.88);
    --footer-bg: linear-gradient(180deg, rgba(238, 242, 248, 0.9), rgba(228, 234, 243, 0.95));
    --glow-1: rgba(47, 99, 230, 0.10);
    --glow-2: rgba(15, 138, 104, 0.09);
    --hero-grad: linear-gradient(100deg, #16202f 10%, #2f63e6 70%);
    --article-text: #263243;
    --code-bg: #f1f4f9;
    --code-border: #dde4ee;
    --code-text: #a34a12;
    --mark-bg: rgba(255, 193, 79, 0.35);
    --mark-text: #7a4a00;
    --badge-media-bg: rgba(255, 255, 255, 0.86);
    --shadow: 0 18px 40px -26px rgba(16, 32, 64, 0.35);
}


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

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

body {
    margin: 0;
    background:
        radial-gradient(1100px 520px at 82% -180px, var(--glow-1), transparent 65%),
        radial-gradient(900px 420px at 6% -120px, var(--glow-2), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-hover);
}

h1, h2, h3, h4 {
    line-height: 1.25;
    margin: 0 0 0.5em;
    letter-spacing: -0.015em;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: var(--on-accent);
    padding: 10px 16px;
    z-index: 100;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    left: 0;
}

/* ---------- Шапка ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 66px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    flex-shrink: 0;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: contain;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 4px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.02em;
}

.brand-name em {
    font-style: normal;
    color: inherit;
}

.brand-tagline {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    gap: 3px;
    margin-left: auto;
    flex-wrap: nowrap;
    flex-shrink: 0;
    align-items: center;
}

.nav-link {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    color: var(--text-dim);
    font-size: 13.5px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.nav-group {
    position: relative;
}

.nav-group > summary {
    list-style: none;
    cursor: pointer;
}

.nav-group > summary::-webkit-details-marker {
    display: none;
}

.nav-group > summary::marker {
    content: "";
}

.nav-link--parent {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nav-caret {
    opacity: 0.65;
    transition: transform 0.16s ease;
}

.nav-group[open] .nav-caret {
    transform: rotate(180deg);
}

.nav-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 60;
    min-width: 235px;
    padding: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -8px;
    height: 8px;
}

.nav-menu-link {
    display: block;
    padding: 8px 11px;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 13.5px;
    white-space: nowrap;
}

.nav-menu-link:hover {
    color: var(--text);
    background: var(--surface-2);
}

.nav-menu-link.is-active {
    color: var(--text);
    background: var(--accent-soft);
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface);
}

.nav-link.is-active {
    color: var(--text);
    background: var(--accent-soft);
    border-color: rgba(91, 140, 255, 0.35);
}

.nav-toggle,
.nav-burger {
    display: none;
}

/* ---------- Поиск в шапке ---------- */

.site-search {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 4px;
}

.site-search input {
    width: 180px;
    padding: 8px 34px 8px 13px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, width 0.2s ease;
}

.site-search input::placeholder {
    color: var(--muted);
}

.site-search input:focus {
    background: var(--surface);
    border-color: rgba(91, 140, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.12);
}

.site-search button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.site-search button:hover {
    color: var(--text);
    background: var(--surface-2);
}

/* ---------- Переключатель темы ---------- */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-toggle:hover {
    color: var(--text);
    background: var(--surface);
    border-color: rgba(91, 140, 255, 0.5);
}

.theme-toggle:focus-visible {
    outline: none;
    border-color: rgba(91, 140, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .icon-moon {
    display: none;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
    display: none;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

/* ---------- Hero ---------- */

.hero {
    padding: 56px 0 28px;
}

.hero-kicker {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.hero-title {
    margin: 0 0 12px;
    font-size: clamp(30px, 5vw, 46px);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--hero-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text {
    margin: 0;
    max-width: 620px;
    color: var(--text-dim);
    font-size: 17px;
}

/* ---------- Заголовки страниц/разделов ---------- */

.page-head {
    padding: 34px 0 10px;
}

.page-title {
    margin: 8px 0 8px;
    font-size: clamp(26px, 3.6vw, 36px);
    font-weight: 750;
}

.page-text {
    margin: 0;
    max-width: 720px;
    color: var(--text-dim);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    padding: 14px 0 4px;
}

.breadcrumbs a {
    color: var(--muted);
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.breadcrumbs .current {
    color: var(--text-dim);
}

.breadcrumbs .sep {
    color: var(--border);
}

/* ---------- Сетка ---------- */

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 36px;
    align-items: start;
    padding-bottom: 56px;
}

.layout-side {
    position: sticky;
    top: 86px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.section-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 18px 0 18px;
}

.section-title {
    margin: 0;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-weight: 600;
}

.section-count {
    font-size: 12px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 2px 9px;
}

/* ---------- Карточки статей ---------- */

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.post-card {
    margin: 0;
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    border-color: rgba(91, 140, 255, 0.45);
    box-shadow: var(--shadow);
}

.post-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.post-card-media {
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--surface-2);
    overflow: hidden;
}

.post-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .post-card-media img {
    transform: scale(1.04);
}

.post-card-media--empty {
    background:
        linear-gradient(135deg, rgba(91, 140, 255, 0.18), transparent 60%),
        var(--surface-2);
}

/* ---------- Метка «создано нейросетью» ---------- */

.ai-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid rgba(126, 224, 184, 0.38);
    background: rgba(126, 224, 184, 0.12);
    color: var(--accent-2);
}

.ai-badge svg {
    width: 16px;
    height: 16px;
}

.post-card-media {
    position: relative;
}

.post-card-media .ai-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--badge-media-bg);
    border-color: rgba(126, 224, 184, 0.5);
    backdrop-filter: blur(6px);
}

.post-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px 18px;
    flex: 1;
}

.post-card-cat {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.post-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-intro {
    font-size: 14px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    margin-top: auto;
    padding-top: 10px;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.dot {
    color: var(--muted);
}

/* ---------- Сайдбар ---------- */

.widget {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 18px;
}

.widget-title {
    margin: 0 0 12px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.top-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: top;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-item a {
    display: flex;
    gap: 10px;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.4;
}

.top-item a:hover {
    color: var(--text);
}

.top-num {
    flex: 0 0 22px;
    height: 22px;
    border-radius: 7px;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    color: var(--muted);
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.top-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.top-cat {
    font-size: 11px;
    color: var(--muted);
}

.side-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
}

.side-list a {
    color: var(--text-dim);
}

.side-list a:hover {
    color: var(--accent);
}

/* ---------- Статья ---------- */

.article {
    padding-bottom: 40px;
}

.article-head {
    padding: 6px 0 8px;
}

.article-cat {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-2);
    margin-bottom: 10px;
}

.article-cat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.article-cat-row .article-cat {
    margin-bottom: 0;
}

.article-title {
    margin: 0 0 14px;
    font-size: clamp(26px, 3.4vw, 38px);
    font-weight: 780;
    letter-spacing: -0.025em;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: var(--muted);
}

.article-cover {
    margin: 22px 0 26px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-soft);
    background: var(--surface);
}

.article-lead {
    margin: 0 0 24px;
    padding: 16px 18px;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-dim);
    font-size: 17px;
}

.article-body {
    color: var(--article-text);
    font-size: 16.5px;
    line-height: 1.78;
    overflow-wrap: break-word;
}

.article-body > :first-child {
    margin-top: 0;
}

.article-body h2 {
    margin: 1.7em 0 0.6em;
    font-size: 26px;
    font-weight: 700;
    scroll-margin-top: 90px;
}

.article-body h3 {
    margin: 1.5em 0 0.5em;
    font-size: 21px;
    font-weight: 650;
}

.article-body h4 {
    margin: 1.3em 0 0.4em;
    font-size: 18px;
    font-weight: 600;
}

.article-body p {
    margin: 0 0 1.1em;
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.2em;
    padding-left: 1.4em;
}

.article-body li {
    margin: 0.35em 0;
}

.article-body a {
    text-decoration: underline;
    text-decoration-color: rgba(91, 140, 255, 0.4);
    text-underline-offset: 2px;
}

.article-body img {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    margin: 1.2em 0;
}

.article-body blockquote {
    margin: 1.4em 0;
    padding: 12px 18px;
    border-left: 3px solid var(--accent-2);
    background: var(--surface);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-dim);
}

.article-body code {
    font-family: var(--mono);
    font-size: 0.9em;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 6px;
    padding: 0.12em 0.4em;
    color: var(--code-text);
    white-space: nowrap;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.3em 0;
    font-size: 15px;
    display: block;
    overflow-x: auto;
}

.article-body th,
.article-body td {
    border: 1px solid var(--border-soft);
    padding: 8px 12px;
    text-align: left;
}

.article-body th {
    background: var(--surface);
    color: var(--text);
}

.article-body iframe {
    max-width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
}

.article-body hr {
    border: 0;
    border-top: 1px solid var(--border-soft);
    margin: 2em 0;
}

/* ---------- Оглавление и якоря заголовков ---------- */

.article-toc {
    margin: 26px 0 30px;
    padding: 16px 20px 18px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.article-toc-title {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.toc-list {
    margin: 0;
    padding-left: 1.3em;
    font-size: 14.5px;
    line-height: 1.6;
}

.toc-list li {
    margin: 4px 0;
}

.toc-list a {
    color: var(--text-dim);
}

.toc-list a:hover {
    color: var(--text);
}

.article-body .h-anchor {
    display: inline-block;
    width: 1em;
    margin-left: 8px;
    font-weight: 400;
    color: var(--muted);
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.article-body .h-anchor::after {
    content: '#';
}

.article-body h2:hover .h-anchor,
.article-body .h-anchor:focus {
    opacity: 1;
}

@media (hover: none) {
    .article-body .h-anchor {
        opacity: 0.45;
    }
}

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

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: var(--muted);
}

.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    color: var(--text-dim);
    font-size: 12px;
}

a.tag:hover {
    border-color: rgba(91, 140, 255, 0.45);
    color: var(--text);
}

/* ---------- Облако тегов ---------- */

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 26px 0 10px;
    padding-top: 22px;
    border-top: 1px solid var(--border-soft);
}

.tag-cloud-label {
    margin-right: 2px;
    font-size: 13px;
    color: var(--muted);
}

.back-link {
    font-size: 14px;
}

/* ---------- «Читайте также» в конце статьи ---------- */

.read-also {
    margin-top: 38px;
    padding-top: 26px;
    border-top: 1px solid var(--border-soft);
}

.read-also-title {
    margin: 0 0 14px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.read-also-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.read-also-link {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 13px 15px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-dim);
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.read-also-link:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: rgba(91, 140, 255, 0.45);
}

.read-also-arrow {
    flex: none;
    color: var(--accent);
    transition: transform 0.15s ease;
}

.read-also-link:hover .read-also-arrow {
    transform: translateX(2px);
}

.read-also-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.read-also-cat {
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.read-also-name {
    font-size: 14.5px;
    line-height: 1.4;
    color: var(--text);
}

.read-also .ai-badge {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    margin-left: auto;
}

.read-also .ai-badge svg {
    width: 13px;
    height: 13px;
}

/* ---------- Страница поиска ---------- */

.search-page {
    padding: 22px 0 60px;
}

.search-form-lg {
    display: flex;
    gap: 10px;
    max-width: 660px;
    margin: 18px 0 12px;
}

.search-form-lg input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-form-lg input::placeholder {
    color: var(--muted);
}

.search-form-lg input:focus {
    border-color: rgba(91, 140, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.12);
}

.search-form-lg .btn {
    border: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.search-hint {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-result {
    margin: 0;
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-result:hover {
    transform: translateY(-2px);
    border-color: rgba(91, 140, 255, 0.45);
    box-shadow: var(--shadow);
}

.search-result-link {
    display: block;
    padding: 18px 22px 20px;
    color: inherit;
}

.search-result-cat {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-2);
    margin-bottom: 6px;
}

.search-result-title {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 650;
    color: var(--text);
}

.search-result-excerpt {
    margin: 0 0 10px;
    color: var(--text-dim);
    font-size: 14.5px;
    line-height: 1.6;
}

.search-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
}

.search-result-meta .ai-badge {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    margin-right: 2px;
}

.search-result-meta .ai-badge svg {
    width: 13px;
    height: 13px;
}

mark {
    background: var(--mark-bg);
    color: var(--mark-text);
    border-radius: 3px;
    padding: 0 2px;
}


.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
}

.page-btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    font-size: 14px;
}

.page-btn:hover {
    border-color: rgba(91, 140, 255, 0.5);
    color: var(--text);
}

.page-btn.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-info {
    font-size: 13px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.3;
}

.page-total {
    font-size: 11px;
    color: var(--muted);
}

/* ---------- Контакты ---------- */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin: 10px 0 24px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    color: var(--text);
}

.contact-card:hover {
    border-color: rgba(91, 140, 255, 0.45);
    color: var(--text);
}

.contact-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.contact-value {
    font-size: 18px;
    font-weight: 600;
}

.legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding-bottom: 60px;
    font-size: 14px;
}

/* ---------- Сервисы ---------- */

.services-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 18px;
    padding: 12px 0 22px;
}

.service-card {
    display: flex;
    gap: 18px;
    padding: 24px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    color: var(--text);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.service-card:hover {
    transform: translateY(-3px);
    border-color: rgba(91, 140, 255, 0.45);
    box-shadow: var(--shadow);
    color: var(--text);
}

.service-icon {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    border: 1px solid rgba(91, 140, 255, 0.28);
    color: var(--accent);
}

.service-body {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.service-kicker {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.service-title {
    font-size: 19px;
    font-weight: 650;
    line-height: 1.3;
}

.service-text {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.service-more {
    margin-top: 4px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--accent);
}

.services-note {
    max-width: 780px;
    padding: 4px 0 70px;
    color: var(--muted);
    font-size: 14.5px;
}

.services-note p {
    margin: 0 0 8px;
}

/* ---------- 404 ---------- */

.error-page {
    text-align: center;
    padding: 64px 20px 36px;
}

.error-code {
    margin: 0;
    font-size: clamp(72px, 14vw, 140px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    background: var(--hero-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-title {
    margin: 10px 0 6px;
    font-size: 26px;
}

.error-text {
    color: var(--muted);
    margin: 0 0 24px;
}

.error-search {
    margin: 0 auto 18px;
    text-align: left;
}

.error-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 620px;
    margin: 0 auto;
}

.error-popular {
    padding-bottom: 70px;
}

.btn {
    display: inline-block;
    padding: 11px 22px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    font-size: 15px;
}

.btn:hover {
    background: var(--accent-hover);
    color: var(--on-accent);
}

.empty {
    color: var(--muted);
    padding: 24px 0;
}

/* ---------- Подвал ---------- */

.site-footer {
    border-top: 1px solid var(--border-soft);
    background: var(--footer-bg);
    margin-top: 20px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    padding: 40px 20px 26px;
}

.footer-col .brand-name {
    font-size: 19px;
}

.footer-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    max-width: 280px;
}

.footer-title {
    margin: 0 0 12px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.footer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

.footer-list a {
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-list a:hover {
    color: var(--accent);
}

.vk-link svg {
    opacity: 0.85;
}

.footer-bottom {
    border-top: 1px solid var(--border-soft);
    padding: 16px 20px 26px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
}

.footer-copy,
.footer-legal {
    margin: 0;
}

.footer-legal {
    max-width: 580px;
    line-height: 1.6;
}

.footer-legal a {
    color: var(--text-dim);
    text-decoration: underline;
    text-decoration-color: rgba(139, 160, 189, 0.35);
}

/* ---------- Адаптив ---------- */

@media (max-width: 1120px) {
    .brand-tagline {
        display: none;
    }

    .nav-link {
        padding: 7px 9px;
        font-size: 13px;
    }

    .site-search input {
        width: 150px;
    }
}

@media (max-width: 980px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .layout-side {
        position: static;
        flex-direction: column;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .header-inner {
        gap: 14px;
    }

    .nav-link {
        padding: 6px 8px;
        font-size: 12.5px;
    }

    .site-search input {
        width: 120px;
    }
}

@media (max-width: 760px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .nav-burger {
        order: 2;
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        width: 40px;
        height: 40px;
        margin-left: auto;
        padding: 0 9px;
        border: 1px solid var(--border);
        border-radius: 10px;
        cursor: pointer;
    }

    .theme-toggle {
        order: 3;
        width: 40px;
        height: 40px;
    }

    .nav-burger span {
        display: block;
        height: 2px;
        background: var(--text-dim);
        border-radius: 2px;
    }

    .site-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 2px;
        margin: 6px 0 4px;
        order: 4;
    }

    .nav-toggle:checked ~ .site-nav {
        display: flex;
    }

    .nav-link {
        width: 100%;
        border-radius: 10px;
        padding: 10px 12px;
    }

    .nav-group {
        width: 100%;
    }

    .nav-link--parent {
        width: 100%;
        justify-content: space-between;
    }

    .nav-menu {
        position: static;
        min-width: 0;
        padding: 2px 0 6px 10px;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .nav-menu::before {
        display: none;
    }

    .nav-menu-link {
        padding: 9px 12px;
        white-space: normal;
    }

    .services-list {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 20px;
    }

    .site-search {
        order: 5;
        width: 100%;
        margin: 6px 0 2px;
    }

    .site-search input {
        width: 100%;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .hero {
        padding: 36px 0 18px;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-top: 30px;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .read-also-list {
        grid-template-columns: 1fr;
    }

    .article-body {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}
