/* ============================================================
   НейроМиша — блог. Стили /blog/
   Собирается tools/build-blog.mjs. Визуальный язык — тот же, что
   в разделах «ЕГЭ 2027» (/ege/ege.css) и «Теория»: тёплая палитра,
   Unbounded в заголовках, Manrope в тексте, тёмная тема через
   [data-theme="dark"]. Файл самостоятельный: блог не тянет чужой
   CSS, и правки в одном разделе не разъезжаются с другим.

   Главное отличие блога — читаемая колонка. Текст живёт в 720px,
   на широком экране рядом встаёт оглавление и карточка перехода
   в тренажёр, ниже 1160px колонка остаётся одна.
   ============================================================ */

:root{
  --brand:#DF995B; --brand-ink:#B36E30; --brand-deep:#8C5422; --brand-soft:#F6D9B8;
  --sec:#496F82; --sec-ink:#2F4E5E; --sec-soft:#C9DCE6;
  --bg:#FCEDD0; --bg-warm:#F9E4BE; --bg-deep:#F4DAAF;
  --surface:#FFFDF8; --surface-2:#FBF3E4;
  --ink:#1F2937; --ink-2:#4B5563; --ink-3:#6B7280;
  --line:rgba(31,41,55,.08); --line-2:rgba(31,41,55,.14);
  --shadow-sm:0 1px 2px rgba(79,54,24,.06),0 2px 6px rgba(79,54,24,.05);
  --shadow-md:0 4px 10px rgba(79,54,24,.06),0 18px 40px -12px rgba(79,54,24,.18);
  --shadow-lg:0 8px 20px rgba(79,54,24,.08),0 40px 80px -20px rgba(79,54,24,.28);
  --radius:22px; --radius-btn:16px;
  --gold:#F59E0B; --good:#10B981; --bad:#EF4444;
  --ease:cubic-bezier(.22,1,.36,1);
  --col:720px; --side:300px; --gutter:76px;
}

