/* =========================================================================
   Forsaken Scripts — main.css
   Концепция: «хоррор-терминал наблюдения». Холодный угольно-чёрный фон,
   кроваво-красный акцент (чистый красный, hue≈0), почти острые углы (2px),
   красное свечение на hover. Уникальный словарь классов (footprint).
   ========================================================================= */

:root {
  --bg-base:      #0F0F12;  /* холодный угольно-чёрный */
  --bg-card:      #17171C;  /* карточки */
  --bg-code:      #0A0A0D;  /* блоки кода */
  --bg-raise:     #1D1D23;  /* приподнятые плашки */
  --red:          #E23636;  /* кроваво-красный — кнопки, акценты, свечение */
  --red-hot:      #F5484A;  /* красный на hover */
  --red-dim:      #3D1010;  /* тёмно-красная подложка чипов */
  --ash:          #9DA0AB;  /* пепельный — вторичные ссылки/иконки */
  --ok:           #46B36B;  /* «рабочий» — приглушённый зелёный */
  --warn:         #C9922A;  /* «на проверке» — тусклый янтарь */
  --text-primary: #ECECEF;  /* холодно-белый */
  --text-muted:   #7C7F8A;  /* серый */
  --border:       #26262D;  /* граница */
  --border-soft:  #1F1F25;

  --font-display: 'Sofia Sans Semi Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-body:    'Commissioner', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'Anonymous Pro', ui-monospace, 'Cascadia Mono', 'Consolas', monospace;

  --radius:  2px;   /* почти острые углы — ни у кого в сети таких нет */
  --lane:    1150px;
  --glow:    0 0 18px -6px var(--red);
  --glow-lg: 0 0 24px -8px var(--red);
}

/* ── Сброс + база ──────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  overflow-x: hidden;                     /* страница не ездит по горизонтали */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--red); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--red-hot); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: .2px;
  margin: 0 0 .5em;
  color: var(--text-primary);
}
h1 { font-size: clamp(1.9rem, 5.4vw, 3rem); }
h2 { font-size: clamp(1.45rem, 3.6vw, 2.1rem); }
h3 { font-size: 1.16rem; }
p  { margin: 0 0 1em; }

.mono   { font-family: var(--font-mono); }
.accent { color: var(--red); }

::selection { background: var(--red); color: #0F0F12; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ── Лейаут (§2.5) ─────────────────────────────────────────────────────── */

.lane {
  width: 100%;
  max-width: var(--lane);
  margin: 0 auto;
  padding: 0 20px;
}

/* header/footer full-bleed: фон от края до края, .lane только внутри */
.bar-top {
  width: 100%;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 60;
}
.bar-bot {
  width: 100%;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 72px;
}

/* ── Шапка ─────────────────────────────────────────────────────────────── */

.bar-top__nav {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 62px;
  padding: 10px 20px;
}
.bar-top__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.16rem;
  letter-spacing: 1px;
  color: var(--text-primary);
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.bar-top__logo:hover { color: var(--text-primary); }
.bar-top__dot { color: var(--red); margin: 0 3px; }

/* мотив «камеры наблюдения» — пульсирующая метка REC (уникальный приём) */
.bar-top__rec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.bar-top__rec i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: fsk-blink 1.4s steps(2, jump-none) infinite;
}
@keyframes fsk-blink { 50% { opacity: .25; } }

.bar-top__links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
}
.bar-top__links a {
  color: var(--ash);
  font-weight: 600;
  font-size: .95rem;
}
.bar-top__links a:hover { color: var(--text-primary); }

.bar-top__cta { flex-shrink: 0; }

.bar-top__burger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1.2rem;
  line-height: 1;
  padding: 7px 11px;
  cursor: pointer;
}

/* gate-режим: минимальная шапка */
.bar-top--min .bar-top__nav { justify-content: center; }

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  padding: 58px 0 46px;
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(120% 90% at 82% -10%, rgba(226,54,54,.12), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px);
}
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 14px;
}
.hero h1 { margin: 0 0 16px; max-width: 18ch; }
.hero__sub {
  color: var(--ash);
  font-size: 1.08rem;
  max-width: 60ch;
  margin: 0 0 22px;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}
.hero__facts span { display: inline-flex; align-items: center; }
.hero__updated { color: var(--text-muted); }

/* ── Секции контента ───────────────────────────────────────────────────── */

main.lane, .lane > section { scroll-margin-top: 80px; }
section[id] { scroll-margin-top: 80px; }

.section { padding: 42px 0; }
.section + .section { border-top: 1px solid var(--border-soft); }

