/* Единая оболочка сайта ORA (docs/DESIGN_HISTORY.md §9б): одна шапка, один подвал, два шаблона —
   «Сцена» (сцена 60 % · панель 40 %) и «Лист» (контейнер 1280, 12 колонок, всё по левому краю).
   Подключают все страницы: SPA (главная, каталог, серия), страница сигнала, документы, «не найдено».
   Палитра — DEC-056 C (brand/ora-theme.json, tokens/). */
:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --surface: #141414;
  --panel: #1c1c1c;
  --active: #252525;
  --line: #2a2a2a;
  --fg: #f0f0f0;
  --muted: #a0a0a0;
  --label: #8a8a8a;
  --faint: #606060;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --on-accent: #ffffff;
  --danger: #f87171;
  --danger-hover: #fca5a5;
  --outline: rgba(255, 255, 255, 0.22);
  --outline-hover: rgba(255, 255, 255, 0.4);
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Noto Serif CJK SC", SimSun, serif;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --nav-h: 64px;
  --sheet-max: 1280px;
  --gutter: 32px;
  --col-gap: 24px;
  --sec-gap: 64px;
}
@media (max-width: 860px) {
  :root { --nav-h: 56px; --gutter: 16px; --col-gap: 16px; --sec-gap: 48px; }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 14px/1.45 var(--sans); }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
/* Подвал всегда внизу окна, даже у короткой страницы. */
body, #root { min-height: 100svh; display: flex; flex-direction: column; }
body > main, #root > main { flex: 1 0 auto; }
#root { min-height: 100svh; }

/* ── Шапка ─────────────────────────────────────────────────────────── */
.ora-top {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  /* содержимое шапки — по краям листа (1280 по центру), фон — во всю ширину */
  padding: 0 max(var(--gutter), calc((100% - var(--sheet-max)) / 2));
  display: flex; align-items: center; gap: 40px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.ora-top .ora-brand { display: inline-flex; align-items: center; line-height: 0; text-decoration: none; }
.ora-top .ora-brand img { display: block; height: 18px; width: auto; }
.ora-tabs { display: flex; align-items: stretch; gap: 28px; height: 100%; }
.ora-tabs a {
  position: relative; display: inline-flex; align-items: center;
  color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: color 160ms ease;
}
.ora-tabs a:hover { color: var(--fg); }
.ora-tabs a[aria-current="page"] { color: var(--fg); }
.ora-tabs a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--fg);
}
.ora-top-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.ora-lang {
  appearance: none;
  height: 36px; padding: 0 28px 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 14px center / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 9px center / 5px 5px no-repeat,
    var(--surface);
  color: var(--fg); font: 600 13px/1 var(--sans); cursor: pointer;
}
.ora-lang option { background: var(--surface); color: var(--fg); }

/* ── Кнопки ────────────────────────────────────────────────────────── */
.ora-btn {
  height: 40px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--outline); border-radius: 8px;
  background: none; color: var(--fg);
  font: 600 14px/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.ora-btn:hover { border-color: var(--outline-hover); }
.ora-btn.primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.ora-btn.primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.ora-btn.lg { height: 48px; padding: 0 24px; font-size: 15px; }

/* ── Шаблон Б «Лист» ───────────────────────────────────────────────── */
.ora-sheet {
  width: 100%; max-width: calc(var(--sheet-max) + 2 * var(--gutter));
  margin: 0 auto; padding: 0 var(--gutter);
}
.ora-page { padding-top: 48px; padding-bottom: var(--sec-gap); }
.ora-head { margin: 0 0 32px; }
.ora-head h1 {
  margin: 0; font: 700 40px/1.1 var(--display); letter-spacing: -0.02em; text-wrap: balance;
}
.ora-head p { margin: 10px 0 0; max-width: 720px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.ora-sec { margin-top: var(--sec-gap); }
.ora-sec:first-child, .ora-head + .ora-sec, .groups + .ora-sec { margin-top: 0; }
.ora-sec[id] { scroll-margin-top: calc(var(--nav-h) + 24px); }
.ora-sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin: 0 0 20px;
}
.ora-sec-head h2 { margin: 0; font: 700 24px/1.2 var(--display); letter-spacing: -0.01em; }
.ora-sec-head a { color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ora-sec-head a:hover { color: var(--fg); }

/* Текст документа: колонка 720 от левого края листа */
.ora-doc { max-width: 720px; color: #d4d4d4; font-size: 15px; line-height: 1.65; }
.ora-doc h2 { margin: 40px 0 12px; color: var(--fg); font: 700 22px/1.25 var(--display); }
.ora-doc h3 { margin: 28px 0 8px; color: var(--fg); font: 700 17px/1.3 var(--sans); }
.ora-doc p, .ora-doc ul, .ora-doc ol { margin: 0 0 14px; }
.ora-doc ul, .ora-doc ol { padding-left: 22px; }
.ora-doc li { margin: 4px 0; }
.ora-doc strong { color: var(--fg); }
.ora-doc a { color: var(--accent-hover); }
.ora-doc code { font: 13px/1 Consolas, monospace; color: var(--fg); }

/* ── Подвал ────────────────────────────────────────────────────────── */
.ora-foot { border-top: 1px solid var(--line); }
.ora-foot-row {
  min-height: 72px;
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  color: var(--muted); font-size: 13px;
}
.ora-foot-row .ora-brand { line-height: 0; }
.ora-foot-row .ora-brand img { height: 14px; width: auto; display: block; opacity: 0.8; }
.ora-foot-row a { color: var(--muted); text-decoration: none; }
.ora-foot-row a:hover { color: var(--fg); }
.ora-foot-ver { margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .ora-top { gap: 20px; }
  .ora-tabs { gap: 18px; }
  .ora-top-end .ora-btn { display: none; }
  .ora-page { padding-top: 28px; }
  .ora-head h1 { font-size: 30px; }
  .ora-sec-head h2 { font-size: 20px; }
  .ora-foot-row { gap: 16px 20px; padding-top: 20px; padding-bottom: 20px; }
  .ora-foot-row .ora-brand { width: 100%; }
  .ora-foot-ver { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
