/* stratopsis.ru · общее для трёх вариантов: шрифты по ролям, шкала текста, шапка с меню и переключателем темы,
   кнопка-сфера, метки, подвал, сцена объёма с запасным видом, облегчённый вид, просьба уменьшить движение.
   Цвета — только переменными палитры (palette-v*.css пишет scripts/palette.py); раскладка варианта — в v*.css. */

:root {
  --font-heading: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-text: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* шкала текста: от телефона 360 до экрана 1440 */
  --fs-0: clamp(.8125rem, .78rem + .12vw, .875rem);
  --fs-1: clamp(1rem, .96rem + .16vw, 1.0625rem);
  --fs-2: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  --fs-3: clamp(1.1875rem, 1.08rem + .5vw, 1.5rem);
  --fs-4: clamp(1.75rem, 1.35rem + 1.8vw, 2.75rem);
  --fs-5: clamp(2.25rem, 1.5rem + 3.4vw, 4.5rem);

  --wrap: 1240px;
  --gutter: clamp(16px, 3vw, 32px);
  --head-h: 64px;
  --radius: 16px;
  --radius-s: 10px;
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* кнопка-сфера: размеры приёма fresnel-button */
  --fb-radius: 13px;
  --fb-border: 1.4px;
  --fb-spot-size: 5px;
  --fb-spot-opacity: .55;
  --fb-spot-lap: 120s;     /* обход кромки около 5 точек в секунду: заметно, но не назойливо */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-1)/1.6 var(--font-text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
::selection { background: var(--primary-soft); color: var(--ink); }

:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink); box-shadow: 0 6px 24px rgb(0 0 0 / .18);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

.wrap { width: min(100%, var(--wrap)); margin-inline: auto; padding-inline: var(--gutter); }

/* ── Текст ── */
.st-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 var(--fs-0)/1.3 var(--font-mono);
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2);
}
.st-kicker::before {
  content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--accent);
}
.st-h1 { font: 800 var(--fs-5)/1.04 var(--font-heading); letter-spacing: -.03em; text-wrap: balance; }
.st-h2 { font: 800 var(--fs-4)/1.1 var(--font-heading); letter-spacing: -.025em; text-wrap: balance; }
.st-h3 { font: 700 var(--fs-3)/1.25 var(--font-heading); letter-spacing: -.015em; }
.st-lead { font-size: var(--fs-2); line-height: 1.55; color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }
.st-text { color: var(--ink-2); text-wrap: pretty; }
.st-num { font: 600 var(--fs-0)/1 var(--font-mono); color: var(--primary); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
/* обозначение с дефисом и числом — «ISA-95», «152-ФЗ», номер стандарта — не разрывается на конце строки */
.st-nobr { white-space: nowrap; }
/* сокращение с расшифровкой во всплывающей подсказке: тонкий пунктир снизу, курсор-вопрос */
abbr[title] {
  text-decoration: underline dotted color-mix(in srgb, var(--ink-3) 75%, transparent);
  text-decoration-thickness: 1px; text-underline-offset: .22em; cursor: help;
}

.st-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.st-tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font: 500 var(--fs-0)/1.5 var(--font-text);
  background: var(--primary-soft); color: var(--primary);
}

/* ── Шапка ── */
.st-head {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--head-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background-color .25s ease;
}
.st-head[data-scrolled] { border-bottom-color: var(--line); }
.st-head .wrap { height: 100%; display: flex; align-items: center; gap: 20px; }
.st-brand {
  display: inline-flex; align-items: center; gap: 10px; margin-right: auto;
  color: var(--ink); text-decoration: none;
  font: 800 1.1875rem/1 var(--font-heading); letter-spacing: -.02em;
}
.st-brand img { width: 34px; height: 34px; border-radius: 9px; }
.st-nav { display: flex; align-items: center; gap: 4px; }
.st-nav a {
  padding: 8px 12px; border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font: 500 .9375rem/1 var(--font-text);
  transition: color .2s ease, background-color .2s ease;
}
.st-nav a:hover { color: var(--ink); background: var(--surface-2); }
.st-nav a[aria-current="true"] { color: var(--ink); background: var(--surface-2); }
.st-head .st-btn { padding: 11px 18px; font-size: .9375rem; }

.st-iconbtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--ink-2); cursor: pointer; transition: color .2s ease, border-color .2s ease;
}
.st-iconbtn:hover { color: var(--ink); border-color: var(--line-strong); }
.st-iconbtn svg { width: 20px; height: 20px; }
/* переключатель темы: три значка в одной ячейке, виден значок текущего выбора */
.st-theme { display: inline-grid; }
.st-theme svg { grid-area: 1 / 1; opacity: 0; transform: scale(.6) rotate(-40deg); transition: opacity .25s ease, transform .35s var(--ease); }
.st-theme[data-mode="auto"] .i-auto, .st-theme[data-mode="light"] .i-light, .st-theme[data-mode="dark"] .i-dark { opacity: 1; transform: none; }

