/* Объявления шрифтов включены сюда намеренно: отдельный fonts.css был вторым
   блокирующим запросом перед первой отрисовкой. Один файл — один круг ожидания.
   Сами файлы шрифтов лежат отдельно и кэшируются на год. */

/* Локальные шрифты дизайна. Хостим сами: правило проекта — без CDN,
   плюс Google Fonts из РФ отдаёт нестабильно. Только cyrillic+latin. */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/JetBrainsMono-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/JetBrainsMono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/JetBrainsMono-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/JetBrainsMono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/Manrope-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/Manrope-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/Manrope-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/Manrope-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/Manrope-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/Manrope-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url('/static/fonts/Unbounded-200-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url('/static/fonts/Unbounded-200-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/Unbounded-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/Unbounded-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/Unbounded-600-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/Unbounded-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* НейроКампус — дизайн-система «футуристичный терминал».
   Перенесена из макета Claude Design: фон #121A2A, акцент #FF7A45, дисплейный Unbounded,
   моно-метки JetBrains Mono. Светлая тема — второй режим (тумблер data-theme), акцент в ней
   затемнён до #C2410C: оранжевый макета на белом даёт контраст около 2:1 и не проходит AA.
   Шрифты локальные (app/static/fonts.css) — без CDN, работает офлайн. */

:root {
  color-scheme: dark light;

  /* Шрифты */
  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Unbounded", "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Типографический масштаб */
  --step--1: clamp(0.8rem, 0.78rem + 0.12vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.06rem);
  --step-1: clamp(1.15rem, 1.05rem + 0.45vw, 1.375rem);  /* 22px на 1280 — как в макете */
  --step-2: clamp(1.35rem, 1.2rem + 0.7vw, 1.7rem);
  --step-3: clamp(1.8rem, 1.4rem + 1.8vw, 3.2rem);
  --step-4: clamp(2.2rem, 1.6rem + 2.6vw, 3.9rem);
  --step-5: clamp(2.6rem, 1.5rem + 4.6vw, 4.64rem);   /* 74.24px на 1280 — как в макете */

  /* Пространство */
  --sp-1: 0.5rem;
  --sp-2: 0.75rem;
  --sp-3: 1rem;
  --sp-4: 1.5rem;
  --sp-5: 2.5rem;
  --sp-6: 4rem;
  --sp-7: 7.5rem;

  --radius: 14px;
  --radius-sm: 8px;
  --measure: 68ch;
  --maxw: 1296px;   /* = 1240 контента макета + отступы 2×28 (у нас border-box) */

  /* Тёмная тема — основная */
  --bg: #1a1b33;
  --bg-deep: #101226;
  --surface: #1e2040;
  --surface-2: #252748;
  --text: #edf1fa;
  --text-muted: #b3bdd6;
  --text-dim: #9aa5c2;
  --border: #2a2d52;
  --border-strong: #3a3e66;
  --accent: #ff7a45;
  --accent-hover: #ff9a70;
  --accent-soft: rgba(255, 122, 69, 0.12);
  --on-accent: #101226;
  --cyan: #2be9ff;
  --magenta: #ff2bd1;
  --lime: #d7ff3a;
  --success: #d7ff3a;
  --badge-free: #d7ff3a;
  --warning: #ffbe4d;
  --danger: #ff6b6b;

  --track-0: #2be9ff;
  --track-1: #ff7a45;
  --track-2: #ff2bd1;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --glow: 0 0 24px rgba(255, 122, 69, 0.28);
}

/* Светлая тема: та же система, акцент затемнён до читаемого на белом */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8f4;
  --bg-deep: #eef0e8;
  --surface: #ffffff;
  --surface-2: #f1f3ec;
  --text: #12161d;
  --text-muted: #55606f;
  --text-dim: #7b8494;
  --border: #e0e3da;
  --border-strong: #c8ccc0;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: rgba(194, 65, 12, 0.1);
  --on-accent: #ffffff;
  --cyan: #0e7490;
  --magenta: #be185d;
  --success: #15803d;
  --badge-free: #15803d;
  --warning: #a16207;
  --danger: #b91c1c;
  --track-0: #0e7490;
  --track-1: #c2410c;
  --track-2: #be185d;
  --shadow: 0 1px 2px rgba(18, 22, 29, 0.05), 0 10px 30px rgba(18, 22, 29, 0.07);
  --shadow-sm: 0 1px 2px rgba(18, 22, 29, 0.06);
  --glow: none;
}

:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Движение ─────────────────────────────────────────────────────────────
   Ключевые кадры перенесены из макета. Всё декоративное — под
   prefers-reduced-motion гасится общим правилом выше. */
@keyframes nc-grid { from { background-position: 0 0, 0 0; } to { background-position: 0 60px, 0 60px; } }
@keyframes nc-orb {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.18); }
  100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}
@keyframes nc-scanline { from { transform: translateY(-10vh); } to { transform: translateY(110vh); } }
@keyframes nc-blink { 0%, 45% { opacity: 1; } 50%, 95% { opacity: 0.15; } 100% { opacity: 1; } }
@keyframes nc-caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes nc-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes nc-sweep { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
@keyframes nc-flicker {
  0%, 100% { opacity: 1; } 41% { opacity: 1; } 42% { opacity: 0.35; } 43% { opacity: 1; }
  78% { opacity: 1; } 79% { opacity: 0.5; } 80% { opacity: 1; }
}
@keyframes nc-glitch-a {
  0%, 92%, 100% { clip-path: inset(0 0 100% 0); opacity: 0; }
  93% { clip-path: inset(12% 0 62% 0); opacity: 0.9; transform: translate(-4px, -2px); }
  95% { clip-path: inset(48% 0 28% 0); opacity: 0.9; transform: translate(5px, 1px); }
  97% { clip-path: inset(72% 0 8% 0); opacity: 0.8; transform: translate(-3px, 2px); }
}
@keyframes nc-glitch-b {
  0%, 90%, 100% { clip-path: inset(0 0 100% 0); opacity: 0; }
  91% { clip-path: inset(30% 0 52% 0); opacity: 0.85; transform: translate(4px, 2px); }
  94% { clip-path: inset(65% 0 18% 0); opacity: 0.85; transform: translate(-5px, -1px); }
  96% { clip-path: inset(5% 0 82% 0); opacity: 0.7; transform: translate(3px, -2px); }
}

/* ── Фоновые слои, снятые с макета ────────────────────────────────────────
   Порядок снизу вверх: атмосфера → аврора (параллакс) → пятно под курсором →
   CRT-полосы поверх всего. Все fixed, событий не ловят. */

/* 1. Атмосфера: холодная база с синим и пурпурным свечением по углам. */
#nc-bg {
  position: fixed; inset: 0; z-index: -4; pointer-events: none;
  background:
    radial-gradient(90% 70% at 18% 8%, rgba(96, 110, 255, 0.26), transparent 60%),
    radial-gradient(70% 60% at 86% 22%, rgba(196, 62, 236, 0.22), transparent 62%),
    radial-gradient(80% 70% at 60% 96%, rgba(43, 233, 255, 0.18), transparent 64%),
    linear-gradient(#191b36 0%, #212344 46%, #17182e 100%);
}
:root[data-theme="light"] #nc-bg { display: none; }

/* 1б. Звёздное поле: три слоя глубины с параллаксом, рисует app.js. */
#nc-stars {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  width: 100%; height: 100%; display: block;
}
:root[data-theme="light"] #nc-stars { display: none; }

/* 2. Аврора: три пятна под сильным размытием, едет за курсором (app.js). */
#nc-aurora {
  position: fixed; inset: -160px -256px; z-index: -2; pointer-events: none;
  background:
    radial-gradient(46% 40% at 22% 28%, rgba(43, 233, 255, 0.22), transparent 62%),
    radial-gradient(42% 38% at 78% 68%, rgba(255, 43, 209, 0.20), transparent 64%),
    radial-gradient(50% 44% at 55% 110%, rgba(215, 255, 58, 0.16), transparent 60%);
  filter: blur(24px);
  will-change: transform;
}
:root[data-theme="light"] #nc-aurora { opacity: 0.35; }

/* 3. Пятно под курсором. Координаты кладёт app.js в --mx/--my — перерисовывается
   только фон слоя, без пересчёта раскладки. */
#nc-spot {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0; transition: opacity 0.35s ease;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%),
              rgba(255, 122, 69, 0.10), transparent 70%);
}
#nc-spot.is-on { opacity: 1; }
:root[data-theme="light"] #nc-spot {
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%),
              rgba(194, 65, 12, 0.07), transparent 70%);
}

/* 4. CRT-развёртка: тончайшие полосы поверх страницы, режим overlay. */
#nc-crt {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: overlay;
  background: repeating-linear-gradient(
    rgba(255, 255, 255, 0.027) 0px, rgba(255, 255, 255, 0.027) 1px,
    transparent 1px, transparent 3px);
}
:root[data-theme="light"] #nc-crt { display: none; }

