/* ════════════════════════════════════════════════════════════════
   Директ Контроль — стиль контент-страниц (база знаний, словарь,
   сравнения, отрасли, калькуляторы). Тёмная тема, акцент #ff5b3a.
   Единый дизайн-язык с лендингом (index.html).
   ═════════════════════════════════════════════════════════════════ */
:root {
  --bg: #08080c;
  --bg-soft: #101018;
  --bg-card: #14141e;
  --bg-elev: #1b1b27;
  --line: rgba(255,255,255,0.06);
  --line-bright: rgba(255,255,255,0.16);
  --text: #f4f4f6;
  --text-dim: #8b8b9e;
  --text-faint: #4a4a55;
  --accent: #ff5b3a;
  --accent-hi: #ff7252;
  --accent-glow: rgba(255,91,58,0.4);
  --accent-soft: rgba(255,91,58,0.10);
  --ok: #34d399;
  --warn: #fbbf24;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: 'Onest', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --display: 'Space Grotesk', 'Onest', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }

.bg-fx {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 85% -10%, rgba(255,91,58,0.12), transparent 60%),
    radial-gradient(ellipse 70% 60% at 50% 120%, rgba(255,91,58,0.06), transparent 60%);
}

/* ─── Навигация ─── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 18px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(8,8,12,0.72);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.navbar .logo {
  font-family: var(--display); font-size: 17px; font-weight: 600;
  color: var(--text); display: flex; align-items: center; gap: 9px;
  letter-spacing: -0.01em; margin-right: auto;
}
.navbar .logo .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 14px var(--accent-glow);
}
.navbar nav { display: flex; gap: 18px; align-items: center; font-size: 14px; }
.navbar nav a.link { color: var(--text-dim); }
.navbar nav a.link:hover { color: var(--text); }
@media (max-width: 720px) { .navbar nav .link { display: none; } }

/* ─── Кнопки ─── */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600; white-space: nowrap;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
  border: 0;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: #1a0a05;
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.14) inset, 0 8px 22px -10px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); color: #1a0a05; }
.btn-ghost { background: rgba(255,255,255,0.04); color: var(--text); border: 1px solid var(--line-bright); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text); }

/* ─── Каркас страницы ─── */
.wrap { position: relative; z-index: 2; }
.page {
  max-width: 820px; margin: 0 auto;
  padding: 40px clamp(18px, 5vw, 32px) 80px;
}
.page.wide { max-width: 1080px; }

/* ─── Хлебные крошки ─── */
.crumbs {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--text-faint); margin-bottom: 26px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--text-faint); }

