/* ==========================================================================
   NOTARIUS-MEDIATOR.COM — ИНФОРМАЦИОННО-СПРАВОЧНЫЙ РЕСУРС
   Нотариус и Профессиональный Медиатор Кабдрахманова Диана Ерболатовна (г. Астана)
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Тёмная тема («Суверенный Кодекс») */
  --bg-sovereign: #09101D;
  --bg-sovereign-elevated: #0E182B;
  --bg-sovereign-card: #121E36;
  --bg-sovereign-glass: rgba(14, 24, 43, 0.94);

  /* Архивная бумага (Светлые секции) */
  --bg-parchment: #F5F1E8;
  --bg-parchment-elevated: #FAF8F3;
  --bg-parchment-subtle: #EAE4D6;

  /* Цвета текста */
  --text-light: #F4F1EA;
  --text-light-muted: #A9B4C7;
  --text-light-dim: #6E7D96;

  --text-ink: #111827;
  --text-ink-secondary: #374151;
  --text-ink-muted: #646E78;

  /* Акценты (Античная латунь и золото) */
  --brass-primary: #C5A059;
  --brass-light: #DFC082;
  --brass-dark: #8C6A28;
  --brass-glow: rgba(197, 160, 89, 0.16);
  --brass-hairline: rgba(197, 160, 89, 0.28);
  --brass-hairline-strong: rgba(197, 160, 89, 0.55);

  /* Линии сетки */
  --line-dark: rgba(244, 241, 234, 0.11);
  --line-paper: rgba(17, 24, 39, 0.13);

  /* Шрифты */
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Размеры */
  --container-max: 1360px;
  --header-height: 76px;
  --ease-editorial: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Сброс и полная защита от горизонтального скролла на любых смартфонах */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-sovereign);
  color: var(--text-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  position: relative;
}

.page-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  position: relative;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s var(--ease-editorial), border-color 0.25s var(--ease-editorial), background-color 0.25s var(--ease-editorial);
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

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

/* ==========================================================================
   1. ВЕРХНЯЯ ИНФОРМАЦИОННАЯ ПАНЕЛЬ
   ========================================================================== */
.registry-ribbon {
  background: #060B14;
  border-bottom: 1px solid var(--brass-hairline);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--text-light-muted);
  padding: 8px 0;
  position: relative;
  z-index: 101;
}

.registry-ribbon__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.registry-ribbon__items {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.registry-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.registry-tag__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--brass-primary);
  flex-shrink: 0;
}

.registry-ribbon__right {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

.registry-link {
  color: var(--brass-light);
  border-bottom: 1px dashed rgba(223, 192, 130, 0.4);
  padding-bottom: 1px;
}

.registry-link:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* ==========================================================================
   2. НАВИГАЦИОННАЯ ШАПКА
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  background: var(--bg-sovereign-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: background 0.3s var(--ease-editorial), box-shadow 0.3s var(--ease-editorial);
}

.site-header.is-scrolled {
  background: rgba(9, 16, 29, 0.97);
  border-bottom-color: var(--brass-hairline);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
  padding-bottom: 12px;
}

/* Мобильная полоса быстрой связи (скрыта на ПК, видна сразу в шапке на смартфонах) */
.mobile-quickbar {
  display: none;
  width: 100%;
  background: rgba(20, 107, 62, 0.16);
  border-top: 1px solid rgba(53, 194, 121, 0.3);
  padding: 7px 0;
}

.mobile-quickbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-quickbar__phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
}

.mobile-quickbar__wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #146B3E;
  color: #ffffff !important;
  border: 1px solid #35C279;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__monogram {
  width: 42px;
  height: 42px;
  border: 1px solid var(--brass-primary);
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.16), rgba(9, 16, 29, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.brand__monogram::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(197, 160, 89, 0.32);
  pointer-events: none;
}

.brand__monogram-letters {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--brass-light);
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand__title {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-light);
  line-height: 1.15;
  white-space: nowrap;
}

