:root {
    --bg: #ffffff;
    --bg-soft: #f5f7fa;
    --bg-card: #ffffff;
    --text: #12181f;
    --text-soft: #4a5866;
    --text-mute: #6b7885;
    --accent: #0f6f8c;
    --accent-soft: #e6f2f6;
    --border: #e2e8ee;
    --shadow: 0 1px 2px rgba(18, 24, 31, .06), 0 8px 24px rgba(18, 24, 31, .06);
    --radius: 12px;
    --wrap: 1100px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1419;
        --bg-soft: #151c23;
        --bg-card: #171f27;
        --text: #e8edf2;
        --text-soft: #b3c0cc;
        --text-mute: #8c9aa8;
        --accent: #5ab9d6;
        --accent-soft: #14303a;
        --border: #26313b;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

/* ---------- шапка ---------- */

.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header .wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 64px;
    flex-wrap: wrap;
}

.logo {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -.01em;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

.logo span { color: var(--accent); }

.nav {
    display: flex;
    gap: 22px;
    margin-left: auto;
    flex-wrap: wrap;
}

.nav a {
    color: var(--text-soft);
    text-decoration: none;
    font-size: 15px;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- типографика ---------- */

h1, h2, h3 { line-height: 1.25; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 5vw, 44px); }
h2 { font-size: clamp(23px, 3.4vw, 30px); margin-top: 2em; }
h3 { font-size: 19px; margin-top: 1.8em; }
p { margin: 0 0 1.1em; }
a { color: var(--accent); }

.lead {
    font-size: clamp(17px, 2.2vw, 20px);
    color: var(--text-soft);
    max-width: 60ch;
}

.muted { color: var(--text-mute); }
.small { font-size: 14px; }

/* ---------- герой ---------- */

.hero {
    padding: 72px 0 56px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
}

.badge {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 18px;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: opacity .15s;
}

.btn:hover { opacity: .88; }
.btn-primary { background: var(--accent); color: #fff; }

.btn-ghost {
    border-color: var(--border);
    color: var(--text);
    background: var(--bg-card);
}

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

section { padding: 56px 0; }
section.tight { padding: 40px 0; }
.section-soft { background: var(--bg-soft); border-block: 1px solid var(--border); }

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

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.card-icon {
    font-size: 22px;
    line-height: 1;
    margin-bottom: 12px;
    display: block;
}

/* ---------- шаги ---------- */

.steps { counter-reset: step; margin-top: 32px; display: grid; gap: 20px; }

.step {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 16px;
    align-items: start;
}

.step::before {
    counter-increment: step;
    content: counter(step);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    display: grid;
    place-items: center;
    font-size: 15px;
}

.step h3 { margin: 4px 0 6px; }
.step p { margin: 0; color: var(--text-soft); }

/* ---------- таблица ---------- */

.table-scroll { overflow-x: auto; margin: 24px 0; }

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 480px;
    font-size: 15px;
}

th, td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th { font-weight: 600; background: var(--bg-soft); }

/* ---------- FAQ ---------- */

details {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 20px;
    margin-bottom: 12px;
    background: var(--bg-card);
}

details[open] { padding-bottom: 6px; }

summary {
    cursor: pointer;
    font-weight: 600;
    padding: 17px 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

summary::-webkit-details-marker { display: none; }

summary::after {
    content: "+";
    color: var(--accent);
    font-size: 21px;
    font-weight: 400;
    flex-shrink: 0;
}

details[open] summary::after { content: "\2212"; }
details p { color: var(--text-soft); }
details p:last-child { margin-bottom: 14px; }

/* ---------- статьи ---------- */

.article-list { display: grid; gap: 16px; margin-top: 32px; }

.article-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    background: var(--bg-card);
    text-decoration: none;
    display: block;
    color: inherit;
}

.article-item:hover { box-shadow: var(--shadow); }
.article-item h3 { margin: 0 0 8px; color: var(--text); }
.article-item p { margin: 0; color: var(--text-soft); font-size: 15px; }

.article-meta { font-size: 13px; color: var(--text-mute); margin-bottom: 6px; }

.prose { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 1.1em; }
.prose li { margin-bottom: .45em; }

.prose blockquote {
    margin: 1.4em 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--accent);
    color: var(--text-soft);
    font-style: italic;
}

.back-link { display: inline-block; margin-bottom: 24px; font-size: 15px; text-decoration: none; }

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

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    padding: 36px 0;
    margin-top: 40px;
    font-size: 14px;
    color: var(--text-mute);
}

.footer-grid {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.site-footer a { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }

@media (max-width: 640px) {
    .hero { padding: 48px 0 40px; }
    section { padding: 40px 0; }
    .site-header .wrap { min-height: 56px; padding-block: 10px; }
    .nav { gap: 16px; width: 100%; margin-left: 0; }
}
