/* «Нейрон» — журнал Neurocode о нейротехнологиях.
   Контентные стили; токены темы и шапка/футер — в nc-chrome.css */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--grotesque);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  transition: background-color .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
main { padding-top: 118px; min-height: 60vh; }

.container { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 760px; margin-left: auto; margin-right: auto; padding: 0 var(--gutter); }

/* Чипы рубрик: цвет задаётся через --c, фон полупрозрачный — работает в обеих темах */
.chip {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .01em;
  padding: 5px 13px; border-radius: 100px;
  color: var(--c, var(--accent));
  background: color-mix(in srgb, var(--c, var(--accent)) 11%, transparent);
  transition: background-color .2s;
}
.chip:hover { background: color-mix(in srgb, var(--c, var(--accent)) 19%, transparent); }
.card-meta, .article-meta { color: var(--grey); font-size: 13.5px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.12fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: center; padding: 36px 0 14px; }
.hero-cover { border-radius: 28px; overflow: hidden; display: block; border: 1px solid var(--card-line); }
.hero-cover svg { width: 100%; height: auto; }
.hero-body .chip { margin-bottom: 16px; }
.hero h1 { font-size: clamp(30px, 3.7vw, 48px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; margin-bottom: 16px; }
.hero h1 a:hover { color: var(--accent); }
.hero-lead { font-size: 18px; line-height: 1.5; color: var(--grey); margin-bottom: 18px; }

/* ---------- Секции и карточки ---------- */
.section { padding: 38px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-title { font-size: clamp(22px, 2.3vw, 28px); font-weight: 800; letter-spacing: -.025em; margin-bottom: 6px; }
.section-title[style*="--cat"]::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--cat, var(--accent)); margin-right: 12px; vertical-align: 2px; }
.section-desc { color: var(--grey); margin-bottom: 16px; font-size: 15px; }
.section-more { font-weight: 600; font-size: 14.5px; color: var(--accent); white-space: nowrap; }
.section-more:hover { text-decoration: underline; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 2.4vw, 30px); margin-top: 18px; }
.card { display: flex; flex-direction: column; }
.card-cover { border-radius: 22px; overflow: hidden; display: block; border: 1px solid var(--card-line); transition: transform .22s ease, box-shadow .22s ease; }
.card-cover svg { width: 100%; height: auto; }
.card:hover .card-cover { transform: translateY(-4px); box-shadow: var(--card-shadow); }
.card-body { padding: 16px 4px 0; }
.card-body .chip { margin-bottom: 10px; font-size: 12px; padding: 4px 11px; }
.card h3 { font-size: 18.5px; line-height: 1.28; letter-spacing: -.015em; font-weight: 700; margin-bottom: 8px; }
.card h3 a:hover { color: var(--accent); }
.card-lead { color: var(--grey); font-size: 14.5px; line-height: 1.5; margin-bottom: 10px; }

/* ---------- Страница рубрики ---------- */
.cat-hero { padding: 40px 0 6px; }
.cat-hero .chip { margin-bottom: 14px; }
.cat-hero h1 { font-size: clamp(32px, 4vw, 52px); font-weight: 800; letter-spacing: -.03em; margin-bottom: 10px; color: var(--ink); }
.cat-hero p { color: var(--grey); font-size: 17px; max-width: 620px; }
.page-title { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.025em; padding: 34px 0 8px; }