.brand__subtitle {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brass-primary);
  margin-top: 2px;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-nav__link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light-muted);
  position: relative;
  padding: 6px 0;
  white-space: nowrap;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--brass-primary);
  transition: width 0.3s var(--ease-editorial);
}

.site-nav__link:hover {
  color: var(--text-light);
}

.site-nav__link:hover::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-phone {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 12px;
  border-right: 1px solid var(--line-dark);
  flex-shrink: 0;
}

.header-phone__num {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
}

.header-phone__label {
  font-size: 0.68rem;
  color: var(--brass-light);
  white-space: nowrap;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: all 0.3s var(--ease-editorial);
  white-space: nowrap;
  text-align: center;
}

.btn--brass {
  background: linear-gradient(135deg, #CFA960 0%, #B38A3E 100%);
  color: #070C17;
  font-weight: 600;
  border-color: #DFC082;
}

.btn--brass:hover {
  background: linear-gradient(135deg, #DFC082 0%, #C59B4E 100%);
  transform: translateY(-1px);
}

.btn--outline-brass {
  background: rgba(197, 160, 89, 0.06);
  color: var(--brass-light);
  border-color: var(--brass-hairline-strong);
}

.btn--outline-brass:hover {
  background: rgba(197, 160, 89, 0.16);
  border-color: var(--brass-light);
  color: #fff;
  transform: translateY(-1px);
}

.btn--sm {
  padding: 9px 14px;
  font-size: 0.74rem;
}

.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--brass-hairline-strong);
  align-items: center;
  justify-content: center;
  color: var(--brass-light);
  flex-shrink: 0;
}

/* ==========================================================================
   АРХИТЕКТУРНАЯ СЕТКА И ЗАСЕЧКИ
   ========================================================================== */
.codex-frame {
  border-left: 1px solid var(--line-dark);
  border-right: 1px solid var(--line-dark);
  position: relative;
}

.section-paper .codex-frame {
  border-left-color: var(--line-paper);
  border-right-color: var(--line-paper);
}

.crosshair {
  position: absolute;
  width: 11px;
  height: 11px;
  pointer-events: none;
  z-index: 3;
}

.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background-color: var(--brass-primary);
}

.crosshair::before {
  top: 5px;
  left: 0;
  width: 11px;
  height: 1px;
}

.crosshair::after {
  top: 0;
  left: 5px;
  width: 1px;
  height: 11px;
}

.crosshair--tl { top: -6px; left: -6px; }
.crosshair--tr { top: -6px; right: -6px; }
.crosshair--bl { bottom: -6px; left: -6px; }
.crosshair--br { bottom: -6px; right: -6px; }

/* ==========================================================================
   3. ПЕРВЫЙ ЭКРАН (HERO)
   ========================================================================== */
.hero {
  position: relative;
  border-bottom: 1px solid var(--line-dark);
  background:
    radial-gradient(circle at 80% 18%, rgba(197, 160, 89, 0.1) 0%, transparent 48%),
    var(--bg-sovereign);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
}

.hero__content {
  padding: 56px 48px 56px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line-dark);
  position: relative;
  min-width: 0;
}

.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brass-light);
  padding: 6px 14px;
  border: 1px solid var(--brass-hairline);
  background: rgba(197, 160, 89, 0.06);
  width: fit-content;
  max-width: 100%;
  margin-bottom: 24px;
}

.hero__kicker-ornament {
  color: var(--brass-primary);
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2.15rem, 4vw, 3.85rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--text-light);
  margin-bottom: 22px;
}

.hero__title em {
  font-style: italic;
  color: var(--brass-light);
  font-weight: 400;
}

.hero__person-badge {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 0;
  margin-bottom: 20px;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}

.hero__person-name {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

.hero__person-role {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--brass-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero__lead {
  font-size: 1.02rem;
  line-height: 1.68;
  color: var(--text-light-muted);
  max-width: 62ch;
  margin-bottom: 30px;
}

.hero__cta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.hero__epigraph {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding-top: 24px;
  border-top: 1px solid var(--line-dark);
}

.epigraph-card {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 2px solid var(--brass-primary);
}

.epigraph-card__code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brass-primary);
  margin-bottom: 4px;
}

