:root {
    --bg: #f4f1ea;
    --surface: #ffffff;
    --text: #202020;
    --muted: #777777;
    --line: #dddddd;
    --accent: #7a4cff;
    --link: #5d38d6;

    --radius: 14px;
    --space: 18px;
    --container: 860px;
}

:root {
    --font-base: 16px;
    --font-small: 14px;
    --font-h1: clamp(24px, 5vw, 32px);
    --font-h2: clamp(20px, 4vw, 24px);
    --font-h3: clamp(18px, 3vw, 22px);
    --font-h4: clamp(16px, 2.5vw, 18px);
    --font-lead: clamp(17px, 2.5vw, 20px);
}

[data-theme="dark"] {
    --bg: #111318;
    --surface: #191d25;
    --text: #e8e8e8;
    --muted: #9a9a9a;
    --line: #2b303a;
    --accent: #9b7cff;
    --link: #b7a4ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: var(--font-base)/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(100%, var(--container));
    margin: 0 auto;
}

.layout {
    padding: 24px 18px 48px;
}

.stack > * + * {
    margin-top: var(--space);
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space);
}

.split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
}

.site-header,
.site-footer {
    padding: 22px 18px;
}

.logo {
    color: var(--text);
    font-weight: 700;
    font-size: clamp(22px, 5vw, 32px);
}

.nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.breadcrumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.page-title {
    margin: 0;
    font-size: var(--font-h1);
    line-height: 1.1;
}

.title {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.lead {
    margin: 0;
    color: var(--muted);
    font-size: var(--font-lead);
}

.meta {
    color: var(--muted);
    font-size: var(--font-small);
}

.badge {
    display: inline-block;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.text h2 {
    margin: 0 0 12px 0;
    font-size: var(--font-h2);
    line-height: 1.2;
}

.text h3 {
    margin: 28px 0 10px;
    font-size: var(--font-h3);
    line-height: 1.25;
}

.text h4 {
    margin: 0 0 10px;
    font-size: var(--font-h4);
    line-height: 1.25;
}

.text p,
.text ul,
.text ol,
.text blockquote {
    margin: 18px 0;
}

.text blockquote {
    padding: 14px 18px;
    border-left: 4px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tags a {
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px;
}

.site-footer {
    text-align: center;
    color: var(--muted);
    font-size: var(--font-small);
}

.text ul {
    margin: 8px 0;
    padding-left: 20px;
}

.text ul ul {
    margin-top: 4px;
    padding-left: 18px;
}

.text li {
    margin: 4px 0;
}

.tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tree-node {
    line-height: 1.4;
}

.news-list {
    display: grid;
    gap: 12px;
}

.news-item {
    padding: 12px 12px;
    margin-bottom: 16px;

    background: color-mix(in srgb, white 4%, var(--surface));
    border: 2px solid var(--line);
    border-radius: 16px;
    border-left-color: var(--accent);
}

.news-item:last-child {
    margin-bottom: 0;
}

.news-date {
    color: var(--muted);
    margin-bottom: 6px;
    font-size: var(--font-small);

    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.news-tag {
    display: inline-block;
    padding: 2px 8px;

    color: var(--link);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.news-separator {
    color: var(--muted);
    opacity: 0.55;
}

.news-title {
    margin: 0 0 12px;
    font-size: clamp(20px, 4vw, 28px);
    line-height: 1.2;
}

.news-text {
    white-space: pre-wrap;
    line-height: 1.7;
}

.page-image {
    width: 100%;
    display: block;
    border-radius: 14px;
}

img {
    width: 100%;
    display: block;
    border-radius: 14px;
}



@media (max-width: 640px) {
    :root {
        --font-base: 14px;
        --font-small: 12px;
        --font-h1: 18px;
        --font-h2: 16px;
        --font-h3: 14px;
        --font-h4: 13px;
        --font-lead: 13px;

        --space: 10px;
    }

    .row {
        align-items: flex-start;
        flex-direction: column;
    }

    .layout {
        padding: 12px 10px 24px;
    }

    .card {
        padding: 16px;
        border-radius: 12px;
    }

    .news-item {
        padding: 14px;
    }

    .news-tag {
        font-size: 11px;
        padding: 1px 7px;
    }
}