/* Лендинг Argus. Эталон — design/reference/landing.html, параметры анимаций —
   design/CLAUDE.md. Правило цвета: красный и оранжевый — только в кардиограмме
   и логотипе, остальное — оттенки синего и нейтральные. */

:root {
  --ink: #0A1A33;
  --ink-2: #2E3D52;
  --muted: #556377;
  --bg: #FFFFFF;
  --bg-alt: #F3F5F8;
  --chip: #EDF0F4;
  --line: #E7EBF0;
  --accent: #1F5BBF;
  --accent-hover: #0F2747;
  --night: #060B14;
  --night-2: #0B1322;
  --night-3: #1E2B3F;
  --night-line: #162235;
  --night-ink: #F1F4F9;
  --night-ink-2: #C9D3E1;
  --night-muted: #93A3BA;
  --pulse: #8FBCFF;
  --ok: #177245;
  /* В эталоне #8C98A8 — контраст на --bg-alt 2,7:1, меньше 3:1 для крупного текста.
     Этим же цветом перекрашены логотипы в img/vendors */
  --vendor: #6F7B8D;
  --shot-bg: #ECEFF3;
  --shot-bg-dark: #0E1828;

  --font-head: 'Manrope', system-ui, sans-serif;
  --font-text: 'IBM Plex Sans', system-ui, sans-serif;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --wrap: 1200px;
  --gutter: 32px;
  --section-y: 112px;
}

@media (max-width: 720px) {
  :root { --gutter: 16px; --section-y: 72px; }
}

/* ---------- основа ---------- */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/28px var(--font-text);
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.night a:focus-visible { outline-color: var(--pulse); }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section { padding: var(--section-y) 0; }
.alt { background: var(--bg-alt); }
.night { background: var(--night); color: var(--night-ink); }

/* ---------- типографика ---------- */

.h1, .h2 {
  font-family: var(--font-head);
  font-weight: 800;
  text-wrap: balance;
}

.h1 { font-size: 60px; line-height: 64px; letter-spacing: -.03em; }
.h2 { font-size: 44px; line-height: 50px; letter-spacing: -.025em; }
.h2--narrow { max-width: 720px; }
.h2--final { font-size: 52px; line-height: 58px; letter-spacing: -.03em; }

.lead { font-size: 19px; line-height: 30px; color: var(--ink-2); }
.lead--section { margin-top: 16px; max-width: 620px; font-size: 18px; line-height: 29px; }
.lead--night { margin-top: 20px; color: var(--night-ink-2); }

@media (max-width: 720px) {
  .h1 { font-size: 42px; line-height: 46px; }
  .h2 { font-size: 32px; line-height: 38px; }
  .h2--final { font-size: 36px; line-height: 42px; }
  .lead { font-size: 17px; line-height: 28px; }
}

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .2s ease;
}
.btn--sm { height: 44px; padding: 0 20px; font-size: 15px; }
.btn--lg { height: 56px; padding: 0 28px; font-size: 17px; }
.btn--dark, .btn--dark:hover { color: #FFFFFF; }
.btn--dark { background: var(--ink); }
.btn--dark:hover { background: var(--accent-hover); }
.btn--chip, .btn--chip:hover { color: var(--ink); }
.btn--chip { background: var(--chip); }
.btn--chip:hover { background: var(--line); }
.btn--light, .btn--light:hover { color: var(--night); }
.btn--light { background: var(--night-ink); }
.btn--light:hover { background: #FFFFFF; }

.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.dot--ok { background: var(--ok); }

/* ---------- шапка ---------- */

.top { position: relative; z-index: 2; }

.top__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 40px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--accent-hover); }
.brand__name { font: 800 22px/1 var(--font-head); letter-spacing: -.02em; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-size: 15px;
  line-height: 22px;
}
.nav a { color: var(--ink-2); }
.nav a:hover { color: var(--accent); }

.top__cta { margin-left: auto; }

.menu-btn { display: none; }