.epigraph-card__quote {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 1.38;
}

/* Правая колонка первого экрана */
.hero__visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  min-width: 0;
  background: linear-gradient(180deg, rgba(14, 24, 43, 0.35) 0%, rgba(9, 16, 29, 0.92) 100%);
}

.portrait-frame {
  position: relative;
  border: 1px solid var(--brass-hairline-strong);
  padding: 10px;
  background: rgba(9, 16, 29, 0.8);
}

.portrait-frame__img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 4.75;
}

.portrait-frame__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.portrait-frame__caption {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  background: rgba(9, 16, 29, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--brass-hairline-strong);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portrait-frame__caption-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

.portrait-frame__caption-sub {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--brass-light);
  margin-top: 2px;
}

.seal-emblem {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--brass-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brass-light);
  flex-shrink: 0;
  background: rgba(197, 160, 89, 0.12);
}

.hero__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-dark);
  margin-top: 18px;
  background: rgba(14, 24, 43, 0.65);
}

.hero-metric {
  padding: 14px;
  border-right: 1px solid var(--line-dark);
}

.hero-metric:last-child {
  border-right: none;
}

.hero-metric__val {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--brass-light);
  line-height: 1.1;
}

.hero-metric__lbl {
  font-size: 0.73rem;
  color: var(--text-light-muted);
  margin-top: 4px;
  line-height: 1.3;
}

/* ==========================================================================
   СЕКЦИИ И ЗАГОЛОВКИ
   ========================================================================== */
.section-dark {
  background-color: var(--bg-sovereign);
  color: var(--text-light);
  border-bottom: 1px solid var(--line-dark);
}

.section-paper {
  background-color: var(--bg-parchment);
  color: var(--text-ink);
  border-bottom: 1px solid var(--line-paper);
}

.section-pad {
  padding: 80px 40px;
  position: relative;
}

.editorial-header {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  padding-bottom: 36px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--line-dark);
  align-items: end;
}

.section-paper .editorial-header {
  border-bottom-color: var(--line-paper);
}

.marginalia {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.marginalia__index {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brass-primary);
}

.section-paper .marginalia__index {
  color: var(--brass-dark);
  font-weight: 600;
}

.marginalia__law {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-light-dim);
  line-height: 1.45;
}

.section-paper .marginalia__law {
  color: var(--text-ink-muted);
}

.editorial-header__main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.editorial-title {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.2vw, 3rem);
  font-weight: 500;
  line-height: 1.12;
}

.editorial-title em {
  font-style: italic;
  color: var(--brass-light);
}

.section-paper .editorial-title em {
  color: var(--brass-dark);
}

.editorial-subtitle {
  font-size: 1rem;
  color: var(--text-light-muted);
  max-width: 68ch;
  line-height: 1.62;
}

.section-paper .editorial-subtitle {
  color: var(--text-ink-secondary);
}

/* ==========================================================================
   4. ПЕРЕЧЕНЬ НАПРАВЛЕНИЙ (5 РАЗДЕЛОВ)
   ========================================================================== */
.codex-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding: 16px 20px;
  background: var(--bg-parchment-elevated);
  border: 1px solid var(--line-paper);
}

.codex-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.codex-tab {
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-ink-secondary);
  border: 1px solid var(--line-paper);
  background: transparent;
  transition: all 0.2s ease;
}

.codex-tab:hover {
  border-color: var(--brass-dark);
  color: var(--text-ink);
}

.codex-tab.is-active {
  background: #0F172A;
  color: #DFC082;
  border-color: #0F172A;
}

.codex-search {
  position: relative;
  flex: 1 1 220px;
  max-width: 360px;
  min-width: 0;
}

.codex-search__input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--line-paper);
  background: #fff;
  color: var(--text-ink);
  font-size: 0.86rem;
}

.codex-search__input:focus {
  outline: none;
  border-color: var(--brass-dark);
}

.codex-search__icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-ink-muted);
  pointer-events: none;
}