/* 5. Виньетка: мягкое затемнение по краям экрана, поверх фона, но под контентом. */
#nc-vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  box-shadow: inset 0 0 280px 80px rgba(10, 6, 30, 0.3);
}
:root[data-theme="light"] #nc-vignette { display: none; }

/* Сканирующая полоса */
.nc-scanline {
  position: fixed; left: 0; right: 0; top: 0; height: 180px; z-index: 1; pointer-events: none;
  background: linear-gradient(transparent, rgba(215, 255, 58, 0.045), transparent);
  animation: nc-scanline 7.5s linear infinite;
}
:root[data-theme="light"] .nc-scanline { display: none; }

/* Координатная сетка — только в первом экране, как в макете. */
.hero { position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 100% 60px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 64px 100%;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 30%, #000 35%, transparent 100%);
  animation: nc-grid 9s linear infinite;
}

/* Холст сцены в герое — рисует app.js (сфера-ядро с орбитами). */
#nc-net {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  display: block; pointer-events: none;
}

/* Появление блоков при прокрутке.
   Прячем ТОЛЬКО когда скрипт жив (класс .js ставит app.js первой строкой): иначе при
   любой ошибке JS половина страницы осталась бы прозрачной и пустой. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  .nc-scanline { display: none; }
}

/* Карточки и модули подсвечиваются под курсором — координаты локальные, их
   тоже проставляет app.js. */
.card, .module, .b2b, .twin-card, .terminal { position: relative; }
.card::before, .module::before, .b2b::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity 0.25s ease;
  background: radial-gradient(220px circle at var(--cx, 50%) var(--cy, 50%),
              rgba(255, 122, 69, 0.10), transparent 65%);
}
.card:hover::before, .module:hover::before, .b2b:hover::before { opacity: 1; }
:root[data-theme="light"] .card::before,
:root[data-theme="light"] .module::before,
:root[data-theme="light"] .b2b::before {
  background: radial-gradient(220px circle at var(--cx, 50%) var(--cy, 50%),
              rgba(194, 65, 12, 0.08), transparent 65%);
}
@media (hover: none) {
  .card::before, .module::before, .b2b::before { display: none; }
}

/* Холст с сетью узлов — живой слой между фоном и контентом. Рисует app.js. */
#nc-net {
  position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%;
  display: block; pointer-events: none; opacity: 0.75;
}
:root[data-theme="light"] #nc-net { opacity: 0.5; }

/* Сканирующая полоса поверх страницы */
.nc-scanline {
  position: fixed; left: 0; right: 0; top: 0; height: 26vh; z-index: 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(215, 255, 58, 0.045), transparent);
  animation: nc-scanline 7.5s linear infinite;
}
:root[data-theme="light"] .nc-scanline { display: none; }

/* Появление блоков при прокрутке.
   Прячем ТОЛЬКО когда скрипт жив (класс .js ставит app.js первой строкой): иначе при
   любой ошибке JS половина страницы осталась бы прозрачной и пустой. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  .nc-scanline { display: none; }
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.prose { max-width: var(--measure); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.02;
  font-weight: 300;
  letter-spacing: -0.035em;
  margin: 0 0 var(--sp-3);
}
h1 { font-size: var(--step-5); font-weight: 200; line-height: 0.98; }
h2 { font-size: var(--step-3); font-weight: 200; margin-top: var(--sp-6); }
h3 { font-size: var(--step-1); font-weight: 400; line-height: 1.25; margin-top: var(--sp-5); letter-spacing: -0.02em; }
p { margin: 0 0 var(--sp-3); }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
/* Ссылка внутри абзаца или списка отличается от текста не только цветом: одного цвета
   недостаточно людям с нарушением цветовосприятия, и это же ловит проверка доступности.
   Навигация, карточки и кнопки не в счёт — там ссылка видна по положению и форме. */
.prose a, .lead a, .legal a, p a, li a { text-decoration: underline; }
.prose a.btn, .lead a.btn, p a.btn, li a.btn,
.card a.btn, .module a, .chip, .article-row, .measure-row, .tool-card { text-decoration: none; }
small { color: var(--text-muted); font-size: var(--step--1); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-5) 0; }
::selection { background: var(--accent); color: var(--on-accent); }

