
:root {
  --night: #150c1f;
  --dusk: #22132e;
  --dusk-2: #2c1a3b;
  --line: #3d2753;
  --rose: #ff6f91;
  --amber: #ffb45a;
  --text: #ecdff4;
  --muted: #a990bb;
  --display: "Unbounded", "Arial Black", "Segoe UI", sans-serif;
  --body: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --nav-h: 60px;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* Страница задумана тёмной — те же значения и в светлой теме просмотрщика */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --night: #150c1f; --text: #ecdff4; } }
:root[data-theme="dark"] { --night: #150c1f; --text: #ecdff4; }
*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--night); color: var(--text);
  font-family: var(--body); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--amber); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

/* ---------- навигация ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(21, 12, 31, 0.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(61, 39, 83, 0.6);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; height: var(--nav-h);
  display: flex; align-items: center; gap: 28px; padding: 0 24px;
}
.brand { font-family: var(--display); font-weight: 500; letter-spacing: 0.18em; color: var(--amber); text-decoration: none; font-size: 15px; white-space: nowrap; }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0 0 0 auto; padding: 0; overflow-x: auto; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav a.link { display: block; padding: 8px 12px; color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500; white-space: nowrap; border-radius: 6px; position: relative; }
.nav a.link:hover { color: var(--text); }
.nav a.link.active { color: var(--text); }
.nav a.link.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: linear-gradient(90deg, var(--rose), var(--amber)); border-radius: 2px; }

/* ---------- герой ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { /* лёгкая дымка заката у горизонта */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  background: linear-gradient(180deg, transparent, rgba(255, 111, 145, 0.07) 55%, rgba(21, 12, 31, 0.9));
  pointer-events: none;
}
.hero::before { /* затемнение под текстом — волны не спорят с заголовком */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(21, 12, 31, 0.92) 0%, rgba(21, 12, 31, 0.6) 38%, transparent 62%);
}
.hero-copy { position: relative; z-index: 2; max-width: 1180px; width: 100%; margin: 0 auto; padding: calc(var(--nav-h) + 48px) 24px 96px; }
.hero h1 {
  font-family: var(--display); font-weight: 700; margin: 0;
  font-size: clamp(54px, 11vw, 148px); line-height: 0.95; letter-spacing: 0.06em;
  color: var(--text); text-shadow: 0 0 40px rgba(255, 111, 145, 0.35);
}
.hero h1 span { display: block; height: 4px; width: min(420px, 70%); margin-top: 22px; background: linear-gradient(90deg, var(--rose), var(--amber), transparent); border-radius: 4px; }
.hero .lead { font-size: clamp(19px, 2.2vw, 24px); max-width: 24em; margin: 28px 0 0; color: var(--text); line-height: 1.5; }
.hero .sub { max-width: 30em; color: var(--muted); margin: 16px 0 0; }
.hero .free { display: inline-block; margin: 18px 0 0; padding: 6px 14px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--amber); border: 1px solid rgba(255, 180, 90, 0.4); background: rgba(255, 180, 90, 0.08); }
.lang { margin-left: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.lang:hover { color: var(--text); border-color: var(--rose); }
.hero .hint { position: absolute; z-index: 2; right: 24px; bottom: 28px; font-size: 13px; color: var(--muted); }
.cta { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 22px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 15px;
  color: #1d0f26; background: linear-gradient(90deg, var(--amber), #ff9a7a);
  box-shadow: 0 8px 30px rgba(255, 140, 110, 0.25);
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--rose); }

/* ---------- разделы ---------- */
section.block { max-width: 1180px; margin: 0 auto; padding: 110px 24px 20px; }
h2 {
  font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1.1; letter-spacing: 0.01em; margin: 0 0 28px; max-width: 18em;
}
h3 { font-family: var(--display); font-weight: 500; font-size: 21px; line-height: 1.3; margin: 0 0 10px; letter-spacing: 0.01em; }
p { margin: 0 0 16px; }
.prose { max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }

