@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;600;700&display=swap');

:root {
    --header-h: 78px;
    --accent: #4da3ff;
    --accent2: #0088ff;
    --muted: #9aa4b2;
    --glass: rgba(255,255,255,0.02);
    --ease-out: cubic-bezier(.2,.8,.2,1);
    --ease-spring: cubic-bezier(.2,1.1,.2,1);
    --dur-fast: 140ms;
    --dur: 260ms;
    --dur-slow: 420ms;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    color-scheme: only light;
    height: 100%;
}

body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: #0b0d10;
    color: #e7edf6;
    overflow-x: hidden;
    min-height: 100%;
    transition: background .3s, color .3s;
}



html[data-theme='light'] body { background: #f6f7fb; color: #0b0d10; }
html[data-theme='light'] .card {
    background: linear-gradient(135deg, #fff, #f3f6fa) !important;
    border-color: rgba(0,120,255,0.15);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 0 30px rgba(0,120,255,0.08);
}

html[data-theme='light'] .section-content li { color: #222 !important; }
html[data-theme='light'] .section-content h2 { color: #0066cc !important; }
html[data-theme='light'] .header-login { color: #0b0d10; background: rgba(0,120,255,0.12); border-color: rgba(0,120,255,0.25); }
html[data-theme='light'] .footer { background: rgba(255,255,255,0.65); border-color: rgba(0,120,255,0.12); }


.parallax {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.parallax div {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.18;
    transition: transform 0.1s ease-out;
    will-change: transform;
}


.l1 { width: 520px; height: 520px; background: #0b3a8f; box-shadow: 0 0 120px #0a4cff; left: -100px; top: 20%; }
.l2 { width: 440px; height: 440px; background: #0066ff; box-shadow: 0 0 160px #0066ff; right: -120px; top: 55%; }
.l3 { width: 760px; height: 760px; background: #1a5bff; opacity: 0.12; box-shadow: 0 0 200px #1a5bff; left: 10%; bottom: -40%; }


.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    background: var(--glass);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

.header-left, .header-right { display: flex; align-items: center; gap: 12px; }
.header-left { gap: 18px; }

.logo { font-size: 1.4rem; font-weight: 800; color: inherit; text-decoration: none; }


.header-nav {
    display: flex;
    gap: 22px;
    align-items: center;
    z-index: 1200;
}

.header-nav a {
    color: var(--muted);
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: color .25s, background .25s;
}

.header-nav a:hover,
.header-nav a.active { color: var(--accent); background: rgba(77,163,255,0.12); }

.header-login {
    appearance: none;
    border: 1px solid rgba(77,163,255,0.28);
    background: rgba(77,163,255,0.10);
    color: #e7edf6;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    backdrop-filter: blur(8px);
    transition: transform .2s, background .25s, box-shadow .25s, border-color .25s;
}

.header-login:hover {
    transform: translateY(-2px);
    background: rgba(77,163,255,0.16);
    border-color: rgba(77,163,255,0.50);
    box-shadow: 0 0 18px rgba(77,163,255,0.22);
}

.header-login:active { transform: translateY(0); }


.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.9rem;
    color: var(--muted);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
    transition: color .25s, background .25s;
}

.mobile-nav-toggle:hover { color: var(--accent); background: rgba(77,163,255,0.08); }


.main { padding-top: var(--header-h); }

section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    transition: opacity 0.5s ease;
}


section.highlight { animation: sectionPulse 0.6s ease; }
@keyframes sectionPulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: inset 0 0 60px rgba(77,163,255,0.08); }
}


.card {
    position: relative;
    width: 100%;
    max-width: 1150px;
    background: linear-gradient(135deg, #0d111a, #0a0d14);
    padding: 60px;
    border-radius: 18px;
    border: 1px solid rgba(0,140,255,0.18);
    box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 0 30px rgba(0,100,255,0.12);
    transition: transform .45s, box-shadow .45s;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 60px rgba(0,0,0,0.55), 0 0 40px rgba(0,120,255,0.22);
}


.title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(90deg, #4da3ff, #0088ff, #4da3ff);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: waveGradient 6s ease infinite;
}


@keyframes waveGradient {
    0%, 100% { background-position: 0%; }
    50% { background-position: 100%; }
}


.subtitle { margin-top: 12px; color: var(--muted); font-size: 1.2rem; max-width: 700px; }

.section-content {
    font-family: "JetBrains Mono", monospace;
    line-height: 1.6;
}

.section-content .title { font-family: "JetBrains Mono", monospace; font-weight: 700; }
.section-content h2 { font-size: 1.6rem; margin-top: 34px; margin-bottom: 12px; font-weight: 700; color: #4da3ff; }
.section-content h3 { font-size: 1.35rem; margin-top: 28px; margin-bottom: 10px; font-weight: 700; color: #79b8ff; }
.section-content h4 { font-size: 1.1rem; margin-top: 8px; margin-bottom: 10px; font-weight: 600; color: #a8cfff; }
.section-content p { margin-bottom: 14px; font-size: 1.05rem; }
.section-content li { list-style: disc; margin-left: 20px; margin-bottom: 14px; font-size: 1.05rem; color: #e7edf6; }


#home .card { font-family: "JetBrains Mono", monospace; line-height: 1.6; }

.bot-logo {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 120px;
    height: auto;
    opacity: 0.95;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.card:hover .bot-logo { transform: scale(1.04); }

.features { margin-top: 26px; margin-bottom: 26px; }
.features li { list-style: disc; margin-left: 20px; margin-bottom: 10px; font-size: 1.05rem; color: #e7edf6; }


.btn {
    margin-top: 26px;
    display: inline-block;
    padding: 16px 30px;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    color: #04131c;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 0 18px rgba(0,120,255,.35);
    transition: transform .35s, box-shadow .35s;
}

.btn:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 0 28px rgba(0,120,255,.55); }
.btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.26), transparent 60%);
    transform: scale(0);
    opacity: 0;
    transition: transform .45s, opacity .45s;
}

.btn:hover::before { transform: scale(2.5); opacity: 1; }

.commands-header { display: grid; gap: 6px; margin-bottom: 14px; }
.commands-subtitle { margin: 0; opacity: .8; line-height: 1.35; }

.commands-search-wrap { position: relative; margin-top: 16px; max-width: 360px; }
.commands-search {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: rgba(0,0,0,0.25);
    color: #e7edf6;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.commands-search::placeholder { color: rgba(255,255,255,0.4); }
.commands-search:focus { border-color: var(--accent); background: rgba(0,0,0,0.35); box-shadow: 0 0 0 3px rgba(77,163,255,0.15); }
.commands-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; opacity: 0.5; pointer-events: none; }


.search-hint {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-family: inherit;
    font-size: 0.7rem;
    color: var(--muted);
    opacity: 0.5;
    pointer-events: none;
    padding: 3px 7px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    transition: opacity 0.2s;
}


.commands-search:focus ~ .search-hint { opacity: 0; }

.commands-accordion { display: grid; gap: 10px; }

.commands-group { border: 1px solid rgba(255,255,255,.08); border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.02); }
.commands-group.search-hidden { display: none !important; }

.commands-summary {
    position: relative;
    cursor: pointer;
    user-select: none;
    list-style: none;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 13px;
    transition: background 180ms var(--ease-out);
}

.commands-summary:hover { background: rgba(77,163,255,.06); }
.commands-summary:active { background: rgba(77,163,255,.10); }
.commands-summary::-webkit-details-marker { display: none; }
.commands-group[open] .commands-summary { border-bottom: 1px solid rgba(255,255,255,.08); border-radius: 13px 13px 0 0; background: rgba(255,255,255,.02); }
.commands-group-title { font-weight: 700; }
.commands-group-hint { opacity: .7; font-size: .95em; }


.chev {
    margin-left: auto;
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(255,255,255,.55);
    border-bottom: 2px solid rgba(255,255,255,.55);
    transform: rotate(-45deg);
    transition: transform var(--dur) var(--ease-spring);
    opacity: .9;
}


.commands-group[open] .chev { transform: rotate(45deg); }
.commands-group.closing .chev { transform: rotate(-45deg); }

.commands-content { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 350ms var(--ease-spring); overflow: hidden; }
.commands-content > .commands-grid { overflow: hidden; min-height: 0; }

.commands-group[open] .commands-content { grid-template-rows: 1fr; }
.commands-group.closing .commands-content { grid-template-rows: 0fr; }

.commands-grid {
    padding: 0 14px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out), padding 300ms var(--ease-out), gap 300ms var(--ease-out);
}

.commands-group[open] .commands-grid { padding: 14px; opacity: 1; transform: translateY(0); }
.commands-group.closing .commands-grid { opacity: 0; padding: 0 14px; gap: 0; transform: translateY(-8px); }


.cmd {
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(0,0,0,.12);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: transform 200ms var(--ease-spring), border-color 200ms, background 200ms, box-shadow 250ms;
}

.cmd:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(77,163,255,.25);
    background: rgba(0,0,0,.22);
    box-shadow: 0 12px 28px rgba(0,0,0,.25), 0 0 20px rgba(77,163,255,.08);
}


.cmd:active { transform: translateY(-1px) scale(.98); }
.cmd.search-hidden { display: none !important; }

.cmd-title { margin: 0 0 8px; font-size: 1.05rem; }
.cmd-title code {
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(77,163,255,.20);
    background: rgba(77,163,255,.08);
    color: #79b8ff;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: background 200ms, border-color 200ms;
}

.cmd:hover .cmd-title code { background: rgba(77,163,255,.14); border-color: rgba(77,163,255,.30); }
.cmd-title code::after {
    content: '📋';
    position: absolute;
    right: -28px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.cmd:hover .cmd-title code::after { opacity: 0.6; }
.cmd-title code.copied::after { content: '✓'; opacity: 1; color: #4ade80; }

.cmd-desc { margin: 0; opacity: .80; line-height: 1.4; font-size: 0.95rem; }


.commands-group[open] .cmd { animation: cmdIn var(--dur) var(--ease-out) both; }
.commands-group[open] .cmd:nth-child(1) { animation-delay: 20ms; }
.commands-group[open] .cmd:nth-child(2) { animation-delay: 50ms; }
.commands-group[open] .cmd:nth-child(3) { animation-delay: 80ms; }
.commands-group[open] .cmd:nth-child(4) { animation-delay: 110ms; }
.commands-group[open] .cmd:nth-child(5) { animation-delay: 140ms; }
.commands-group[open] .cmd:nth-child(6) { animation-delay: 170ms; }
.commands-group[open] .cmd:nth-child(7) { animation-delay: 200ms; }
.commands-group[open] .cmd:nth-child(8) { animation-delay: 230ms; }

@keyframes cmdIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }


/* ============ Changelog ============ */
.changelog-subtitle { margin: 8px 0 0; color: var(--muted); font-size: 1rem; }

.changelog-list { display: grid; gap: 20px; margin-top: 24px; }
.changelog-list.cl-list { gap: 30px; margin-top: 32px; }

/* Цвета типов изменений */
.cl-add     { --cl-c: #4ade80; }
.cl-improve { --cl-c: #60a5fa; }
.cl-fix     { --cl-c: #fb923c; }
.cl-remove  { --cl-c: #f87171; }
.cl-note    { --cl-c: #a5b4c8; }

.cl-ico { width: 12px; height: 12px; flex: none; }

.cl-mark {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    color: var(--cl-c);
    background: color-mix(in srgb, var(--cl-c) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--cl-c) 28%, transparent);
}

/* Легенда на /updates */
.cl-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; color: var(--muted); font-size: 0.85rem; }
.cl-legend-item { display: inline-flex; align-items: center; gap: 8px; }

/* Версия: слева метка, справа карточка — как таймлайн новостей */
.cl-entry { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 0 28px; scroll-margin-top: calc(var(--header-h) + 20px); }

.cl-rail {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    align-self: start;
    display: grid;
    justify-items: start;
    gap: 6px;
    padding-top: 6px;
    font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

.cl-version { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; color: #e7edf6; line-height: 1; }
.cl-date { font-size: 0.78rem; color: var(--muted); }

.cl-latest {
    margin-top: 4px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #04131c;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.cl-card {
    position: relative;
    min-width: 0;
    display: grid;
    gap: 18px;
    padding: 2px 0 6px 28px;
    border-left: 2px solid rgba(120,170,255,0.12);
}

/* Точка на линии */
.cl-card::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #0b0d10;
    border: 2px solid rgba(120,170,255,0.45);
    box-shadow: 0 0 0 4px #0b0d10;
}

.cl-entry.is-latest .cl-card::before { border-color: var(--accent); box-shadow: 0 0 0 4px #0b0d10, 0 0 14px var(--accent); }

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

.cl-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cl-c);
    background: color-mix(in srgb, var(--cl-c) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--cl-c) 22%, transparent);
}

.cl-sections { display: grid; gap: 14px; }
.cl-sections.is-grid { grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr)); align-items: start; }

.cl-section {
    min-width: 0;
    display: grid;
    gap: 12px;
    padding: 18px 20px;
    border-radius: 14px;
    background: rgba(255,255,255,0.015);
    border: 1px solid rgba(120,170,255,0.12);
    transition: border-color .2s, background .2s;
}

.cl-section:hover { border-color: rgba(77,163,255,0.3); background: rgba(77,163,255,0.035); }

.cl-section-title { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; font-weight: 700; line-height: 1.3; color: #e7edf6; }

.cl-emoji {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 1.05rem;
    background: rgba(77,163,255,0.1);
    border: 1px solid rgba(77,163,255,0.18);
}

.cl-items { list-style: none; display: grid; gap: 9px; margin: 0; padding: 0; }

.cl-item { display: flex; gap: 10px; align-items: flex-start; font-size: 0.94rem; line-height: 1.5; color: rgba(231,237,246,0.84); }
.cl-item .cl-mark { margin-top: 1px; }
.cl-item > span:last-child { min-width: 0; }

.cl-caveats { display: grid; gap: 9px; padding-top: 12px; border-top: 1px dashed rgba(255,255,255,0.1); }
.cl-caveats .cl-item { color: rgba(231,237,246,0.62); font-size: 0.9rem; }

.cl-caveats-title,
.cl-more-count {
    font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.cl-more-count { letter-spacing: .06em; text-transform: none; font-size: 0.78rem; padding-left: 30px; }

.cl-item code {
    padding: 2px 6px;
    background: rgba(77,163,255,0.12);
    border-radius: 4px;
    font-size: 0.9em;
    color: #79b8ff;
}

.cl-item strong { color: #e7edf6; }

/* Итоговая подпись версии */
.cl-outro {
    display: grid;
    gap: 4px;
    padding: 18px 22px;
    border-radius: 14px;
    background: linear-gradient(120deg, rgba(77,163,255,0.14), rgba(0,136,255,0.04) 60%);
    border: 1px solid rgba(77,163,255,0.28);
    color: rgba(231,237,246,0.88);
    font-size: 1rem;
    line-height: 1.5;
}

.cl-outro strong { color: #e7edf6; }

.cl-more-sections { padding-left: 0; margin-top: -4px; }
.cl-read-more { justify-self: start; }
.cl-read-more:hover svg { transform: translateX(4px); }

/* Простая версия без разделов (например, v1.0.0) */
.cl-section.is-plain { padding: 16px 20px; }

/* Светлая тема */
html[data-theme='light'] .cl-version,
html[data-theme='light'] .cl-section-title,
html[data-theme='light'] .cl-item strong,
html[data-theme='light'] .cl-outro strong { color: #0b0d10; }
html[data-theme='light'] .cl-item { color: rgba(11,13,16,0.8); }
html[data-theme='light'] .cl-card::before { background: #f6f7fb; box-shadow: 0 0 0 4px #f6f7fb; }

@media (max-width: 760px) {
    .cl-entry { grid-template-columns: 1fr; gap: 14px; }
    .cl-rail { position: static; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding-top: 0; }
    .cl-latest { margin-top: 0; }
    .cl-card { padding: 2px 0 6px 20px; }
    .cl-section { padding: 14px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .cl-section, .cl-read-more svg { transition: none; }
}

.status-placeholder { color: var(--muted); font-size: 1.1rem; margin-top: 12px; }


.footer {
    position: relative;
    z-index: 5;
    padding: 22px 18px;
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,120,255,0.14);
}

.footer-inner { max-width: 1150px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.footer-brand { font-weight: 800; letter-spacing: 0.2px; }
.footer small { display: block; margin-top: 6px; color: var(--muted); font-size: 0.95rem; }
.footer-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.footer a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 10px; font-weight: 600; transition: color .25s, background .25s, transform .15s; }
.footer a:hover { color: var(--accent); background: rgba(77,163,255,0.12); transform: translateY(-1px); }


.fade { opacity: 0; transform: translateY(40px); filter: blur(4px); transition: opacity 1s, transform 1s, filter 1s; }
.fade.in { opacity: 1; transform: none; filter: blur(0); }

[data-stagger] > * { opacity: 0; transform: translateY(24px); filter: blur(3px); }
[data-stagger].in > * { opacity: 1; transform: none; filter: blur(0); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out), filter 0.6s var(--ease-out); }
[data-stagger].in > *:nth-child(1) { transition-delay: 0s; }
[data-stagger].in > *:nth-child(2) { transition-delay: 0.06s; }
[data-stagger].in > *:nth-child(3) { transition-delay: 0.12s; }
[data-stagger].in > *:nth-child(4) { transition-delay: 0.18s; }
[data-stagger].in > *:nth-child(5) { transition-delay: 0.24s; }
[data-stagger].in > *:nth-child(6) { transition-delay: 0.30s; }
[data-stagger].in > *:nth-child(7) { transition-delay: 0.36s; }
[data-stagger].in > *:nth-child(8) { transition-delay: 0.42s; }
[data-stagger].in > *:nth-child(9) { transition-delay: 0.48s; }
[data-stagger].in > *:nth-child(10) { transition-delay: 0.54s; }
[data-stagger].in > *:nth-child(n+11) { transition-delay: 0.60s; }


.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0b0d10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s, visibility 0.5s;
}

.preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-inner { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.preloader-logo { width: 80px; height: 80px; animation: preloaderPulse 1.5s ease-in-out infinite; }
.preloader-spinner { width: 40px; height: 40px; border: 3px solid rgba(77,163,255,0.2); border-top-color: var(--accent); border-radius: 50%; animation: preloaderSpin 0.8s linear infinite; }


@keyframes preloaderPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: 0.8; } }
@keyframes preloaderSpin { to { transform: rotate(360deg); } }


.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,120,255,0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: opacity 0.3s var(--ease-out), visibility 0.3s, transform 0.3s var(--ease-spring), box-shadow 0.2s;
}

.scroll-top-btn.visible { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.scroll-top-btn:hover { transform: translateY(-4px) scale(1.05); box-shadow: 0 8px 30px rgba(0,120,255,0.5); }
.scroll-top-btn:active { transform: translateY(-2px) scale(0.98); }


.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 2000;
    padding: 12px 24px;
    border-radius: 12px;
    background: rgba(20,24,32,0.95);
    border: 1px solid rgba(77,163,255,0.25);
    color: #e7edf6;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s var(--ease-spring);
}

.toast.visible { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }


.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: static; left: auto; width: auto; height: auto; padding: 8px 12px; background: rgba(77,163,255,0.12); border-radius: 6px; margin: 6px; z-index: 2000; }

a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }


@media (max-width: 768px) {
    .bot-logo { position: static; display: block; margin: 0 auto 20px; width: 110px; transform: none; }
}

@media (max-width: 760px) {
    .header { padding: 0 16px; }
    .header-nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; gap: 0; background: rgba(10,12,18,0.98); backdrop-filter: blur(10px); padding: 8px 0; border-bottom: 1px solid rgba(0,120,255,0.12); z-index: 1150; opacity: 0; transform: translateY(-14px); }
    .header-nav a { padding: 14px 22px; font-size: 1.05rem; border-radius: 0; display: block; width: 100%; }
    .header-nav.open { display: flex !important; opacity: 1; transform: translateY(0); }
    .mobile-nav-toggle { display: inline-flex; }
    .card { padding: 32px; }
    .title { font-size: 2.2rem; }
}

@media (max-width: 600px) {
    .scroll-top-btn { bottom: 20px; right: 20px; width: 44px; height: 44px; }
}

@media (max-width: 540px) {
    .card { padding: 24px !important; }
    .title { font-size: 1.8rem !important; }
    .subtitle { font-size: 1.05rem; }
}

@media (max-width: 480px) {
    .bot-logo { width: 90px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


.faq-subtitle { margin: 8px 0 0; color: var(--muted); font-size: 1rem; }
.faq-accordion { display: grid; gap: 10px; margin-top: 24px; }

.faq-item {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255,255,255,.02);
}

.faq-question {
    cursor: pointer;
    user-select: none;
    list-style: none;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    transition: background 180ms var(--ease-out);
}

.faq-question:hover { background: rgba(77,163,255,.06); }
.faq-question:active { background: rgba(77,163,255,.10); }
.faq-question::-webkit-details-marker { display: none; }

.faq-question-text { flex: 1; }

.faq-item[open] .faq-question {
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.02);
}

.faq-question .chev {
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(255,255,255,.55);
    border-bottom: 2px solid rgba(255,255,255,.55);
    transform: rotate(-45deg);
    transition: transform var(--dur) var(--ease-spring);
    opacity: .9;
    flex-shrink: 0;
}

.faq-item[open] .chev { transform: rotate(45deg); }
.faq-item.closing .chev { transform: rotate(-45deg); }

.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 300ms var(--ease-spring);
    overflow: hidden;
}

.faq-answer-inner {
    overflow: hidden;
    min-height: 0;
    padding: 0 20px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 250ms, transform 250ms, padding 300ms;
    color: rgba(231,237,246,0.85);
    line-height: 1.6;
}

.faq-item[open] .faq-answer { grid-template-rows: 1fr; }
.faq-item[open] .faq-answer-inner {
    padding: 16px 20px;
    opacity: 1;
    transform: translateY(0);
}

.faq-item.closing .faq-answer { grid-template-rows: 0fr; }
.faq-item.closing .faq-answer-inner {
    padding: 0 20px;
    opacity: 0;
    transform: translateY(-8px);
}

.faq-answer-inner code {
    padding: 2px 6px;
    background: rgba(77,163,255,0.12);
    border-radius: 4px;
    font-size: 0.9em;
    color: #79b8ff;
}


/* ============ News ============ */
:root {
    --news-line: rgba(120,170,255,0.12);
    --news-line-strong: rgba(77,163,255,0.32);
    --news-surface: rgba(255,255,255,0.015);
    --news-text: rgba(231,237,246,0.76);
    --news-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

.news-subtitle { margin: 8px 0 0; color: var(--muted); font-size: 1rem; }

/* Мета-строка: тип • дата • время чтения */
.news-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    font-family: var(--news-mono);
    font-size: 0.8rem;
    color: var(--muted);
}

.news-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .55; }

.news-tag {
    --tag-color: hsl(var(--tag-hue, 212) 95% 68%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--news-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tag-color);
}

.news-tag::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tag-color);
    box-shadow: 0 0 10px var(--tag-color);
}

.news-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}

