/* Lyupa&Co — «инженерный чертёж»: светлая калька с сеткой + чёрные блоки,
   вертикальная рейка-меню слева, карандаш вместо курсора.
   Два акцентных цвета переключаются палитрой (data-palette на <html>). */
:root {
  --paper: #ECEEF0;
  --paper-2: #E2E5E8;
  --ink: #0B0B0C;
  --ink-2: #3A3D44;          /* графит */
  --ink-3: #5C616B;
  --line: rgba(11, 11, 12, .14);
  --grid: rgba(11, 11, 12, .055);
  --night: #0B0B0C;
  --night-2: #16171A;
  --night-fg: #F2F3F5;
  --night-dim: #A3A8B2;
  --night-line: rgba(242, 243, 245, .14);
  --night-grid: rgba(242, 243, 245, .05);
  --ok: #19C37D;
  --bad: #FF3B30;

  /* Палитра по умолчанию: «Ток» */
  --a1: #00C2FF;
  --a2: #FF4F1A;
  --a1-ink: #0B0B0C;
  --a2-ink: #0B0B0C;

  --f-logo: 'Ultra', 'Rockwell Extra Bold', Georgia, serif;
  --f-logo-2: 'Lemon', 'Ultra', Georgia, serif;
  --f-display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --f-body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'Consolas', monospace;
  /* «ГОСТ»: если положить GOST type A в assets/fonts — подхватится он, иначе Jura с наклоном */
  --f-gost: 'GOST type A', 'GOST Type A', 'GOSTtypeA', 'ISOCPEUR', 'Jura', 'Consolas', monospace;

  --rail: 92px;
  --maxw: 1240px;
  --r: 14px;
  color-scheme: light;
}
html[data-palette="laser"] { --a1: #B6F000; --a2: #6B4CFF; --a2-ink: #FFFFFF; }
html[data-palette="indigo"] { --a1: #2F5BFF; --a2: #FFC21A; --a1-ink: #FFFFFF; }

@font-face {
  font-family: 'GOST type A';
  src: local('GOST type A'), local('GOSTtypeA'), url('../fonts/GOSTtypeA.woff2') format('woff2');
  font-display: swap;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--a2); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute !important; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Карандаш-курсор ---------- */
@media (hover: hover) and (pointer: fine) {
  html.pencil-on, html.pencil-on * { cursor: none !important; }
  html.pencil-on input, html.pencil-on textarea, html.pencil-on select, html.pencil-on .smart-captcha, html.pencil-on .smart-captcha * { cursor: auto !important; }
}
.pencil {
  position: fixed; left: 0; top: 0; z-index: 9999;
  width: 44px; height: 44px; pointer-events: none;
  transform: translate3d(-100px, -100px, 0);
  will-change: transform;
}
.pencil svg { width: 100%; height: 100%; overflow: visible; display: block; }
html[data-pencil="off"] .pencil { display: none; }
.pencil-trail { position: fixed; inset: 0; pointer-events: none; z-index: 9998; }

/* Переписывание текста карандашом */
.ww { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; white-space: pre; transition: color .2s; }
.ch.g {
  font-family: var(--f-gost);
  font-style: italic;
  font-weight: 600;
  color: var(--ink-2);
  padding-right: .03em;
  animation: draw .3s ease-out;
}
.night .ch.g { color: var(--a1); }
@keyframes draw {
  from { clip-path: inset(-30% 100% -30% -30%); opacity: .4; }
  to { clip-path: inset(-30% -30% -30% -30%); opacity: 1; }
}
[data-write] { overflow-wrap: normal; }
[data-write] .ww { white-space: nowrap; }

/* ---------- Вертикальная рейка-меню ---------- */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail); z-index: 50;
  background: var(--ink); color: var(--night-fg);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 0 calc(18px + env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 0px);
  width: calc(var(--rail) + env(safe-area-inset-left, 0px));
}
.rail-mark { display: block; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; outline-offset: 4px; }
.rail-mark img { width: 100%; height: 100%; display: block; }
.rail nav { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rail nav a {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--f-display); font-weight: 600; font-size: 14px; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; padding: 18px 12px; border-radius: 10px; position: relative;
  color: var(--night-dim); transition: color .2s, background .2s;
}
.rail nav a::before {
  content: ""; position: absolute; left: 4px; top: 50%; width: 4px; height: 0; translate: 0 -50%;
  background: var(--a1); border-radius: 2px; transition: height .25s;
}
.rail nav a:hover, .rail nav a.is-active { color: var(--night-fg); }
.rail nav a.is-active::before { height: 60%; }
.rail nav a.cta { background: var(--a2); color: var(--a2-ink); margin-top: 10px; }
.rail nav a.cta::before { display: none; }
.rail-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rail-foot small { font-family: var(--f-mono); font-size: 10px; color: var(--night-dim); writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .1em; }
.pal { position: relative; }
.dot {
  display: block; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(90deg, var(--p1) 0 50%, var(--p2) 50% 100%);
  box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--night-line);
}
.pal-toggle { --p1: var(--a1); --p2: var(--a2); background: none; border: 0; padding: 7px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.pal-toggle .dot { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.pal-toggle:hover .dot, .pal-toggle[aria-expanded="true"] .dot { transform: rotate(180deg) scale(1.08); }
.pal-fly {
  position: absolute; left: calc(100% + 18px); bottom: -6px; z-index: 60;
  display: flex; gap: 6px; padding: 8px; border-radius: 16px;
  background: var(--ink); border: 1.5px solid var(--night-line); box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .5);
  opacity: 0; visibility: hidden; transform: translateX(-24px) scale(.96); transform-origin: left center;
  transition: opacity .25s, transform .4s cubic-bezier(.3, 1.4, .5, 1), visibility 0s .25s;
}
.pal-fly.open { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .4s cubic-bezier(.3, 1.4, .5, 1), visibility 0s; }
.pal-fly button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 64px; padding: 8px 6px 6px;
  background: none; border: 0; border-radius: 12px; color: var(--night-dim); cursor: pointer;
  font: 600 11px var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
  opacity: 0; transform: translateX(-12px); transition: opacity .3s, transform .4s cubic-bezier(.3, 1.5, .5, 1), background .2s, color .2s;
}
.pal-fly.open button { opacity: 1; transform: none; }
.pal-fly.open button:nth-child(2) { transition-delay: .05s; }
.pal-fly.open button:nth-child(3) { transition-delay: .1s; }
.pal-fly button .dot { width: 34px; height: 34px; }
.pal-fly button:hover { background: var(--night-2); color: var(--night-fg); }
.pal-fly button[aria-pressed="true"] { color: var(--night-fg); }
.pal-fly button[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--night-fg); }

