@import url("../fonts/fonts.css");

/* =========================================================
   RISEA Group — схема линий
   Чёрное поле — материал. Один цвет, четыре тира яркости.
   Геометрия только 45°/90°. Глубина только перекрытием.
   ========================================================= */

:root {
  /* ground */
  --ink: #000000;
  --ink-raise: #070b0b;   /* перекрывающая плоскость, не тень */
  --ink-deep: #040707;

  /* accent — снят пипеткой с логотипа */
  --cy: #1ad5cc;
  --cy-bright: #17d9d8;
  --cy-t2: #14a8a1;   /* 7.15:1 on black — route codes, small labels */
  --cy-t3: #0e7b76;   /* inactive rules and ticks, never a route */

  /* rules, hairlines */
  --rule: #12211f;
  --rule-strong: #1c3532;

  /* text */
  --fg: #f2f7f6;
  --fg-2: #9baba9;
  --fg-3: #849392;   /* поднят с #6e7d7c: на пике плавающего поля даёт 4.5:1 */

  --step: 8px;
  --gutter: clamp(20px, 5vw, 72px);
  --maxw: 1280px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: "Golos Text", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

/* --- browser surfaces carry the design too --- */
::selection { background: var(--cy); color: var(--ink); }
::-moz-selection { background: var(--cy); color: var(--ink); }

* { scrollbar-width: thin; scrollbar-color: var(--cy-t3) var(--ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--cy-t3); }
::-webkit-scrollbar-thumb:hover { background: var(--cy-t2); }

:focus-visible {
  outline: 2px solid var(--cy-bright);
  outline-offset: 3px;
}

a {
  color: var(--cy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

h1, h2, h3 {
  font-family: "Unbounded", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.06;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; }
/* the UA sheet gives <figure> margin: 1em 40px — it was quietly
   inset the hero diagram by 40px on each side */
figure, figcaption { margin: 0; }

/* label — the system's small tracked caps */
.lbl {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--cy);
  color: var(--ink);
  padding: 12px 20px;
  font-weight: 600;
}
.skip:focus { left: 0; }

/* =========================================================
   Header
   ========================================================= */

.hdr {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ink);
  border-bottom: 1px solid var(--rule);
}

.hdr__in {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cy);
  text-decoration: none;
  margin-right: auto;
}
.brand svg { width: 30px; height: auto; display: block; }
.brand__name {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--fg);
  text-transform: uppercase;
}

.nav { display: none; gap: 28px; }
@media (min-width: 760px) { .nav { display: flex; } }
.nav a {
  font-size: 13px;
  color: var(--fg-2);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s var(--ease);
}
.nav a:hover { color: var(--cy); }

/* =========================================================
   Buttons — the station marker vocabulary
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--cy);
  background: var(--cy);
  color: var(--ink);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { background: var(--cy-bright); }

.btn--ghost {
  background: transparent;
  color: var(--cy);
}
.btn--ghost:hover { background: var(--cy); color: var(--ink); }

.btn--sm { padding: 9px 16px; font-size: 11px; }

.btn svg { width: 14px; height: 14px; flex: none; }

/* =========================================================
   Position rail — the route always says where you are
   ========================================================= */

.rail {
  position: fixed;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: none;
  flex-direction: column;
  gap: 0;
}

.rail__item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  position: relative;
  padding: 11px 0;
}
.rail__item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  bottom: -50%;
  width: 1px;
  background: var(--rule-strong);
}
.rail__item:last-child::before { display: none; }