.codex-chapters {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.codex-chapter {
  background: var(--bg-parchment-elevated);
  border: 1px solid var(--line-paper);
  position: relative;
}

.codex-chapter__head {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 24px;
  padding: 24px 30px;
  border-bottom: 1px solid var(--line-paper);
  background: linear-gradient(90deg, rgba(197, 160, 89, 0.08) 0%, transparent 100%);
  align-items: center;
}

.codex-chapter__num-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.codex-chapter__roman {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brass-dark);
}

.codex-chapter__statute {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--text-ink-muted);
}

.codex-chapter__title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 600;
  color: var(--text-ink);
  line-height: 1.2;
}

.codex-chapter__badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 6px 12px;
  border: 1px solid rgba(140, 106, 40, 0.35);
  background: rgba(197, 160, 89, 0.1);
  color: #6E521C;
  white-space: nowrap;
  width: fit-content;
}

.codex-articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.codex-article {
  padding: 24px 30px;
  border-right: 1px solid var(--line-paper);
  border-bottom: 1px solid var(--line-paper);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.codex-article:nth-child(2n) {
  border-right: none;
}

.codex-article--full {
  grid-column: 1 / -1;
  border-right: none;
}

.codex-article__top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.codex-article__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.codex-article__clause {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--brass-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.codex-article__name {
  font-family: var(--font-serif);
  font-size: 1.26rem;
  font-weight: 600;
  color: var(--text-ink);
  line-height: 1.26;
}

.codex-article__text {
  font-size: 0.91rem;
  color: var(--text-ink-secondary);
  line-height: 1.58;
}

.platform-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.platform-pill {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 500;
  padding: 4px 10px;
  border: 1px solid rgba(17, 24, 39, 0.16);
  background: #fff;
  color: var(--text-ink);
}

.codex-article__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px dashed rgba(17, 24, 39, 0.12);
}

.codex-article__action {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #0F172A;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--brass-dark);
  padding-bottom: 2px;
}

.codex-article__action:hover {
  color: var(--brass-dark);
}

.uk-matrix {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.uk-card {
  padding: 12px;
  background: var(--bg-parchment);
  border: 1px solid var(--line-paper);
  border-top: 2px solid var(--brass-dark);
}

.uk-card__art {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: #0F172A;
  margin-bottom: 4px;
}

.uk-card__desc {
  font-size: 0.76rem;
  color: var(--text-ink-secondary);
  line-height: 1.38;
}

/* ==========================================================================
   5. ТЕМАТИЧЕСКИЙ УКАЗАТЕЛЬ РАЗДЕЛОВ
   ========================================================================== */
.navigator-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  border: 1px solid var(--brass-hairline);
  background: var(--bg-sovereign-elevated);
}

.navigator-selector {
  padding: 32px;
  border-right: 1px solid var(--line-dark);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.navigator-selector__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brass-primary);
  margin-bottom: 6px;
}

.scenario-btn {
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.22s ease;
}

.scenario-btn:hover {
  border-color: var(--brass-hairline-strong);
  background: rgba(197, 160, 89, 0.06);
}

.scenario-btn.is-active {
  border-color: var(--brass-primary);
  background: linear-gradient(90deg, rgba(197, 160, 89, 0.16) 0%, rgba(197, 160, 89, 0.04) 100%);
  box-shadow: inset 3px 0 0 var(--brass-primary);
}

.scenario-btn__num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--brass-primary);
  margin-top: 2px;
  flex-shrink: 0;
}

.scenario-btn__body {
  flex: 1;
  min-width: 0;
}

.scenario-btn__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.25;
}

.scenario-btn__sub {
  font-size: 0.79rem;
  color: var(--text-light-muted);
  margin-top: 4px;
}

.navigator-dossier {
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-sovereign-card);
  min-width: 0;
}

.dossier-stamp {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brass-light);
  padding: 5px 12px;
  border: 1px solid var(--brass-hairline-strong);
  margin-bottom: 16px;
  width: fit-content;
}

