/* ═══════════════════════════════════════════════════════════
   Стили сайта ВКСЭ.
   Блок ниже перенесён из index.html без изменений — это эталон
   стилистики, править только осознанно.
   Единственная правка: .nav-glass background был rgba(12,15,14,.8)
   (остаток зелёной схемы) → приведён к #0a0a09 текущей палитры.
   ═══════════════════════════════════════════════════════════ */

html { scroll-behavior: smooth; }
body {
  background: #0a0a09;
  color: #d4d0c7;
  font-family: 'Inter', sans-serif;
  /* hidden создаёт контейнер прокрутки и ломает position:sticky
     (оглавление стандарта переставало прилипать). clip обрезает
     так же, но контейнер не создаёт; hidden оставлен запасным
     для браузеров, не знающих clip. */
  overflow-x: hidden;
  overflow-x: clip;
  cursor: none;
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #0a0a09; }
::-webkit-scrollbar-thumb { background: #7a6038; border-radius: 2px; }

/* Custom cursor */
.cursor-dot {
  position: fixed; top: 0; left: 0; width: 6px; height: 6px;
  background: #b8935a; border-radius: 50%; pointer-events: none;
  z-index: 9999; transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, background 0.3s;
}
.cursor-ring {
  position: fixed; top: 0; left: 0; width: 40px; height: 40px;
  border: 1px solid rgba(184,147,90,0.4); border-radius: 50%;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s;
}
.cursor-ring.hover { width: 60px; height: 60px; border-color: #b8935a; }

/* Grid background */
.grid-bg {
  background-image:
    linear-gradient(rgba(184,147,90,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184,147,90,0.04) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* Noise */
.noise::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  opacity: 0.03; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Reveal */
.rv { opacity: 0; transform: translateY(60px); }
.rv.active { opacity: 1; transform: translateY(0); transition: all 1.4s cubic-bezier(0.16, 1, 0.3, 1); }
.rv-d1 { transition-delay: 0.1s; }
.rv-d2 { transition-delay: 0.2s; }
.rv-d3 { transition-delay: 0.3s; }
.rv-d4 { transition-delay: 0.4s; }
.rv-d5 { transition-delay: 0.5s; }

/* Section number */
.sec-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(6rem, 18vw, 18rem);
  line-height: 0.8;
  color: rgba(184,147,90,0.08);
  font-weight: 300;
  letter-spacing: -0.05em;
}

/* Buttons */
.btn-primary {
  background: #b8935a; color: #0a0a09;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative; overflow: hidden;
}
.btn-primary:hover {
  background: #d4d0c7; transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(184,147,90,0.3);
}
.btn-outline {
  border: 1px solid rgba(184,147,90,0.3); color: #d4d0c7;
  transition: all 0.5s ease;
}
.btn-outline:hover { border-color: #b8935a; background: rgba(184,147,90,0.08); }

/* Cards */
.card {
  border: 1px solid rgba(184,147,90,0.1);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, #b8935a, transparent);
  transform: translateX(-100%);
  transition: transform 0.8s;
}
.card:hover::before { transform: translateX(100%); }
.card:hover {
  border-color: rgba(184,147,90,0.3);
  background: rgba(26,34,32,0.6);
  transform: translateY(-8px);
}

/* Horizontal scroll */
.hscroll-wrap { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hscroll-wrap::-webkit-scrollbar { display: none; }
.hscroll-item { scroll-snap-align: start; }

/* Orbit */
@keyframes orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes orbit-r { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }
.orbit { animation: orbit 50s linear infinite; }
.orbit-r { animation: orbit-r 70s linear infinite; }
.orbit-counter { animation: orbit-r 50s linear infinite; }
.orbit-counter-r { animation: orbit 70s linear infinite; }

/* Marquee */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee { animation: marquee 40s linear infinite; }

/* Line draw */
.line-draw { width: 0; transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1); }
.line-draw.active { width: 100%; }

/* Counter */
.counter { font-variant-numeric: tabular-nums; }

/* Mobile menu */
.mob { transform: translateX(100%); transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.mob.open { transform: translateX(0); }

/* Nav */
.nav-glass { backdrop-filter: blur(20px); background: rgba(10,10,9,0.8); }

/* Hover link */
.link-u { position: relative; }
.link-u::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: #b8935a;
  transition: width 0.4s ease;
}
.link-u:hover::after { width: 100%; }

/* Doc row */
.doc-row { transition: all 0.5s ease; border-bottom: 1px solid rgba(184,147,90,0.1); }
.doc-row:hover { padding-left: 24px; background: rgba(184,147,90,0.03); border-bottom-color: rgba(184,147,90,0.4); }

/* Chip */
.chip { transition: all 0.3s ease; border: 1px solid rgba(184,147,90,0.15); }
.chip:hover, .chip.on { background: rgba(184,147,90,0.15); border-color: #b8935a; color: #b8935a; }

/* Glow */
.glow { box-shadow: 0 0 60px rgba(184,147,90,0.15); }

/* Split reveal */
.split-word { display: inline-block; overflow: hidden; }
.split-word span { display: inline-block; transform: translateY(100%); transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1); }
.split-word.active span { transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════
   Добавлено для внутренних страниц и формы заявки.
   Языком палитры выше: те же рамки rgba(184,147,90,…), тот же
   accent #b8935a, те же шрифты — новых цветов не вводится.
   ═══════════════════════════════════════════════════════════ */

/* Активный пункт меню */
.nav-active { color: #b8935a; }
.nav-active::after { width: 100% !important; }

/* Шапка внутренней страницы */
.page-head { padding-top: 180px; }

/* Модальное окно заявки */
.modal-back {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10,10,9,0.85);
  backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
}
.modal-back.open { opacity: 1; pointer-events: auto; }
.modal-box {
  transform: translateY(30px);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-back.open .modal-box { transform: translateY(0); }

/* Поля формы */
.fld {
  width: 100%;
  background: rgba(10,10,9,0.6);
  border: 1px solid rgba(184,147,90,0.15);
  color: #e8e6e1;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 14px 16px;
  transition: border-color 0.3s ease, background 0.3s ease;
  outline: none;
}
.fld::placeholder { color: #80796b; }
.fld:focus { border-color: #b8935a; background: rgba(10,10,9,0.9); }
.fld-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9f998e;
  margin-bottom: 8px;
}
textarea.fld { resize: vertical; min-height: 110px; }
.fld-err { border-color: #a05a4a; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ───────────────────────────────────────────────────────────────
   Компактные поля формы: подпись живёт внутри рамки поля, а не
   отдельной строкой над ним. На форме из пяти-шести полей отдельные
   надписи съедают экран без пользы — плейсхолдер и так объясняет
   поле, а рамка + подпись внутри достаточно её называют. Рамку и фон
   рисует .fld-wrap, а не сам .fld: иначе подпись оказалась бы либо
   поверх текста, либо со своей рамкой над рамкой поля.
   ─────────────────────────────────────────────────────────────── */
.fld-wrap {
  border: 1px solid rgba(184,147,90,0.15);
  background: rgba(10,10,9,0.6);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.fld-wrap:focus-within { border-color: #b8935a; background: rgba(10,10,9,0.9); }
.fld-wrap.fld-err { border-color: #a05a4a; }
/* Приписка внутри капса поля («— необязательно»): капс целиком
   заглавный и разрежённый, а приписке это не идёт — сбрасываем оба
   свойства локально вместо подключения двух utility-классов Tailwind,
   которых нет в собранном tailwind.css (сборка требует отдельного
   шага — см. Platform/scripts/build-css.md, здесь недоступен). */
.cap-note { text-transform: none; letter-spacing: normal; }

.fld-cap {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9f998e;
  padding: 8px 15px 0;
}
/* .fld-in переопределяет рамку/фон базового .fld — они уже нарисованы
   обёрткой. Класс идёт вторым в разметке, поэтому при равной
   специфичности побеждает как объявленный ниже по каскаду. */
.fld-in.fld {
  border: none;
  background: transparent;
  padding: 2px 15px 10px;
}
.fld-in.fld:focus { border: none; background: transparent; }
textarea.fld-in.fld { min-height: 84px; padding-top: 2px; }

/* Выпадающее подменю в шапке.
   Раскрывается наведением и фокусом с клавиатуры; padding-top у .nav-drop-menu
   создаёт «мостик», чтобы меню не закрывалось при переводе курсора вниз.
   Клавиатурный фокус ловим через :has(:focus-visible), а не :focus-within:
   клик мышью тоже ставит фокус на кнопку, и меню оставалось раскрытым при
   уходе курсора на другой пункт и при прокрутке страницы. */
.nav-drop-menu {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -8px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.nav-drop:hover .nav-drop-menu,
.nav-drop:has(:focus-visible) .nav-drop-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.nav-drop-arrow { transition: transform 0.3s ease; }
.nav-drop:hover .nav-drop-arrow,
.nav-drop:has(:focus-visible) .nav-drop-arrow { transform: rotate(180deg); }
.nav-drop-btn { cursor: inherit; background: none; border: none; font: inherit; }

/* Пасхалка: знак © в подвале.
   Намеренно неотличим от обычного текста — находится случайно.
   Единственная подсказка появляется только при наведении. */
.egg-trigger {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: inherit;
  transition: color 0.4s ease;
}
.egg-trigger:hover { color: #b8935a; }
.egg-trigger:focus-visible { outline: 1px solid #b8935a; outline-offset: 3px; }

/* ═══════════════════════════════════════════════════════════
   Страница стандарта: оглавление + текст
   ═══════════════════════════════════════════════════════════ */
.std-layout { display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media (min-width: 1024px) {
  /* Без align-items:start — иначе колонка оглавления сжимается по
     высоте содержимого, и sticky внутри неё некуда «ехать». */
  .std-layout { grid-template-columns: 320px 1fr; gap: 4rem; }
}

/* Оглавление */
.std-toc-inner { position: sticky; top: 110px; }
.std-toc-list {
  display: flex; flex-direction: column;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.std-toc-link {
  display: flex; gap: 0.75rem; align-items: baseline;
  padding: 0.5rem 0.75rem;
  font-size: 13px; line-height: 1.45;
  color: #b8b3a8; text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.std-toc-link:hover { color: #e8e6e1; background: rgba(184,147,90,0.06); }
.std-toc-link.is-active { color: #b8935a; border-left-color: #b8935a; background: rgba(184,147,90,0.08); }
.std-toc-num { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #9f998e; flex-shrink: 0; min-width: 2.2em; }
.std-toc-link.is-active .std-toc-num { color: #b8935a; }
.std-toc-l1 { font-weight: 500; }
.std-toc-l2 { padding-left: 1.75rem; font-size: 12.5px; }

/* Текст стандарта */
.std-body { min-width: 0; max-width: 78ch; }
.std-h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.15; color: #e8e6e1;
  margin: 5rem 0 2rem; padding-top: 2.5rem;
  border-top: 1px solid rgba(184,147,90,0.15);
  scroll-margin-top: 110px;
}
.std-body > .std-h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.std-h2-num {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.3em;
  color: #b8935a; margin-bottom: 1rem;
}
.std-h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem, 2.2vw, 1.95rem);
  line-height: 1.25; color: #e8e6e1;
  margin: 3.5rem 0 1.25rem;
  scroll-margin-top: 110px;
}
.std-h3-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: #b8935a;
  margin-right: 0.75rem;
}
.std-h4 {
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 600;
  color: #d4d0c7; margin: 2.5rem 0 1rem;
  scroll-margin-top: 110px;
}
.std-p { color: #b8b3a8; line-height: 1.75; margin-bottom: 1.15rem; font-size: 15.5px; }
.std-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase;
  color: #9f998e; margin: 1.75rem 0 0.75rem;
}
.std-ul, .std-ol, .std-check { margin: 0 0 1.5rem; padding: 0; list-style: none; }
.std-ul li, .std-ol li, .std-check li {
  position: relative; padding-left: 1.9rem; margin-bottom: 0.6rem;
  color: #b8b3a8; line-height: 1.7; font-size: 15px;
}
.std-ul li::before { content: '—'; position: absolute; left: 0; color: #b8935a; }
.std-ol { counter-reset: stdol; }
.std-ol li { counter-increment: stdol; }
.std-ol li::before {
  content: counter(stdol);
  position: absolute; left: 0;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #b8935a;
}
.std-check li::before {
  content: ''; position: absolute; left: 0; top: 0.45em;
  width: 12px; height: 12px;
  border: 1px solid rgba(184,147,90,0.5);
}

.std-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px; color: #d4b87a;
  background: rgba(10,10,9,0.7);
  border: 1px solid rgba(184,147,90,0.15);
  border-left: 2px solid #b8935a;
  padding: 0.9rem 1.1rem; margin: 0 0 1.5rem;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

/* Врезки */
.std-callout {
  border-left: 2px solid rgba(184,147,90,0.4);
  background: rgba(20,19,18,0.6);
  padding: 1.5rem 1.75rem; margin: 2rem 0;
}
.std-callout .std-p:last-child,
.std-callout .std-ul:last-child,
.std-callout .std-ol:last-child { margin-bottom: 0; }
.std-callout-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase;
  margin-bottom: 1rem; color: #b8935a;
}
.std-callout--proof { border-left-color: #b8935a; background: rgba(184,147,90,0.06); }
.std-callout--error { border-left-color: #a05a4a; background: rgba(160,90,74,0.07); }
.std-callout--error .std-callout-label { color: #c08070; }
.std-callout--limit { border-left-color: #7a7468; }
.std-callout--limit .std-callout-label { color: #9a9488; }
.std-callout--control { border-left-color: #c9a45c; }

.std-end {
  margin-top: 5rem; padding-top: 3rem;
  border-top: 1px solid rgba(184,147,90,0.15);
}

/* Кнопка содержания на мобильных */
.std-toc-toggle {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 45;
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  background: #b8935a; color: #0a0a09;
  border: none; cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
@media (min-width: 1024px) { .std-toc-toggle { display: none; } }

@media (max-width: 1023px) {
  .std-toc {
    position: fixed; inset: 0; z-index: 60;
    background: #0a0a09;
    padding: 5rem 1.5rem 2rem;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .std-toc.open { transform: translateY(0); }
  .std-toc-inner { position: static; }
  .std-toc-list { max-height: none; }
}

/* Уважение к системной настройке «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; }
  .orbit, .orbit-r, .orbit-counter, .orbit-counter-r, .marquee { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* На тач-устройствах кастомный курсор не нужен */
@media (hover: none), (max-width: 1024px) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}

/* ───────────────────────────────────────────────────────────────
   Читаемость на первом экране
   Блоки «Миссия / Принцип / Основано» стоят поверх фоновой
   графики героя, поэтому под текст нужна подложка: полупрозрачная
   заливка + размытие фона за ней. Без неё засечки серифа рвутся
   о контуры рисунка даже при контрастном цвете.
   ─────────────────────────────────────────────────────────────── */
.hero-aside {
  background: linear-gradient(90deg, rgba(10,10,9,0.82) 0%, rgba(10,10,9,0.55) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Заголовок героя и подзаголовок — та же задача, мягче */
.hero-shade {
  text-shadow: 0 2px 24px rgba(10,10,9,0.9), 0 1px 3px rgba(10,10,9,0.8);
}

/* ───────────────────────────────────────────────────────────────
   Образцы документов (/dokumenty)
   Текст шаблона — моноширинный, с сохранением переносов строк:
   в процессуальном документе отступы и пустые строки несут смысл,
   поэтому wrap только по длинным строкам, а не по всем подряд.
   ─────────────────────────────────────────────────────────────── */
.doc-pre {
  margin: 0;
  padding: 28px 24px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.85;
  color: #b8b3a8;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-height: 620px;
  overflow-y: auto;
}
.doc-copy { cursor: pointer; }

/* ───────────────────────────────────────────────────────────────
   FAQ-аккордеон на <details>
   Без JavaScript: раскрытие умеет сам браузер, а поисковик видит
   ответ в разметке независимо от состояния. Убираем встроенный
   треугольник и поворачиваем «+» в «×» при раскрытии.
   ─────────────────────────────────────────────────────────────── */
.faq-item summary { list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-plus { transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.faq-item[open] .faq-plus { transform: rotate(45deg); }

/* Моноширинные цифры в калькуляторах: при вводе суммы разряды
   не должны прыгать по горизонтали. */
.tabular { font-variant-numeric: tabular-nums; }