/* Телефон и узкий планшет: шапка в одну строку и прилипает к верху, якоря —
   в выпадающей панели за кнопкой меню (main.js). Без скрипта (нет .js)
   якоря остаются второй строкой под логотипом */
@media (max-width: 860px) {
  .nav { order: 3; width: 100%; gap: 4px 20px; }

  .js .top {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--line);
  }
  .js .top__row { flex-wrap: nowrap; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
  .js .top__cta { height: 40px; padding: 0 14px; font-size: 14px; }

  .js .menu-btn {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: var(--chip);
    color: var(--ink);
    cursor: pointer;
  }
  .menu-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .menu-btn__close, .menu-btn[aria-expanded="true"] .menu-btn__open { display: none; }
  .menu-btn[aria-expanded="true"] .menu-btn__close { display: inline; }
  .menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .js .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--bg);
    box-shadow: 0 1px 0 var(--line), 0 16px 32px -16px rgba(10, 26, 51, .25);
  }
  .js .top.is-open .nav { display: flex; }
  .js .nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 17px;
  }
  .js .nav a:last-child { border-bottom: 0; }

  /* Якорь не прячет заголовок раздела под прилипшей шапкой */
  .js [id] { scroll-margin-top: 64px; }
}

/* ---------- кардиограмма ---------- */

.ecg {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
}
/* Без top: стоит там, где была бы в потоке, — сразу под заголовком.
   Базовая линия (y = 190 из 300) — посередине зазора 24 px до лида */
.ecg--hero { height: 300px; margin-top: -178px; z-index: -1; }
.ecg--final { bottom: 20px; height: 220px; }

.ecg path { fill: none; stroke-linejoin: miter; }
.ecg__base { stroke: var(--line); stroke-width: 2; vector-effect: non-scaling-stroke; }
.night .ecg__base { stroke: var(--night-line); }
.ecg__pulse { stroke-width: 3; stroke-linecap: butt; stroke-miterlimit: 12; }

/* Голова кометы — резкий край маски; на пиках маска идёт втрое медленнее */
.ecg-comet--hero { animation: comet-hero 5.5s linear infinite; }
.ecg-comet--final { animation: comet-final 5.5s linear infinite; }

@keyframes comet-hero {
  0% { transform: translateX(0); }
  20% { transform: translateX(500px); }
  46.4% { transform: translateX(720px); }
  100% { transform: translateX(2060px); }
}
@keyframes comet-final {
  0% { transform: translateX(0); }
  35.2% { transform: translateX(880px); }
  61.6% { transform: translateX(1100px); }
  100% { transform: translateX(2060px); }
}

/* ---------- первый экран ---------- */

.hero { position: relative; overflow: hidden; isolation: isolate; }

.hero__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 600px);
  align-items: center;
  gap: 56px 48px;
  padding-top: 72px;
  padding-bottom: 96px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 20px;
}

.hero .h1 { margin-top: 24px; }
.hero .lead { margin-top: 24px; }

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

.hero__visual { position: relative; display: flex; justify-content: center; }

.hero__shot {
  width: 620px;
  max-width: 100%;
  aspect-ratio: 620 / 520;
  overflow: hidden;
  border-radius: 14px;
  background: var(--shot-bg);
  box-shadow: 0 1px 0 #D5DCE5, 0 30px 80px -20px rgba(10, 26, 51, .28);
}
.hero__shot img { width: 100%; }

.forecast {
  position: absolute;
  left: -8px;
  bottom: -28px;
  width: 300px;
  max-width: 80%;
  padding: 16px 18px;
  border-radius: 12px;
  background: #FFFFFF;
  box-shadow: 0 20px 50px -12px rgba(10, 26, 51, .3);
  font-size: 14px;
  line-height: 20px;
}
.forecast__label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ok);
  font-size: 13px;
  font-weight: 600;
}
.forecast__title { margin-top: 6px; font-weight: 600; }
.forecast__note { color: var(--muted); }