.st-menu { display: none; }
@media (max-width: 900px) {
  .st-menu { display: inline-grid; }
  .st-nav {
    position: fixed; inset: var(--head-h) 0 auto 0; z-index: 49;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 12px var(--gutter) 20px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 40px -20px rgb(0 0 0 / .35);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s ease, transform .25s var(--ease), visibility 0s linear .25s;
  }
  .st-nav a { padding: 14px 12px; font-size: 1.0625rem; border-radius: var(--radius-s); }
  .st-head[data-open] .st-nav { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
  .st-head .st-btn { display: none; }
}
@media (max-width: 380px) { .st-brand span { display: none; } }

/* ── Кнопка-сфера (приём fresnel-button): тело отражает небо и тьму, кромка светлеет к краям, по ней идёт пятно ── */
.st-btn {
  position: relative; isolation: isolate;          /* ::before с z-index:-1 ляжет над фоном, под текст */
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px; min-height: 48px;
  font: 700 1rem/1 var(--font-heading); letter-spacing: .005em; text-decoration: none; white-space: nowrap;
  color: var(--btn-ink); cursor: pointer;
  border: var(--fb-border) solid transparent; border-radius: var(--fb-radius);
  background:
    linear-gradient(180deg, var(--btn-body-top) 0%, var(--btn-body) 46%, var(--btn-body-bottom) 100%) padding-box,
    linear-gradient(180deg, var(--btn-rim) 0%, var(--btn-rim-mid) 38%, var(--btn-body) 62%, var(--btn-rim) 100%) border-box;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .28),
    inset 0 -12px 20px -12px rgb(0 0 0 / .55),
    0 10px 24px -12px color-mix(in srgb, var(--btn-body) 70%, black);
  transition: transform .14s ease, box-shadow .2s ease, filter .2s ease;
}
/* тёплый неподвижный блик — цвет созвучия */
.st-btn::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(72% 120% at 28% -12%, color-mix(in srgb, var(--btn-glint) 34%, transparent), transparent 62%);
}
@supports (offset-path: border-box) {
  .st-btn::after {
    content: ""; position: absolute; left: 0; top: 0; z-index: -1; pointer-events: none;
    width: var(--fb-spot-size); height: var(--fb-spot-size); border-radius: 50%;
    background: radial-gradient(closest-side, rgb(255 255 255 / calc(.95 * var(--fb-spot-opacity))),
      color-mix(in srgb, var(--btn-rim) 60%, transparent) 50%, transparent 100%);
    offset-path: border-box; offset-rotate: 0deg; offset-distance: 0%;
    transition: opacity .18s ease;
    animation: st-rim var(--fb-spot-lap) linear infinite;
  }
  @keyframes st-rim { from { offset-distance: 0%; } to { offset-distance: 100%; } }
  .st-btn:hover::after { opacity: 0; }
}
.st-btn:hover {
  transform: translateY(-1px); filter: brightness(1.06);
  background:
    linear-gradient(180deg, var(--btn-body-top) 0%, var(--btn-body-hover) 46%, var(--btn-body) 100%) padding-box,
    linear-gradient(180deg, var(--btn-rim) 0%, var(--btn-rim) 30%, var(--btn-rim-mid) 62%, var(--btn-rim) 100%) border-box;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .38),
    inset 0 -12px 20px -12px rgb(0 0 0 / .5),
    0 14px 30px -12px color-mix(in srgb, var(--btn-body) 70%, black),
    0 0 26px -6px color-mix(in srgb, var(--btn-glow) 60%, transparent);
}
.st-btn:active {
  transform: translateY(1px) scale(.986); filter: none;
  background:
    linear-gradient(180deg, var(--btn-body-active) 0%, var(--btn-body-active) 50%, var(--btn-body-bottom) 100%) padding-box,
    linear-gradient(180deg, var(--btn-rim-mid) 0%, var(--btn-body) 40%, var(--btn-body) 60%, var(--btn-rim-mid) 100%) border-box;
  box-shadow: inset 0 2px 9px rgb(0 0 0 / .6), 0 2px 8px -4px rgb(0 0 0 / .5);
}
.st-btn:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; }
/* второстепенная: свои правила наведения и нажатия, иначе общие перекрасили бы её в основную */
.st-btn.st-btn--ghost {
  color: var(--btn2-ink);
  background:
    linear-gradient(180deg, var(--surface) 0%, var(--btn2-body) 100%) padding-box,
    linear-gradient(180deg, var(--btn2-rim) 0%, var(--line) 50%, var(--btn2-rim) 100%) border-box;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), 0 6px 18px -12px rgb(0 0 0 / .45);
}
.st-btn.st-btn--ghost::before { display: none; }
.st-btn.st-btn--ghost:hover {
  background:
    linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%) padding-box,
    linear-gradient(180deg, var(--ink-3) 0%, var(--btn2-rim) 50%, var(--ink-3) 100%) border-box;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), 0 10px 22px -12px rgb(0 0 0 / .5);
}
.st-btn.st-btn--ghost:active {
  background:
    linear-gradient(180deg, var(--btn2-body) 0%, var(--btn2-body) 100%) padding-box,
    linear-gradient(180deg, var(--btn2-rim) 0%, var(--btn2-rim) 100%) border-box;
  box-shadow: inset 0 2px 8px rgb(0 0 0 / .25);
}
.st-btn svg { width: 18px; height: 18px; flex: none; }

