/* ALFRIC landing v3 — «Полночное золото», живые макеты интерфейсов.
   Темы: system по умолчанию (prefers-color-scheme) + ручной data-theme.
   Макеты продукта всегда тёмные (как само приложение) — в обеих темах. */

/* ---------- Токены ---------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", system-ui, sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --bg: #f5f3ef;
  --bg-2: #fffdf9;
  --bg-3: #f0ede5;
  --border: #e4dfd2;
  --border-strong: #d3ccba;
  --text: #1b1c1d;
  --muted: #5f5c53;
  --gold: #8f7038;
  --gold-strong: #a6854a;
  --gold-tint: rgba(166, 133, 74, 0.12);
  --cta-bg: #1b1c1d;
  --cta-text: #f3ecda;
  --cta-shadow: 0 10px 24px rgba(28, 27, 24, 0.18);
  --glass: rgba(245, 243, 239, 0.8);
  --shadow-lg: 0 24px 64px rgba(60, 50, 25, 0.16);
  --shadow-md: 0 12px 32px rgba(60, 50, 25, 0.1);
  --star: rgba(143, 112, 56, 0.55);
  --link-line: rgba(143, 112, 56, 0.22);
  --aur-a: rgba(184, 148, 84, 0.2);
  --aur-b: rgba(210, 180, 120, 0.16);
  --aur-c: rgba(140, 110, 60, 0.12);

  /* Макеты продукта (всегда тёмные) */
  --mk-bg: #131316;
  --mk-bg-2: #1a1b1f;
  --mk-bg-3: #212228;
  --mk-border: #2b2c33;
  --mk-text: #ecebe6;
  --mk-muted: #96948c;
  --mk-gold: #b89454;
  --mk-gold-soft: rgba(184, 148, 84, 0.16);
  --mk-green: #6b8c5c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0e;
    --bg-2: #16171a;
    --bg-3: #1c1d22;
    --border: #27282d;
    --border-strong: #383a41;
    --text: #ece9e2;
    --muted: #a19d93;
    --gold: #b89454;
    --gold-strong: #c9a565;
    --gold-tint: rgba(184, 148, 84, 0.12);
    --cta-bg: linear-gradient(180deg, #c9a565, #a6854a);
    --cta-text: #171410;
    --cta-shadow: 0 10px 28px rgba(184, 148, 84, 0.28);
    --glass: rgba(12, 12, 14, 0.75);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
    --star: rgba(184, 148, 84, 0.7);
    --link-line: rgba(184, 148, 84, 0.18);
    --aur-a: rgba(184, 148, 84, 0.14);
    --aur-b: rgba(120, 90, 40, 0.18);
    --aur-c: rgba(70, 55, 30, 0.22);
  }
}

:root[data-theme="dark"] {
  --bg: #0c0c0e;
  --bg-2: #16171a;
  --bg-3: #1c1d22;
  --border: #27282d;
  --border-strong: #383a41;
  --text: #ece9e2;
  --muted: #a19d93;
  --gold: #b89454;
  --gold-strong: #c9a565;
  --gold-tint: rgba(184, 148, 84, 0.12);
  --cta-bg: linear-gradient(180deg, #c9a565, #a6854a);
  --cta-text: #171410;
  --cta-shadow: 0 10px 28px rgba(184, 148, 84, 0.28);
  --glass: rgba(12, 12, 14, 0.75);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
  --star: rgba(184, 148, 84, 0.7);
  --link-line: rgba(184, 148, 84, 0.18);
  --aur-a: rgba(184, 148, 84, 0.14);
  --aur-b: rgba(120, 90, 40, 0.18);
  --aur-c: rgba(70, 55, 30, 0.22);
}

/* ---------- База ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }

img { height: auto; }

a { color: inherit; }

button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--gold-tint); }

.eyebrow {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Прогресс скролла ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  background: transparent;
}

.scroll-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-strong));
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- Reveal-анимации ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(34px) scale(0.975);
  filter: blur(10px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].revealed { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; filter: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Aurora ---------- */
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.aurora i {
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.aurora i:nth-child(1) { background: var(--aur-a); top: -18%; right: -8%; animation: float-a 26s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: var(--aur-b); bottom: -30%; left: -12%; animation: float-b 32s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { background: var(--aur-c); top: 30%; left: 34%; width: 30vw; height: 30vw; animation: float-c 24s ease-in-out infinite alternate; }

.aurora.dim i { opacity: 0.5; }

@keyframes float-a { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-8%, 10%, 0) scale(1.15); } }
@keyframes float-b { from { transform: translate3d(0, 0, 0) scale(1.1); } to { transform: translate3d(10%, -8%, 0) scale(0.95); } }
@keyframes float-c { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(12%, 12%, 0); } }