.rail__dot {
  width: 9px;
  height: 9px;
  border: 1px solid var(--cy-t3);
  background: var(--ink);
  position: relative;
  z-index: 1;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.rail__txt {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}
.rail:hover .rail__txt { opacity: 1; transform: none; }

.rail__item[aria-current="true"] .rail__dot { background: var(--cy); border-color: var(--cy); }
.rail__item[aria-current="true"] .rail__txt { color: var(--cy); }

@media (min-width: 1240px) { .rail { display: flex; } }

/* =========================================================
   Hero
   ========================================================= */

.hero { padding: clamp(30px, 4vw, 54px) 0 clamp(44px, 5vw, 72px); }

.hero__stage { display: grid; gap: clamp(28px, 3.4vw, 44px); }

@media (min-width: 1000px) {
  /* one plate: the figure fills the stage, the headline occupies the empty
     lower-left the route geometry deliberately leaves open */
  .hero__stage { gap: 0; }
  .hero__stage > * { grid-area: 1 / 1; }
  .hero__head {
    align-self: end;
    justify-self: start;
    /* the route geometry keeps the left 41% of the frame empty at every
       height, so the headline can never meet a label */
    max-width: min(41%, 540px);
    padding-bottom: 1%;
    position: relative;
    z-index: 2;
  }
}

/* headline width is set by the stage, not by a ch cap */

.hero h1 {
  font-size: clamp(2rem, 3.3vw, 3.1rem);
  letter-spacing: -0.045em;
  /* the break is authored with <br>; balancing fights it into four lines */
  text-wrap: normal;
}
.hero h1 em {
  font-style: normal;
  color: var(--cy);
}

.hero__sub {
  margin-top: 18px;
  max-width: 62ch;
  font-size: clamp(15px, 1.5vw, 18px);
  color: var(--fg-2);
  line-height: 1.55;
}

.hero__note {
  margin-top: 18px;
  font-size: 12px;
  color: var(--fg-3);
  letter-spacing: 0.01em;
}
.fan__origin-note {
  font-family: "Golos Text", system-ui, sans-serif;
  font-size: 15px;
  fill: var(--fg-3);
}

.hero__fig { min-width: 0; }
.hero__fig .lbl { display: block; margin-bottom: 16px; }
/* keep the figure's caption over the diagram, not stacked above the headline
   where it would read as an eyebrow */
@media (min-width: 1000px) { .hero__fig .lbl { margin-left: 43%; } }

/* --- the diagram --- */

.fan { display: block; width: 100%; height: auto; overflow: visible; }
.fan--desk { display: none; }
/* the trunk diagram is drawn for a phone; let it scale up to a tablet and it
   becomes a billboard, so it stops growing at its natural size */
.fan--mob { max-width: 460px; }

@media (min-width: 900px) {
  .fan--desk { display: block; }
  .fan--mob { display: none; }
}

.fan__line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fan__line { stroke: var(--cy); stroke-width: 4; }
.fan__line[data-dash="1"] { stroke-dasharray: 18 10; }


.fan__label svg { color: var(--cy); }
.fan__txt {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.01em;
  fill: var(--fg);
}
.fan__code {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  fill: var(--cy-t2);
}

.fan__origin { fill: var(--cy); }
.fan__origin-txt {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  fill: var(--ink);
}
.fan__origin-lbl {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.18em;
  fill: var(--fg-3);
}

.fan__a { text-decoration: none; }
.fan__origin-a .fan__origin { transition: fill 0.2s var(--ease); }
.fan__origin-a:hover .fan__origin { fill: var(--cy-bright); }
.fan__origin-a:focus-visible { outline: 2px solid var(--cy-bright); outline-offset: 2px; }
.fan__a:hover .fan__txt { fill: var(--cy); }
.fan__a:hover .fan__code { fill: var(--cy); }
.fan__a:focus-visible { outline: 2px solid var(--cy-bright); outline-offset: 2px; }

/* mobile diagram type: measured against the widest label,
   "Автоматизация через AI", inside the 340-unit frame */
.fan--mob .fan__txt { font-size: 12px; }
.fan--mob .fan__origin-lbl { font-size: 11px; }
.fan--mob .fan__origin-note { font-size: 11px; }
.fan--mob .fan__line { stroke-width: 3; }
/* a 56-unit branch needs a finer dash than the desktop run */
.fan--mob .fan__line[data-dash="1"] { stroke-dasharray: 8 5; }
.fan--mob .fan__code { font-size: 10px; }
.fan--mob .fan__origin-txt { font-size: 13px; }

/* the one authored moment: the routes draw themselves out of the origin */
.fan__line, .fan__term, .fan__mark { --draw: 1; }

@media (prefers-reduced-motion: no-preference) {
  .js .fan__line {
    stroke-dasharray: var(--len);
    stroke-dashoffset: var(--len);
    animation: draw 1.15s var(--ease) forwards;
    animation-delay: var(--d, 0s);
  }
  .js .fan__line[data-dash="1"] {
    animation-name: draw-dash;
  }
  .js .fan__term,
  .js .fan__label {
    opacity: 0;
    animation: appear 0.5s var(--ease) forwards;
    animation-delay: calc(var(--d, 0s) + 0.85s);
  }
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes draw-dash {
  to { stroke-dashoffset: 0; stroke-dasharray: 20 11; }
}
@keyframes appear { to { opacity: 1; } }

/* =========================================================
   Sections
   ========================================================= */

.sec { padding: clamp(64px, 9vw, 128px) 0; border-top: 1px solid var(--rule); }

.sec__head { margin-bottom: clamp(36px, 5vw, 60px); }
.sec h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.9rem);
  max-width: 20ch;
}
.sec__lede {
  margin-top: 16px;
  max-width: 62ch;
  color: var(--fg-2);
  font-size: clamp(14px, 1.3vw, 17px);
}