[data-theme="dark"]{
  --bg:#1A1410; --bg-warm:#20180F; --bg-deep:#251C12;
  --surface:#241E17; --surface-2:#2B241B;
  --ink:#F5EDE0; --ink-2:#CBBFA9; --ink-3:#9C8F79;
  --line:rgba(245,237,224,.09); --line-2:rgba(245,237,224,.16);
  --brand-soft:#4A3520; --sec-soft:#22333D;
  --shadow-sm:0 1px 2px rgba(0,0,0,.3),0 2px 6px rgba(0,0,0,.25);
  --shadow-md:0 4px 10px rgba(0,0,0,.3),0 18px 40px -12px rgba(0,0,0,.5);
  --shadow-lg:0 8px 20px rgba(0,0,0,.35),0 40px 80px -20px rgba(0,0,0,.6);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
html,body{margin:0;padding:0}
body{
  font-family:'Manrope',system-ui,-apple-system,'Segoe UI',sans-serif;
  color:var(--ink); background:var(--bg);
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  line-height:1.6;
}
h1,h2,h3,h4{font-family:'Unbounded','Manrope',sans-serif;letter-spacing:-.02em;margin:0;font-weight:700;text-wrap:balance}
p{margin:0;text-wrap:pretty}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
button,input{font-family:inherit}
main{display:block}

.wrap{max-width:1096px;margin:0 auto;padding:0 28px}
@media(max-width:760px){.wrap{padding:0 18px}}

/* Шапка фиксирована и полностью прозрачна — брони под неё нет: пустая
   полоса показывала бы плоский фон body над градиентом первой секции.
   Отступ живёт в padding-top первого экрана, его фон идёт от y=0. */

/* ── Общие элементы ─────────────────────────────────────────── */
.lede{
  font-size:19px;line-height:1.62;color:var(--ink-2);margin-top:20px;max-width:760px;
  padding-left:20px;border-left:3px solid var(--brand);
}
.tag{
  display:inline-block;padding:7px 14px;border-radius:999px;
  background:var(--brand-soft);color:var(--brand-ink);
  font-family:'Unbounded',sans-serif;font-size:11px;font-weight:700;
  letter-spacing:.14em;text-transform:uppercase;
}
[data-theme="dark"] .tag{color:#F0B964}

.btn{
  display:inline-flex;align-items:center;gap:10px;
  padding:15px 24px;border-radius:var(--radius-btn);font-weight:700;font-size:15px;
  cursor:pointer;border:none;font-family:inherit;text-align:left;
  transition:transform .22s var(--ease),box-shadow .22s var(--ease),background .2s,color .2s;
}
.btn svg{width:17px;height:17px;flex-shrink:0}
.btn-primary{background:var(--brand);color:#fff;box-shadow:0 10px 24px -8px rgba(223,153,91,.7),inset 0 -3px 0 rgba(0,0,0,.14)}
.btn-primary:hover{transform:translateY(-2px);box-shadow:0 16px 30px -10px rgba(223,153,91,.85),inset 0 -3px 0 rgba(0,0,0,.14)}
.btn-ghost{background:var(--surface);color:var(--ink);border:1px solid var(--line-2);box-shadow:var(--shadow-sm)}
.btn-ghost:hover{transform:translateY(-2px);box-shadow:var(--shadow-md);color:var(--brand-ink)}
.btn:focus-visible,a:focus-visible,summary:focus-visible,button:focus-visible{outline:3px solid rgba(223,153,91,.55);outline-offset:3px}
.cta-row{display:flex;gap:14px;flex-wrap:wrap;margin-top:26px}

.crumbs{display:flex;align-items:center;gap:8px;font-size:13.5px;color:var(--ink-3);font-weight:600;flex-wrap:wrap}
.crumbs a{color:var(--ink-3);transition:color .2s}
.crumbs a:hover{color:var(--brand-ink)}
.crumbs .sep{opacity:.5}
.crumbs .cur{color:var(--brand-ink)}

.reveal{opacity:0;transform:translateY(24px);transition:opacity .7s var(--ease),transform .7s var(--ease)}
.reveal.in{opacity:1;transform:none}
@media(prefers-reduced-motion:reduce){.reveal{opacity:1!important;transform:none!important;transition:none!important}}

.theme-toggle{
  width:44px;height:44px;border-radius:50%;border:1px solid var(--line-2);cursor:pointer;
  background:var(--surface);color:var(--ink-2);display:grid;place-items:center;
  box-shadow:var(--shadow-sm);transition:transform .22s var(--ease),color .2s;
}
.theme-toggle:hover{transform:translateY(-2px);color:var(--brand-ink)}
.theme-toggle svg{width:20px;height:20px}
.theme-toggle .moon{display:none}
[data-theme="dark"] .theme-toggle .moon{display:block}
[data-theme="dark"] .theme-toggle .sun{display:none}
.theme-fab{position:fixed;right:20px;bottom:20px;z-index:60}
@media(max-width:760px){.theme-fab{right:14px;bottom:14px}}

@keyframes floaty{0%,100%{transform:translateY(0) rotate(-1.5deg)}50%{transform:translateY(-14px) rotate(1.5deg)}}
.floaty{animation:floaty 7s ease-in-out infinite;filter:drop-shadow(0 30px 40px rgba(79,54,24,.28))}
@media(prefers-reduced-motion:reduce){.floaty{animation:none}}
[data-theme="dark"] img.misha-art{filter:brightness(.94) saturate(.96)}

/* ============ ХАБ ============ */
.hub-hero{
  position:relative;padding:196px 0 52px;overflow:hidden;
  background:
    radial-gradient(900px 500px at 88% -14%,rgba(223,153,91,.3),transparent 60%),
    radial-gradient(700px 460px at -8% 46%,rgba(73,111,130,.14),transparent 60%),
    linear-gradient(180deg,var(--bg) 0%,var(--bg-warm) 100%);
}
[data-theme="dark"] .hub-hero{
  background:
    radial-gradient(900px 500px at 88% -14%,rgba(223,153,91,.15),transparent 60%),
    radial-gradient(700px 460px at -8% 46%,rgba(73,111,130,.12),transparent 60%),
    linear-gradient(180deg,var(--bg) 0%,var(--bg-warm) 100%);
}
.hub-hero .wrap{display:grid;grid-template-columns:1.2fr .8fr;gap:44px;align-items:center}
.hub-hero h1{font-size:clamp(28px,4vw,46px);line-height:1.08;margin:18px 0 0}
.hub-hero .crumbs{margin-bottom:18px}
.hero-stage{position:relative;min-height:320px;display:grid;place-items:center}
.hero-stage .blob{position:absolute;border-radius:50%;filter:blur(48px);opacity:.5;z-index:0}
.hero-stage .blob.a{width:300px;height:300px;background:#F2C896;top:0;right:0}
.hero-stage .blob.b{width:220px;height:220px;background:#BEDAE5;bottom:10px;left:-10px}
.hero-stage img{position:relative;z-index:2;width:100%;max-width:320px;height:auto}
@media(max-width:940px){
  .hub-hero{padding:178px 0 40px}
  .hub-hero .wrap{grid-template-columns:1fr}
  .hero-stage{display:none}
}

.hub-list{padding:44px 0 60px;background:var(--bg-warm)}

.chips{display:flex;flex-wrap:wrap;gap:9px;margin-bottom:28px}
.chip{
  padding:9px 16px;border-radius:999px;cursor:pointer;font-size:13.5px;font-weight:700;
  background:var(--surface);color:var(--ink-2);border:1px solid var(--line-2);
  transition:transform .18s var(--ease),background .2s,color .2s,border-color .2s;
}
.chip:hover{transform:translateY(-2px);color:var(--brand-ink);border-color:rgba(223,153,91,.45)}
.chip.on{background:var(--brand);color:#fff;border-color:var(--brand)}

.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:20px}
@media(max-width:700px){.cards{grid-template-columns:1fr}}
.post-card{
  display:flex;flex-direction:column;gap:12px;padding:26px 26px 22px;border-radius:var(--radius);
  background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow-sm);
  transition:transform .25s var(--ease),box-shadow .25s var(--ease),border-color .2s;
}
.post-card:hover{transform:translateY(-4px);box-shadow:var(--shadow-md);border-color:rgba(223,153,91,.4)}
.post-card .pc-link{display:flex;flex-direction:column;gap:10px}
.post-card .k{
  font-family:'Unbounded',sans-serif;font-size:10.5px;font-weight:700;
  letter-spacing:.14em;text-transform:uppercase;color:var(--brand-ink);
}
[data-theme="dark"] .post-card .k{color:#F0B964}
.post-card .t{font-size:20px;line-height:1.24;transition:color .2s}
.post-card:hover .t{color:var(--brand-deep)}
[data-theme="dark"] .post-card:hover .t{color:#F0B964}
.post-card .d{font-size:15px;color:var(--ink-2);line-height:1.55}
.post-card .m{margin-top:auto;padding-top:8px;font-size:13px;color:var(--ink-3);font-weight:600;display:flex;gap:8px;align-items:center}
.post-card .m .sep{opacity:.5}
.post-card .tg{display:flex;flex-wrap:wrap;gap:6px}
.post-card .tg span{
  font-size:12px;font-weight:600;color:var(--ink-2);
  background:var(--surface-2);border:1px solid var(--line);border-radius:999px;padding:4px 10px;
}
.post-card[hidden]{display:none}
.empty,.no-match{color:var(--ink-2);font-size:16px;margin-top:8px}
.empty a,.no-match a{color:var(--brand-ink);font-weight:700}
.empty a:hover{text-decoration:underline}
.no-match{margin-top:22px}

/* ============ СТАТЬЯ ============ */
.post-hero{
  position:relative;padding:190px 0 40px;overflow:hidden;
  background:
    radial-gradient(760px 420px at 92% -20%,rgba(223,153,91,.26),transparent 62%),
    linear-gradient(180deg,var(--bg) 0%,var(--bg-warm) 100%);
}
[data-theme="dark"] .post-hero{
  background:
    radial-gradient(760px 420px at 92% -20%,rgba(223,153,91,.14),transparent 62%),
    linear-gradient(180deg,var(--bg) 0%,var(--bg-warm) 100%);
}
.post-hero .tag{margin:18px 0 14px}
.post-hero h1{font-size:clamp(28px,3.8vw,44px);line-height:1.1;max-width:840px}
.post-meta{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px;
  margin-top:16px;font-size:14px;color:var(--ink-3);font-weight:600;
}
.post-meta a{color:var(--brand-ink)}
.post-meta a:hover{text-decoration:underline}
.post-meta .sep{opacity:.5}

.post-body{padding:38px 0 60px;background:var(--bg-warm)}
.post-body .wrap{display:grid;grid-template-columns:minmax(0,1fr);gap:34px;align-items:start}
.post-main{min-width:0}

/* Боковая колонка появляется только там, где под неё есть место рядом с
   читаемой колонкой в 720px. Ниже — оглавление сворачивается в «Содержание». */
@media(min-width:1160px){
  .post-body .wrap{grid-template-columns:minmax(0,var(--col)) var(--side);gap:var(--gutter)}
}

/* ── Текст статьи ───────────────────────────────────────────── */
.prose{max-width:var(--col)}
.prose p{font-size:17.5px;line-height:1.72;color:var(--ink-2);margin:0 0 20px}
.prose > h2{
  font-size:clamp(23px,2.6vw,30px);line-height:1.18;margin:46px 0 16px;
  padding-top:22px;border-top:1px dashed var(--line-2);scroll-margin-top:92px;
}
.prose > h2:first-child{margin-top:0;padding-top:0;border-top:none}
.prose h3{font-size:19px;line-height:1.3;margin:30px 0 12px;color:var(--ink)}
.prose a,.post-faq a,.post-src a,.post-quote a{color:var(--brand-ink);font-weight:700}
.prose a:hover,.post-faq a:hover,.post-src a:hover{text-decoration:underline}
.prose strong{color:var(--ink);font-weight:800}

.post-ul,.post-ol{margin:0 0 22px;padding:0;list-style:none;display:grid;gap:11px}
.post-ul li{position:relative;padding-left:26px;font-size:17px;color:var(--ink-2);line-height:1.62}
.post-ul li::before{content:"";position:absolute;left:6px;top:11px;width:8px;height:8px;border-radius:50%;background:var(--brand)}
.post-ol{counter-reset:s}
.post-ol li{counter-increment:s;position:relative;padding-left:46px;font-size:17px;color:var(--ink-2);line-height:1.62;min-height:32px}
.post-ol li::before{
  content:counter(s);position:absolute;left:0;top:0;
  width:32px;height:32px;border-radius:11px;display:grid;place-items:center;
  background:var(--brand-soft);color:var(--brand-deep);
  font-family:'Unbounded',sans-serif;font-weight:700;font-size:13px;
}
[data-theme="dark"] .post-ol li::before{color:#F0B964}

.post-quote{
  margin:0 0 24px;padding:20px 24px;border-radius:18px;
  background:rgba(245,158,11,.1);border:1px solid rgba(245,158,11,.28);
}
.post-quote p{margin:0;font-size:17px;color:var(--ink-2);line-height:1.62}

.tbl-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 0 24px;padding-bottom:2px}
.data-table{width:100%;border-collapse:collapse;font-size:15.5px;min-width:480px}
.data-table th,.data-table td{padding:12px 14px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top}
.data-table thead th{
  font-family:'Unbounded',sans-serif;font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;
  color:var(--ink-3);font-weight:700;border-bottom:1px solid var(--line-2);
}
.data-table td{color:var(--ink-2)}
.data-table tbody tr{transition:background .18s}
.data-table tbody tr:hover{background:var(--surface-2)}

/* Блок кода: прокручивается внутри своей обёртки, как и таблица, — длинная
   строка не должна утаскивать страницу вбок. */
.code-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 0 24px}
pre.code{
  margin:0;padding:16px 18px;border-radius:16px;min-width:0;
  background:var(--surface);border:1px solid var(--line);border-left:3px solid var(--brand);
  font-family:ui-monospace,'SFMono-Regular',Consolas,'Liberation Mono',monospace;
  font-size:14px;line-height:1.55;color:var(--ink);tab-size:4;
}

/* ── Оглавление ─────────────────────────────────────────────── */
.toc{
  position:sticky;top:90px;background:var(--surface);border:1px solid var(--line);
  border-radius:20px;padding:22px;box-shadow:var(--shadow-sm);display:none;
}
.toc h4{font-family:'Unbounded',sans-serif;font-size:12px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-3);margin-bottom:14px}
.toc ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.toc li a{
  display:flex;gap:10px;align-items:center;padding:8px 10px;border-radius:11px;
  font-size:14px;font-weight:600;color:var(--ink-2);line-height:1.35;transition:background .2s,color .2s;
}
.toc li a:hover{background:var(--bg);color:var(--brand-deep)}
.toc li a.active{background:var(--brand-soft);color:var(--brand-deep)}
[data-theme="dark"] .toc li a.active{color:#F0B964}
.toc li a .dot{width:8px;height:8px;border-radius:50%;background:var(--line-2);flex-shrink:0}
.toc li a.active .dot{background:var(--brand)}

.toc-m{
  background:var(--surface);border:1px solid var(--line);border-radius:18px;
  box-shadow:var(--shadow-sm);margin-bottom:28px;overflow:hidden;
}
.toc-m summary{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:16px 20px;cursor:pointer;font-weight:700;font-size:15px;list-style:none;
}
.toc-m summary::-webkit-details-marker{display:none}
.toc-m summary .chev{width:18px;height:18px;color:var(--ink-3);transition:transform .25s var(--ease);flex-shrink:0}
.toc-m[open] summary .chev{transform:rotate(180deg)}
.toc-m ul{list-style:none;margin:0;padding:0 20px 16px;display:grid;gap:4px}
.toc-m li a{display:flex;gap:10px;align-items:center;font-size:14.5px;font-weight:600;color:var(--ink-2);padding:6px 0}
.toc-m li a .dot{width:7px;height:7px;border-radius:50%;background:var(--brand);flex-shrink:0}

@media(min-width:1160px){
  .toc{display:block}
  .toc-m{display:none}
}

/* ── Боковая карточка ───────────────────────────────────────── */
.post-side{display:grid;gap:18px;align-content:start}
.side-cta{
  padding:24px;border-radius:20px;text-align:center;
  background:linear-gradient(160deg,#FFF6E6,#F7DFBB);border:1px solid rgba(223,153,91,.3);
  box-shadow:var(--shadow-sm);
}
[data-theme="dark"] .side-cta{background:linear-gradient(160deg,#2A2114,#241E17);border-color:rgba(223,153,91,.24)}
.side-cta img{margin:0 auto 12px;width:120px;height:auto}
.side-cta h4{font-size:17px;line-height:1.25;margin-bottom:8px}
.side-cta p{font-size:14.5px;color:var(--ink-2);margin-bottom:16px}
.side-cta .btn{width:100%;justify-content:center;text-align:center;padding:13px 18px;font-size:14.5px}
.side-cta .btn + .btn{margin-top:10px}

/* ── Вопросы и ответы ───────────────────────────────────────── */
.post-faq,.post-src,.post-next{max-width:var(--col);margin-top:48px}
.post-faq h2,.post-src h2,.post-next h2{
  font-size:clamp(22px,2.4vw,28px);line-height:1.18;margin-bottom:18px;
  padding-top:22px;border-top:1px dashed var(--line-2);scroll-margin-top:92px;
}
.faq-list{display:grid;gap:12px}
.faq-item{
  background:var(--surface);border:1px solid var(--line);border-radius:18px;
  box-shadow:var(--shadow-sm);overflow:hidden;
}
.faq-item summary{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:18px 22px;cursor:pointer;font-weight:700;font-size:16px;list-style:none;
}
.faq-item summary::-webkit-details-marker{display:none}
.faq-item summary .chev{width:18px;height:18px;color:var(--ink-3);transition:transform .25s var(--ease);flex-shrink:0}
.faq-item[open] summary .chev{transform:rotate(180deg)}
.faq-item .faq-a{padding:0 22px 18px;color:var(--ink-2);font-size:16px;line-height:1.62}
.faq-item .faq-a p{margin:0 0 12px}
.faq-item .faq-a p:last-child{margin-bottom:0}

/* ── Источники ──────────────────────────────────────────────── */
.src-list{list-style:none;margin:0;padding:0;display:grid;gap:10px;font-size:15.5px}
.src-list li{color:var(--ink-2);line-height:1.55}
.src-list a{color:var(--brand-ink);font-weight:700;overflow-wrap:anywhere}

/* ── Автор ──────────────────────────────────────────────────── */
.post-author{
  display:flex;gap:16px;align-items:center;max-width:var(--col);margin-top:44px;
  padding:20px 22px;border-radius:20px;background:var(--surface);
  border:1px solid var(--line);box-shadow:var(--shadow-sm);
}
.post-author img{width:72px;height:72px;flex-shrink:0;border-radius:16px;background:var(--surface-2)}
.post-author .who{font-size:15.5px;font-weight:700;line-height:1.4}
.post-author .more{margin-top:6px;font-size:14px}
.post-author .more a{color:var(--brand-ink);font-weight:700}
.post-author .more a:hover{text-decoration:underline}
@media(max-width:520px){.post-author{flex-direction:column;align-items:flex-start;text-align:left}}

/* ── Читать дальше ──────────────────────────────────────────── */
.next-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}
.next-card{
  display:flex;flex-direction:column;gap:7px;padding:18px 20px;border-radius:18px;
  background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow-sm);
  transition:transform .22s var(--ease),box-shadow .22s var(--ease);
}
.next-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-md)}
.next-card .k{
  font-family:'Unbounded',sans-serif;font-size:10px;font-weight:700;
  letter-spacing:.14em;text-transform:uppercase;color:var(--brand-ink);
}
[data-theme="dark"] .next-card .k{color:#F0B964}
.next-card .t{font-weight:700;font-size:15.5px;line-height:1.3}
.next-card .m{font-size:12.5px;color:var(--ink-3);font-weight:600}
.next-links{list-style:none;margin:16px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:10px}
.next-links a{
  display:inline-flex;padding:10px 16px;border-radius:999px;font-size:14px;font-weight:700;
  background:var(--surface-2);border:1px solid var(--line);color:var(--ink-2);
  transition:transform .18s var(--ease),color .2s,border-color .2s;
}
.next-links a:hover{transform:translateY(-2px);color:var(--brand-ink);border-color:rgba(223,153,91,.45)}

/* ── Итоговый призыв ────────────────────────────────────────── */
.final-cta{padding:20px 0 76px;background:var(--bg-warm)}
.final-wrap{
  display:grid;grid-template-columns:1.3fr .7fr;gap:30px;align-items:center;
  padding:36px 40px;border-radius:28px;
  background:linear-gradient(150deg,#FFF6E6,#F7DFBB);border:1px solid rgba(223,153,91,.3);
  box-shadow:var(--shadow-md);
}
[data-theme="dark"] .final-wrap{background:linear-gradient(150deg,#2A2114,#241E17);border-color:rgba(223,153,91,.24)}
.final-wrap h2{font-size:clamp(24px,3vw,34px);line-height:1.12;margin-bottom:12px}
.final-wrap p{color:var(--ink-2);font-size:16.5px;max-width:560px}
.final-wrap img{max-width:210px;height:auto;margin:0 auto}
@media(max-width:860px){
  .final-wrap{grid-template-columns:1fr;padding:28px 22px}
  .final-wrap img{display:none}
}