/* ---------- Шапка ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.topbar.scrolled {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom-color: var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.brand .mark { width: 22px; height: 22px; color: var(--gold); flex: 0 0 auto; }

.brand span { color: var(--gold); }

.top-nav { display: flex; gap: 4px; margin-inline: auto; }

.top-nav a {
  position: relative;
  font-size: 14px;
  font-weight: 550;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.top-nav a:hover { color: var(--text); background: var(--gold-tint); }

.top-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.3s ease;
}

.theme-toggle:hover { color: var(--gold); border-color: var(--border-strong); transform: rotate(24deg); }

.theme-toggle svg { width: 18px; height: 18px; }

.icon-moon { display: none; }

:root[data-theme="dark"] .icon-moon { display: block; }
:root[data-theme="dark"] .icon-sun { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon { display: block; }
  :root:not([data-theme="light"]) .icon-sun { display: none; }
}

/* ---------- Кнопки ---------- */
.cta-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border: none;
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  box-shadow: var(--cta-shadow);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, filter 0.25s ease;
}

.cta-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.35) 50%, transparent 68%);
  transform: translateX(-130%);
  pointer-events: none;
}

.cta-button:hover { transform: translateY(-2px); filter: brightness(1.05); }

.cta-button:hover::after { animation: shine 0.9s ease; }

@keyframes shine { to { transform: translateX(130%); } }

.cta-button:active { transform: translateY(0); }

.cta-button svg { width: 18px; height: 18px; transition: transform 0.25s ease; }

.cta-button:hover svg { transform: translateX(3px); }

.cta-button.small { padding: 10px 18px; font-size: 13px; box-shadow: none; }

.cta-button.ghost {
  background: transparent;
  color: var(--gold);
  box-shadow: inset 0 0 0 1.5px var(--gold);
}

.cta-button.ghost::after { display: none; }

.cta-button.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--gold-strong); }

/* «Войти» — для тех, у кого аккаунт уже есть: заметно, но не спорит за внимание
   с «Попробовать» и «Регистрацией». Поэтому текстом, без рамки и заливки. */
.cta-button.plain {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  padding-left: 10px;
  padding-right: 10px;
}

.cta-button.plain::after { display: none; }

.cta-button.plain:hover { color: var(--gold); background: transparent; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(96px, 13vh, 150px) clamp(20px, 5vw, 72px) 72px;
  overflow: hidden;
}

.constellation {
  position: absolute;
  inset: -5% -5% auto;
  width: 110%;
  height: 90%;
  pointer-events: none;
  animation: drift 60s linear infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-1.5%, 0, 0); }
  to   { transform: translate3d(1.5%, -2%, 0); }
}

.constellation line { stroke: var(--link-line); stroke-width: 1; }

.constellation circle { fill: var(--star); animation: twinkle 4.5s ease-in-out infinite; }