/* Моно-метка над заголовком: «▸ ПРОГРАММА» */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan);
  margin-bottom: var(--sp-3);
}
.eyebrow::before { content: "▸"; opacity: 0.7; }
.lead { font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem); color: var(--text-muted); line-height: 1.55; }

/* Хедер */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(26, 27, 51, 0.68);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(180, 200, 255, 0.13);
}
.site-header .wrap { display: flex; align-items: center; gap: var(--sp-4); height: 68px; }
.brand {
  display: flex; align-items: center; gap: 10px; font-family: var(--font-display);
  font-weight: 400; letter-spacing: -0.03em; font-size: var(--step-1);
  color: var(--text); text-decoration: none;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand .mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  box-shadow: var(--glow);
}
.nav { margin-left: auto; display: flex; align-items: center; gap: var(--sp-4); }
.nav a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--text); text-decoration: none; }

/* Кнопка меню: три полоски, превращающиеся в крестик. Только для узких экранов —
   на широких вся навигация видна и кнопка не нужна. */
.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 11px 10px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 10px;
  flex-direction: column; justify-content: space-between; flex: 0 0 auto;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.15s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.nav-mobile {
  display: none; flex-direction: column; gap: 2px;
  border-top: 1px solid var(--border); background: var(--bg-deep);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
}
.nav-mobile a {
  color: var(--text); text-decoration: none; font-size: 1.02rem;
  /* 48px по высоте: палец попадает без прицеливания. */
  padding: 13px 4px; border-bottom: 1px solid var(--border);
}
.nav-mobile a:last-of-type { border-bottom: none; }
.nav-mobile .btn { margin-top: var(--sp-3); text-align: center; border-bottom: none; }

@media (max-width: 900px) {
  .nav a.hide-sm { display: none; }
  .nav-toggle { display: flex; }
  .nav-mobile:not([hidden]) { display: flex; }
}

/* На узком экране шапка не должна ломаться: кнопка «Открыть по коду» переносилась
   на две строки и выдавливала тумблер темы за край. */
@media (max-width: 520px) {
  .site-header .wrap { gap: var(--sp-2); padding: 0 var(--sp-3); }
  .nav { gap: var(--sp-2); }
  .nav .btn { padding: 0.55em 0.85em; font-size: 0.82rem; }
  .brand { font-size: 1.02rem; gap: 8px; }
  .brand .mark { width: 28px; height: 28px; font-size: 13px; }
  .theme-toggle { width: 34px; height: 34px; flex: 0 0 auto; }
}
/* Совсем узкие экраны: имени рядом с маркой уже не хватает места — вход по коду
   и тумблер важнее, а марка сама по себе остаётся ссылкой на главную. */
@media (max-width: 430px) {
  .brand .brand-name { display: none; }
}

.theme-toggle {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid; place-items: center;
  font-size: 16px; line-height: 1;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-family: var(--font-sans); font-weight: 700; font-size: 0.95rem; cursor: pointer;
  text-decoration: none; padding: 0.8em 1.4em; border-radius: 0;
  border: 1px solid transparent; white-space: nowrap;
  /* Срез правого верхнего и левого нижнего углов — фирменная форма макета. */
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
/* Блик, пробегающий по главной кнопке при наведении. */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 35%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-120%);
}
.btn-primary:hover::after { animation: nc-sweep 1.1s linear; }
@media (prefers-reduced-motion: reduce) { .btn-primary:hover::after { animation: none; } }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg {
  font-size: 1rem; padding: 17px 30px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

/* Секции */
.section { padding: var(--sp-7) 0; }
.section-tight { padding: var(--sp-6) 0; }

/* Hero. Как в макете: занимает экран целиком, содержимое по центру, холст сцены
   обрезается по границам секции. */
.hero {
  padding: var(--sp-6) 0;
  min-height: 100vh; display: flex; align-items: center; overflow: hidden;
}
/* Секция стала flex-контейнером — обёртке нужно занять всю строку, иначе колонки схлопнутся. */
.hero > .wrap { flex: 1 1 auto; width: 100%; padding-top: 132px; padding-bottom: 80px; }
.hero h1 { max-width: none; margin-bottom: var(--sp-4); }
.hero h1 .hl { color: var(--accent); font-weight: 600; }
.hero .lead { max-width: 571px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }
.hero-note { margin-top: var(--sp-5); color: var(--text-muted); font-size: var(--step--1); }
.hero-grid { display: grid; grid-template-columns: 1.353fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: var(--sp-5); } }