.cat-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.cat-head__note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Каталог ───────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.empty {
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.flagship { padding-top: 42px; }
.flagship .fcard { max-width: 760px; }

/* ── Таб-бар категорий (структурное отличие каталога) ──────────────────── */

.tabs {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin: 0 0 22px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.tabs::-webkit-scrollbar { height: 4px; }
.tabs::-webkit-scrollbar-thumb { background: var(--border); }
.tabs__tab {
  background: none;
  border: 0;
  padding: 10px 2px 12px;
  color: var(--text-muted);
  font: 600 14px var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.tabs__tab:hover { color: var(--text-primary); }
.tabs__tab.is-active { color: var(--red); border-bottom-color: var(--red); }

/* ── Лонгрид / SEO-проза ───────────────────────────────────────────────── */

.longread { padding: 40px 0; }
.longread + .longread { border-top: 1px solid var(--border-soft); }
.longread h2 { margin-bottom: 16px; }
.longread p { color: var(--ash); max-width: 74ch; }
.longread strong { color: var(--text-primary); font-weight: 600; }
.lead-line { color: var(--text-primary) !important; font-size: 1.06rem; }

.longread--split {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.longread--split > div { min-width: 0; }

.callout {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
}
.callout p { margin: 0; color: var(--ash); }

/* Плитки типов скриптов / платформ / карты игр */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tile:hover { border-color: var(--red); box-shadow: var(--glow); }
.tile__ico {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-dim);
  border-radius: var(--radius);
  padding: 2px 8px;
  display: inline-block;
  margin-bottom: 10px;
}
.tile h3 { margin: 0 0 6px; }
.tile p { color: var(--ash); font-size: .95rem; margin: 0; }

/* Карта поисковых терминов / хабов: категория (красный моно-лейбл) → список */
.termmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.termmap__group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.termmap__cat {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 6px;
}
.termmap__list { margin: 0; color: var(--ash); font-size: .93rem; }

/* Дуо-сравнение (Дельта vs Xeno и т.п.) */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}
.duo__col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.duo__col:hover { border-color: var(--red); box-shadow: var(--glow); }
.duo__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-dim);
  border-radius: var(--radius);
  padding: 2px 8px;
  margin-bottom: 8px;
}
.duo__col h3 { margin: 0 0 6px; }
.duo__col p { color: var(--ash); font-size: .94rem; margin: 0; }
@media (max-width: 560px) { .duo { grid-template-columns: 1fr; } }

/* Видео-демонстрация: клик-фасад (плеер грузится по клику) */
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 760px;
  margin: 12px auto 0;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-embed__facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: block;
}
.video-embed__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .7;
  transition: opacity .15s ease;
}
.video-embed__facade:hover .video-embed__thumb { opacity: .5; }
.video-embed__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  padding-left: 5px;
  font-size: 26px;
  color: #0F0F12;
  background: var(--red);
  border-radius: 50%;
  box-shadow: var(--glow-lg);
  transition: background .15s ease, transform .1s ease;
}
.video-embed__facade:hover .video-embed__play { background: var(--red-hot); transform: translate(-50%, -50%) scale(1.06); }
.video-embed__iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed__note {
  max-width: 760px;
  margin: 8px auto 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* Ключевые «факты» строкой (мини-таблица характеристик) */
.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding: 0;
  list-style: none;
}
.specs li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.specs b {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 3px;
}
.specs span { color: var(--ash); font-size: .92rem; }

.steps, .cause-list { padding-left: 0; list-style: none; counter-reset: step; margin: 0; }
.steps li, .cause-list li {
  position: relative;
  padding: 0 0 16px 46px;
  color: var(--ash);
  counter-increment: step;
}
.steps li::before, .cause-list li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: -2px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--red);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.steps strong, .cause-list strong { color: var(--text-primary); }

/* ── FAQ ───────────────────────────────────────────────────────────────── */

.faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 15px 44px 15px 16px;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 1.2rem;
}
.faq[open] summary::after { content: '−'; }
.faq p { margin: 0; padding: 0 16px 16px; color: var(--ash); }

/* ── CTA-полоса ────────────────────────────────────────────────────────── */

.cta-band {
  margin-top: 8px;
  border-top: 1px solid var(--border-soft);
  background:
    radial-gradient(90% 140% at 50% -40%, rgba(226,54,54,.14), transparent 65%);
}
.cta-band__inner { padding: 48px 0; text-align: center; }
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { color: var(--ash); max-width: 52ch; margin: 0 auto 22px; }
.cta-band .hero__cta,
.hero__cta--center { justify-content: center; }

/* ── Футер ─────────────────────────────────────────────────────────────── */

.bar-bot__inner { padding: 42px 0 30px; }
.bar-bot__top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 30px;
}
.bar-bot__brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.bar-bot__brand-name .bar-top__dot { color: var(--red); }
.bar-bot__tag { color: var(--text-muted); font-size: .92rem; max-width: 40ch; margin: 0; }
.bar-bot__head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 12px;
}
.bar-bot__col a {
  display: block;
  color: var(--ash);
  padding: 3px 0;
  font-size: .95rem;
}
.bar-bot__col a:hover { color: var(--text-primary); }
.bar-bot__legal {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.6;
}

/* ── 404 ───────────────────────────────────────────────────────────────── */

.nf { padding: 80px 0; text-align: center; }
.nf__code {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 12vw, 6rem);
  color: var(--red);
  line-height: 1;
  margin-bottom: 8px;
}

/* ── Адаптив ───────────────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .bar-bot__top { grid-template-columns: 1fr 1fr; }
  .bar-bot__brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .bar-top__links,
  .bar-top__cta { display: none; }
  .bar-top__burger { display: inline-block; margin-left: auto; }

  /* раскрытое мобильное меню */
  .bar-top.is-open .bar-top__nav { flex-wrap: wrap; }
  .bar-top.is-open .bar-top__links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin: 6px 0 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .bar-top.is-open .bar-top__links a { display: block; padding: 8px 0; }

  .longread--split { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 34px; }
}

@media (max-width: 520px) {
  .bar-bot__top { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .bar-top__rec { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
}