.intro { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: start; }
.heritage {
  border-left: 3px solid var(--rose); padding: 6px 0 6px 24px; color: var(--text);
  font-size: 19px; line-height: 1.6;
}
.heritage strong { color: var(--amber); font-weight: 700; }

.genres { display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0 0; padding: 0; list-style: none; }
.genres li { font-family: var(--display); font-weight: 300; font-size: 15px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); background: rgba(44, 26, 59, 0.5); }

.traits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin-top: 54px; }
.traits h3 { color: var(--amber); }

/* схема сигнала */
.flow { margin: 36px 0 50px; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, rgba(44, 26, 59, 0.55), rgba(34, 19, 46, 0.3)); overflow-x: auto; }
.flow-row { display: flex; align-items: center; gap: 14px; min-width: 820px; }
.sources { display: grid; gap: 10px; }
.node { padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--dusk); font-size: 14.5px; white-space: nowrap; }
.node b { display: block; font-family: var(--display); font-weight: 500; font-size: 14px; color: var(--text); }
.node small { color: var(--muted); font-size: 12.5px; }
.node.hot { border-color: rgba(255, 180, 90, 0.6); }
.node.hot b { color: var(--amber); }
.arrow { flex: 1 1 18px; min-width: 18px; height: 2px; background: linear-gradient(90deg, var(--line), var(--rose)); position: relative; }
.arrow::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: var(--rose); }
.mods { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); min-width: 820px; }
.mods .node { background: transparent; }
.mods .label { color: var(--muted); font-size: 13.5px; align-self: center; margin-right: 6px; }

.parts { display: grid; grid-template-columns: 260px 1fr; border-top: 1px solid var(--line); }
.parts > dt, .parts > dd { margin: 0; padding: 24px 0; border-bottom: 1px solid var(--line); }
.parts > dt { font-family: var(--display); font-weight: 500; font-size: 18px; padding-right: 24px; color: var(--text); }
.parts > dt small { display: block; font-family: var(--body); font-weight: 500; font-size: 13.5px; color: var(--muted); margin-top: 6px; letter-spacing: 0; }
.parts > dd { max-width: 70ch; }
.parts > dd ul { margin: 8px 0 0; padding-left: 20px; }
.parts > dd li { margin-bottom: 4px; }

/* ядра */
.engines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-top: 10px; }
.engine { padding: 28px; background: rgba(34, 19, 46, 0.6); }
.engine + .engine { border-left: 1px solid var(--line); }
.engine.star { background: linear-gradient(180deg, rgba(255, 111, 145, 0.12), rgba(34, 19, 46, 0.6)); }
.engine h3 { font-size: 24px; }
.engine .tag { color: var(--rose); font-weight: 700; font-size: 14.5px; margin-bottom: 14px; }
.engine ul { margin: 0; padding-left: 18px; }
.engine li { margin-bottom: 6px; }

/* режим P432 */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 34px 0; }
.mode { padding: 26px 28px; border-radius: 16px; border: 1px solid var(--line); background: var(--dusk); }
.mode h3 { color: var(--amber); }
.mode.rom { border-color: rgba(255, 111, 145, 0.55); }
.mode.rom h3 { color: var(--rose); }
.mode ul { margin: 8px 0 0; padding-left: 18px; }
.mode li { margin-bottom: 6px; }

ol.steps { counter-reset: step; list-style: none; margin: 30px 0 0; padding: 0; max-width: 76ch; }
ol.steps > li { counter-increment: step; position: relative; padding: 0 0 26px 62px; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--display); font-size: 16px; color: var(--night);
  background: linear-gradient(135deg, var(--amber), var(--rose));
}
ol.steps > li::after { content: ""; position: absolute; left: 19px; top: 44px; bottom: 6px; width: 2px; background: var(--line); }
ol.steps > li:last-child::after { display: none; }
ol.steps strong { color: var(--text); }