@media (max-width: 1023px) {
  .hero__row { grid-template-columns: minmax(0, 1fr); padding-bottom: 80px; }
  .hero__text { max-width: 640px; }
}
@media (max-width: 720px) {
  .hero__row { padding-top: 40px; padding-bottom: 64px; }
  .forecast { left: 12px; bottom: -36px; }
}

/* На узком телефоне две кнопки всё равно в одну строку: поровну ширины,
   подпись переносится внутри кнопки */
@media (max-width: 480px) {
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .actions .btn {
    height: auto;
    min-height: 56px;
    padding: 8px 12px;
    font-size: 15px;
    line-height: 20px;
    text-align: center;
    white-space: normal;
  }
}

/* ---------- совместимость ---------- */

.vendors { background: var(--bg-alt); }

.vendors__row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-top: 32px;
  padding-bottom: 32px;
  text-align: center;
}

/* Одной строкой; на телефоне не помещается — переносится ровно */
.vendors__caption { color: var(--muted); font-size: 15px; line-height: 22px; text-wrap: balance; }

.vendors__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 40px;
}
.vendors__more { color: var(--muted); font-size: 15px; line-height: 22px; }

/* Высоты подобраны на глаз: у логотипов разные пропорции и плотность */
.vendor { width: auto; }
.vendor--abb { height: 24px; }
.vendor--siemens { height: 17px; }
.vendor--danfoss { height: 28px; }
.vendor--schneider { height: 30px; }
.vendor--veda { height: 26px; }

@media (max-width: 720px) {
  .vendors__list { gap: 14px 28px; }
}

/* ---------- ассистент ---------- */

.ai__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 64px 56px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--pulse);
  font-size: 15px;
  line-height: 22px;
}

.ai__text .h2 { margin-top: 20px; }
.ai__text .lead { margin-top: 20px; max-width: 560px; color: var(--night-ink-2); }

.theses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 32px;
  margin-top: 40px;
}
.theses h3 { font-size: 17px; line-height: 24px; font-weight: 600; }
.theses p { margin-top: 6px; color: var(--night-muted); font-size: 15px; line-height: 24px; }

.ai__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 322px;
  max-width: 100%;
  font-size: 14px;
  line-height: 21px;
}
.chat__ask {
  align-self: flex-end;
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--night-3);
}
.chat__answer {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--night-2);
  color: var(--night-ink-2);
}
.chat__head { margin-bottom: 6px; color: var(--night-ink); font-weight: 500; }

.typing { display: flex; gap: 5px; padding: 6px 4px; }
.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pulse);
  animation: blink 1.2s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }

/* Рядом с телефоном чат встаёт сбоку, когда ширины хватает и на текст */
@media (min-width: 1024px) and (max-width: 1199px) {
  .ai__row { grid-template-columns: minmax(0, 1fr); }
  .ai__visual { flex-direction: row; justify-content: center; align-items: flex-end; }
  .chat { padding-bottom: 40px; }
}
@media (max-width: 1023px) {
  .ai__row { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 720px) and (max-width: 1023px) {
  .ai__visual { flex-direction: row; justify-content: center; align-items: flex-end; }
  .chat { padding-bottom: 40px; }
}
@media (max-width: 560px) {
  .theses { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

/* ---------- iPhone ---------- */

.phone {
  position: relative;
  flex: none;
  width: 322px;
  height: 714px;
  padding: 11px;
  border-radius: 58px;
  background: linear-gradient(145deg, #5A616B 0%, #2B3038 22%, #1A1D22 55%, #3A4049 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .18),
    inset 0 0 0 3px #0B0D10,
    0 50px 90px -30px rgba(0, 0, 0, .75),
    0 0 0 1px rgba(0, 0, 0, .4);
}

.phone__key {
  position: absolute;
  left: -3px;
  width: 3px;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(90deg, #2B3038, #565D67);
}
.phone__key--action { top: 118px; height: 30px; }
.phone__key--up { top: 172px; height: 56px; }
.phone__key--down { top: 240px; height: 56px; }
.phone__key--side {
  left: auto;
  right: -3px;
  top: 196px;
  height: 88px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(270deg, #2B3038, #565D67);
}

.phone__screen {
  position: relative;
  height: 692px;
  overflow: hidden;
  border-radius: 47px;
  background: var(--shot-bg-dark);
  box-shadow: 0 0 0 1px #000000;
}

.phone__status {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 26px 0 32px;
  color: var(--night-ink);
  fill: currentColor;
  font: 600 13px/16px -apple-system, 'SF Pro Text', var(--font-text);
  letter-spacing: .01em;
}
.phone__icons { display: flex; align-items: center; gap: 5px; }
.phone__island {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 90px;
  height: 26px;
  margin-left: -45px;
  border-radius: 13px;
  background: #000000;
}
.phone__screen img { width: 100%; }
.phone__home {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 108px;
  height: 4px;
  margin-left: -54px;
  border-radius: 2px;
  background: var(--night-ink);
  opacity: .85;
}

/* ---------- возможности ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.feature {
  padding: 28px;
  border-radius: 12px;
  background: var(--bg-alt);
  transition: transform .25s ease;
}
.feature:hover { transform: translateY(-4px); }
.feature svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature h3 { margin-top: 16px; font-size: 19px; line-height: 26px; font-weight: 600; }
.feature p { margin-top: 8px; color: var(--ink-2); font-size: 15px; line-height: 24px; }

@media (max-width: 1023px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .features { grid-template-columns: minmax(0, 1fr); margin-top: 32px; }
  .feature { padding: 24px; }
}

/* ---------- интерфейс ---------- */

.screens {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.screen { transition: transform .25s ease; }
.screen:hover { transform: translateY(-4px); }

/* Окно фиксированной высоты, скриншот кадрируется сверху; по клику —
   на весь экран (main.js) */
.screen__frame {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  height: 300px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--shot-bg);
  box-shadow: 0 20px 50px -24px rgba(10, 26, 51, .35);
}
.screen__frame--dark { background: var(--shot-bg-dark); box-shadow: 0 20px 50px -24px rgba(10, 26, 51, .5); }
.screen__frame img { width: 100%; }
.screen__frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.screen figcaption { margin-top: 16px; color: var(--muted); font-size: 15px; line-height: 22px; }
.screen strong { display: block; color: var(--ink); font-size: 17px; line-height: 24px; font-weight: 600; }

@media (max-width: 1023px) {
  .screens { grid-template-columns: minmax(0, 1fr); gap: 40px; max-width: 640px; }
  .screen__frame { height: auto; aspect-ratio: 800 / 520; }
}

/* ---------- подключение ---------- */

.steps { position: relative; margin-top: 56px; }

.steps__line {
  position: absolute;
  left: 0;
  top: 18px;
  width: 100%;
  height: 20px;
}
.steps__line line { stroke-width: 2; vector-effect: non-scaling-stroke; }
.steps__base { stroke: var(--line); }
.steps__pulse {
  stroke: var(--accent);
  stroke-dasharray: 220 1380;
  animation: sweep 4.5s linear infinite;
}

.steps ol {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}
.steps h3 { margin-top: 20px; font-size: 19px; line-height: 26px; font-weight: 600; }
.steps p { margin-top: 8px; color: var(--ink-2); font-size: 15px; line-height: 24px; }

.steps__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--accent);
  font: 800 20px/1 var(--font-head);
}
.steps__num--last { background: var(--ink); box-shadow: none; color: #FFFFFF; }

/* Линия связывает шаги только в один ряд */
@media (max-width: 1023px) {
  .steps__line { display: none; }
  .steps ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
}
@media (max-width: 560px) {
  .steps { margin-top: 40px; }
  .steps ol { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

/* ---------- для кого ---------- */

.audience {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 48px;
  margin-top: 40px;
}
.audience li { padding-top: 20px; border-top: 2px solid var(--ink); }
.audience h3 { font-size: 21px; line-height: 28px; font-weight: 600; }
.audience p { margin-top: 10px; color: var(--ink-2); font-size: 16px; line-height: 26px; }

@media (max-width: 860px) {
  .audience { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

/* ---------- финал и подвал ---------- */

.final { position: relative; overflow: hidden; }

.final__row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-top: var(--section-y);
  padding-bottom: 160px;
}
.final__text { max-width: 640px; }
.final__cta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.final__contact { color: var(--night-muted); font-size: 14px; line-height: 20px; }
.final__contact a { color: var(--night-ink-2); text-decoration: underline; text-underline-offset: 3px; }
.final__contact a:hover { color: var(--night-ink); }

@media (max-width: 720px) {
  .final__row { padding-bottom: 140px; }
  .ecg--final { height: 160px; }
}

.footer { background: var(--night); color: var(--night-muted); border-top: 1px solid var(--night-line); }
.footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 14px;
  line-height: 20px;
}
.footer__brand { color: var(--night-ink); font: 800 17px/20px var(--font-head); letter-spacing: -.02em; }

/* ---------- просмотр экрана ---------- */

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 56px 80px 16px;
  border: 0;
  background: transparent;
  overflow: auto;
  cursor: zoom-out;
}
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: rgba(6, 11, 20, .94); }
.lightbox__img {
  max-width: min(1440px, 100%);
  max-height: 100%;
  /* auto во flex — по центру, а если картинка выше окна, прокрутка с её верха */
  margin: auto;
  border-radius: 12px;
  object-fit: contain;
}
.lightbox__close {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--night-3);
  color: var(--night-ink);
  cursor: pointer;
}
.lightbox__nav {
  position: fixed;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--night-3);
  color: var(--night-ink);
  cursor: pointer;
  transition: background-color .2s ease;
}
.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }
.lightbox__close:hover, .lightbox__nav:hover { background: #2A3A52; }
.lightbox__close svg, .lightbox__nav svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lightbox__close:focus-visible, .lightbox__nav:focus-visible { outline: 2px solid var(--pulse); outline-offset: 2px; }
.lightbox__count {
  position: fixed;
  left: 0;
  right: 0;
  top: 20px;
  color: var(--night-muted);
  font-size: 14px;
  line-height: 24px;
  text-align: center;
  pointer-events: none;
}
html:has(.lightbox[open]) { overflow: hidden; }

/* На телефоне окно целиком — мелко: показываем в ширину, дальше прокрутка */
@media (max-width: 720px) {
  .lightbox { padding: 56px 16px 80px; }
  .lightbox__img { max-height: none; }
  .lightbox__nav { top: auto; bottom: 16px; margin-top: 0; }
  .lightbox__prev { left: calc(50% - 56px); }
  .lightbox__next { right: calc(50% - 56px); }
}

/* ---------- анимации ---------- */

.rise { animation: rise .9s var(--ease-out) both; }
.rise--2 { animation-delay: .12s; }
.rise--3 { animation-delay: .24s; }

.float { animation: float 7s ease-in-out infinite; }
.float--slow { animation-duration: 9s; animation-delay: 1s; }

.pop { animation: pop 1.1s .6s var(--ease-out) both; }
.pop--late { animation-delay: 1.4s; }

.glow { animation: glow 2.4s ease-in-out infinite; }

.spin { transform-origin: 50px 50px; animation: spin 40s linear infinite; }

/* Появление при прокрутке: класс .is-pending ставит main.js и снимает,
   когда блок попадает в окно. Без скрипта блоки просто на месте. */
.reveal.is-pending { transform: translateY(18px); }
.reveal.is-shown { animation: rise .9s var(--ease-out) both; }

@keyframes rise { from { transform: translateY(18px); } to { transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pop {
  0% { transform: translateY(12px) scale(.97); }
  60% { transform: translateY(-2px) scale(1.01); }
  100% { transform: none; }
}
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sweep { from { stroke-dashoffset: 1600; } to { stroke-dashoffset: 0; } }

/* Без движения страница остаётся законченной: комета замирает на пике,
   импульс — на первом шаге */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ecg-comet--hero { transform: translateX(720px); }
  .ecg-comet--final { transform: translateX(1100px); }
}