.news-more svg { transition: transform .2s var(--ease-out); }

/* Обложки: сгенерированная волна или своя картинка */
.news-cover {
    position: relative;
    overflow: hidden;
    background: #111724;
}

.news-cover canvas,
.news-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.news-cover img { object-fit: cover; object-position: right center; }

.news-cover-glyph {
    position: absolute;
    left: 7%;
    bottom: 9%;
    font-family: var(--news-mono);
    font-weight: 700;
    font-size: 2.4rem;
    line-height: .9;
    letter-spacing: -.04em;
    color: #fff;
    text-shadow: 0 4px 30px rgba(0,0,0,.5);
}

.news-cover-glyph small {
    display: block;
    margin-top: .45em;
    font-size: .3em;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: .85;
}


/* ---------- Главная: превью новостей ---------- */
.news-preview { display: grid; gap: 34px; margin-top: 32px; }
.news-preview:empty { display: none; }

.news-card {
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.18);
    border: 1px solid var(--news-line);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s, border-color 0.2s;
}

.news-card:hover {
    transform: translateY(-4px);
    border-color: var(--news-line-strong);
    box-shadow: 0 12px 28px rgba(0,0,0,.25), 0 0 20px rgba(77,163,255,.08);
}

.news-card:hover .news-more svg { transform: translateX(4px); }