.note { margin-top: 26px; padding: 18px 22px; border-radius: 12px; background: rgba(255, 180, 90, 0.08); border: 1px solid rgba(255, 180, 90, 0.3); max-width: 76ch; }

figure { margin: 0; }
.shot { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 111, 145, 0.06); cursor: zoom-in; background: var(--dusk); }
.shot img { width: 100%; height: auto; }
figcaption { color: var(--muted); font-size: 14.5px; margin-top: 12px; }

/* Reserve screenshot geometry before lazy images load. This prevents anchor jumps
   when navigating directly to the final Download section. */
img[src$="/shot-01.jpg"] { aspect-ratio: 830 / 220; }
img[src$="/shot-02.jpg"],
img[src$="/shot-03.jpg"],
img[src$="/shot-04.jpg"],
img[src$="/shot-05.jpg"],
img[src$="/shot-06.jpg"] { aspect-ratio: 1240 / 880; }
img[src$="/shot-07.jpg"] { aspect-ratio: 640 / 480; }
.wide-shot { margin-top: 40px; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 34px 28px; }
.gallery figure.big { grid-column: 1 / -1; }

/* лайтбокс */
.lightbox { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(10, 5, 15, 0.92); padding: 24px; cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-height: 92vh; width: auto; max-width: 100%; border-radius: 12px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); }

footer { margin-top: 120px; border-top: 1px solid var(--line); }
.foot { max-width: 1180px; margin: 0 auto; padding: 40px 24px 60px; display: flex; flex-wrap: wrap; gap: 24px 60px; justify-content: space-between; color: var(--muted); font-size: 15px; }
.foot .mark { font-family: var(--display); letter-spacing: 0.18em; color: var(--amber); font-size: 18px; margin-bottom: 8px; }

@media (max-width: 900px) {
  .intro, .split { grid-template-columns: 1fr; gap: 30px; }
  .traits { grid-template-columns: 1fr; gap: 26px; }
  .engines { grid-template-columns: 1fr; }
  .engine + .engine { border-left: none; border-top: 1px solid var(--line); }
  .parts { grid-template-columns: 1fr; }
  .parts > dt { border-bottom: none; padding-bottom: 4px; }
  .parts > dd { padding-top: 0; }
  .gallery { grid-template-columns: 1fr; }
  section.block { padding-top: 80px; }
  .brand { display: none; }
  .hero .free { display: inline-block; margin: 18px 0 0; padding: 6px 14px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--amber); border: 1px solid rgba(255, 180, 90, 0.4); background: rgba(255, 180, 90, 0.08); }
.lang { margin-left: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.lang:hover { color: var(--text); border-color: var(--rose); }
.hero .hint { display: none; }
  .hero-copy { padding-bottom: 34vh; }
  .hero::before { background: linear-gradient(180deg, rgba(21, 12, 31, 0.85) 0%, rgba(21, 12, 31, 0.55) 55%, transparent 75%); }
  .nav ul { margin-left: 0; }
}