/* =========================================================
   Map key — the notation says what it means
   ========================================================= */

.key {
  list-style: none;
  margin: 0 0 clamp(30px, 4vw, 48px);
  padding: 20px 0 0;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 14px 40px;
  max-width: 1000px;
}
@media (min-width: 820px) { .key { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.key li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg-2);
}
.key__fig { display: flex; align-items: center; height: 22px; }
.key__fig--marks { gap: 7px; color: var(--cy); }
.key__fig--marks svg { width: 15px; height: 15px; display: block; }
.key__rule { display: block; width: 100%; height: 4px; background: var(--cy); }
.key__rule--dash {
  background: repeating-linear-gradient(to right, var(--cy) 0 13px, transparent 13px 20px);
}

/* =========================================================
   Services — the line index + the flooded detail region
   ========================================================= */

.lines {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
}

@media (min-width: 1000px) {
  .lines {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    column-gap: clamp(28px, 4vw, 64px);
    border-top: none;
  }
}

.line__btn {
  grid-column: 1;
  display: grid;
  grid-template-columns: 46px 26px 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 19px 4px 19px 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--rule);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding-left: 10px;
  transition: background 0.2s var(--ease);
}
.line__btn:hover { background: var(--ink-raise); }

.line__code {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--cy-t2);
  transition: color 0.2s var(--ease);
}

.line__mark { width: 22px; height: 22px; flex: none; color: var(--cy); }
.line__mark svg { width: 100%; height: 100%; display: block; }

.line__name {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: clamp(14px, 1.5vw, 17px);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--fg);
}

.line__chev {
  width: 16px;
  height: 16px;
  color: var(--fg-3);
  transition: transform 0.25s var(--ease), color 0.2s var(--ease);
}

/* active state floods the whole row, not an icon */
.line__btn[aria-expanded="true"],
.line__btn[aria-selected="true"] {
  background: var(--cy);
}
.line__btn[aria-expanded="true"] .line__code,
.line__btn[aria-selected="true"] .line__code,
.line__btn[aria-expanded="true"] .line__name,
.line__btn[aria-selected="true"] .line__name,
.line__btn[aria-expanded="true"] .line__mark,
.line__btn[aria-selected="true"] .line__mark,
.line__btn[aria-expanded="true"] .line__chev,
.line__btn[aria-selected="true"] .line__chev { color: var(--ink); }
.line__btn[aria-expanded="true"] .line__name,
.line__btn[aria-selected="true"] .line__name { color: var(--ink); }
.line__btn[aria-expanded="true"] .line__chev { transform: rotate(90deg); }

/* --- detail panel --- */

