/* dev-1c.kz — платформа интеграций 1С.
   Оформление: живая цветовая система — пять «цветов направлений», чанковые
   карточки с жёсткой тенью, маркерная подсветка в заголовках и схема,
   по которой бегут пакеты данных. */

:root {
  --ground: #f3f5ff;
  --ground-2: #e8ecff;
  --surface: #ffffff;
  --ink: #171935;
  --muted: #565c86;
  --faint: #8a90bd;
  --border: #171935;
  --line-soft: #d9dffa;
  --wire: #b4bee8;

  --c1: #e8912a;
  --c2: #2e6df6;
  --c3: #e8474f;
  --c4: #0fa77a;
  --c5: #7250f0;

  --hl-alpha: 0.32;

  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --step--1: 13.5px;
  --step-0: 16.5px;
  --step-1: 19px;
  --step-2: clamp(20px, 2vw, 24px);
  --step-3: clamp(26px, 3.2vw, 36px);
  --step-4: clamp(34px, 5.6vw, 58px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #14152e;
    --ground-2: #1c1e40;
    --surface: #1e2146;
    --ink: #f1f2ff;
    --muted: #aab0e4;
    --faint: #8288c2;
    --border: #4a4f8f;
    --line-soft: #2e3266;
    --wire: #454b8f;

    --c1: #ffc15a;
    --c2: #7aa9ff;
    --c3: #ff8087;
    --c4: #3ed9a6;
    --c5: #a894ff;

    --hl-alpha: 0.28;
  }
}

:root[data-theme="dark"] {
  --ground: #14152e;
  --ground-2: #1c1e40;
  --surface: #1e2146;
  --ink: #f1f2ff;
  --muted: #aab0e4;
  --faint: #8288c2;
  --border: #4a4f8f;
  --line-soft: #2e3266;
  --wire: #454b8f;
  --c1: #ffc15a;
  --c2: #7aa9ff;
  --c3: #ff8087;
  --c4: #3ed9a6;
  --c5: #a894ff;
  --hl-alpha: 0.28;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--ground);
  background-image: radial-gradient(var(--line-soft) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Каркас ───────────────────────────────────────────────────────── */

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 28px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid var(--border);
  background: var(--ground);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.wordmark .port {
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--c1);
  transition: transform 200ms ease, background 200ms ease;
}

.wordmark:hover .port { transform: rotate(-12deg) scale(1.12); background: var(--c3); }

.nav { display: flex; flex-wrap: wrap; gap: 6px; }

.nav a {
  padding: 7px 13px;
  border: 2px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 500;
  text-decoration: none;
  transition: color 130ms ease, background 130ms ease, border-color 130ms ease;
}

.nav a:hover { color: var(--ink); background: var(--ground-2); }

.nav a[aria-current="page"] {
  border-color: var(--border);
  background: var(--c1);
  color: #171935;
  font-weight: 600;
}

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--c5);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Типографика ──────────────────────────────────────────────────── */

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.06;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); line-height: 1.1; }
h2 { font-size: var(--step-3); line-height: 1.14; }
h3 { font-size: var(--step-1); letter-spacing: -0.012em; line-height: 1.28; }

p { margin: 0; }

/* Маркерная подсветка ключевых слов в заголовках */
.mark {
  padding: 0 0.12em;
  /* Полоса «маркера» идёт от нижней трети строчных букв до низа строки —
     при плотном межстрочном это читается как штрих маркером, а не как
     полоса поверх текста. */
  background-image: linear-gradient(transparent 60%, var(--hl) 60%, var(--hl) 92%, transparent 92%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  --hl: color-mix(in srgb, var(--c1) calc(var(--hl-alpha) * 100%), transparent);
}
.mark.m2 { --hl: color-mix(in srgb, var(--c2) calc(var(--hl-alpha) * 100%), transparent); }
.mark.m3 { --hl: color-mix(in srgb, var(--c3) calc(var(--hl-alpha) * 100%), transparent); }
.mark.m4 { --hl: color-mix(in srgb, var(--c4) calc(var(--hl-alpha) * 100%), transparent); }
.mark.m5 { --hl: color-mix(in srgb, var(--c5) calc(var(--hl-alpha) * 100%), transparent); }

.lede { max-width: 60ch; color: var(--muted); font-size: var(--step-2); line-height: 1.44; }
.prose { max-width: 66ch; display: grid; gap: 14px; color: var(--muted); }
.prose strong { color: var(--ink); font-weight: 700; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 10px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--c3);
}

