/* ============================================================
   Neurotechnica — design tokens, typography, journal layout.
   Все интерактивные элементы дизайна (scrollspy, hover-preview,
   progress bar, ⌘K, topic filter) намеренно опущены: движок
   выдаёт статический HTML без JS.
   ============================================================ */

:root {
  --paper: #efece3;
  --ink: #2a2822;
  --ink-soft: #4a4842;
  --ink-mute: #86837b;
  --accent: #b83d1e;
  --rule: rgba(42, 40, 34, 0.18);
  --rule-soft: rgba(42, 40, 34, 0.1);
  --tint: rgba(0, 0, 0, 0.03);

  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --max: 1180px;
  --pad-x: 48px;
}

/* ---- reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* =============================================================
   Masthead (hero header strip)
   ============================================================= */
.nt-masthead {
  border-bottom: 1px solid var(--ink);
  padding: 48px var(--pad-x) 28px;
}
.nt-masthead-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nt-masthead .nt-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.nt-brand {
  display: inline-block;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.nt-brand:hover { color: var(--ink); }

/* =============================================================
   Top navigation (строка под mastheadом, стиль как topic-row)
   ============================================================= */
.nt-topnav {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.nt-topnav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px var(--pad-x);
}
.nt-topnav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}
.nt-topnav-item {
  position: relative;
  font-family: var(--sans);
  font-size: 13px;
}
.nt-topnav-item + .nt-topnav-item::before {
  content: '·';
  color: var(--ink-mute);
  padding: 0 14px;
  font-size: 10px;
}
.nt-topnav-item > a {
  color: var(--ink-soft);
  padding: 4px 0;
  transition: color 0.12s;
}
.nt-topnav-item > a:hover { color: var(--accent); }

/* вложенный <ul> с дочерними страницами — CSS-only dropdown */
.nt-topnav-item > ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin: 4px 0 0;
  padding: 8px 0;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--ink);
  min-width: 260px;
  z-index: 20;
}
.nt-topnav-item:hover > ul,
.nt-topnav-item:focus-within > ul { display: block; }
.nt-topnav-item > ul > li { padding: 0; }
.nt-topnav-item > ul > li + li { border-top: 1px dashed var(--rule); }
.nt-topnav-item > ul a {
  display: block;
  padding: 10px 16px;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink);
}
.nt-topnav-item > ul a:hover { color: var(--accent); background: var(--tint); }

/* =============================================================
   Main column
   ============================================================= */
.nt-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px var(--pad-x) 80px;
}

/* =============================================================
   Landing (главная)
   ============================================================= */
.nt-landing-lead {
  padding-bottom: 28px;
  margin-bottom: 40px;
  border-bottom: 2px solid var(--ink);
}
.nt-kicker-accent {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.nt-landing-heading {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.nt-landing-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 56px;
}

/* =============================================================
   Preview tile
   ============================================================= */
.nt-preview {
  border-top: 2px solid var(--ink);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nt-preview-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.nt-preview-kicker time { font-variant-numeric: tabular-nums; }
.nt-preview-title {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.nt-preview-title a { color: var(--ink); transition: color 0.12s; }
.nt-preview-title a:hover { color: var(--accent); }
.nt-preview-excerpt {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}
.nt-preview-more {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nt-preview-more a {
  color: var(--accent);
  border-bottom: 1px solid rgba(184, 61, 30, 0.3);
  padding-bottom: 1px;
  transition: border-color 0.12s;
}
.nt-preview-more a:hover { border-bottom-color: var(--accent); }

/* =============================================================
   Article body
   (стилизует стандартный HTML из content/*.html без модификации)
   ============================================================= */
.nt-main > .entry-title,
.nt-main > h1,
.nt-main > h2,
.nt-main > div.entry-content {
  max-width: 780px;
}
.nt-main > .entry-title,
.nt-main > h1 {
  margin: 0 0 8px;
}
.entry-title {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

/* h2, стоящие непосредственно в <main> (вне entry-content) —
   служат мягким subtitle/section-заголовком до блока контента */
.nt-main > h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-soft);
  margin: 24px 0 32px;
  font-style: italic;
}

.entry-content {
  counter-reset: section;
  max-width: 780px;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.entry-content p {
  margin: 0 0 18px;
}
.entry-content p:first-of-type { margin-top: 8px; }

.entry-content h2 {
  counter-increment: section;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  margin: 48px 0 16px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.entry-content h2::before {
  content: "§" counter(section) " ";
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  font-weight: 400;
  margin-right: 8px;
  letter-spacing: 0;
  vertical-align: 0.05em;
}

.entry-content strong {
  font-weight: 600;
  color: var(--ink);
}
.entry-content em { font-style: italic; }

.entry-content a {
  color: var(--accent);
  border-bottom: 1px solid rgba(184, 61, 30, 0.3);
  padding-bottom: 1px;
  transition: border-color 0.12s, background 0.12s;
}
.entry-content a:hover {
  border-bottom-color: var(--accent);
  background: rgba(184, 61, 30, 0.05);
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 20px;
  padding-left: 28px;
}
.entry-content li {
  margin: 6px 0;
  line-height: 1.6;
}
.entry-content ol { list-style: decimal; }
.entry-content ol li::marker {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--accent);
}

.entry-content br { line-height: 2; }

/* =============================================================
   Children list (для list_children: true)
   Встаёт под телом страницы внутри {{content}}
   ============================================================= */
.nt-children {
  max-width: 780px;
  margin: 56px 0 0;
  padding: 24px 0 0;
  border-top: 2px solid var(--ink);
}
.nt-col-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.nt-children-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: chapter;
}
.nt-children-item {
  counter-increment: chapter;
  padding: 14px 0;
  border-bottom: 1px dashed var(--rule);
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.nt-children-item::before {
  content: counter(chapter, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  min-width: 24px;
}
.nt-children-item:last-child { border-bottom: none; }
.nt-children-item a {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  transition: color 0.12s;
}
.nt-children-item a:hover { color: var(--accent); }

/* =============================================================
   Footer
   ============================================================= */
.nt-footer {
  border-top: 1px solid var(--ink);
  padding: 48px var(--pad-x) 40px;
  margin-top: 64px;
}
.nt-footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 56px;
}
.nt-footer .nt-col-label {
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.nt-footer-about {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 18px;
  max-width: 380px;
}
.nt-footer-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}
.nt-contact {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 10px;
}
.nt-contact a {
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: color 0.12s, border-color 0.12s;
}
.nt-contact a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.nt-contact-role {
  display: block;
  color: var(--ink-mute);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
.nt-footer-lab {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 900px) {
  :root { --pad-x: 24px; }
  .nt-brand { font-size: 48px; }
  .nt-landing-heading { font-size: 36px; }
  .nt-landing-list { grid-template-columns: 1fr; gap: 32px; }
  .nt-footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .entry-title { font-size: 36px; }
}