/* ─── Заголовки ─── */
.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.22em; color: var(--accent);
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.eyebrow::before { content: ''; width: 26px; height: 1px; background: var(--accent); }
h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(30px, 5vw, 46px); line-height: 1.08;
  letter-spacing: -0.02em; margin-bottom: 22px;
}
h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(23px, 3.4vw, 30px); line-height: 1.18;
  letter-spacing: -0.01em; margin: 52px 0 18px;
}
h3 { font-size: 20px; font-weight: 600; margin: 32px 0 12px; }
.article p { color: #d8d8e0; margin-bottom: 18px; }
.article ul, .article ol { margin: 0 0 20px; padding-left: 4px; list-style: none; }
.article li { color: #d8d8e0; margin-bottom: 11px; padding-left: 28px; position: relative; }
.article ul li::before {
  content: ''; position: absolute; left: 4px; top: 11px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.article ol { counter-reset: li; }
.article ol li::before {
  counter-increment: li; content: counter(li);
  position: absolute; left: 0; top: 1px;
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  width: 20px; height: 20px; border: 1px solid var(--line-bright); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.article strong { color: var(--text); font-weight: 600; }
.lead { font-size: 19px; color: var(--text-dim); margin-bottom: 30px; }

/* ─── TL;DR / короткий ответ (главный AEO-блок) ─── */
.tldr {
  background: var(--accent-soft); border: 1px solid rgba(255,91,58,0.22);
  border-left: 3px solid var(--accent);
  border-radius: 14px; padding: 22px 24px; margin: 0 0 36px;
}
.tldr .label {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--accent); margin-bottom: 8px;
}
.tldr p { font-size: 18px; color: var(--text); margin: 0; line-height: 1.55; }
.tldr p + p { margin-top: 12px; }

/* ─── Определение (DefinedTerm) ─── */
.definition {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px 24px; margin: 24px 0;
}
.definition dfn {
  font-style: normal; font-weight: 700; color: var(--accent);
  font-family: var(--display); font-size: 19px;
}
.definition p { margin: 8px 0 0; }

/* ─── Формула ─── */
.formula {
  font-family: var(--mono); font-size: 15px; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--line-bright);
  border-radius: 12px; padding: 18px 22px; margin: 20px 0;
  overflow-x: auto; line-height: 1.7;
}
.formula b { color: var(--accent); font-weight: 500; }

/* ─── Таблицы (любимый формат LLM) ─── */
.table-scroll { overflow-x: auto; margin: 24px 0; -webkit-overflow-scrolling: touch; }
table.dc {
  width: 100%; border-collapse: collapse; font-size: 15px; min-width: 480px;
}
table.dc th, table.dc td {
  text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.dc th {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-dim); font-weight: 500;
  background: var(--bg-soft);
}
table.dc td { color: #d8d8e0; }
table.dc tr:last-child td { border-bottom: 0; }
table.dc .accent { color: var(--accent); font-weight: 600; }

/* ─── Callout ─── */
.note, .warn {
  border-radius: 12px; padding: 16px 20px; margin: 22px 0; font-size: 15.5px;
  border: 1px solid var(--line); background: var(--bg-card);
}
.note { border-left: 3px solid var(--ok); }
.warn { border-left: 3px solid var(--warn); }
.note p:last-child, .warn p:last-child { margin-bottom: 0; }

/* ─── FAQ ─── */
.faq { margin: 32px 0; }
.faq details {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 0 20px; margin-bottom: 10px; background: var(--bg-card);
  transition: border-color .3s var(--ease);
}
.faq details[open] { border-color: var(--line-bright); }
.faq summary {
  list-style: none; cursor: pointer; padding: 17px 0;
  font-weight: 600; font-size: 16.5px; color: var(--text);
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; color: var(--accent); font-size: 22px; font-weight: 400;
  flex-shrink: 0; transition: transform .3s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 18px; color: #d8d8e0; }
.faq .answer p { margin-bottom: 12px; }

/* ─── Связанные страницы ─── */
.related { margin: 48px 0 0; }
.related h2 { margin-top: 0; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.related-grid a {
  display: block; padding: 16px 18px; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--line); color: var(--text);
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.related-grid a:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.related-grid a .k {
  font-family: var(--mono); font-size: 11px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.08em; display: block; margin-bottom: 6px;
}
.related-grid a .t { font-weight: 600; font-size: 15px; line-height: 1.35; }

/* ─── CTA-блок (конверсия) ─── */
.cta {
  margin: 56px 0 0; padding: 32px clamp(22px, 4vw, 40px);
  border-radius: 18px; border: 1px solid rgba(255,91,58,0.22);
  background: linear-gradient(135deg, rgba(255,91,58,0.10), rgba(255,91,58,0.02));
  text-align: center;
}
.cta h2 { margin: 0 0 10px; }
.cta p { color: var(--text-dim); margin: 0 auto 22px; max-width: 52ch; }
.cta .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── Калькулятор ─── */
.calc {
  background: var(--bg-card); border: 1px solid var(--line-bright);
  border-radius: 18px; padding: 26px clamp(20px, 4vw, 32px); margin: 30px 0;
}
.calc .field { margin-bottom: 18px; }
.calc label { display: block; font-size: 14px; color: var(--text-dim); margin-bottom: 7px; }
.calc input {
  width: 100%; padding: 13px 16px; font-size: 16px; font-family: var(--mono);
  background: var(--bg-elev); border: 1px solid var(--line-bright);
  border-radius: 10px; color: var(--text);
}
.calc input:focus { outline: none; border-color: var(--accent); }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 540px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-result {
  margin-top: 8px; padding: 22px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid rgba(255,91,58,0.22);
  text-align: center;
}
.calc-result .big {
  font-family: var(--display); font-size: 40px; font-weight: 700;
  color: var(--accent); line-height: 1;
}
.calc-result .cap { font-size: 13px; color: var(--text-dim); margin-top: 8px; }

/* ─── Метка обновления / автор ─── */
.meta {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  font-size: 13px; color: var(--text-faint); margin-bottom: 34px;
  padding-bottom: 22px; border-bottom: 1px solid var(--line);
}
.meta .author { color: var(--text-dim); }
.meta .author b { color: var(--text); font-weight: 600; }

/* ─── Футер ─── */
footer { border-top: 1px solid var(--line); margin-top: 60px; position: relative; z-index: 2; }
.foot {
  max-width: 1080px; margin: 0 auto; padding: 48px clamp(18px, 5vw, 32px);
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px;
}
@media (max-width: 760px) { .foot { grid-template-columns: 1fr 1fr; } }
.foot .logo { font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.foot .logo .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.foot p { color: var(--text-dim); font-size: 14px; margin-top: 12px; max-width: 36ch; }
.foot h4 { font-size: 13px; color: var(--text); margin-bottom: 14px; font-weight: 600; }
.foot a { display: block; color: var(--text-dim); font-size: 14px; margin-bottom: 9px; }
.foot a:hover { color: var(--accent); }
.foot .legal { color: var(--text-faint); font-size: 12.5px; line-height: 1.7; }