.dossier-title {
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.5vw, 2rem);
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.2;
  margin-bottom: 14px;
}

.dossier-summary {
  font-size: 0.94rem;
  color: var(--text-light-muted);
  line-height: 1.62;
  margin-bottom: 24px;
}

.dossier-checklist {
  margin-bottom: 28px;
}

.dossier-checklist__heading {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light-muted);
  margin-bottom: 12px;
}

.dossier-checklist__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dossier-checklist__list li {
  font-size: 0.89rem;
  color: var(--text-light);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.dossier-checklist__list li::before {
  content: "§";
  font-family: var(--font-serif);
  color: var(--brass-primary);
  font-weight: 600;
  flex-shrink: 0;
}

.dossier-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ==========================================================================
   6. КАРТОЧКИ СВЕДЕНИЙ И ДОКУМЕНТОВ
   ========================================================================== */
.credentials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.credential-card {
  border: 1px solid var(--line-paper);
  background: var(--bg-parchment-elevated);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.credential-card:hover {
  border-color: var(--brass-dark);
  transform: translateY(-2px);
}

.credential-card__media {
  position: relative;
  height: 280px;
  overflow: hidden;
  background: #09101D;
  border-bottom: 1px solid var(--line-paper);
}

.credential-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.credential-card__zoom {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 5px 10px;
  background: rgba(9, 16, 29, 0.88);
  border: 1px solid var(--brass-hairline-strong);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: #DFC082;
}

.credential-card__body {
  padding: 22px;
}

.credential-card__code {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brass-dark);
  margin-bottom: 6px;
}

.credential-card__title {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 600;
  color: var(--text-ink);
  margin-bottom: 6px;
  line-height: 1.25;
}

.credential-card__desc {
  font-size: 0.86rem;
  color: var(--text-ink-secondary);
  line-height: 1.55;
}

/* ==========================================================================
   7. КОНТАКТЫ, КАРТА 2ГИС И ФОРМА ОБРАЩЕНИЯ
   ========================================================================== */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  border: 1px solid var(--line-dark);
  background: var(--bg-sovereign-elevated);
}

.contacts-info {
  padding: 36px;
  border-right: 1px solid var(--line-dark);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-width: 0;
}

.contact-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.contact-item {
  padding: 16px;
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.015);
  min-width: 0;
  overflow-wrap: anywhere;
}

.contact-item--full {
  grid-column: 1 / -1;
}

.contact-item__lbl {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brass-primary);
  margin-bottom: 6px;
}

.contact-item__val {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.25;
}

.contact-item__sub {
  font-size: 0.8rem;
  color: var(--text-light-muted);
  margin-top: 4px;
}

.map-container {
  width: 100%;
  height: 280px;
  border: 1px solid var(--brass-hairline);
  position: relative;
  overflow: hidden;
  background: #0A1324;
}

.map-overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(9, 16, 29, 0.92);
  border: 1px solid var(--brass-hairline);
  border-top: none;
}

.map-overlay-bar__text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--brass-light);
}

/* Панель формы */
.dispatch-panel {
  padding: 36px;
  background: var(--bg-sovereign-card);
  min-width: 0;
}

.dispatch-panel__title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}

.dispatch-panel__sub {
  font-size: 0.88rem;
  color: var(--text-light-muted);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
  min-width: 0;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brass-light);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-dark);
  background-color: #09101D;
  color: #F4F1EA;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--brass-primary);
}

.form-control option {
  background-color: #09101D;
  color: #F4F1EA;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dispatch-panel__buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.form-note {
  font-size: 0.75rem;
  color: var(--text-light-dim);
  margin-top: 14px;
  line-height: 1.45;
}

/* ==========================================================================
   8. ПОДВАЛ САЙТА
   ========================================================================== */
.site-footer {
  background: #050911;
  border-top: 1px solid var(--brass-hairline);
  padding: 48px 0 36px;
  font-size: 0.84rem;
  color: var(--text-light-muted);
}

.site-footer__top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line-dark);
}

.site-footer__heading {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brass-light);
  margin-bottom: 12px;
}