.line__panel {
  grid-column: 1;
  border-bottom: 1px solid var(--rule);
  padding: 4px 0 30px;
}
.line__panel[hidden] { display: none; }

@media (min-width: 1000px) {
  .line__panel {
    grid-column: 2;
    grid-row: 1 / span 14;
    align-self: start;
    position: sticky;
    top: 108px;
    border-bottom: none;
    border-left: 1px solid var(--rule);
    padding: 4px 0 4px clamp(28px, 4vw, 56px);
  }
}

.line__strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 24px;
}
.line__strip-code {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--cy);
  flex: none;
}
.line__strip-rule {
  flex: 1 1 auto;
  height: 4px;
  min-width: 40px;
  background: var(--cy);
}
.line__panel[data-dash="1"] .line__strip-rule {
  background: repeating-linear-gradient(to right, var(--cy) 0 18px, transparent 18px 28px);
}
.line__strip-mark { flex: none; width: 22px; height: 22px; color: var(--cy); }
.line__strip-mark svg { width: 100%; height: 100%; display: block; }

.line__desc {
  color: var(--fg-2);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.55;
  max-width: 46ch;
}

.line__route { margin: 28px 0 0; }
.line__route svg { display: block; width: 100%; height: auto; overflow: visible; }

.route__line { fill: none; stroke: var(--cy); stroke-width: 3; }
.route__stop { fill: var(--ink); stroke: var(--cy); stroke-width: 3; }
.route__stop--end { fill: var(--cy); }
.route__txt {
  font-family: "Golos Text", system-ui, sans-serif;
  font-size: 13px;
  fill: var(--fg-2);
}

.line__stops {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.line__stops li {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: baseline;
  gap: 12px;
  padding: 0 0 20px 28px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-2);
}
/* the station */
.line__stops li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 13px;
  height: 13px;
  border: 3px solid var(--cy);
  border-radius: 50%;
  background: var(--ink);
  z-index: 1;
}
/* the run to the next station */
.line__stops li::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 14px;
  bottom: -2px;
  width: 3px;
  background: var(--cy);
}
.line__stops li:last-child { padding-bottom: 0; }
.line__stops li:last-child::after { display: none; }
.line__stops .n {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--cy-t2);
}

.line__owner {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--fg-3);
}
.line__owner b { color: var(--fg); font-weight: 500; }
.line__owner--open { color: var(--fg-3); font-style: italic; }

/* =========================================================
   Process — one line, five stations, a live marker
   ========================================================= */

.proc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.proc__step { position: relative; padding: 0 0 30px 38px; }

/* vertical rail on narrow screens */
.proc__rail { position: absolute; left: 0; top: 0; bottom: 0; width: 22px; }
.proc__rail::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 4px;
  bottom: -4px;
  width: 3px;
  background: var(--cy-t3);
  transition: background 0.35s var(--ease);
}
.proc__step:last-child .proc__rail::before { display: none; }

.proc__dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 21px;
  height: 21px;
  border: 3px solid var(--cy-t3);
  border-radius: 50%;
  background: var(--ink);
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}

.proc__step.is-passed .proc__rail::before { background: var(--cy); }
.proc__step.is-passed .proc__dot { border-color: var(--cy); }
.proc__step.is-here .proc__dot { border-color: var(--cy); background: var(--cy); }

@media (min-width: 860px) {
  .proc { grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 26px; }
  .proc__step { padding: 44px 0 0; }
  .proc__rail { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 22px; }
  .proc__rail::before {
    left: 11px;
    right: -26px;
    top: 9px;
    bottom: auto;
    width: auto;
    height: 3px;
  }
  .proc__step:last-child .proc__rail::before { display: block; left: 0; right: calc(100% - 11px); }
  .proc__dot { top: 0; }
}

.proc__step h3 {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.proc__step p { font-size: 14px; color: var(--fg-2); line-height: 1.5; }
.proc__step .n {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--cy-t2);
  display: block;
  margin-bottom: 10px;
}

/* =========================================================
   Team — interchange nodes
   ========================================================= */