/* Линейка прокрутки сверху */
.ruler {
  position: fixed; top: 0; left: calc(var(--rail) + env(safe-area-inset-left, 0px)); right: 0; height: 22px; z-index: 40;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 10px) bottom / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 50px) bottom / 100% 10px no-repeat,
    color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.ruler-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--a2); }
.ruler-read {
  position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: 2px; font: 600 11px/18px var(--f-mono); color: var(--ink-2);
  background: var(--paper); padding: 0 6px; border-radius: 3px; font-variant-numeric: tabular-nums;
}

/* ---------- Каркас ---------- */
main { margin-left: calc(var(--rail) + env(safe-area-inset-left, 0px)); padding-top: 22px; }
.band { position: relative; padding-block: clamp(72px, 10vw, 128px); }
.wrap {
  max-width: var(--maxw); margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px));
  position: relative;
}
.night {
  background-color: var(--night); color: var(--night-fg);
  background-image:
    linear-gradient(var(--night-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--night-grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 12px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--a2); }
.night .eyebrow { color: var(--night-dim); }
.sec-head { display: grid; gap: 18px; max-width: 820px; margin-bottom: 56px; }
.sec-head h2 { font-size: clamp(32px, 5vw, 60px); font-weight: 800; }
.sec-head p { font-size: 19px; color: var(--ink-2); max-width: 64ch; }
.night .sec-head p { color: var(--night-dim); }
.tag { font: 600 12px/1 var(--f-mono); letter-spacing: .08em; padding: 7px 10px; border-radius: 6px; border: 1px solid currentColor; display: inline-block; }
.hl { background: linear-gradient(transparent 62%, var(--a1) 62% 92%, transparent 92%); padding: 0 .08em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px;
  padding: 0 24px; border-radius: 12px; border: 2px solid var(--ink);
  font: 700 15px/1 var(--f-display); letter-spacing: .02em; text-decoration: none; cursor: pointer;
  background: var(--ink); color: var(--paper); transition: transform .15s, box-shadow .15s, background .2s;
  box-shadow: 4px 4px 0 var(--a2);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--a2); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--a2); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: 4px 4px 0 var(--a1); }