.news-card-cover-link { display: block; }
.news-card-cover { height: 160px; border-bottom: 1px solid var(--news-line); }

.news-card-content { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.news-card-title { font-size: 1.15rem; font-weight: 700; color: #e7edf6; line-height: 1.3; }

.news-card-excerpt {
    flex: 1;
    font-size: 0.95rem;
    color: var(--news-text);
    line-height: 1.5;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-view-all-wrap { text-align: center; margin-top: 24px; }
.news-view-all { display: inline-block; }

.changelog-view-all { display: inline-block; }


/* ---------- /news: шапка и фильтры ---------- */
#news-page .card:hover { transform: none; }

.news-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.news-count { font-family: var(--news-mono); font-size: 0.85rem; color: var(--muted); }

.news-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.news-filters[hidden], .news-filters:empty { display: none; }

.news-chip {
    appearance: none;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 999px;
    border: 1px solid var(--news-line);
    background: transparent;
    color: var(--news-text);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: border-color .2s, background .2s, color .2s;
}

.news-chip:hover { border-color: var(--news-line-strong); }
.news-chip[aria-pressed="true"] { background: rgba(77,163,255,0.12); border-color: var(--news-line-strong); color: var(--accent); }
.news-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#news-page.is-article .news-page-head,
#news-page.is-article .news-filters,
#news-page.is-article .news-list { display: none; }


/* ---------- /news: таймлайн ---------- */
.news-list { display: grid; gap: 34px; margin-top: 32px; }
.news-list:empty { display: none; }

.news-month { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 0 28px; }

.news-month-label {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    align-self: start;
    padding-top: 6px;
    font-family: var(--news-mono);
}

.news-month-label b { display: block; font-size: 1rem; color: #e7edf6; }
.news-month-label span { font-size: 0.78rem; letter-spacing: .1em; color: var(--muted); }

.news-month-items {
    display: grid;
    gap: 18px;
    padding: 0 0 6px 28px;
    border-left: 2px solid var(--news-line);
}

.news-item {
    --tag-color: hsl(var(--tag-hue, 212) 95% 68%);
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 22px;
    padding: 20px 22px;
    border-radius: 14px;
    background: var(--news-surface);
    border: 1px solid var(--news-line);
    transition: border-color .2s, background .2s, transform .3s var(--ease-spring);
}

.news-item:hover { border-color: var(--news-line-strong); background: rgba(77,163,255,0.04); transform: translateX(4px); }
.news-item:hover .news-more svg { transform: translateX(4px); }
.news-item:focus-within { border-color: var(--accent); }

/* Точка на линии таймлайна, цвет — по типу новости */
.news-item::before {
    content: "";
    position: absolute;
    left: -37px;
    top: 26px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #0b0d10;
    border: 2px solid var(--tag-color);
    box-shadow: 0 0 0 4px #0b0d10, 0 0 14px var(--tag-color);
}

.news-item-text { min-width: 0; display: grid; gap: 8px; align-content: start; }
.news-item-day { color: #e7edf6; font-weight: 600; }

.news-item-title { font-size: 1.25rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.news-item-link { color: #e7edf6; text-decoration: none; }
.news-item-link:focus-visible { outline: none; }

/* Вся карточка кликабельна через ссылку в заголовке */
.news-item-link::after { content: ""; position: absolute; inset: 0; border-radius: 14px; z-index: 1; }

.news-item-excerpt { color: var(--news-text); line-height: 1.55; }

.news-item-cover { border-radius: 10px; min-height: 120px; }
.news-item-cover .news-cover-glyph { font-size: 2.3rem; }

.news-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--news-line);
    border-radius: 14px;
}


/* ---------- /news?article=… ---------- */
.news-progress {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    height: 3px;
    z-index: 999;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
}

.news-progress[hidden] { display: none; }

.news-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 6px 0;
    transition: color 0.2s;
}

.news-back-link:hover { color: var(--accent); }

.news-not-found { text-align: center; padding: 40px 20px; }
.news-not-found h2 { font-size: 1.5rem; color: var(--accent); margin-bottom: 12px; }
.news-not-found p { color: var(--muted); margin-bottom: 24px; }

.news-article-container:empty { display: none; }

.news-article { display: grid; gap: 28px; }

.news-article-header { display: grid; gap: 14px; max-width: 820px; }

.news-article-title {
    font-size: clamp(2rem, 4.5vw, 3.1rem);
    font-weight: 800;
    line-height: 1.07;
    letter-spacing: -.03em;
    color: #e7edf6;
    text-wrap: balance;
}

.news-article-lead { font-size: 1.15rem; line-height: 1.55; color: var(--news-text); max-width: 62ch; }

.news-article-cover {
    height: clamp(180px, 26vw, 300px);
    border-radius: 18px;
    border: 1px solid var(--news-line);
}

.news-article-cover.has-image { height: auto; aspect-ratio: 5 / 2; max-width: 600px; }
.news-article-cover .news-cover-glyph { font-size: clamp(4.5rem, 12vw, 10rem); }

.news-article-grid {
    display: grid;
    grid-template-columns: minmax(0, 700px) 220px;
    gap: 56px;
    justify-content: space-between;
}

.news-article-aside {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    align-self: start;
    display: grid;
    gap: 24px;
}

.news-aside-title {
    margin-bottom: 8px;
    font-family: var(--news-mono);
    font-size: 0.72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.news-toc { display: grid; border-left: 1px solid var(--news-line); }
.news-toc .news-aside-title { padding-left: 14px; }

.news-toc a {
    margin-left: -1px;
    padding: 6px 0 6px 14px;
    border-left: 2px solid transparent;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.35;
    text-decoration: none;
    transition: color .15s, border-color .15s;
}

.news-toc a:hover { color: #e7edf6; }
.news-toc a.active { color: var(--accent); border-left-color: var(--accent); }

.news-share-btn {
    appearance: none;
    cursor: pointer;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid var(--news-line);
    background: rgba(255,255,255,0.02);
    color: #e7edf6;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: border-color .2s;
}

.news-share-btn:hover { border-color: var(--news-line-strong); }

.news-article-body {
    min-width: 0;
    font-size: 1.06rem;
    line-height: 1.75;
    color: var(--news-text);
}

.news-article-body h3 {
    font-size: 1.5rem;
    line-height: 1.25;
    letter-spacing: -.015em;
    margin: 44px 0 14px;
    color: #e7edf6;
    font-weight: 700;
    scroll-margin-top: calc(var(--header-h) + 20px);
}

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

.news-article-body h4 { font-size: 1.15rem; margin: 28px 0 10px; color: #a8cfff; font-weight: 600; }

.news-article-body p { margin-bottom: 18px; }

.news-article-body ul,
.news-article-body ol { margin: 0 0 20px; padding-left: 22px; }

.news-article-body li { margin-bottom: 8px; line-height: 1.6; }
.news-article-body li::marker { color: var(--accent); }

/* Разделы уже разбиты заголовками, линии между ними лишние */
.news-article-body hr { display: none; }

.news-article-body blockquote {
    margin: 28px 0;
    padding: 22px 26px;
    border-radius: 14px;
    background: rgba(77,163,255,0.08);
    border: 1px solid var(--news-line-strong);
    color: #e7edf6;
    font-size: 1.2rem;
    line-height: 1.45;
    font-weight: 600;
}

.news-article-body blockquote strong { font-weight: 600; }

.news-article-body img.news-image {
    max-width: 100%;
    border-radius: 12px;
    margin: 24px 0;
    border: 1px solid var(--news-line);
}

.news-article-body code {
    padding: 2px 6px;
    background: rgba(77,163,255,0.12);
    border-radius: 4px;
    font-size: 0.9em;
    color: #79b8ff;
}

.news-article-body strong { color: #e7edf6; }

.news-article-body a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
.news-article-body a:hover { color: var(--accent2); text-decoration: underline; }

.news-next {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 22px 24px;
    border-radius: 16px;
    border: 1px solid var(--news-line);
    background: var(--news-surface);
    color: inherit;
    text-decoration: none;
    transition: border-color .2s;
}

.news-next:hover { border-color: var(--news-line-strong); }
.news-next:hover .news-more svg { transform: translateX(4px); }

.news-next small {
    font-family: var(--news-mono);
    font-size: 0.72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.news-next b { display: block; margin-top: 4px; font-size: 1.15rem; color: #e7edf6; }


/* ---------- Светлая тема ---------- */
html[data-theme='light'] {
    --news-line: rgba(0,90,200,0.14);
    --news-line-strong: rgba(0,110,240,0.35);
    --news-surface: rgba(255,255,255,0.7);
    --news-text: rgba(11,13,16,0.74);
}

html[data-theme='light'] .news-card-title,
html[data-theme='light'] .news-item-link,
html[data-theme='light'] .news-item-day,
html[data-theme='light'] .news-month-label b,
html[data-theme='light'] .news-article-title,
html[data-theme='light'] .news-article-body h3,
html[data-theme='light'] .news-article-body strong,
html[data-theme='light'] .news-article-body blockquote,
html[data-theme='light'] .news-next b,
html[data-theme='light'] .news-share-btn,
html[data-theme='light'] .news-toc a:hover { color: #0b0d10; }

html[data-theme='light'] .news-item::before { background: #f6f7fb; box-shadow: 0 0 0 4px #f6f7fb, 0 0 10px var(--tag-color); }
html[data-theme='light'] .news-tag { --tag-color: hsl(var(--tag-hue, 212) 80% 40%); }
html[data-theme='light'] .news-item { --tag-color: hsl(var(--tag-hue, 212) 80% 45%); }


/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
    .news-article-grid { grid-template-columns: 1fr; gap: 28px; }
    .news-article-aside { position: static; }
    .news-toc { display: none; }
}

@media (max-width: 760px) {
    .news-card-cover { height: 140px; }

    .news-month { grid-template-columns: 1fr; gap: 12px; }
    .news-month-label { position: static; padding-top: 0; display: flex; gap: 8px; align-items: baseline; }

    .news-month-items { padding-left: 20px; }
    .news-item { grid-template-columns: 1fr; padding: 16px; }
    .news-item::before { left: -29px; }
    .news-item-cover { order: -1; min-height: 110px; }
    .news-item:hover { transform: none; }

    .news-article-body { font-size: 1rem; }
    .news-article-body h3 { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
    .news-item, .news-card, .news-more svg { transition: none; }
}

@media (max-width: 540px) {
    .faq-question { padding: 14px 16px; font-size: 0.95rem; }
    .faq-answer-inner { font-size: 0.95rem; }
    .news-card-content { padding: 16px; }
    .news-card-title { font-size: 1.05rem; }
    .news-item-title { font-size: 1.1rem; }
}


.error-page {
    min-height: calc(100vh - var(--header-h) - 100px);
}

.error-content {
    text-align: center;
    padding: 40px 20px;
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: waveGradient 6s ease infinite;
    line-height: 1;
    margin-bottom: 16px;
}

.error-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #e7edf6;
    margin-bottom: 16px;
}

.error-description {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 400px;
    margin: 0 auto 32px;
    line-height: 1.5;
}

.error-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 540px) {
    .error-code { font-size: 5rem; }
    .error-title { font-size: 1.4rem; }
    .error-description { font-size: 1rem; }
}


/* ============ Scrollbar ============ */
::-webkit-scrollbar {
    width:  10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background-color: #2b7bff;
    border-radius: 10px;
    border: 2px solid #0a0a0a;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #519dff;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #2b7bff #0a0a0a;
}

[data-theme="light"]::-webkit-scrollbar-track {
  background: #e5e5e5;
}

[data-theme="light"]::-webkit-scrollbar-thumb {
  background-color: #007bff;
  border: 2px solid #e5e5e5;
}

[data-theme="light"] * {
  scrollbar-color: #007bff #e5e5e5;
}
