/* ============================================================
   NEXORA v2 — ТЁМНЫЙ СЛОЙ (deep-black / aurora).
   Один источник для всех страниц. Подключается ПОСЛЕДНИМ в <head>
   (после inline-<style> страницы) И scoped под html.nx-dark
   → выигрывает каскад двойной страховкой (порядок + специфичность).
   Сборка: build-dark.mjs берёт светлую страницу → применяет этот слой.
   ============================================================ */

/* ---------- 4.1 Токены: deep-black палитра (override colors_and_type.css) ---------- */
html.nx-dark{
  --graphite:        #0A0A0A;  /* page bg — НЕЙТРАЛЬНЫЙ чёрный (без синевы) */
  --graphite-soft:   #0E0E0E;  /* section bg */
  --bg-deep:         #050505;  /* deepest */
  --milk:            #0A0A0A;
  --milk-2:          #141414;
  --white:           #141414;  /* card surface */
  --surface-hover:   #1C1C1C;
  --surface-elevated:#242424;
  --border:          rgba(255,255,255,0.11);
  --border-strong:   rgba(255,255,255,0.17);
  /* текст остаётся светлым (как в charcoal-базе): --fg/#F2F2EE, muted — светло-серый */
  --warm-gray:       #B4B6BD;
  --warm-gray-2:     #8E909A;
}

/* грейн чуть тише на чистом чёрном */
html.nx-dark body::before{ opacity:.38; }

/* ============================================================
   ОБЩИЕ КОМПОНЕНТЫ (шапка/футер/CTA) — красим один раз, site-wide.
   ============================================================ */

