/* Vision Market — docs.vision-market.com
   Светлая минималистичная тема. Inter, тёплый воздушный layout,
   accent — фирменный оранжевый из логотипа. */

:root {
    --bg: #ffffff;
    --bg-soft: #f7f7f8;
    --bg-card: #ffffff;
    --border: rgba(15, 15, 17, 0.08);
    --border-strong: rgba(15, 15, 17, 0.16);
    --fg: #18181b;
    --fg-muted: #52525b;
    --fg-dim: #71717a;
    --accent: #ff3c00;
    --accent-soft: rgba(255, 60, 0, 0.08);
    --link: #ff3c00;
    --warn-bg: #fff7ed;
    --warn-border: #fed7aa;
    --warn-fg: #9a3412;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--bg);
    color: var(--fg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.65;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.15s;
}
a:hover { color: #cc3000; }

/* ── Header ─────────────────────────────────────────── */

.header {
    border-bottom: 1px solid var(--border);
    padding: 18px 24px;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    z-index: 10;
}
.header-inner {
    max-width: 920px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--fg);
}
.brand img {
    height: 22px;
    width: auto;
    display: block;
}
.brand:hover { opacity: 0.85; }

.nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.nav a {
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--fg-muted);
    font-weight: 500;
    white-space: nowrap;
}
.nav a:hover {
    color: var(--fg);
    background: var(--bg-soft);
}
.nav a.active {
    color: var(--fg);
    background: var(--bg-soft);
}

/* Mobile hamburger button — hidden on desktop, shown ≤640px. */
.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 8px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border-radius: 8px;
}
.nav-toggle:hover { background: var(--bg-soft); }
.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--fg);
    border-radius: 2px;
    transition: transform 0.18s ease, opacity 0.18s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.doc-meta {
    color: var(--fg-muted);
    font-size: 13.5px;
    margin: -20px 0 26px;
}

/* ── Main ───────────────────────────────────────────── */

main {
    max-width: 760px;
    margin: 0 auto;
    padding: 56px 24px 96px;
}

.hero {
    margin-bottom: 40px;
}
.hero .kicker {
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 4px 12px;
    margin-bottom: 18px;
    font-weight: 600;
}
.hero h1 {
    font-size: 36px;
    line-height: 1.15;
    letter-spacing: -0.025em;
    font-weight: 700;
    color: var(--fg);
}

/* ── Article ────────────────────────────────────────── */

article {
    font-size: 15.5px;
}

article h1, article h2, article h3, article h4, article h5 {
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: var(--fg);
    font-weight: 700;
}

article h2 {
    font-size: 22px;
    margin: 44px 0 14px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
article h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
article h3 {
    font-size: 17px;
    margin: 28px 0 10px;
    color: var(--fg);
}
article h4 {
    font-size: 13px;
    margin: 22px 0 8px;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

article p {
    margin: 0 0 16px;
    color: var(--fg);
}
article ul, article ol {
    margin: 12px 0 18px 22px;
}
article li {
    margin: 8px 0;
}
article ul li { list-style: disc; }
article ol li { list-style: decimal; }

article hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 36px 0;
}

article strong {
    color: var(--fg);
    font-weight: 600;
}
article em {
    color: var(--fg-muted);
}

article code {
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 13.5px;
    color: var(--fg);
    border: 1px solid var(--border);
}
article pre {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
    font-size: 13.5px;
}
article pre code {
    background: transparent;
    border: 0;
    padding: 0;
}

article table {
    border-collapse: collapse;
    margin: 18px 0;
    width: 100%;
    font-size: 14px;
}
article th, article td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
}
article th {
    background: var(--bg-soft);
    font-weight: 600;
}

article blockquote {
    border-left: 3px solid var(--accent);
    padding: 4px 0 4px 16px;
    margin: 16px 0;
    color: var(--fg-muted);
    font-style: italic;
}

/* ── Risks notice block ────────────────────────────── */

.notice {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    color: var(--warn-fg);
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.55;
}
.notice strong { color: #7c2d12; }

/* ── Footer ─────────────────────────────────────────── */

footer {
    border-top: 1px solid var(--border);
    padding: 28px 24px 40px;
    margin-top: 64px;
    color: var(--fg-dim);
    font-size: 13px;
}
.footer-inner {
    max-width: 920px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.footer-links a {
    color: var(--fg-muted);
}
.footer-links a:hover { color: var(--accent); }
.footer-sep {
    margin: 0 8px;
    color: var(--fg-dim);
    user-select: none;
}

/* ── Responsive ────────────────────────────────────── */

@media (max-width: 640px) {
    .header { padding: 12px 16px; }
    .header-inner { gap: 12px; }
    .brand img { height: 20px; }

    main { padding: 30px 18px 56px; }
    .hero { margin-bottom: 28px; }
    .hero .kicker { margin-bottom: 12px; }
    .hero h1 { font-size: 26px; line-height: 1.2; }
    article { font-size: 15px; }
    article h2 { font-size: 19px; margin-top: 32px; padding-top: 22px; }
    article h3 { font-size: 16px; margin-top: 22px; }

    /* Hamburger replaces the inline nav. */
    .nav-toggle { display: inline-flex; }
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        padding: 8px 12px 16px;
        gap: 2px;
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid var(--border);
        backdrop-filter: saturate(180%) blur(12px);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
    }
    .nav.open { display: flex; }
    .nav a {
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 15px;
        width: 100%;
    }
    .nav a.active { background: var(--bg-soft); }

    /* Tables — горизонтальная прокрутка чтобы не ломать layout. */
    article table { font-size: 13px; }
    article th, article td { padding: 8px 10px; }

    /* Footer — стек на узком экране. */
    .footer-inner { justify-content: center; text-align: center; }
}