/* Версионный бейдж «ПРИКЛАДНОЙ ИИ · V.2026» */
.badge-ver {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-soft); border-radius: 999px; padding: 6px 14px; margin-bottom: var(--sp-4);
}
.badge-ver::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: nc-blink 2.4s ease-in-out infinite;
}

/* Акцентное слово в заголовке: редкий глитч двумя слоями-двойниками. */
.hero h1 .hl { position: relative; display: inline-block; }
.hero h1 .hl::before, .hero h1 .hl::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
}
.hero h1 .hl::before { color: var(--cyan); animation: nc-glitch-a 6.5s steps(1) infinite; }
.hero h1 .hl::after { color: var(--magenta); animation: nc-glitch-b 6.5s steps(1) infinite; }

/* Терминальный блок */
.terminal {
  background: var(--bg-deep); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; font-family: var(--font-mono); font-size: 0.82rem;
  line-height: 1.75;
  animation: nc-float 5s ease-in-out infinite;
}
/* Строка, которую печатает app.js: курсор мигает, пока идёт набор. */
.terminal .typed { min-height: 3.5em; }
.terminal .typed::after {
  content: "▌"; color: var(--accent); margin-left: 1px;
  animation: nc-caret 1s steps(1) infinite;
}
.terminal .typed.is-done::after { animation: none; opacity: 0.25; }
/* Пункты проверки проявляются по одному после набора команды. */
.terminal .ok { opacity: 0.18; transition: opacity 0.45s ease; }
.terminal .ok.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .terminal { animation: none; }
  .terminal .ok { opacity: 1; }
}
.terminal .bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); color: var(--text-dim);
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
}
.terminal .dots { margin-left: auto; display: flex; gap: 6px; }
.terminal .dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.terminal .dots i:nth-child(1) { background: var(--magenta); }
.terminal .dots i:nth-child(2) { background: var(--cyan); }
.terminal .dots i:nth-child(3) { background: var(--accent); }
.terminal .screen { padding: var(--sp-4); }
.terminal .cmd { color: var(--cyan); }
.terminal .cmd::before { content: "> "; color: var(--text-dim); }
.terminal .out { color: var(--text); margin: 4px 0 var(--sp-3); }
.terminal .ok { color: var(--text-muted); display: flex; gap: 8px; align-items: baseline; }
.terminal .ok::before { content: "[✓]"; color: var(--accent); font-size: 0.78em; }

/* Секция «Цифровой двойник» */
.twin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .twin-grid { grid-template-columns: 1fr; } }

.steps { list-style: none; padding: 0; margin: var(--sp-5) 0 0; display: grid; gap: var(--sp-3); }
.steps li {
  display: flex; gap: var(--sp-3); align-items: baseline; color: var(--text-muted);
  padding: var(--sp-3) 0; border-top: 1px solid var(--border);
}
.steps .code {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan); flex: 0 0 auto;
}

.twin-card {
  position: relative; min-height: 520px;
  background: rgba(20, 28, 44, 0.46); border: 1px solid rgba(180, 200, 255, 0.16);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.twin-card .bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-dim);
}
.twin-card .dots { margin-left: auto; display: flex; gap: 6px; }
.twin-card .dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.twin-card .dots i:nth-child(1) { background: var(--magenta); }
.twin-card .dots i:nth-child(2) { background: var(--cyan); }
.twin-card .dots i:nth-child(3) { background: var(--accent); }
.twin-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.twin-card .bar, .twin-card .twin-meta { position: relative; z-index: 1; }
.twin-card .twin-meta { position: absolute; left: 0; right: 0; bottom: 0; }
.twin-meta {
  display: flex; justify-content: space-between; gap: var(--sp-3); padding: 12px 14px;
  border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.68rem;
  letter-spacing: 0.1em; color: var(--text-dim);
}
.twin-status { color: var(--accent); animation: nc-flicker 5s infinite; }
@media (prefers-reduced-motion: reduce) { .twin-status { animation: none; } }

/* Карточки-сетки */
.grid { display: grid; gap: var(--sp-4); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-5); box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card h2, .card h3 { margin-top: 0; font-size: var(--step-1); }
.card p { color: var(--text-muted); margin-bottom: 0; }
.card .num-mono {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em;
  color: var(--text-dim); display: block; margin-bottom: var(--sp-2);
}