.night .btn { background: var(--night-fg); color: var(--ink); border-color: var(--night-fg); }
.night .btn.ghost { background: transparent; color: var(--night-fg); }
.btn svg { width: 18px; height: 18px; }

/* ---------- Логотип 2.6 ---------- */
.logo { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink); user-select: none; }
.logo-mark { display: flex; align-items: center; line-height: 1; }
.logo-mark .l, .logo-mark .o { font-family: var(--f-logo); font-size: var(--logo-size, 150px); }
.logo-mark .amp {
  position: relative; z-index: 1; margin: 0 calc(var(--logo-size, 150px) * -.18);
  transform: translateY(calc(var(--logo-size, 150px) * .095)) rotate(-6deg);
  background: var(--ink); color: var(--paper); border: calc(var(--logo-size, 150px) * .026) solid var(--paper);
  border-radius: calc(var(--logo-size, 150px) * .085);
  padding: calc(var(--logo-size, 150px) * .02) calc(var(--logo-size, 150px) * .095) calc(var(--logo-size, 150px) * .063);
  font-family: var(--f-logo-2); font-size: calc(var(--logo-size, 150px) * .37); line-height: 1;
  transition: transform .4s cubic-bezier(.3, 1.6, .5, 1);
}
.logo:hover .logo-mark .amp { transform: translateY(calc(var(--logo-size, 150px) * .095)) rotate(6deg) scale(1.06); }
.logo-word { font-family: var(--f-logo-2); font-size: calc(var(--logo-size, 150px) * .125); letter-spacing: .33em; padding-left: .33em; }