.crew {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.crew__p {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 6px 18px;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
/* stacked: the node keeps its own column, everything else shares the second */
.crew__node { grid-column: 1; grid-row: 1 / span 3; }
.crew__name,
.crew__role,
.crew__lines { grid-column: 2; }

@media (min-width: 900px) {
  .crew__p {
    grid-template-columns: 40px minmax(0, 250px) minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
  }
  .crew__node { grid-row: auto; }
  .crew__name { grid-column: 2; }
  .crew__role { grid-column: 3; }
  .crew__lines { grid-column: 4; }
}

.crew__node { width: 34px; height: 34px; color: var(--cy); }
.crew__node svg { width: 100%; height: 100%; display: block; }

.crew__name {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: clamp(15px, 1.6vw, 19px);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.crew__role { font-size: 14px; color: var(--fg-2); line-height: 1.5; }

.crew__lines { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
@media (min-width: 900px) { .crew__lines { margin-top: 0; } }
.crew__tag {
  font-family: "Unbounded", system-ui, sans-serif;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--cy);
  border: 1px solid var(--cy-t3);
  padding: 4px 8px;
}

/* =========================================================
   Terms — the honest small print, given real weight
   ========================================================= */

.terms {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
  max-width: 900px;
}
.terms__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 760px) {
  .terms__row { grid-template-columns: 220px 1fr; gap: 28px; align-items: baseline; }
}
.terms__k {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.terms__v { font-size: 15px; color: var(--fg); line-height: 1.55; }

/* =========================================================
   End of line — CTA
   ========================================================= */

.end { text-align: left; }
.end__fig { margin-bottom: 34px; }
.end__fig svg { display: block; width: 100%; max-width: 620px; height: auto; overflow: visible; }
.end__line { fill: none; stroke: var(--cy); stroke-width: 4; stroke-linecap: round; }
.end__stop { fill: var(--ink); stroke: var(--cy); stroke-width: 3; }
.end__term { fill: var(--cy); }

.end h2 { font-size: clamp(1.9rem, 4.4vw, 3.4rem); }
.end__sub { margin-top: 18px; max-width: 52ch; color: var(--fg-2); font-size: clamp(15px, 1.5vw, 18px); }
.end__act { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* =========================================================
   Footer
   ========================================================= */

.ft {
  border-top: 1px solid var(--rule);
  padding: 40px 0 56px;
}
.ft__in {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  align-items: center;
  justify-content: space-between;
}
.ft__acr {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.ft__acr span {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.ft__acr .sep {
  width: 3px; height: 3px; background: var(--cy-t3); display: block;
}
.ft__meta { font-size: 12px; color: var(--fg-3); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   Развязка в объёме
   Та же схема, но у неё появилась глубина. Правило про 45°/90°
   держится: колено каждой линии стоит ровно на своей высоте,
   поэтому заход в узел остаётся диагональю. Азимуты разведены
   по кругу — семь конечных ложатся спиралью вокруг точки входа.
   ========================================================= */

.scene,
.scene__note,
.hero__hint { display: none; }

/* .hero__fig .lbl задаёт display: block, поэтому здесь нужна та же вложенность */
.hero__fig .hero__cap { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.hero__hint { color: var(--cy-t2); }

.scene__canvas { display: block; width: 100%; height: 100%; }

.scene__lbl {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
  /* маршрут может пройти позади подписи — чёрное поле пробивает его насквозь */
  text-shadow: 0 0 7px var(--ink), 0 0 3px var(--ink), 0 0 2px var(--ink);
  will-change: transform;
}
.scene__code,
.scene__name {
  font-family: "Unbounded", system-ui, sans-serif;
}
.scene__code {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--cy-t2);
  margin-right: 10px;
  transition: color 0.18s var(--ease);
}
.scene__name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg);
  transition: color 0.18s var(--ease);
}
.scene__lbl:hover .scene__name,
.scene__lbl:focus-visible .scene__name,
.scene__lbl:hover .scene__code,
.scene__lbl:focus-visible .scene__code { color: var(--cy); }
.scene__lbl:focus-visible { outline: 2px solid var(--cy-bright); outline-offset: 4px; }

/* узел — сама кнопка: маршруты уходят за неё, глубина снова перекрытием */
.scene__hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  background: var(--cy);
  color: var(--ink);
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 0 0 7px var(--ink);
  transition: background-color 0.2s var(--ease);
}
.scene__hub svg { width: 16px; height: 16px; }
.scene__hub:hover { background: var(--cy-bright); }
.scene__hub:focus-visible { outline: 2px solid var(--cy-bright); outline-offset: 5px; }

@media (max-width: 1199px) {
  .scene__name { font-size: 13px; }
  .scene__code { font-size: 10px; }
}

/* объём работает на любом экране: на телефоне меняется только плотность
   подписей — у конечных остаются коды, имена уходят в легенду ниже */
.js-scene .fan--desk,
.js-scene .fan--mob { display: none; }

.js-scene .scene {
  display: block;
  position: relative;
  width: 100%;
  height: clamp(300px, 80vw, 400px);
  cursor: grab;
  touch-action: pan-y;
}
.js-scene .scene:active { cursor: grabbing; }
.js-scene .scene:focus-visible { outline: 2px solid var(--cy-bright); outline-offset: 8px; }

.js-scene .scene__note {
  display: block;
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--fg-3);
}
.js-scene .hero__hint { display: inline; }

.scene__key {
  display: none;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.js-scene .scene__key { display: block; }
.scene__key li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  color: var(--fg-2);
}
.scene__key b {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--cy-t2);
  flex: none;
  width: 26px;
}

@media (max-width: 899px) {
  /* имя не помещается рядом с конечной — на фигуре остаётся код */
  .scene__name { display: none; }
  .scene__code { font-size: 12px; margin-right: 0; }
  /* узел ужимаем: на узкой фигуре он иначе съедает всю ширину */
  .scene__hub { font-size: 12px; padding: 10px 14px; gap: 8px; box-shadow: 0 0 0 5px var(--ink); }
  .scene__hub svg { width: 13px; height: 13px; }
  /* подпись и подсказка встают в две строки, а не рвутся посередине */
  .hero__fig .hero__cap { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (min-width: 900px) {
  .js-scene .scene { height: clamp(400px, 40vw, 560px); }
  .js-scene .scene__key { display: none; }
  .js-scene .scene__note { margin-top: 20px; }
}

/* объём занимает всю ширину, поэтому заголовок встаёт над ним
   в две колонки, а не в оставленный схемой левый нижний угол */
@media (min-width: 1000px) {
  .js-scene .hero__stage { gap: clamp(26px, 3vw, 42px); }
  .js-scene .hero__stage > * { grid-area: auto; }
  .js-scene .hero__head {
    max-width: none;
    align-self: start;
    padding-bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: end;
  }
  .js-scene .hero__sub { margin-top: 0; max-width: none; }
  .js-scene .hero__fig .lbl { margin-left: 0; }
}

/* =========================================================
   Трассировка направлений
   План дорожек лежит призраком, скролл прокладывает по нему
   медь. Дорожка сохраняет свой штрих: сплошная остаётся
   сплошной, пунктир пунктиром — открывает их маска, а не
   подмена штриха.
   ========================================================= */

.trace {
  display: block;
  position: relative;
  /* запас прокрутки, по которому идёт прорисовка */
  height: calc(100vh + 760px);
  margin: clamp(24px, 3vw, 44px) 0 clamp(40px, 5vw, 72px);
}
.trace__stick {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  align-content: center;
}

@media (min-width: 1000px) {
  .trace { height: calc(100vh + 980px); }
}

/* горизонтальная раскладка на узком экране нечитаема: там своя,
   где отводы сходятся в общую шину, а шина спускается в узел */
.trace__svg { display: none; }
@media (min-width: 1000px) { .trace__svg--desk { display: block; } }
@media (max-width: 999px) {
  .trace__svg--mob { display: block; }
  /* фигура не должна упираться в липкую шапку, поэтому чуть уже и с полем */
  .trace__svg--mob { max-width: 320px; margin-inline: auto; }
  .trace__stick { padding-top: 76px; align-content: start; }
  .trace__cap { flex-direction: column; align-items: flex-start; gap: 4px; }
}

.trace__svg--mob .trace__ghost,
.trace__svg--mob .trace__live { stroke-width: 3; }
.trace__svg--mob .trace__ghost[data-dash="1"],
.trace__svg--mob .trace__live[data-dash="1"] { stroke-dasharray: 10 6; }
.trace__svg--mob .trace__reveal { stroke-width: 12; }
.trace__svg--mob .trace__pulse { stroke-width: 1.6; }
.trace__svg--mob .trace__code { font-size: 10px; }
.trace__svg--mob .trace__name { font-size: 13px; }
.trace__svg--mob .trace__hub-lbl { font-size: 10px; }
.trace__svg--mob .trace__hub-txt { font-size: 15px; }
.trace__svg--mob .trace__hub-note { font-size: 12px; }
.trace__svg--mob .trace__hub-box { stroke-width: 1.6; }

.trace__fig { min-width: 0; }
.trace__cap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
}
.trace__hint { color: var(--cy-t2); transition: opacity 0.3s var(--ease); }
/* дорожки проложены — подсказку можно убрать */
.trace.is-done .trace__hint { opacity: 0; }
/* показ раскладки решают правила выше; здесь только габариты */
.trace__svg { width: 100%; height: auto; overflow: visible; }

/* план */
.trace__ghost {
  stroke: var(--cy);
  stroke-width: 4;
  opacity: 0.14;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trace__ghost[data-dash="1"] { stroke-dasharray: 18 10; }

/* проложенная дорожка */
.trace__live {
  stroke: var(--cy);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trace__live[data-dash="1"] { stroke-dasharray: 18 10; }

/* открывающая маска: белое видно, чёрное нет */
.trace__reveal {
  stroke: #fff;
  stroke-width: 16;
  fill: none;
  stroke-linecap: butt;
  stroke-linejoin: round;
}

/* конечные */
.trace__mark { color: var(--cy-t3); transition: color 0.32s var(--ease); }
.trace__node.is-on .trace__mark { color: var(--cy); }

.trace__pulse {
  fill: none;
  stroke: var(--cy);
  stroke-width: 2;
  opacity: 0;
}
.trace__node.is-pulse .trace__pulse { animation: tracePulse 0.55s var(--ease) 1; }
@keyframes tracePulse {
  from { opacity: 0.9; transform: scale(0.55); }
  to { opacity: 0; transform: scale(2.4); }
}

.trace__lbl { transition: opacity 0.32s var(--ease); opacity: 0.5; }
.trace__node.is-on .trace__lbl { opacity: 1; }
.trace__code {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  fill: var(--cy-t2);
}
.trace__name {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
  fill: var(--fg);
}

/* узел: пока не подведены все семь — контур, потом заливка */
.trace__hub-box {
  fill: none;
  stroke: var(--cy-t2);
  stroke-width: 2;
  transition: fill 0.34s var(--ease), stroke 0.34s var(--ease);
}
.trace__hub-txt {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  fill: var(--cy);
  transition: fill 0.34s var(--ease);
}
.trace__hub-ico { color: var(--cy); transition: color 0.34s var(--ease); }
.trace__hub.is-on .trace__hub-box { fill: var(--cy); stroke: var(--cy); }
.trace__hub.is-on .trace__hub-txt { fill: var(--ink); }
.trace__hub.is-on .trace__hub-ico { color: var(--ink); }
.trace__hub-a:hover .trace__hub-box { stroke: var(--cy-bright); }
.trace__hub.is-on .trace__hub-a:hover .trace__hub-box { fill: var(--cy-bright); stroke: var(--cy-bright); }
.trace__hub-a:focus-visible { outline: 2px solid var(--cy-bright); outline-offset: 3px; }

.trace__hub-pulse {
  fill: none;
  stroke: var(--cy);
  stroke-width: 2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.trace__hub.is-pulse .trace__hub-pulse { animation: traceHub 0.7s var(--ease) 1; }
@keyframes traceHub {
  from { opacity: 0.85; transform: scale(1); }
  to { opacity: 0; transform: scale(1.22); }
}

.trace__hub-lbl {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  fill: var(--fg-3);
}
.trace__hub-note {
  font-family: "Golos Text", system-ui, sans-serif;
  font-size: 14px;
  fill: var(--fg-3);
  opacity: 0;
  transition: opacity 0.34s var(--ease);
}
.trace__hub.is-on .trace__hub-note { opacity: 1; }

/* дорожка дошла до строки услуги — на ней зажигается торец */
.line__btn { box-shadow: inset 0 0 0 0 var(--cy); transition: background 0.2s var(--ease), box-shadow 0.3s var(--ease); }
.line__btn.is-traced { box-shadow: inset 3px 0 0 0 var(--cy); }
.line__btn.is-traced:not([aria-expanded="true"]):not([aria-selected="true"]) .line__code { color: var(--cy); }

/* без движения — весь план сразу проложен, запас прокрутки не нужен */
.trace.is-static { height: auto; }
.trace.is-static .trace__stick { position: static; height: auto; }

/* =========================================================
   Переливы поля
   Чёрное остаётся материалом. Сверху три очень слабых развода
   цвета логотипа: три тира яркости, три разных периода, поэтому
   они никогда не совпадают и поле медленно переливается.
   Слой закреплён и двигается только трансформом, так что
   страница от него не перерисовывается.
   ========================================================= */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: layout paint;
}

.bg span {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform, opacity;
}

.bg span:nth-child(1) {
  width: 52vmax;
  height: 52vmax;
  left: -14vmax;
  top: -16vmax;
  background: radial-gradient(circle at 50% 50%,
    rgba(26, 213, 204, 0.135), rgba(26, 213, 204, 0.047) 38%, transparent 62%);
  animation: bgA 34s ease-in-out infinite;
}

.bg span:nth-child(2) {
  width: 40vmax;
  height: 40vmax;
  right: -12vmax;
  top: 26vh;
  background: radial-gradient(circle at 50% 50%,
    rgba(23, 217, 216, 0.121), rgba(23, 217, 216, 0.04) 40%, transparent 64%);
  animation: bgB 27s ease-in-out infinite;
}

.bg span:nth-child(3) {
  width: 62vmax;
  height: 62vmax;
  left: 16vw;
  bottom: -34vmax;
  background: radial-gradient(circle at 50% 50%,
    rgba(20, 168, 161, 0.126), rgba(20, 168, 161, 0.04) 36%, transparent 60%);
  animation: bgC 43s ease-in-out infinite;
}

/* замкнутые траектории: пятно уплывает и возвращается, а не качается
   по прямой. Первый и последний кадр совпадают, поэтому шва нет */
@keyframes bgA {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  25% { transform: translate3d(48vw, 16vh, 0) scale(1.16); }
  50% { transform: translate3d(76vw, 54vh, 0) scale(0.88); }
  75% { transform: translate3d(22vw, 66vh, 0) scale(1.1); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes bgB {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(-62vw, -32vh, 0) scale(1.22); }
  66% { transform: translate3d(-28vw, 42vh, 0) scale(0.84); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes bgC {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  30% { transform: translate3d(-44vw, -38vh, 0) scale(1.18); }
  60% { transform: translate3d(38vw, -64vh, 0) scale(0.9); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

/* содержимое идёт поверх слоя */
main,
.ft { position: relative; z-index: 1; }

/* шапка перестаёт быть глухой полосой поперёк перелива */
.hdr {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}

@media (prefers-reduced-motion: reduce) {
  /* перелив замирает, разводы остаются.
     Специфичность та же, что у правил с nth-child, иначе они перебьют */
  .bg span:nth-child(1),
  .bg span:nth-child(2),
  .bg span:nth-child(3) { animation: none; }
}