/* ── Секции ───────────────────────────────────────────────────────── */

.section { padding: 54px 0; }
.section + .section { border-top: 2px dashed var(--line-soft); }

.section-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.rail { display: grid; gap: 10px; padding-top: 4px; }

.rail-no {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--c1);
  box-shadow: 4px 4px 0 var(--border);
  color: #171935;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}

.rail span:not(.rail-no) {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section.c2 .rail-no { background: var(--c2); color: #fff; }
.section.c3 .rail-no { background: var(--c3); color: #fff; }
.section.c4 .rail-no { background: var(--c4); color: #fff; }
.section.c5 .rail-no { background: var(--c5); color: #fff; }

.section-body { display: grid; gap: 22px; }

/* ── Титульный блок ───────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 46px;
  align-items: center;
  padding: 64px 0 54px;
}

.hero-text { display: grid; gap: 22px; justify-items: start; }

.hero-figure {
  border: 2px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 8px 8px 0 var(--c5);
  padding: 18px;
}

.hero-figure svg { display: block; width: 100%; height: auto; }

.figcaption {
  margin-top: 12px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* ── Кнопки ───────────────────────────────────────────────────────── */

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 2px solid var(--border);
  border-radius: 11px;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 700;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.btn-primary { background: var(--c2); color: #fff; box-shadow: 5px 5px 0 var(--border); }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: 5px 5px 0 var(--c4); }

.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--border); }
.btn-ghost:hover { box-shadow: 7px 7px 0 var(--c4); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--border); }

/* ── Карточки ─────────────────────────────────────────────────────── */

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.tile {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 22px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--c1);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.tile.c2 { box-shadow: 6px 6px 0 var(--c2); }
.tile.c3 { box-shadow: 6px 6px 0 var(--c3); }
.tile.c4 { box-shadow: 6px 6px 0 var(--c4); }
.tile.c5 { box-shadow: 6px 6px 0 var(--c5); }

.tile:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--c1); }
.tile.c2:hover { box-shadow: 9px 9px 0 var(--c2); }
.tile.c3:hover { box-shadow: 9px 9px 0 var(--c3); }
.tile.c4:hover { box-shadow: 9px 9px 0 var(--c4); }
.tile.c5:hover { box-shadow: 9px 9px 0 var(--c5); }

.tile-no {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--c1);
  color: #171935;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.tile.c2 .tile-no { background: var(--c2); color: #fff; }
.tile.c3 .tile-no { background: var(--c3); color: #fff; }
.tile.c4 .tile-no { background: var(--c4); color: #fff; }
.tile.c5 .tile-no { background: var(--c5); color: #fff; }

.tile p { color: var(--muted); font-size: var(--step--1); line-height: 1.56; }

/* ── Таблица-спецификация ─────────────────────────────────────────── */

.spec { display: grid; gap: 12px; }

.spec-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 18px;
  border: 2px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 140ms ease, transform 140ms ease;
}

.spec-row:hover { border-color: var(--c2); transform: translateX(3px); }

.spec-term {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
}

.spec-def { color: var(--muted); font-size: var(--step--1); line-height: 1.58; }
.spec-def ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 5px; }

/* ── Шаги ─────────────────────────────────────────────────────────── */

.steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: step; }

.steps li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 16px 18px;
  border: 2px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--c4);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}