.site-footer__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-footer__list a {
  color: var(--brass-light);
}

.site-footer__bottom {
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-light-dim);
}

/* ==========================================================================
   МОДАЛЬНОЕ ОКНО И ПЛАВАЮЩАЯ КНОПКА WHATSAPP
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 17, 0.92);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__dialog {
  max-width: 840px;
  width: 100%;
  background: var(--bg-sovereign-elevated);
  border: 1px solid var(--brass-primary);
  padding: 18px;
  position: relative;
}

.lightbox__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(9, 16, 29, 0.9);
  border: 1px solid var(--brass-primary);
  color: #DFC082;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  background: #050911;
}

.lightbox__caption {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-light);
  text-align: center;
}

.floating-dock {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 95;
}

.floating-dock__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: #146B3E;
  color: #fff;
  border: 1px solid #35C279;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.floating-dock__btn:hover {
  background: #1B874F;
}

/* Анимация появления */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease-editorial), transform 0.65s var(--ease-editorial);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ И СВЕТЛАЯ ТЕМА («ГЕРБОВАЯ БУМАГА»)
   ========================================================================== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid var(--brass-hairline-strong);
  background: rgba(197, 160, 89, 0.08);
  color: var(--brass-light);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(197, 160, 89, 0.18);
  border-color: var(--brass-primary);
}

.theme-toggle__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle__icon--moon {
  display: none;
}

html[data-theme="light"] {
  color-scheme: light;

  --bg-sovereign: #F8F5EE;
  --bg-sovereign-elevated: #FFFFFF;
  --bg-sovereign-card: #F3EFE4;
  --bg-sovereign-glass: rgba(248, 245, 238, 0.96);

  --bg-parchment: #EFEAE0;
  --bg-parchment-elevated: #FFFFFF;
  --bg-parchment-subtle: #E5DFD1;

  --text-light: #0F172A;
  --text-light-muted: #334155;
  --text-light-dim: #64748B;

  --brass-primary: #8C6A28;
  --brass-light: #745516;
  --brass-dark: #745516;
  --brass-hairline: rgba(140, 106, 40, 0.28);
  --brass-hairline-strong: rgba(140, 106, 40, 0.52);

  --line-dark: rgba(15, 23, 42, 0.13);
  --line-paper: rgba(15, 23, 42, 0.13);
}

html[data-theme="light"] .theme-toggle__icon--sun {
  display: none;
}

html[data-theme="light"] .theme-toggle__icon--moon {
  display: inline-flex;
}

html[data-theme="light"] .registry-ribbon {
  background: #EAE4D6;
  color: #334155;
}

html[data-theme="light"] .registry-link:hover {
  color: #0F172A;
  border-bottom-color: #0F172A;
}

html[data-theme="light"] .site-header.is-scrolled {
  background: rgba(248, 245, 238, 0.98);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .mobile-quickbar {
  background: rgba(20, 107, 62, 0.1);
  border-top-color: rgba(20, 107, 62, 0.25);
}

html[data-theme="light"] .brand__monogram {
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.22), #F8F5EE);
}

html[data-theme="light"] .hero {
  background:
    radial-gradient(circle at 80% 18%, rgba(197, 160, 89, 0.15) 0%, transparent 48%),
    #F8F5EE;
}

html[data-theme="light"] .hero__visual {
  background: linear-gradient(180deg, rgba(239, 234, 224, 0.5) 0%, rgba(248, 245, 238, 0.95) 100%);
}