/* ── Подвал ── */
.st-foot { border-top: 1px solid var(--line); padding-block: 28px 32px; color: var(--ink-3); font-size: var(--fs-0); }
.st-foot .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.st-foot .st-brand { font-size: 1rem; margin-right: 0; }
.st-foot .st-brand img { width: 26px; height: 26px; border-radius: 7px; }
.st-foot a { color: var(--ink-2); }
.st-foot__sp { margin-left: auto; }
/* ссылки на страницы направлений — своей строкой во всю ширину подвала, над знаком и почтой */
.st-foot__svc { flex: 1 1 100%; display: grid; gap: 12px; padding-bottom: 20px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.st-foot__h { font: 600 var(--fs-0)/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.st-foot__svc ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px 24px; }
.st-foot .st-foot__svc a { text-decoration: none; }
.st-foot .st-foot__svc a:hover { color: var(--ink); text-decoration: underline; }
.st-foot .st-foot__svc a[aria-current="page"] { color: var(--ink); }
.st-linkbtn {
  border: 0; padding: 4px 0; background: none; cursor: pointer; color: var(--ink-2);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
}
.st-linkbtn:hover { color: var(--ink); text-decoration-thickness: 2px; }
@media (max-width: 640px) { .st-foot__sp { margin-left: 0; width: 100%; } }

/* ── Копирование адреса: смена значка (приём uf-swap) ── */
.st-copy .uf-swap { display: inline-grid; place-items: center; }
.st-copy .uf-swap > * { grid-area: 1 / 1; transition: opacity .2s ease, transform .3s var(--ease); }
.st-copy .uf-swap > :last-child { opacity: 0; transform: rotate(-90deg) scale(.6); }
.st-copy[data-done] .uf-swap > :first-child { opacity: 0; transform: rotate(90deg) scale(.6); }
.st-copy[data-done] .uf-swap > :last-child { opacity: 1; transform: none; }

/* ── Сцена объёма ── */
.st3d { position: relative; overflow: hidden; contain: layout paint; }
.st3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.st3d__poster { position: absolute; inset: 0; pointer-events: none; transition: opacity .6s ease; }
.st3d[data-ready] .st3d__poster { opacity: 0; }
.st3d__labels { position: absolute; inset: 0; pointer-events: none; }
.st3d-label {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font: 600 .75rem/1.2 var(--font-mono); letter-spacing: .03em; color: var(--ink);
  padding: 4px 8px; border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1px solid var(--line);
  opacity: 0; transition: opacity .3s ease;
  will-change: transform;
}
.st3d-label[data-on] { opacity: 1; }
/* без WebGL или без Three.js остаётся неподвижный вид — его рисует CSS варианта */
[data-st3d="off"] .st3d canvas { display: none; }

/* ── Облегчённый вид: без размытия под шапкой и плашками, украшения стоят ── */
[data-lite] .st-head, [data-lite] .st-glass { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
[data-lite] .st-head { background: var(--bg); }
[data-lite] .st-btn::after { animation: none; opacity: 0; }

/* ── Просьба уменьшить движение: псевдоэлементы перечислены явно — «*» их не покрывает ── */
/* переходы снимаются целиком, а не укорачиваются: укороченная длительность при свойстве по умолчанию all
   превращает в переход любую правку стиля, и сценарий, который правит размер и тут же его меряет (рамка
   заголовка подбирает кегль), читал бы прежнее значение */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .st-btn, .st-btn::before, .st-btn::after { animation: none !important; transition: none !important; }
}