/* ---------- Статья ---------- */
.article-head { padding-top: 34px; }
.article-head .chip { margin-bottom: 18px; }
.article-head h1 { font-size: clamp(30px, 4.2vw, 46px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; margin-bottom: 16px; }
.article-lead { font-size: 21px; line-height: 1.45; color: var(--grey); margin-bottom: 20px; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.article-meta .dot { color: color-mix(in srgb, var(--grey) 45%, transparent); }
.author-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.author-link:hover span:last-child { color: var(--accent); }
.ava { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; display: inline-flex; flex: none; }
.ava svg { width: 100%; height: 100%; }
.article-cover { border-radius: 28px; overflow: hidden; margin-bottom: 38px; border: 1px solid var(--card-line); }
.article-cover svg { width: 100%; height: auto; }

.article-body { font-size: 18.5px; line-height: 1.7; }
.article-body p { margin: 0 0 22px; }
.article-body h2 { font-size: 28px; line-height: 1.2; letter-spacing: -.025em; font-weight: 800; margin: 46px 0 18px; }
.article-body h3 { font-size: 21.5px; letter-spacing: -.015em; font-weight: 700; margin: 34px 0 14px; }
.article-body ul, .article-body ol { margin: 0 0 22px; padding-left: 26px; }
.article-body li { margin-bottom: 10px; }
.article-body a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.article-body table { width: 100%; border-collapse: collapse; margin: 8px 0 26px; font-size: 15.5px; }
.article-body th { text-align: left; font-weight: 700; background: var(--surface); }
.article-body th, .article-body td { padding: 11px 14px; border: 1px solid var(--line); vertical-align: top; }
.article-body strong { font-weight: 700; }

/* ---------- Фирменные блоки ---------- */
.tj-note { background: color-mix(in srgb, var(--accent) 7%, var(--bg)); border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 20px; padding: 22px 26px; margin: 28px 0; font-size: 16.5px; }
.tj-note p:last-child { margin-bottom: 0; }
.tj-warning { background: color-mix(in srgb, #e2a000 9%, var(--bg)); border: 1px solid color-mix(in srgb, #e2a000 22%, transparent); border-radius: 20px; padding: 22px 26px 22px 58px; margin: 28px 0; font-size: 16.5px; position: relative; }
.tj-warning::before { content: "⚠️"; position: absolute; left: 22px; top: 21px; font-size: 19px; }
.tj-warning p:last-child { margin-bottom: 0; }
.tj-quote { border-left: 3px solid var(--accent); margin: 32px 0; padding: 4px 0 4px 24px; }
.tj-quote p { font-size: 22px; line-height: 1.42; font-weight: 600; letter-spacing: -.015em; margin-bottom: 10px; font-family: "Playfair Display", Georgia, serif; font-style: italic; font-weight: 500; }
.tj-quote cite { font-style: normal; color: var(--grey); font-size: 14.5px; }
.tj-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 32px 0; padding: 24px 28px; background: var(--surface); border: 1px solid var(--card-line); border-radius: 20px; }
.tj-stat .num { font-size: 46px; font-weight: 800; letter-spacing: -.03em; color: var(--accent); line-height: 1; }
.tj-stat .cap { color: var(--grey); font-size: 15.5px; }
.tj-q { font-weight: 700; font-size: 19.5px; letter-spacing: -.01em; margin-top: 30px; color: var(--ink); }
.tj-figure { margin: 30px 0; }
.tj-figure svg { width: 100%; height: auto; border-radius: 20px; }
.tj-figure figcaption { color: var(--grey); font-size: 14px; margin-top: 10px; }
.tj-memo { background: var(--surface); border: 1px solid var(--card-line); border-radius: 24px; padding: 28px 30px; margin: 44px 0 10px; }
.tj-memo h2 { margin: 0 0 14px; font-size: 23px; }
.tj-memo ul { margin-bottom: 0; }

/* ---------- Теги, автор ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0; }
.tag { background: var(--surface); border: 1px solid var(--card-line); color: var(--grey); font-size: 13.5px; font-weight: 500; padding: 6px 13px; border-radius: 100px; transition: color .2s, border-color .2s; }
.tag:hover { color: var(--ink); border-color: var(--line); }
.author-card { display: flex; gap: 18px; align-items: flex-start; background: var(--surface); border: 1px solid var(--card-line); border-radius: 22px; padding: 24px; margin: 26px 0; font-size: 15px; }
.ava-big { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex: none; display: block; }
.ava-big svg { width: 100%; height: 100%; }
.author-name { font-weight: 700; font-size: 17px; }
.author-name:hover { color: var(--accent); }
.author-role { color: var(--grey); font-size: 13.5px; margin: 2px 0 8px; }
.author-card p { color: var(--grey); margin: 0; }
.author-hero { display: flex; gap: 22px; align-items: center; padding: 40px 0 4px; }
.author-hero h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.025em; }
.author-hero .ava-big { width: 86px; height: 86px; }
.author-hero p { color: var(--grey); max-width: 560px; margin-top: 6px; }

/* ---------- Комментарии ---------- */
.comments { padding: 16px var(--gutter) 30px; }
.comments h2 { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin: 30px 0 18px; }
.comment { border-top: 1px solid var(--line); padding: 18px 0; }
.comment-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.comment-head span { color: var(--grey); font-size: 13px; }
.comment p { font-size: 15.5px; }
.comment-form { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.comment-form input[type="text"], .comment-form textarea {
  font: inherit; font-size: 15.5px; padding: 13px 16px; color: var(--ink);
  background: var(--card-bg); border: 1px solid var(--line); border-radius: 14px; outline: none; resize: vertical;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; font-size: 15px;
  height: 46px; padding: 0 24px; border: 0; border-radius: 999px; cursor: pointer; align-self: flex-start;
  transition: filter .2s;
}
.btn:hover { filter: brightness(1.08); }
.flash { background: color-mix(in srgb, #14a56f 10%, var(--bg)); border: 1px solid color-mix(in srgb, #14a56f 25%, transparent); color: #14a56f; font-weight: 600; padding: 14px 18px; border-radius: 14px; margin: 14px 0; }
.form-error { color: #d2544c; font-size: 14px; }
.muted { color: var(--grey); }
.small { font-size: 13px; }

/* ---------- Поиск ---------- */
.search-big { display: flex; gap: 10px; margin: 10px 0 8px; }
.search-big input {
  flex: 1; font: inherit; font-size: 17px; padding: 13px 18px; color: var(--ink);
  background: var(--card-bg); border: 1px solid var(--line); border-radius: 999px; outline: none;
}
.search-big input:focus { border-color: var(--accent); }

/* ---------- О журнале ---------- */
.about { padding-top: 40px; padding-bottom: 40px; font-size: 17.5px; }
.about h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 800; letter-spacing: -.03em; margin-bottom: 14px; }
.about h2 { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin: 32px 0 12px; }
.about p, .about ul { margin-bottom: 16px; color: color-mix(in srgb, var(--ink) 82%, var(--grey)); }
.about ul { padding-left: 24px; }
.about a { color: var(--accent); }

/* ---------- Пагинация ---------- */
.pagination { display: flex; gap: 18px; align-items: center; justify-content: center; padding: 26px 0; font-weight: 600; }
.pagination a { color: var(--accent); }
.pagination a:hover { text-decoration: underline; }
.pagination span { color: var(--grey); font-weight: 400; }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  main { padding-top: 100px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; gap: 22px; padding-top: 18px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .article-body { font-size: 17px; }
  .article-lead { font-size: 18.5px; }
}

/* ---------- Растровые обложки и аватары ---------- */
.card-cover img, .hero-cover img, .article-cover img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.ava img, .ava-big img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tj-figure img { width: 100%; border-radius: 20px; display: block; }