/* ---------- Hero ---------- */
.hero { padding-block: 64px 40px; overflow: hidden; }
.hero canvas.net { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.hero-text { display: grid; gap: 26px; position: relative; }
.hero .logo { --logo-size: clamp(86px, 11vw, 150px); justify-self: start; }
.hero h1 { font-size: clamp(34px, 5.2vw, 68px); font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--ink); background: var(--a1); padding: 0 .14em; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; color: var(--a1-ink); }
.hero-lead { font-size: 20px; color: var(--ink-2); max-width: 54ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-hint { font: 500 13px/1.4 var(--f-mono); color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.hero-hint svg { width: 22px; height: 22px; flex: none; }

.term {
  background: var(--night); color: var(--night-fg); border-radius: var(--r); overflow: hidden;
  box-shadow: 10px 10px 0 var(--a1), 0 30px 60px -20px rgba(0, 0, 0, .45);
  font: 13px/1.7 var(--f-mono); position: relative; min-width: 0;
}
.term-top { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--night-line); color: var(--night-dim); font-size: 12px; }
.term-top i { width: 11px; height: 11px; border-radius: 50%; background: var(--night-line); display: block; }
.term-top i:first-child { background: var(--a2); }
.term-top span { margin-left: auto; }
.term-body { padding: 16px 18px 20px; min-height: 300px; white-space: pre-wrap; overflow-wrap: anywhere; }
.term-body .ok { color: var(--ok); }
.term-body .acc { color: var(--a1); }
.term-body .dim { color: var(--night-dim); }
.term-body .cur { display: inline-block; width: 8px; height: 15px; background: var(--a1); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cad { position: absolute; left: 24px; bottom: -8px; font: 600 11px var(--f-mono); color: var(--ink-3); font-variant-numeric: tabular-nums; display: flex; gap: 14px; }

/* Бегущая строка */
.ticker { background: var(--a1); color: var(--a1-ink); border-block: 2px solid var(--ink); overflow: hidden; padding-block: 14px; }
.ticker-track { display: flex; gap: 40px; width: max-content; animation: tick 38s linear infinite; font: 800 20px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.ticker-track span { display: inline-flex; align-items: center; gap: 40px; }
.ticker-track span::after { content: ""; width: 12px; height: 12px; background: var(--ink); transform: rotate(45deg); display: block; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- Услуги ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 0; border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); }
.svc {
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  padding: 28px 26px 26px; display: flex; flex-direction: column; gap: 14px; min-height: 300px;
  position: relative; background: var(--paper); transition: background .25s;
  overflow: hidden;
}
.svc::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border: 2px dashed var(--line); border-radius: 50%;
  transition: transform .6s;
}
.svc:hover { background: #fff; }
.svc:hover::after { transform: rotate(180deg) scale(1.3); border-color: var(--a1); }
.svc-ico { width: 48px; height: 48px; color: var(--ink); }
.svc-ico svg { width: 100%; height: 100%; }
.svc h3 { font-size: 21px; font-weight: 700; }
.svc p { color: var(--ink-2); font-size: 16px; flex: 1; }
.svc .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.svc .tags > span { font: 600 11px/1 var(--f-mono); padding: 6px 8px; background: var(--paper-2); border-radius: 5px; }
.svc-go {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font: 700 14px var(--f-display); background: none; border: 0; border-bottom: 2px solid var(--a2); padding: 0 0 2px; cursor: pointer; color: var(--ink);
}
.svc-go svg { width: 18px; transition: transform .2s; }
.svc-go:hover svg { transform: translateX(5px); }

/* ---------- Конструктор бизнес-процессов ---------- */
.bp { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.bp-side { display: grid; gap: 18px; position: sticky; top: 40px; }
.bp-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--night-line); background: transparent; color: var(--night-fg);
  font: 600 13px var(--f-body); cursor: pointer; transition: background .2s, color .2s;
}
.chip[aria-pressed="true"], .chip:hover { background: var(--night-fg); color: var(--ink); }
.bp-palette { display: grid; gap: 8px; }
.bp-palette h3, .bp-side h3 { font: 600 12px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--night-dim); }
.blk-src {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
  min-height: 46px; padding: 8px 12px; border-radius: 10px; border: 1.5px dashed var(--night-line);
  background: var(--night-2); color: var(--night-fg); font: 600 14px var(--f-body); cursor: grab; transition: border-color .2s, transform .2s;
}
.blk-src:hover { border-color: var(--a1); transform: translateX(4px); }
.blk-src .k, .blk .k { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; color: var(--ink); font: 800 13px var(--f-mono); }
.k-trigger { background: var(--a1); }
.k-cond { background: #FFD24A; }
.k-act { background: var(--night-fg); }
.k-ai { background: var(--a2); color: var(--a2-ink) !important; }
.k-end { background: var(--ok); }

.bp-stage {
  background: var(--night-2); border: 1.5px solid var(--night-line); border-radius: var(--r);
  min-height: 520px; position: relative; overflow: hidden; display: flex; flex-direction: column; min-width: 0;
}
.bp-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--night-line); }
.bp-bar .title { font: 600 13px var(--f-mono); color: var(--night-dim); margin-right: auto; }
.bp-bar button { min-height: 40px; }
.run-btn { background: var(--a1); color: var(--a1-ink); border: 0; border-radius: 10px; padding: 0 16px; font: 700 14px var(--f-display); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.run-btn svg { width: 16px; height: 16px; }
.clr-btn { background: transparent; color: var(--night-dim); border: 1.5px solid var(--night-line); border-radius: 10px; padding: 0 14px; font: 600 13px var(--f-body); cursor: pointer; }
.bp-canvas {
  flex: 1; position: relative; padding: 28px 20px 40px; overflow-x: auto;
  background-image: radial-gradient(var(--night-line) 1px, transparent 1px); background-size: 20px 20px;
}
.bp-flow { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 0; width: min(440px, 100%); }
.bp-flow li { width: 100%; display: flex; flex-direction: column; align-items: center; }
.bp-flow li + li::before {
  content: ""; width: 2px; height: 30px; display: block;
  background: repeating-linear-gradient(var(--night-dim) 0 5px, transparent 5px 9px);
}
.blk {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--night); border: 1.5px solid var(--night-line); color: var(--night-fg); position: relative;
  cursor: grab; transition: border-color .2s, box-shadow .3s, transform .2s;
  animation: pop .35s cubic-bezier(.3, 1.5, .5, 1);
}
@keyframes pop { from { transform: scale(.85); opacity: .3; } }
.blk.dragging { opacity: .4; }
.blk.drop-before { box-shadow: 0 -4px 0 var(--a1); }
.blk.active { border-color: var(--a1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 30%, transparent), 0 0 40px -6px var(--a1); transform: scale(1.03); }
.blk.done { border-color: var(--ok); }
.blk-t { display: grid; gap: 2px; min-width: 0; flex: 1; }
.blk-t b { font: 700 14px var(--f-body); }
.blk-t small { font: 12px/1.4 var(--f-mono); color: var(--night-dim); }
.blk-x { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--night-dim); cursor: pointer; font-size: 18px; flex: none; }
.blk-x:hover { background: var(--night-line); color: var(--night-fg); }
.bp-empty { text-align: center; color: var(--night-dim); font: 14px var(--f-mono); padding: 60px 10px; }
.bp-log { border-top: 1px solid var(--night-line); padding: 12px 16px; font: 12.5px/1.6 var(--f-mono); color: var(--night-dim); min-height: 52px; }
.bp-log b { color: var(--a1); font-weight: 600; }
.bp-token {
  position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--a1); pointer-events: none;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--a1) 25%, transparent), 0 0 24px var(--a1); opacity: 0; transition: left .45s cubic-bezier(.6, 0, .3, 1), top .45s cubic-bezier(.6, 0, .3, 1), opacity .2s;
}