/* Программа курса */
.module {
  display: flex; gap: var(--sp-4); padding: var(--sp-4) var(--sp-3);
  border: 1px solid transparent; border-top-color: var(--border);
  border-radius: var(--radius-sm); transition: background 0.2s ease, border-color 0.2s ease;
}
.module:hover { background: var(--surface); border-color: var(--border); }
.module:last-child { border-bottom: 1px solid var(--border); }
.module:last-child:hover { border-bottom-color: var(--border); }
.module .num {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 500; font-size: 0.95rem;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.module .body h2, .module .body h3 { margin: 0 0 4px; font-size: var(--step-1); font-weight: 400; }
.module .body p { margin: 0; color: var(--text-muted); }
.module .meta {
  margin-top: 6px; font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.06em; color: var(--text-dim);
}
.badge-free, .badge-soon {
  display: inline-block; font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 9px; margin-left: 10px; vertical-align: middle;
}
.badge-free {
  color: var(--badge-free); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--badge-free) 40%, transparent);
}
/* Модуль запланирован, но ещё не написан. Приглушённый, чтобы не спорить с «бесплатно». */
.badge-soon {
  color: var(--text-dim); border: 1px dashed color-mix(in srgb, var(--text-dim) 45%, transparent);
}
.module.is-soon { opacity: 0.55; }
.module.is-soon:hover { opacity: 0.8; }

/* B2B блок */
.b2b {
  position: relative; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: var(--sp-6);
  background-image: radial-gradient(closest-side at 85% 0%, var(--accent-soft), transparent 70%);
}
.b2b ul { padding-left: 1.1em; color: var(--text-muted); }
.b2b li { margin-bottom: 8px; }

/* Прайс/оффер карточка */
.pricebox h2 { margin-top: 0; font-size: var(--step-1); }
.pricebox {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: var(--sp-5); box-shadow: var(--shadow); text-align: center; max-width: 420px;
}
.pricebox .price {
  font-family: var(--font-display); font-size: var(--step-4); font-weight: 400; letter-spacing: -0.04em;
  line-height: 1.1;
}
/* Отдельной строкой: в подпись входит слэш, и при переносе он повисал один посреди блока. */
.pricebox .price small {
  display: block; margin-top: var(--sp-2);
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim);
  font-weight: 400; letter-spacing: 0.08em;
}

/* Формы */
.form { display: grid; gap: var(--sp-3); max-width: 460px; }
.field label {
  display: block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px;
}
.field input[type="email"], .field input[type="text"] {
  width: 100%; font: inherit; padding: 0.75em 0.95em; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-deep); color: var(--text);
}
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--step--1); color: var(--text-muted); }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.check a { color: var(--accent); }
.form-error {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger); padding: var(--sp-3); border-radius: var(--radius-sm); font-size: var(--step--1);
}
.notice {
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: var(--sp-4); border-radius: var(--radius);
}

/* Поля форм заявок: подпись и поле в одном label — так подпись всегда связана с полем
   без ручных id/for, и клик по тексту ставит курсор в поле. */
.form label:not(.check) {
  display: block; font-size: var(--step--1); color: var(--text-muted);
}
.form input[type="email"], .form input[type="text"], .form input[type="number"],
.form textarea, .form select, .calc-grid input, .calc-grid select {
  display: block; width: 100%; margin-top: 6px; font: inherit;
  padding: 0.7em 0.9em; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-deep); color: var(--text);
}
.form textarea { resize: vertical; min-height: 3.4em; }
.form input:focus-visible, .form textarea:focus-visible, .form select:focus-visible,
.calc-grid input:focus-visible, .calc-grid select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}

/* Калькулятор эффекта */
.calc-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4); margin-top: var(--sp-4);
}
.calc-grid label { font-size: var(--step--1); color: var(--text-muted); }
.calc-out {
  margin-top: var(--sp-4); font-size: var(--step-2); font-weight: 300;
  font-family: var(--font-display); line-height: 1.35;
}
.calc-out b { color: var(--accent); font-weight: 400; }

/* Блок «промпт для копирования» */
.prompt {
  position: relative; background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: var(--sp-4); margin: var(--sp-4) 0;
  font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.7; white-space: pre-wrap;
}
.prompt .copy {
  position: absolute; top: 10px; right: 10px; font-family: var(--font-mono);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-dim);
  border-radius: 6px; padding: 4px 10px; font-size: 0.68rem; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer;
}
.prompt .copy:hover { color: var(--accent); border-color: var(--accent); }

/* Бейдж актуальности */
.checked-badge { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); }
.checked-badge.stale { color: var(--warning); }

/* --- Уровень 0: каталог инструментов и библиотека промптов --- */