.steps li:nth-child(2n)::before { background: var(--c2); }
.steps li:nth-child(3n)::before { background: var(--c5); }
.steps li:nth-child(5n)::before { background: var(--c1); color: #171935; }

.steps h3 { margin-bottom: 5px; }
.steps p { color: var(--muted); font-size: var(--step--1); }

/* ── Список-галочки ───────────────────────────────────────────────── */

.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 13px; }

.checks li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 13px;
  color: var(--muted);
  font-size: var(--step--1);
}

.checks li::before {
  content: "";
  margin-top: 4px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 5px;
  background: var(--c4);
}

.checks li:nth-child(2n)::before { background: var(--c1); }
.checks li:nth-child(3n)::before { background: var(--c3); }
.checks li:nth-child(4n)::before { background: var(--c5); }

/* ── Итоговая полоса ──────────────────────────────────────────────── */

.band {
  border: 2px solid var(--border);
  border-radius: 18px;
  background: var(--ground-2);
  box-shadow: 8px 8px 0 var(--c3);
  padding: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.band-text { display: grid; gap: 8px; max-width: 58ch; }
.band-text p { color: var(--muted); font-size: var(--step--1); }

.contact-line {
  display: grid;
  gap: 5px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

.contact-line a { color: var(--ink); font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--c2); }
.contact-line a:hover { border-bottom-color: var(--c3); }
.contact-line .label { color: var(--faint); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }

/* ── Заглушка раздела ─────────────────────────────────────────────── */

.stub {
  display: grid;
  gap: 16px;
  justify-items: start;
  max-width: 62ch;
  padding: 34px;
  border: 2px dashed var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.stub p { color: var(--muted); }

/* ── Подвал ───────────────────────────────────────────────────────── */

footer.site { border-top: 2px solid var(--border); margin-top: 20px; padding: 26px 0 42px; }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: baseline;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
}

.footer-inner a { color: var(--muted); text-decoration: none; border-bottom: 2px solid var(--line-soft); }
.footer-inner a:hover { color: var(--ink); border-bottom-color: var(--c1); }

/* ── Схема ────────────────────────────────────────────────────────── */

.dgm-wire { fill: none; stroke: var(--wire); stroke-width: 2; stroke-linecap: round; }
.dgm-box { fill: var(--surface); stroke: var(--border); stroke-width: 2; }
.dgm-hub { fill: var(--c5); stroke: var(--border); stroke-width: 2.5; }
.dgm-port { fill: var(--c1); stroke: var(--border); stroke-width: 1.5; }
.dgm-t { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; fill: var(--ink); }
.dgm-t.sub { fill: var(--faint); font-weight: 400; }
.dgm-t.hub { fill: #fff; font-size: 11.5px; }
.pk { fill: var(--c3); }
.pk-b { fill: var(--c1); }
.pk-e, .pk-g { fill: var(--c4); }
.pk-d, .pk-h { fill: var(--c2); }

/* ── Появление при загрузке ───────────────────────────────────────── */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.hero-text > *, .hero-figure { animation: rise 620ms cubic-bezier(.2,.7,.3,1) backwards; }
.hero-text > *:nth-child(1) { animation-delay: 40ms; }
.hero-text > *:nth-child(2) { animation-delay: 110ms; }
.hero-text > *:nth-child(3) { animation-delay: 180ms; }
.hero-text > *:nth-child(4) { animation-delay: 250ms; }
.hero-figure { animation-delay: 200ms; }

/* ── Адаптив ──────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding: 40px 0 36px; }
  .section-grid { grid-template-columns: 1fr; gap: 18px; }
  .rail { grid-auto-flow: column; justify-content: start; align-items: center; gap: 14px; padding-top: 0; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .section { padding: 38px 0; }
  .tiles { grid-template-columns: 1fr; }
  .spec-row { grid-template-columns: 1fr; gap: 8px; }
  .band, .stub { padding: 22px; }
  .hero-figure { box-shadow: 5px 5px 0 var(--c5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tile:hover, .btn:hover, .spec-row:hover { transform: none; }
}

/* Пакеты данных, бегущие по схеме. Путь каждого повторяет L-образную линию:
   горизонтальный участок → вертикальный → горизонтальный. Проценты кадров
   пропорциональны длине участков, чтобы скорость была постоянной. */

.pk { animation-timing-function: linear; animation-iteration-count: infinite; }

.pk-a { animation-name: pk-a; animation-duration: 3.4s; animation-delay: 0.0s; }
@keyframes pk-a {
  0%   { transform: translate(0, 0); opacity: 0; }
  9%   { opacity: 1; }
  23.4% { transform: translate(30px, 0); }
  76.6% { transform: translate(30px, 68px); }
  91%  { opacity: 1; }
  100% { transform: translate(60px, 68px); opacity: 0; }
}
.pk-b { animation-name: pk-b; animation-duration: 3.4s; animation-delay: 0.55s; }
@keyframes pk-b {
  0%   { transform: translate(0, 0); opacity: 0; }
  9%   { opacity: 1; }
  100.0% { transform: translate(60px, 0); }
  100.0% { transform: translate(60px, 0px); }
  91%  { opacity: 1; }
  100% { transform: translate(60px, 0px); opacity: 0; }
}
.pk-c { animation-name: pk-c; animation-duration: 3.4s; animation-delay: 1.05s; }
@keyframes pk-c {
  0%   { transform: translate(0, 0); opacity: 0; }
  9%   { opacity: 1; }
  23.1% { transform: translate(30px, 0); }
  76.9% { transform: translate(30px, -70px); }
  91%  { opacity: 1; }
  100% { transform: translate(60px, -70px); opacity: 0; }
}
.pk-d { animation-name: pk-d; animation-duration: 3.4s; animation-delay: 1.45s; }
@keyframes pk-d {
  0%   { transform: translate(0, 0); opacity: 0; }
  9%   { opacity: 1; }
  16.5% { transform: translate(30px, 0); }
  83.5% { transform: translate(30px, -122px); }
  91%  { opacity: 1; }
  100% { transform: translate(60px, -122px); opacity: 0; }
}
.pk-e { animation-name: pk-e; animation-duration: 3.4s; animation-delay: 1.95s; }
@keyframes pk-e {
  0%   { transform: translate(0, 0); opacity: 0; }
  9%   { opacity: 1; }
  24.2% { transform: translate(30px, 0); }
  75.8% { transform: translate(30px, -64px); }
  91%  { opacity: 1; }
  100% { transform: translate(60px, -64px); opacity: 0; }
}
.pk-f { animation-name: pk-f; animation-duration: 3.4s; animation-delay: 2.35s; }
@keyframes pk-f {
  0%   { transform: translate(0, 0); opacity: 0; }
  9%   { opacity: 1; }
  45.5% { transform: translate(30px, 0); }
  54.5% { transform: translate(30px, -6px); }
  91%  { opacity: 1; }
  100% { transform: translate(60px, -6px); opacity: 0; }
}
.pk-g { animation-name: pk-g; animation-duration: 3.4s; animation-delay: 0.85s; }
@keyframes pk-g {
  0%   { transform: translate(0, 0); opacity: 0; }
  9%   { opacity: 1; }
  26.8% { transform: translate(30px, 0); }
  73.2% { transform: translate(30px, 52px); }
  91%  { opacity: 1; }
  100% { transform: translate(60px, 52px); opacity: 0; }
}
.pk-h { animation-name: pk-h; animation-duration: 3.4s; animation-delay: 1.65s; }
@keyframes pk-h {
  0%   { transform: translate(0, 0); opacity: 0; }
  9%   { opacity: 1; }
  17.6% { transform: translate(30px, 0); }
  82.4% { transform: translate(30px, 110px); }
  91%  { opacity: 1; }
  100% { transform: translate(60px, 110px); opacity: 0; }
}