html[data-theme="light"] .portrait-frame {
  background: #FFFFFF;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .portrait-frame__caption {
  background: rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .portrait-frame__caption-title {
  color: #0F172A;
}

html[data-theme="light"] .hero__metrics {
  background: #FFFFFF;
}

html[data-theme="light"] .btn--outline-brass:hover {
  color: #0F172A;
}

/* Выпадающий список <select> и <option> в светлой теме */
html[data-theme="light"] .form-control {
  background-color: #FFFFFF;
  color: #0F172A;
  border-color: rgba(15, 23, 42, 0.22);
}

html[data-theme="light"] .form-control option {
  background-color: #FFFFFF;
  color: #0F172A;
}

html[data-theme="light"] .map-overlay-bar {
  background: #FFFFFF;
}

html[data-theme="light"] .site-footer {
  background: #EAE4D6;
  color: #334155;
}

html[data-theme="light"] .site-footer__list a {
  color: #0F172A;
}

/* ==========================================================================
   АДАПТИВНОСТЬ (ПЛАНШЕТЫ И СМАРТФОНЫ)
   ========================================================================== */
@media (max-width: 1180px) {
  .site-nav {
    display: none;
  }

  .site-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-sovereign);
    border-bottom: 1px solid var(--brass-primary);
    padding: 20px 24px;
    gap: 14px;
    align-items: flex-start;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
    z-index: 150;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .hero__grid,
  .navigator-layout,
  .contacts-grid {
    grid-template-columns: 1fr;
  }

  .hero__content {
    border-right: none;
    border-bottom: 1px solid var(--line-dark);
    padding: 40px 28px;
  }

  .editorial-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .codex-chapter__head {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .uk-matrix {
    grid-template-columns: repeat(2, 1fr);
  }

  .credentials-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .crosshair {
    display: none;
  }

  .codex-frame {
    border-left: none;
    border-right: none;
  }

  /* На смартфоне делаем верхнюю полосу в 1 компактную строку */
  .registry-ribbon__right,
  .registry-tag--address,
  .registry-tag--cert {
    display: none;
  }

  .registry-tag {
    font-size: 0.65rem;
  }

  /* В шапке на смартфоне оставляем логотип, тему и кнопку меню в 1 ряд + нижнюю полосу быстрой связи */
  .header-phone,
  .header-cta-btn {
    display: none;
  }

  .mobile-quickbar {
    display: block;
  }

  /* Нижний плавающий блок скрываем на мобильном, т.к. кнопка WhatsApp и телефон теперь всегда закреплены в шапке */
  .floating-dock {
    display: none;
  }

  .site-header {
    min-height: auto;
  }

  .site-header__inner {
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 8px;
  }

  .brand {
    gap: 10px;
  }

  .brand__monogram {
    width: 36px;
    height: 36px;
  }

  .brand__monogram-letters {
    font-size: 1.05rem;
  }

  .brand__title {
    font-size: 1rem;
  }

  .brand__subtitle {
    font-size: 0.58rem;
  }

  .theme-toggle {
    padding: 8px 10px;
    font-size: 0.68rem;
  }

  .theme-toggle__label {
    display: none;
  }

  .section-pad {
    padding: 40px 0;
  }

  .hero__content,
  .hero__visual {
    padding: 26px 0;
  }

  .hero__title {
    font-size: 2rem;
  }

  .hero__person-name {
    font-size: 1.24rem;
  }

  .hero__cta-row .btn {
    width: 100%;
  }

  .hero__epigraph,
  .hero__metrics,
  .codex-articles-grid,
  .credentials-grid,
  .contact-list,
  .form-row,
  .site-footer__top,
  .uk-matrix {
    grid-template-columns: 1fr;
  }

  .hero-metric {
    border-right: none;
    border-bottom: 1px solid var(--line-dark);
  }

  .hero-metric:last-child {
    border-bottom: none;
  }

  .codex-toolbar {
    padding: 14px;
  }

  .codex-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .codex-tab {
    flex-shrink: 0;
  }

  .codex-search {
    max-width: 100%;
    width: 100%;
    flex: 1 1 100%;
  }

  .codex-chapter__head,
  .codex-article {
    padding: 20px 16px;
    border-right: none;
  }

  .navigator-selector,
  .navigator-dossier,
  .contacts-info,
  .dispatch-panel {
    padding: 22px 16px;
    border-right: none;
  }

  .dossier-actions .btn,
  .dispatch-panel__buttons .btn {
    width: 100%;
  }

  .portrait-frame__caption {
    position: static;
    margin-top: 10px;
  }
}