/* Фильтры — обычные ссылки. Выглядят как кнопки, но работают без JS и делятся ссылкой. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-4); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
  font-size: var(--step--1); color: var(--text-muted); text-decoration: none;
  background: var(--surface); transition: border-color 0.15s, color 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.chip small { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-dim); }
.chip.is-on {
  color: var(--on-accent); background: var(--accent); border-color: var(--accent); font-weight: 500;
}
.chip.is-on small { color: var(--on-accent); opacity: 0.75; }

/* Уровень риска по данным. Цвет здесь несёт смысл, поэтому дублируется словом в тексте. */
.risk {
  display: inline-block; font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px;
  border: 1px solid currentColor;
}
.risk-низкий { color: #4ade80; }
.risk-средний { color: var(--accent); }
.risk-высокий { color: #ff5c7a; }

.tool-card { display: block; text-decoration: none; color: inherit; }
.tool-card:hover { text-decoration: none; }
.tool-card h2 { color: var(--text); }
.tool-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-3); }

/* Строка промпта в списке: карточка модуля без номера слева. */
.prompt-row .body { width: 100%; }
.prompt-row .prompt { margin-bottom: 0; }
.prompt-row h2 a { color: var(--text); text-decoration: none; }
.prompt-row h2 a:hover { color: var(--accent); }

/* --- Инструмент обезличивания --- */

.anon-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-top: var(--sp-5);
}
@media (max-width: 860px) { .anon-grid { grid-template-columns: 1fr; } }

.anon-label {
  display: block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px;
}
/* Моноширинный шрифт здесь по делу: в тексте важны позиции цифр, а метки должны
   визуально отличаться от прозы. */
.anon-area {
  width: 100%; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.6;
  padding: var(--sp-3); border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-deep); color: var(--text);
  resize: vertical;
}
.anon-area:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.anon-area[readonly] { background: var(--surface); color: var(--text-muted); }
.anon-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); flex-wrap: wrap; }
.anon-stat { margin-top: var(--sp-4); color: var(--text-muted); font-size: var(--step--1); }

/* --- Конструктор запроса --- */

.pb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); margin-top: var(--sp-5); }
@media (max-width: 860px) { .pb-grid { grid-template-columns: 1fr; } }

.pb-form { display: grid; gap: var(--sp-4); }
.pb-field { display: block; }
.pb-name {
  display: block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
}
.pb-why { display: block; font-size: var(--step--1); color: var(--text-dim); margin: 2px 0 6px; }
.pb-field input {
  width: 100%; font: inherit; padding: 0.7em 0.9em; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-deep); color: var(--text);
}
.pb-field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Пустая часть подсвечивается пунктиром: пропуск должно быть видно, а не угадываться. */
.pb-field input.is-empty { border-style: dashed; border-color: var(--border-strong); }

.pb-guards {
  border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4);
  display: grid; gap: 10px;
}
.pb-guards legend {
  padding: 0 8px; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-dim);
}
.pb-hint { margin-top: var(--sp-3); font-size: var(--step--1); color: var(--text-muted); }
.pb-hint.is-ok { color: var(--success); }

.chip[data-preset] { cursor: pointer; font: inherit; font-size: var(--step--1); }

/* --- Статьи, словарь, диагностика --- */

.article-row .body { width: 100%; }
.article-row h2 { color: var(--text); }
.article-row:hover h2 { color: var(--accent); }
.article-row { text-decoration: none; color: inherit; }
.article-row:hover { text-decoration: none; }

.glossary-search { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap; }
.glossary-search input[type="search"] {
  flex: 1 1 240px; font: inherit; padding: 0.7em 0.9em; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-deep); color: var(--text);
}

/* Термин: короткое определение выделено, развёрнутое — обычным текстом.
   Якорь на каждом термине, чтобы можно было дать ссылку прямо на нужный. */
.term { padding: var(--sp-4) 0; border-bottom: 1px solid var(--border); scroll-margin-top: 90px; }
.term:last-child { border-bottom: none; }
.term h2 { font-size: var(--step-1); margin: 0 0 6px; }
.term-aka { font-size: var(--step--1); color: var(--text-dim); font-weight: 400; }
.term-short { margin: 0 0 8px; color: var(--text); }
.term .risk { margin-top: 8px; }