/* ---------- Облако vs Коробка ---------- */
.cmp { display: grid; gap: 28px; }
.switch {
  display: inline-grid; grid-template-columns: 1fr 1fr; position: relative; border: 2px solid var(--ink); border-radius: 999px; padding: 4px; width: min(460px, 100%);
  background: var(--paper);
}
.switch button { position: relative; z-index: 1; min-height: 48px; border: 0; background: none; font: 700 15px var(--f-display); cursor: pointer; color: var(--ink); border-radius: 999px; transition: color .3s; }
.switch button[aria-pressed="true"] { color: var(--paper); }
.switch .knob { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--ink); transition: transform .45s cubic-bezier(.5, 1.6, .4, 1); }
.switch[data-v="box"] .knob { transform: translateX(100%); }
.cmp-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(260px, 30%), 1fr)); gap: 14px; }
.cmp-row { border: 2px solid var(--ink); border-radius: var(--r); padding: 20px; background: #fff; display: grid; gap: 10px; align-content: start; }
.cmp-row dt { font: 600 12px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.cmp-row dd { margin: 0; font-size: 17px; font-weight: 600; min-height: 3.2em; }
.cmp-meter { height: 8px; background: var(--paper-2); border-radius: 4px; overflow: hidden; }
.cmp-meter i { display: block; height: 100%; background: var(--a2); width: 50%; transition: width .7s cubic-bezier(.5, 1.4, .5, 1); }
.cmp-meter + small { font: 12px var(--f-mono); color: var(--ink-3); }
.cmp-verdict { font-size: 18px; max-width: 70ch; padding: 20px 24px; border-left: 0; background: var(--ink); color: var(--paper); border-radius: var(--r); }

/* ---------- ИИ в закрытом контуре ---------- */
.ai { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; align-items: center; }
.ai-diagram { position: relative; aspect-ratio: 1 / .82; max-width: 100%; border: 1.5px solid var(--night-line); border-radius: var(--r); background: var(--night-2); overflow: hidden; }
.ai-diagram canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ai-mode { display: flex; gap: 8px; flex-wrap: wrap; position: absolute; left: 14px; top: 14px; z-index: 2; }
.ai-legend { position: absolute; left: 14px; bottom: 12px; right: 14px; z-index: 2; font: 12px/1.5 var(--f-mono); color: var(--night-dim); }
.ai-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--night-line); }
.ai-list li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--night-line); }
.ai-list svg { width: 28px; height: 28px; color: var(--a1); }
.ai-list b { display: block; font-family: var(--f-display); font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.ai-list span { color: var(--night-dim); font-size: 15.5px; }

/* ---------- Безопасность ---------- */
.sec { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.rings { position: relative; aspect-ratio: 1; width: 100%; max-width: 520px; justify-self: center; }
.rings svg { width: 100%; height: 100%; overflow: visible; }
.ring { fill: none; stroke: var(--ink); stroke-width: 2; cursor: pointer; transition: stroke .2s, stroke-width .2s; }
.ring-hit { fill: transparent; stroke: transparent; stroke-width: 34; cursor: pointer; }
.ring.on { stroke: var(--a2); stroke-width: 5; }
.ring-dash { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 7; transform-origin: 260px 260px; animation: spin 40s linear infinite; }
.ring-dash.r2 { animation-duration: 60s; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.ring-lbl { font: 700 13px var(--f-mono); fill: var(--ink); letter-spacing: .06em; pointer-events: none; }
.core { fill: var(--ink); }
.core-t { font: 400 34px var(--f-logo); fill: var(--paper); }
.sat { fill: var(--a1); stroke: var(--ink); stroke-width: 2; }
.layer-card { border: 2px solid var(--ink); border-radius: var(--r); background: #fff; padding: 28px; display: grid; gap: 14px; min-height: 330px; align-content: start; box-shadow: 8px 8px 0 var(--a1); }
.layer-card h3 { font-size: 26px; }
.layer-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.layer-card li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.layer-card li::before { content: ""; width: 10px; height: 10px; margin-top: 8px; background: var(--a2); transform: rotate(45deg); }
.layer-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.layer-tabs button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; font: 600 13px var(--f-body); cursor: pointer; color: var(--ink); }
.layer-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.law { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 48px; }
.law div { border-top: 2px solid var(--ink); padding-top: 14px; display: grid; gap: 6px; }
.law b { font-family: var(--f-display); font-size: 16px; }
.law span { color: var(--ink-2); font-size: 15px; }

/* ---------- Проекты ---------- */
.proj-scroller { position: relative; display: flex; gap: 20px; overflow-x: auto; padding-bottom: 20px; scroll-snap-type: x mandatory; cursor: grab; scrollbar-width: thin; }
.proj-scroller.drag { cursor: grabbing; scroll-snap-type: none; }
.proj {
  flex: 0 0 min(400px, 82vw); scroll-snap-align: start; border-radius: var(--r); background: var(--night-2); border: 1.5px solid var(--night-line);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .3s;
}
.proj:hover { transform: translateY(-6px); }
.proj-vis { height: 190px; position: relative; overflow: hidden; border-bottom: 1px solid var(--night-line); }
.proj-vis canvas { width: 100%; height: 100%; display: block; }
.proj-vis .tag { position: absolute; left: 14px; top: 14px; color: var(--night-fg); background: var(--night); }
.proj-b { padding: 22px; display: grid; gap: 10px; }
.proj-b h3 { font-size: 20px; }
.proj-b p { color: var(--night-dim); font-size: 15.5px; }
.proj-b dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 6px 0 0; font: 13px var(--f-mono); }
.proj-b dt { color: var(--night-dim); }
.proj-b dd { margin: 0; color: var(--a1); }
.proj-note { font: 12px var(--f-mono); color: var(--night-dim); margin-top: 6px; }

/* ---------- О нас ---------- */
.about { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
.person { border: 2px solid var(--ink); border-radius: var(--r); background: #fff; overflow: hidden; }
.person-photo { aspect-ratio: 4 / 3.4; background: var(--paper-2); display: grid; place-items: center; position: relative; overflow: hidden; }
.person-photo .logo { --logo-size: 96px; }
.person-photo::after { content: "[ФОТО]"; position: absolute; right: 12px; bottom: 10px; font: 600 11px var(--f-mono); color: var(--ink-3); }
.person-b { padding: 22px; display: grid; gap: 6px; border-top: 2px solid var(--ink); }
.person-b b { font-family: var(--f-display); font-size: 20px; }
.person-b span { color: var(--ink-2); font-size: 15px; }
.about-text { display: grid; gap: 18px; font-size: 18px; }
.steps { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 0; counter-reset: s; position: relative; }
.steps::before { content: ""; position: absolute; left: 21px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.steps .prog { position: absolute; left: 21px; top: 10px; width: 2px; height: 0; background: var(--a2); transition: height .2s linear; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 12px 0; position: relative; }
.steps li::before {
  content: counter(s, decimal-leading-zero); width: 44px; height: 44px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink);
  display: grid; place-items: center; font: 700 13px var(--f-mono); position: relative; z-index: 1; transition: background .3s, color .3s;
}
.steps li.lit::before { background: var(--ink); color: var(--paper); }
.steps b { font-family: var(--f-display); font-weight: 600; font-size: 18px; display: block; margin-top: 8px; }
.steps span { color: var(--ink-2); font-size: 15.5px; }

/* ---------- Форма ---------- */
.order { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 56px; align-items: start; }
.order-side { display: grid; gap: 22px; }
.order-side h2 { font-size: clamp(36px, 5.5vw, 72px); font-weight: 800; }
.contacts { display: grid; gap: 10px; font: 15px var(--f-mono); color: var(--night-dim); }
.contacts a { color: var(--night-fg); }
.form { background: var(--night-fg); color: var(--ink); border-radius: var(--r); padding: clamp(20px, 3vw, 36px); display: grid; gap: 18px; box-shadow: 12px 12px 0 var(--a2); position: relative; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font: 600 12px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; border: 2px solid var(--ink); border-radius: 10px; padding: 12px 14px; background: #fff; color: var(--ink);
  font: 500 16px var(--f-body); transition: box-shadow .2s;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: 4px 4px 0 var(--a1); }
.field.full { grid-column: 1 / -1; }
.svc-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.svc-pick label { position: relative; }
.svc-pick input { position: absolute; opacity: 0; inset: 0; }
.svc-pick span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 999px; font: 600 13px var(--f-body); cursor: pointer; transition: background .2s, color .2s; }
.svc-pick input:checked + span { background: var(--ink); color: var(--paper); }
.svc-pick input:focus-visible + span { outline: 3px solid var(--a2); outline-offset: 2px; }
.consent { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 14px; color: var(--ink-2); align-items: start; }
.consent input { width: 22px; height: 22px; accent-color: var(--ink); margin: 1px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font: 600 14px var(--f-mono); min-height: 1.4em; }
.form-status.ok { color: #0A7A4B; }
.form-status.err { color: #C4261D; }
.form .btn { justify-self: start; }
.form.sent .fgrid, .form.sent .consent, .form.sent .btn { opacity: .35; pointer-events: none; }

footer { padding-block: 40px; border-top: 2px solid var(--ink); margin-left: calc(var(--rail) + env(safe-area-inset-left, 0px)); }
@media (max-width: 760px) { footer { margin-left: 0; padding-bottom: 100px; } }
footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; font: 13px var(--f-mono); color: var(--ink-3); }
footer .logo { --logo-size: 54px; }

/* Аккуратные «чертёжные» уголки */
.corners { position: relative; }
.corners::before, .corners::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--a2); pointer-events: none; }
.corners::before { left: -10px; top: -10px; border-right: 0; border-bottom: 0; }
.corners::after { right: -10px; bottom: -10px; border-left: 0; border-top: 0; }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .hero .wrap, .ai, .sec, .about, .order { grid-template-columns: minmax(0, 1fr); }
  .bp { grid-template-columns: minmax(0, 1fr); }
  .bp-side { position: static; }
  .bp-palette { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}
@media (max-width: 760px) {
  :root { --rail: 0px; }
  body { font-size: 16px; }
  .rail {
    inset: auto 0 0 0; width: 100%; height: auto; flex-direction: row; padding: 8px max(10px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  }
  .rail-mark { width: 40px; height: 40px; flex: none; }
  .rail nav { flex-direction: row; gap: 2px; flex: 1; justify-content: center; }
  .rail nav a { writing-mode: horizontal-tb; transform: none; padding: 10px 8px; font-size: 11px; letter-spacing: .04em; }
  .rail nav a.cta { margin: 0 0 0 4px; }
  .rail nav a::before { display: none; }
  .rail-foot small { display: none; }
  .pal-toggle { padding: 4px; }
  .pal-toggle > .dot { width: 24px; height: 24px; }
  .pal-fly { left: auto; right: -4px; bottom: calc(100% + 14px); transform: translateY(16px) scale(.96); transform-origin: bottom right; }
  .ruler { left: 0; }
  main { margin-left: 0; padding-bottom: 70px; }
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .fgrid { grid-template-columns: minmax(0, 1fr); }
  .term-body { min-height: 230px; font-size: 12px; }
  .ticker-track { font-size: 16px; }
  .cad { display: none; }
}
@media (max-width: 440px) {
  .pal-fly button { min-width: 56px; }
  .rail nav a { padding: 10px 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Картинки, загруженные в админке */
.proj-vis img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person-photo.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person-photo.has-photo::after { display: none; }
.smart-captcha { min-height: 102px; }