.constellation circle:nth-child(odd) { animation-delay: 1.4s; }
.constellation circle:nth-child(3n) { animation-delay: 2.6s; }
.constellation circle:nth-child(4n) { animation-delay: 0.8s; animation-duration: 6s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

.hero-copy { position: relative; z-index: 2; max-width: 580px; }

.wordmark {
  font-family: var(--font-display);
  font-size: clamp(50px, 7.2vw, 92px);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: 0.14em;
  margin-top: 14px;
  background: linear-gradient(100deg, var(--text) 55%, var(--gold-strong) 78%, var(--text) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gold-sheen 7s ease-in-out infinite;
}

@keyframes gold-sheen {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

.tagline {
  font-size: clamp(20px, 2.2vw, 27px);
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-top: 16px;
}

/* Ротация УТП: фразы лежат в одной grid-ячейке, высота блока = самая длинная
   фраза, поэтому смена не дёргает layout. */
.tagline-rotator {
  display: grid;
}

.tagline-rotator > span {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.tagline-rotator > span.is-active {
  opacity: 1;
  transform: none;
}

.tagline-rotator > span.is-leaving {
  opacity: 0;
  transform: translateY(-14px);
}

.description {
  color: var(--muted);
  font-size: 17px;
  max-width: 46ch;
  margin-top: 14px;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
}

.hero-facts {
  list-style: none;
  display: flex;
  gap: clamp(18px, 2.4vw, 34px);
  margin-top: 36px;
}

.hero-facts li { display: grid; gap: 2px; position: relative; }

.hero-facts li + li { padding-left: clamp(18px, 2.4vw, 34px); border-left: 1px solid var(--border); }

.hero-facts b { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }

.hero-facts span { font-size: 12.5px; color: var(--muted); }

/* Композиция устройств в hero */
.hero-devices { position: relative; z-index: 1; display: grid; place-items: center; will-change: transform; }

.hero-devices .hero-mac { width: min(100%, 680px); rotate: 0.4deg; }

.hero-mac { transition: rotate 0.6s ease; }

.hero-devices:hover .hero-mac { rotate: 0deg; }

/* ---------- Scroll-hint ---------- */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  translate: -50% 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-2);
  animation: bob 2.4s ease-in-out infinite;
  z-index: 3;
}

.scroll-hint svg { width: 16px; height: 16px; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* =========================================================
   РЕАЛЬНЫЕ СКРИНШОТЫ ПРИЛОЖЕНИЯ В РАМКАХ УСТРОЙСТВ
   Движение: Ken Burns (медленный пан/зум), перелистывание экранов.
   ========================================================= */

/* Mac-окно */
.mac-shot {
  width: 100%;
  background: #141416;
  border: 1px solid #2b2c33;
  border-radius: 14px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.ms-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  background: #1a1b1f;
  border-bottom: 1px solid #2b2c33;
}

.ms-chrome i { width: 11px; height: 11px; border-radius: 50%; }
.ms-chrome i:nth-child(1) { background: #de6057; }
.ms-chrome i:nth-child(2) { background: #dfae4b; }
.ms-chrome i:nth-child(3) { background: #66b168; }
.ms-chrome em { font-style: normal; font-size: 11px; color: #96948c; margin-inline: auto; letter-spacing: 0.08em; }

/* Видовое окно: скриншот целиком, без кадрирования — интерфейс читается сразу */
.ms-view {
  position: relative;
  aspect-ratio: 1240 / 860;
  overflow: hidden;
  background: #131316;
}

.ms-view img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: transform;
}

.ms-view img.is-active {
  opacity: 1;
  animation: shot-breathe 18s ease-in-out infinite alternate;
}

@keyframes shot-breathe {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

/* ---------- Scrolly-секции ---------- */
.scrolly { position: relative; height: 450vh; }

.scrolly-pin {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.scrolly-grid {
  width: 100%;
  max-width: 1220px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}

.scrolly.flip .scrolly-grid > .scrolly-copy { order: 2; }
.scrolly.flip .scrolly-grid > .scrolly-stage { order: 1; }

.scrolly-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 12px;
}

.steps { list-style: none; margin-top: 30px; display: grid; gap: 6px; counter-reset: step; }

.step {
  position: relative;
  padding: 14px 16px 14px 22px;
  border-left: 2px solid var(--border);
  opacity: 0.42;
  cursor: pointer;
  transition: opacity 0.45s ease, border-color 0.45s ease, background-color 0.45s ease, transform 0.45s ease;
}

.step h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }

.step p { font-size: 14.5px; color: var(--muted); margin-top: 4px; max-width: 44ch; }

.step.is-active {
  opacity: 1;
  transform: translateX(4px);
  border-left-color: var(--gold);
  background: linear-gradient(90deg, var(--gold-tint), transparent 70%);
  border-radius: 0 12px 12px 0;
}

.scrolly-stage { display: grid; place-items: center; perspective: 1400px; touch-action: pan-y; }

.stage-caption { display: none; text-align: center; margin-top: 18px; max-width: 340px; }

.stage-caption .dots { display: flex; justify-content: center; gap: 7px; margin-bottom: 12px; }

.stage-caption .dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.stage-caption .dots i.on { background: var(--gold); transform: scale(1.25); }

.stage-caption b { display: block; font-size: 16px; font-weight: 700; }

.stage-caption small { display: block; font-size: 13.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

.stage-mac { width: min(100%, 720px); }

/* ---------- Обычные секции ---------- */
.section {
  position: relative;
  padding: clamp(80px, 12vh, 140px) clamp(20px, 5vw, 48px);
  max-width: 1220px;
  margin-inline: auto;
}

.section-head { max-width: 660px; position: relative; z-index: 1; }

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 12px;
}

.section-sub { color: var(--muted); margin-top: 12px; font-size: 17px; }

/* Приватность */
.privacy { overflow: hidden; border-block: 1px solid var(--border); max-width: none; }

.privacy > .section-head, .privacy > .privacy-grid { max-width: 1124px; margin-inline: auto; }

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 44px;
  position: relative;
  z-index: 1;
}

.privacy-card {
  padding: 30px 26px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.privacy-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.privacy-card svg { width: 36px; height: 36px; color: var(--gold); }

.privacy-card h3 { font-size: 18px; font-weight: 700; margin-top: 16px; letter-spacing: -0.01em; }

.privacy-card p { font-size: 15px; color: var(--muted); margin-top: 8px; }

/* Демо */
.video-frame {
  margin: 40px auto 0;
  max-width: 360px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: #0f0f12;
}

.video-frame video { width: 100%; aspect-ratio: 720 / 1554; }

/* FAQ */
.faq-list { margin: 40px auto 0; width: 100%; display: grid; gap: 12px; }

.faq-list details {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.25s ease;
}

.faq-list details[open] { border-color: var(--border-strong); }

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-icon { position: relative; flex: 0 0 auto; width: 18px; height: 18px; }

.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  width: 14px;
  height: 1.6px;
  background: var(--gold);
  transition: rotate 0.3s ease;
}

.faq-icon::after { rotate: 90deg; }

details[open] .faq-icon::after { rotate: 0deg; }

.faq-body {
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 15px;
  animation: faq-in 0.35s ease;
}

@keyframes faq-in {
  from { opacity: 0; translate: 0 -6px; }
  to { opacity: 1; translate: 0 0; }
}

/* Финальный CTA */
.final-cta { padding: clamp(60px, 10vh, 120px) clamp(20px, 5vw, 48px) clamp(80px, 12vh, 140px); }

.final-panel {
  position: relative;
  max-width: 880px;
  margin-inline: auto;
  padding: clamp(48px, 7vw, 84px) clamp(24px, 6vw, 72px);
  text-align: center;
  background:
    radial-gradient(120% 160% at 50% -30%, var(--gold-tint) 0%, transparent 55%),
    var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.final-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  color: var(--gold);
  animation: bob 3.5s ease-in-out infinite;
}

.final-panel h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 50px);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 12px;
}

.final-panel p { color: var(--muted); max-width: 52ch; margin: 14px auto 0; }

.final-panel .cta-button { margin-top: 30px; }

/* ---------- Футер ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  padding: 28px clamp(20px, 5vw, 48px) 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13.5px;
}

.footer-brand { display: flex; align-items: center; gap: 12px; }

.mini-wordmark {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: 0.1em;
  color: var(--text);
}

.footer .divider { width: 22px; height: 1px; background: var(--border-strong); }

.footer-links { margin-inline: auto; display: flex; flex-wrap: wrap; gap: 4px 18px; }

.footer-links a { color: var(--muted); text-decoration-color: var(--border-strong); }

.footer-links a:hover { color: var(--text); }

/* ---------- Диалог подписки ---------- */
.subscribe-dialog {
  margin: auto;
  border: none;
  border-radius: 20px;
  padding: 0;
  background: transparent;
  max-width: min(440px, calc(100vw - 32px));
  width: 100%;
}

.subscribe-dialog::backdrop {
  background: rgba(8, 8, 10, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.subscribe-dialog[open] .dialog-panel { animation: dlg-in 0.35s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes dlg-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.dialog-panel {
  position: relative;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px 28px;
  box-shadow: var(--shadow-lg);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.dialog-close:hover { color: var(--text); border-color: var(--border-strong); }

.dialog-close svg { width: 14px; height: 14px; }

.dialog-kicker { font-size: 11px; font-weight: 650; letter-spacing: 0.16em; color: var(--gold); }

.dialog-panel h2 {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 10px;
}

.dialog-text { color: var(--muted); font-size: 15px; margin-top: 8px; }

.form-legal { color: var(--muted); font-size: 12px; margin-top: 14px; text-align: center; }

/* Окно «Попробовать сейчас»: скачивание + шаги первого запуска */
.try-downloads { display: grid; gap: 10px; margin-top: 22px; }

.try-downloads .cta-button { justify-content: center; width: 100%; }

.try-downloads svg { width: 17px; height: 17px; }

.try-steps {
  list-style: none;
  counter-reset: try;
  display: grid;
  gap: 10px;
  margin: 24px 0 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.try-steps li {
  counter-increment: try;
  position: relative;
  padding-left: 32px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.try-steps li::before {
  content: counter(try);
  position: absolute;
  left: 0;
  top: -1px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-tint);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

.cta-button.wide { justify-content: center; width: 100%; }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; padding-top: 120px; }
  .hero-devices { margin-top: 20px; padding-bottom: 40px; }
  .hero-devices .hero-mac { width: min(100%, 600px); margin-inline: auto; }
}

@media (max-width: 900px) {
  .top-nav { display: none; }

  .scrolly { height: auto; }
  .scrolly-pin { position: static; height: auto; padding: 72px 0 24px; overflow: visible; }
  .scrolly-track { display: none; }
  .scrolly-grid { grid-template-columns: 1fr; gap: 32px; }
  .scrolly.flip .scrolly-grid > .scrolly-copy { order: 1; }
  .scrolly.flip .scrolly-grid > .scrolly-stage { order: 2; }
  .scrolly-stage { order: 2; }

  .privacy-grid { grid-template-columns: 1fr; }

  .steps { display: none; }
  .stage-caption { display: block; }
  .scrolly-stage > .mac-shot { cursor: grab; }

  .hero-facts { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  /* Две кнопки в шапке на узком экране не влезают рядом с логотипом и темой.
     Оставляем «Регистрацию» — «Попробовать» тем же действием есть в hero. */
  .top-actions [data-open-try] { display: none; }
  /* «Регистрация» + «Войти» рядом с логотипом и темой: ужимаем, иначе «Войти»
     уезжает за край экрана. */
  .top-actions { gap: 6px; }
  .top-actions .cta-button.small { padding: 9px 12px; font-size: 12px; }
  .top-actions .cta-button.plain { padding-left: 6px; padding-right: 6px; }
  .hero { padding-top: 104px; }
  .wordmark { font-size: clamp(44px, 13vw, 64px); }
  /* На узком экране кнопки действия — во всю ширину, в столбик. */
  .cta-group { display: grid; gap: 12px; }
  .cta-group .cta-button { width: 100%; justify-content: center; }
  .final-panel .cta-button { width: 100%; justify-content: center; }
  .footer { flex-direction: column; align-items: flex-start; }
  .footer-links { margin-inline: 0; }
  .hero-facts li + li { padding-left: 14px; }
}

/* Трек скролли-секций */
.scrolly-track { position: absolute; inset: 0; pointer-events: none; }

.scrolly-sentinel { height: 20%; }

/* ---------- Просмотр скриншота в полном размере ---------- */
/* Кликабельные снимки: курсор и лёгкий отклик подсказывают, что можно открыть. */
.ms-view img[data-zoomable] { cursor: zoom-in; }
.mac-shot:has(img[data-zoomable]) { transition: transform .25s ease; }
.mac-shot:has(img[data-zoomable]):hover { transform: translateY(-2px); }

.shot-dialog {
  width: min(1400px, 94vw);
  max-width: 94vw;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.shot-dialog::backdrop { background: rgba(12, 12, 14, .88); backdrop-filter: blur(3px); }
.shot-figure { margin: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.shot-figure img {
  width: 100%;
  height: auto;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  background: #16150f;
}
.shot-figure figcaption { color: rgba(255, 255, 255, .78); font-size: 14px; text-align: center; }
.shot-close {
  position: absolute;
  top: -46px;
  right: 0;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
}
.shot-close:hover { background: rgba(255, 255, 255, .18); }
@media (max-width: 640px) {
  .shot-dialog { width: 96vw; }
  .shot-close { top: -42px; }
  .shot-figure img { max-height: 74vh; }
}

/* Кейсы: сетка карточек-сценариев. Роль серым, результат заголовком. */
.cases-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.case-card { padding: 22px 24px; background: var(--glass); border: 1px solid var(--border); border-radius: 16px; }
.case-card .case-role { margin: 0 0 10px; font-size: 12.5px; letter-spacing: .04em; color: var(--gold); text-transform: uppercase; }
.case-card h3 { margin: 0 0 10px; font-size: 19px; line-height: 1.25; }
.case-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.case-card .case-role + h3 { letter-spacing: -0.01em; }
.cases-note { margin: 18px 0 0; color: var(--muted); font-size: 13px; }
@media (max-width: 720px) { .cases-grid { grid-template-columns: 1fr; } }