.maturity-form { margin-top: var(--sp-5); display: grid; gap: var(--sp-5); }
.maturity-q { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4); }
.maturity-q legend {
  padding: 0 8px; font-size: var(--step-0); color: var(--text);
  display: flex; gap: 10px; align-items: baseline;
}
.maturity-q .num-mono { color: var(--accent); }
/* 44px по высоте: вариант ответа должен попадаться пальцем без прицеливания. */
.maturity-opt { padding: 10px 4px; min-height: 44px; align-items: center; cursor: pointer; }
.maturity-opt:hover span { color: var(--text); }

/* --- Реестр замеров --- */

/* Строка замера: слева цифра эффекта, справа сама операция. Цифра — то, ради чего
   человек сюда пришёл, поэтому она читается раньше текста. */
.measure-row { display: flex; gap: var(--sp-4); text-decoration: none; color: inherit; }
.measure-row:hover { text-decoration: none; }
.measure-row h2 { color: var(--text); }
.measure-figure {
  flex: 0 0 108px; display: flex; flex-direction: column; align-items: flex-start;
  justify-content: center; border-right: 1px solid var(--border); padding-right: var(--sp-4);
}
.measure-figure strong {
  font-family: var(--font-display); font-size: var(--step-2); font-weight: 400; color: var(--accent);
  line-height: 1;
}
.measure-figure span { font-size: var(--step--1); color: var(--text-dim); margin-top: 4px; }

/* Шапка страницы замера: четыре числа в ряд, на узком экране — в два. */
.measure-head {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4);
  margin-top: var(--sp-5); padding: var(--sp-4) 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.measure-head strong {
  display: block; font-family: var(--font-display); font-weight: 300;
  font-size: var(--step-3); line-height: 1.1;
}
.measure-head div:nth-child(3) strong { color: var(--accent); }
/* Длинное значение (цена) не должно разрываться посреди числа и ломать ряд. */
.measure-head strong.is-price { font-size: var(--step-2); white-space: nowrap; }
.measure-head span { font-size: var(--step--1); color: var(--text-dim); }
@media (max-width: 620px) {
  .measure-head { grid-template-columns: repeat(2, 1fr); }
  .measure-figure { flex-basis: 84px; }
}

/* Превью закрытого модуля: текст растворяется к низу — видно, что материал продолжается,
   и не создаётся впечатление, будто урок оборвался на полуслове. */
.preview-fade {
  position: relative; max-height: 30em; overflow: hidden;
}
.preview-fade::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 10em; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg) 92%);
}

/* Таблица характеристик инструмента */
.facts { width: 100%; border-collapse: collapse; max-width: var(--measure); }
.facts th, .facts td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-weight: 400; vertical-align: top;
}
.facts th { color: var(--text-dim); width: 42%; font-size: var(--step--1); }

/* Футер */
.site-footer {
  border-top: 1px solid var(--border); padding: var(--sp-6) 0; margin-top: var(--sp-7);
  color: var(--text-muted); font-size: var(--step--1); background: var(--bg-deep);
}
.site-footer .cols {
  display: grid; gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.site-footer .cols strong { display: block; color: var(--text); margin-bottom: 10px; }
.site-footer .cols small { display: block; margin-bottom: 12px; }
.site-footer a { color: var(--text-muted); text-decoration: none; display: block; margin-bottom: 8px; }
.site-footer a:hover { color: var(--accent); text-decoration: none; }
.footer-legal {
  margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--border);
  max-width: var(--measure);
}

/* Правовые страницы. Дисплейный кегль здесь ни к чему — это документ, а не витрина. */
.legal { max-width: var(--measure); }
.legal h1 { font-size: var(--step-3); font-weight: 300; }
.legal h2 { font-size: var(--step-2); font-weight: 300; }
.legal ol, .legal ul { padding-left: 1.3em; }
.legal li { margin-bottom: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Памятка для печати. Раздатка коллегам живёт на бумаге: декоративные слои, шапка,
   футер и кнопки на печати только съедают тонер и место. */
.handout .facts { width: 100%; }
@media print {
  .site-header, .site-footer, .no-print,
  #nc-bg, #nc-stars, #nc-aurora, #nc-spot, .nc-scanline, #nc-crt, #nc-vignette { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .handout, .handout * { color: #000 !important; background: transparent !important; }
  .handout a { color: #000 !important; text-decoration: underline; }
  .handout h1 { font-size: 20pt; }
  .handout h2 { font-size: 14pt; page-break-after: avoid; }
  .handout table, .handout ul { page-break-inside: avoid; }
  .handout .facts th, .handout .facts td { border: 1px solid #999 !important; padding: 4pt 6pt; }
}