/* Heaven42 integration */
.site-home { font-family: var(--display); font-weight: 700; letter-spacing: .12em; color: var(--rose); text-decoration:none; font-size:12px; white-space:nowrap; }
.site-home:hover { color: var(--amber); }
/* Downloads are the final main-page section, before the footer. */
section.block.formator-download {
  max-width:1180px; margin:0 auto; padding:110px 24px 36px;
}
section.block.formator-download .download-card { width:100%; }
section.block.formator-download h2 { max-width:none; }
.download-card { border:1px solid var(--line); border-radius:18px; padding:30px; display:flex; gap:28px; align-items:center; justify-content:space-between; background:linear-gradient(135deg,rgba(255,111,145,.08),rgba(255,180,90,.05)); }
.download-card h2 { margin:0 0 10px; font-size:clamp(25px,3vw,38px); }
.download-card p { margin:0; color:var(--muted); }
.download-meta { margin-top:12px; color:var(--amber); font-size:14px; }
.btn.disabled { opacity:.55; pointer-events:none; }
@media (max-width:900px){ .site-home{display:none}.download-card{align-items:flex-start;flex-direction:column} }
.download-buttons{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.download-disabled{display:inline-block;padding:10px 14px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:14px}


/* v17: support modal + secondary CTA */
.btn.support-open {
  color: #fff;
  border: 0;
  background: linear-gradient(90deg, #8d6cff 0%, #c85cff 48%, var(--rose) 100%);
  box-shadow: 0 8px 30px rgba(172, 86, 255, .28), 0 0 22px rgba(255, 111, 145, .08);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn.support-open:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 10px 34px rgba(172, 86, 255, .36), 0 0 28px rgba(255, 111, 145, .12);
}
body.support-modal-open { overflow: hidden; }
.support-modal[hidden] { display: none !important; }
.support-modal {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  padding: calc(22px + env(safe-area-inset-top, 0px)) 18px calc(22px + env(safe-area-inset-bottom, 0px));
  background: rgba(8, 5, 12, .78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.support-modal.open { opacity: 1; pointer-events: auto; }
.support-dialog {
  position: relative; width: min(720px, 100%); max-height: min(760px, calc(100svh - 44px)); overflow: auto;
  padding: 32px; border: 1px solid rgba(255,180,90,.32); border-radius: 22px;
  background: linear-gradient(145deg, rgba(44,26,59,.98), rgba(21,12,31,.99));
  box-shadow: 0 28px 90px rgba(0,0,0,.55), 0 0 50px rgba(255,111,145,.08);
  transform: translateY(10px) scale(.985); transition: transform .18s ease;
}
.support-modal.open .support-dialog { transform: none; }
.support-close {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; padding: 0; background: rgba(21,12,31,.75); color: var(--text); font: 300 27px/1 var(--body); cursor: pointer;
}
.support-close:hover { border-color: var(--rose); color: #fff; }
.support-kicker { margin-bottom: 9px; color: var(--amber); font: 700 12px/1.2 var(--display); letter-spacing: .16em; }
.support-dialog h2 { margin: 0 50px 12px 0; max-width: none; font-size: clamp(26px,4vw,38px); }
.support-intro { max-width: 58ch; margin: 0 0 24px; color: var(--muted); }
.support-methods { display: grid; gap: 11px; }
.support-method {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; align-items: center;
  min-width: 0; padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(13,8,19,.62);
}
.support-method strong { display: block; margin-bottom: 5px; color: var(--text); font: 500 14px/1.25 var(--display); }
.support-method span { display: block; color: var(--muted); font-size: 13px; }
.support-value-wrap { min-width: 0; }
.support-method code {
  display: block; max-width: 100%; overflow-wrap: anywhere; word-break: break-all;
  color: #f3dfef; font: 500 14px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
.support-action, .support-copy {
  flex: 0 0 auto; border: 1px solid rgba(255,180,90,.38); border-radius: 999px; padding: 9px 13px;
  background: rgba(255,180,90,.08); color: var(--amber); text-decoration: none; font: 700 13px/1.2 var(--body); cursor: pointer; white-space: nowrap;
}
.support-action:hover, .support-copy:hover { border-color: var(--amber); background: rgba(255,180,90,.13); }
.support-copy.copied { border-color: rgba(255,111,145,.7); color: var(--rose); }
@media (max-width: 620px) {
  .support-modal { place-items: end center; padding: 10px; }
  .support-dialog { width: 100%; max-height: calc(100svh - 20px); padding: 25px 18px 20px; border-radius: 20px; }
  .support-method { grid-template-columns: 1fr; gap: 11px; }
  .support-action, .support-copy { justify-self: start; }
}