/* ---- Frosted sticky header (язык pill-навбара Versus/Resend) ---- */
html.nx-dark .site-hdr{
  background: rgba(8,8,11,0.60);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
          backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
html.nx-dark .brand .mk{ background:#151515; }

/* ---- Мобильное меню (в shared-css зашит #1E2026) ---- */
@media (max-width:768px){ html.nx-dark .site-hdr .nav-drawer{ background:#0A0A0C; } }

/* ---- Футер ---- */
html.nx-dark .site-ft{ background:#080808; }       /* был #262932 */
html.nx-dark .trust{ background: rgba(8,8,8,0.72); }

/* ---- Контактные ссылки в CTA: подняли контраст ---- */
html.nx-dark .cta-card .ft .quick a{ color: var(--fg-muted); }
html.nx-dark .cta-card .ft .quick a:hover{ color: var(--fg); border-bottom-color: rgba(255,255,255,0.35); }

/* ---- Панели: featured-кейс / CTA — нейтральный чёрный, без синевы ---- */
html.nx-dark .case-card{
  background:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    #0F0F0F;
  background-size: 28px 28px, 28px 28px, auto;
}
html.nx-dark .case-card .left .pat{ display:none; }
html.nx-dark .case-card .right{ background:transparent; }
html.nx-dark .cta-card{ background:#0F0F0F; }

/* ============================================================
   4.2 AURORA-HERO — WebGL mesh-градиент за заголовком.
   hero / a-hero / doc-hdr получают слот .nx-aurora первым ребёнком.
   ============================================================ */
/* ВНУТРЕННИЕ СТРАНИЦЫ: aurora НЕ внедряется (см. build-dark.mjs), hero
   остаётся в оригинальной светлой раскладке — выравнивание по левому краю,
   без центрирования и без gradient-text H1. Тёмная только палитра/поверхности.
   Aurora + центрирование живут ТОЛЬКО на home (index-dark.html, inline-скин). */

/* ============================================================
   4.2 3D-градиентный медальон иконки (Resend-приём, монохром-хром).
   ============================================================ */
html.nx-dark .ico3d, html.nx-dark .practice .ico{
  position:relative; isolation:isolate;
  display:inline-flex; align-items:center; justify-content:center;
  color:#F4F4F0; border:1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(66% 56% at 32% 12%, rgba(255,255,255,0.44), rgba(255,255,255,0.06) 38%, transparent 62%),
    linear-gradient(158deg, #323232 0%, #191919 52%, #0B0B0B 100%);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.34),
    inset 0 -12px 20px rgba(0,0,0,0.55),
    0 12px 26px -12px rgba(0,0,0,0.9);
}
html.nx-dark .ico3d{ width:56px; height:56px; border-radius:15px; }
html.nx-dark .ico3d::after, html.nx-dark .practice .ico::after{
  content:""; position:absolute; inset:1px; border-radius:inherit; pointer-events:none;
  background:linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 46%); opacity:.7;
}
html.nx-dark .ico3d svg, html.nx-dark .practice .ico svg{
  position:relative; z-index:1; stroke-width:1.85;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,0.22)) drop-shadow(0 -1px 1px rgba(0,0,0,0.7));
}
html.nx-dark .practice .ico{ width:54px; height:54px; border-radius:15px; }
html.nx-dark .practice .ico svg{ width:24px; height:24px; }
html.nx-dark .practice.has-tiles:hover .ico{
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.30),
    inset 0 -12px 20px rgba(0,0,0,0.5),
    0 14px 26px -12px rgba(0,0,0,0.85),
    0 0 0 5px rgba(255,255,255,0.04), 0 0 26px rgba(255,255,255,0.07);
}

/* ============================================================
   Команда (home + /team) — была сине-серой.
   ============================================================ */
html.nx-dark .team-panel{
  background:
    radial-gradient(120% 80% at 50% -14%, #171717 0%, transparent 60%),
    linear-gradient(180deg, #101010 0%, #080808 100%) !important;
}
html.nx-dark .team--panel .person .ph,
html.nx-dark .team-panel .person .ph{ background:#101010; }

/* ============================================================
   УБРАТЬ ВСЕ ФОНОВЫЕ СВЕЧЕНИЯ (сине-серые washes базы).
   ============================================================ */
html.nx-dark .hero::before,
html.nx-dark .hero .container::before,
html.nx-dark .hero-visual .glow,
html.nx-dark .cta-sec::before,
html.nx-dark .cta-card::before,
html.nx-dark .team-panel::before,
html.nx-dark .pubs--band::before,
html.nx-dark .practice::before,
html.nx-dark .practice.has-tiles::after,
html.nx-dark html::after{
  display:none !important; background:none !important;
  animation:none !important; box-shadow:none !important; opacity:0 !important;
}
/* курсор-glow — компактный (если есть .nx-spotlight на странице) */
html.nx-dark .nx-spotlight{
  width:420px; height:420px; margin:-210px 0 0 -210px;
  background: radial-gradient(circle,
    rgba(255,255,255,0.065) 0%,
    rgba(255,255,255,0.030) 30%,
    rgba(255,255,255,0) 62%);
  transition: opacity .5s var(--ease-out, ease);
}
html.nx-dark .cta, html.nx-dark .hero .btn-primary, html.nx-dark .cta-card .submit{ box-shadow:none !important; }
html.nx-dark .cta::before, html.nx-dark .hero .btn-primary::before, html.nx-dark .submit::before{ display:none !important; }

/* воздух practices→кейс на мобиле */
html.nx-dark .case-feat{ padding-top:48px; }

/* r6: статы кейса на мобайле — 3 в ряд */
@media (max-width:768px){
  html.nx-dark .case-card .stats{ grid-template-columns: repeat(3, 1fr); gap: 14px; }
  html.nx-dark .case-card .stat .v{ font-size: 21px; white-space: nowrap; }
  html.nx-dark .case-card .stat .l{ font-size: 11px; line-height: 1.3; }
}

/* ============================================================
   TRUST-WALL «Нам доверяют» (resend-стиль) — home (+опц. about).
   ============================================================ */
html.nx-dark .trust--wall{
  padding: 64px 0 66px;
  background: transparent;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}
html.nx-dark .trust--wall > .container{ max-width: 1000px; }
html.nx-dark .trust-cap{
  text-align: center; margin: 0 auto 38px; max-width: 52ch;
  font: 400 15px/1.62 var(--font-body);
  letter-spacing: 0.01em; color: var(--warm-gray);
}
html.nx-dark .trust--wall .logos{
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 22px 54px;
}
html.nx-dark .trust--wall .tlogo{
  height: 40px; width: auto; display: block;
  opacity: 0.5; transition: opacity .25s var(--ease-out, ease);
  -webkit-user-drag: none; user-select: none;
}
html.nx-dark .trust--wall .tlogo:hover{ opacity: 0.88; }
html.nx-dark .trust--wall .tlogo--emblem{ height: 50px; }
html.nx-dark .trust--wall .tlogo--tram{ height: 46px; }
html.nx-dark .trust--wall .tlogo--mark{ height: 38px; }
html.nx-dark .trust--wall .tlogo--word{ height: 22px; }
@media (max-width: 760px){
  html.nx-dark .trust--wall{ padding: 44px 0 46px; }
  html.nx-dark .trust-cap{ font-size: 14px; margin-bottom: 26px; }
  html.nx-dark .trust--wall .logos{ gap: 18px 30px; }
  html.nx-dark .trust--wall .tlogo{ height: 32px; }
  html.nx-dark .trust--wall .tlogo--emblem{ height: 40px; }
  html.nx-dark .trust--wall .tlogo--tram{ height: 36px; }
  html.nx-dark .trust--wall .tlogo--word{ height: 18px; }
}

/* ============================================================
   КРОСС-ШАБЛОННЫЕ НЕЙТРАЛИЗАТОРЫ (practice-detail / work-case /
   media-article / legal-doc / хабы). Хардкод-поверхности правит
   build-dark.mjs (background/border → deep-black). Здесь — то, что
   токен/remap не ловит: градиенты-washes, спец-бордеры, контраст.
   ============================================================ */

/* секции-альтернативы и тела статей: ровный чёрный, читаемый текст */
html.nx-dark .s,
html.nx-dark .s.alt,
html.nx-dark section.alt{ background: var(--graphite); }

/* аккордеон practice-detail (.a-card) — тёмная карточка */
html.nx-dark .a-card{ background:#141414; border:1px solid var(--border); }
html.nx-dark .a-card + .a-card{ margin-top:12px; }
html.nx-dark .a-card .answer{ color: var(--fg-muted); }

/* work-case: метрики результата */
html.nx-dark .result-sec{ background: var(--graphite-soft); }
html.nx-dark .result-sec .v,
html.nx-dark .result-sec .num{ color: var(--fg); }

/* хаб-карточки (practices / work / media) — тёмные, hover-elevated */
html.nx-dark .cards-grid > a,
html.nx-dark .practice,
html.nx-dark .work-card,
html.nx-dark .pub,
html.nx-dark .post-card{ background:#141414; border:1px solid var(--border); }
html.nx-dark .cards-grid > a:hover,
html.nx-dark .practice:hover,
html.nx-dark .work-card:hover,
html.nx-dark .pub:hover,
html.nx-dark .post-card:hover{ background:#1C1C1C; border-color: var(--border-strong); }

/* media-article: цитаты/коллауты — тёмные карточки, тело — выверенный серый */
html.nx-dark .article-section blockquote,
html.nx-dark .callout,
html.nx-dark .note{ background:#141414; border-left:3px solid var(--border-strong); color: var(--fg); }
html.nx-dark .article-section p,
html.nx-dark .doc-wrap p,
html.nx-dark article p{ color:#D7D8DC; }       /* body ≥ 4.5:1 на #0A0A0A */
html.nx-dark .article-section li,
html.nx-dark .doc-wrap li,
html.nx-dark article li{ color:#D7D8DC; }

/* legal-doc: строгий минимал */
html.nx-dark .doc-hdr{ background: var(--graphite); }
html.nx-dark .ask{ background:#141414; border:1px solid var(--border); }

/* form-sec / contacts way-cards — тёмные слоты */
html.nx-dark .form-sec{ background: var(--graphite-soft); }
html.nx-dark .way{ background:#141414; border:1px solid var(--border); }
html.nx-dark .way:hover{ background:#1C1C1C; }

/* about feature-tiles — тёмные/прозрачные плитки */
html.nx-dark .feature.has-tiles .tile,
html.nx-dark .has-tiles .tile{ background:#141414; border:1px solid var(--border); }

/* инпуты/плейсхолдеры (cta-sec / form-sec) на тёмном */
html.nx-dark input, html.nx-dark textarea, html.nx-dark select{
  background:#0E0E0E; border:1px solid var(--border); color: var(--fg);
}
html.nx-dark input::placeholder, html.nx-dark textarea::placeholder{ color: var(--warm-gray-2); }
html.nx-dark .chip, html.nx-dark .tag{ background:#141414; border:1px solid var(--border); color: var(--fg-muted); }
