/* ai-speak — лендинг. Палитра продолжает ai-speak.ru (ночной синий + голубой/фиолетовый/бирюза),
   композиция — «чёрная сцена» Dala: крупная лёгкая типографика, без карточек и теней. */

:root {
  --bg: #05070e;
  --bg-1: #0b1020;
  --bg-2: #131a33;
  --ink: #e8ecf6;
  --ink-2: #bcc6de;
  --muted: #9aa6c4;
  --faint: rgba(154, 166, 196, .55);
  --line: rgba(142, 160, 220, .16);
  --blue: #6ea8fe;
  --violet: #8f7dfb;
  --teal: #3fd0c9;
  --magenta: #e07bf5;
  --iri: linear-gradient(100deg, #6ea8fe 0%, #8f7dfb 30%, #e07bf5 50%, #3fd0c9 75%, #6ea8fe 100%);

  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(96px, 14vw, 180px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: rgba(143, 125, 251, .45); }

/* ---------- Слои фона ---------- */
#voice-line {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
}
.grain {
  position: fixed; inset: -50%; z-index: 50; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
main, .footer, .nav { position: relative; z-index: 2; }

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

/* ---------- Типографика ---------- */
.display {
  font-weight: 400;
  font-size: clamp(52px, 9.4vw, 128px);
  line-height: .98;
  letter-spacing: -.045em;
}
.h2 {
  font-weight: 400;
  font-size: clamp(38px, 5.6vw, 78px);
  line-height: 1.02;
  letter-spacing: -.04em;
}
.lead { font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); max-width: 34em; font-weight: 300; }
.body { color: var(--ink-2); max-width: 30em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; font-weight: 400;
  letter-spacing: .16em; text-transform: uppercase; color: var(--teal);
  margin-bottom: 28px;
}
.eyebrow .idx { color: var(--faint); }
.iri {
  background: var(--iri); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: iri 8s linear infinite;
}
@keyframes iri { to { background-position: -220% 0; } }
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 0 0 rgba(63, 208, 201, .6); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(63, 208, 201, .55); }
  70% { box-shadow: 0 0 0 12px rgba(63, 208, 201, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 208, 201, 0); }
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 26px; border-radius: 999px;
  font-size: 15px; font-weight: 400; letter-spacing: .01em; white-space: nowrap;
  transition: transform .4s var(--ease), background .3s, box-shadow .4s, color .3s;
}
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 10px 40px -8px rgba(143,125,251,.75), 0 0 80px -20px rgba(63,208,201,.6); }
.btn-ghost { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px rgba(232,236,246,.4); }
.btn:focus-visible, .voice:focus-visible, .nav a:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

/* ---------- Навигация ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px var(--gutter);
  transition: background .4s, backdrop-filter .4s, padding .4s;
}
.nav.is-scrolled { background: rgba(5, 7, 14, .62); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 19px; letter-spacing: -.02em; }
.brand-mark { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 34px; }
.nav-links a { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); transition: color .25s; }
.nav-links a:hover { color: var(--ink); }

/* ---------- Видео-узлы: чёрный фон растворяется через screen ---------- */
.node { position: absolute; pointer-events: none; z-index: 0; }
.node video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  mix-blend-mode: screen; opacity: 0; transition: opacity 1.2s var(--ease);
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
}
.node video.is-on { opacity: 1; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; padding-bottom: clamp(72px, 10vh, 120px); overflow: hidden; }
.hero-glow { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-glow .orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .32; animation: float 18s ease-in-out infinite; }
.hero-glow .a { width: 520px; height: 520px; background: var(--blue); top: -220px; left: -160px; }
.hero-glow .b { width: 440px; height: 440px; background: var(--violet); bottom: -240px; right: 6%; animation-delay: -6s; }
.hero-glow .c { width: 300px; height: 300px; background: var(--teal); top: 30%; left: 46%; animation-delay: -11s; opacity: .16; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(30px, -40px) scale(1.08); } }
.node-hero { top: 0; bottom: 0; left: 70%; width: min(118vh, 92vw); transform: translateX(-50%); }
.hero-inner { position: relative; z-index: 2; }
.hero .display { margin-bottom: 30px; }
.hero .lead { margin-bottom: 40px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.scroll-hint {
  position: absolute; z-index: 2; right: var(--gutter); bottom: 36px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint);
  writing-mode: vertical-rl;
}

/* ---------- Цифры ---------- */
.stats { padding-block: clamp(72px, 9vw, 120px); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); }
.stats-grid > div { padding: 28px 28px 0 0; }
.stats-grid > div + div { padding-left: 28px; border-left: 1px solid var(--line); }
.stats dt { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.stats .num { font-size: clamp(40px, 4.6vw, 64px); font-weight: 300; letter-spacing: -.04em; line-height: 1; }
.stats .unit { font-size: 22px; color: var(--muted); }
.stats dd { color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 16em; }

/* ---------- Манифест ---------- */
.manifesto { padding-block: var(--section); padding-left: max(var(--gutter), 14vw); }
.manifesto-text {
  font-size: clamp(30px, 4.4vw, 62px); font-weight: 300; line-height: 1.14; letter-spacing: -.03em; max-width: 19em;
}
.manifesto-text .w { opacity: .14; transition: opacity .5s; }
.manifesto-text .w.is-lit { opacity: 1; }

/* ---------- Возможности ---------- */
.feature {
  position: relative; min-height: 110vh;
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  max-width: var(--wrap); margin: 0 auto; padding: var(--section) var(--gutter);
}
.node-feature { left: 30%; top: 50%; width: min(68vw, 1100px); aspect-ratio: 16 / 9; transform: translate(-50%, -50%); }
.feature-flip .node-feature { left: 70%; }
.feature .feature-copy { grid-column: 2; position: relative; z-index: 2; padding-left: clamp(0px, 3vw, 48px); }
.feature-flip .feature-copy { grid-column: 1; padding-left: 0; padding-right: clamp(0px, 3vw, 48px); }
.feature .h2 { margin-bottom: 26px; }
.facts { margin-top: 34px; border-top: 1px solid var(--line); }
.facts li {
  display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em; color: var(--ink-2);
}
.facts li::before { content: ""; width: 18px; height: 1px; background: var(--iri); flex: none; }

/* ---------- Голоса ---------- */
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head .h2 { margin-bottom: 22px; }
.voices { padding-block: var(--section); position: relative; z-index: 2; }
.voice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
.voice {
  position: relative; width: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 18px;
  align-items: center; text-align: left; padding: 26px 24px; background: rgba(5, 7, 14, .88);
  transition: background .35s;
}
.voice:hover { background: rgba(19, 26, 51, .9); }
.voice-eq { grid-row: 1 / 3; display: flex; align-items: center; gap: 3px; width: 44px; height: 44px; border-radius: 50%; justify-content: center; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .3s; }
.voice-eq i { width: 3px; height: 6px; border-radius: 2px; background: var(--muted); transform-origin: center; transition: transform .08s linear, background .3s; }
.voice-name { font-size: 22px; font-weight: 400; letter-spacing: -.02em; line-height: 1.2; }
.voice-meta { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.voice.is-playing { background: rgba(19, 26, 51, .95); }
.voice.is-playing .voice-eq { box-shadow: inset 0 0 0 1px rgba(143, 125, 251, .7), 0 0 30px -6px rgba(143, 125, 251, .8); }
.voice.is-playing .voice-eq i { background: var(--iri); }

/* ---------- Сценарии ---------- */
.cases { padding-block: var(--section); padding-left: max(var(--gutter), 8vw); }
.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: clamp(24px, 4vw, 64px); row-gap: 64px; }
.case-grid li { border-top: 1px solid var(--line); padding-top: 24px; }
.case-n { font-family: var(--mono); font-size: 12px; color: var(--teal); letter-spacing: .1em; }
.case-grid h3 { font-size: clamp(24px, 2.2vw, 30px); font-weight: 400; letter-spacing: -.03em; line-height: 1.15; margin: 18px 0 14px; }
.case-grid p { color: var(--muted); font-size: 16px; max-width: 24em; }

/* ---------- API ---------- */
.api { padding-block: var(--section); display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(48px, 9vw, 140px); align-items: center; }
.api .h2 { margin-bottom: 44px; }
.steps li { display: flex; gap: 22px; padding: 22px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.step-n { font-family: var(--mono); font-size: 13px; color: var(--violet); padding-top: 4px; }
.steps h3 { font-size: 22px; font-weight: 400; letter-spacing: -.02em; margin-bottom: 4px; }
.steps p { color: var(--muted); font-size: 16px; }
.code {
  position: relative; z-index: 2; border-radius: 24px; overflow: hidden;
  background: rgba(11, 16, 32, .82); box-shadow: inset 0 0 0 1px var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.code figcaption { display: flex; align-items: center; gap: 7px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.code .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(154, 166, 196, .25); }
.code-title { margin-left: 12px; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.code pre { padding: 24px 24px 28px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.75; color: var(--ink-2); }
.code .k { color: var(--violet); } .code .s { color: var(--teal); } .code .p { color: var(--blue); } .code .c { color: var(--faint); }

/* ---------- Финал ---------- */
.finale { position: relative; height: 320vh; }
.finale-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; place-items: center; }
.finale-video { position: absolute; inset: 0; }
.finale-video .fv {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.4s var(--ease); mix-blend-mode: screen;
}
.finale-video .fv.is-on { opacity: 1; }
.finale-video::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(5, 7, 14, .55) 75%, var(--bg) 100%),
              linear-gradient(to top, rgba(5, 7, 14, .92) 0%, rgba(5, 7, 14, 0) 42%);
}
/* Лицо в кадре смещено влево — текст встаёт справа от него и не закрывает взгляд */
.finale-copy {
  position: absolute; z-index: 2; left: 58%; right: var(--gutter); top: 50%;
  display: flex; flex-direction: column; align-items: flex-start;
  opacity: 0; transform: translateY(calc(-50% + 30px)); transition: opacity 1.6s var(--ease), transform 1.6s var(--ease);
}
.finale.is-revealed .finale-copy { opacity: 1; transform: translateY(-50%); }
.finale-title { font-size: clamp(52px, 6.6vw, 104px); margin-bottom: 22px; }
.finale .lead { margin-bottom: 36px; }
.finale-video::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 1.6s var(--ease);
  background: linear-gradient(to left, rgba(5, 7, 14, .88) 0%, rgba(5, 7, 14, .5) 34%, rgba(5, 7, 14, 0) 58%);
}
.finale.is-revealed .finale-video::before { opacity: 1; }

/* ---------- Подвал ---------- */
.footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-block: 40px 48px; border-top: 1px solid var(--line); color: var(--faint); font-size: 14px; }
.footer nav { display: flex; gap: 28px; }
.footer a:hover { color: var(--ink); }

/* ---------- Появление ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats-grid > div:nth-child(n+3) { margin-top: 28px; border-top: 1px solid var(--line); }
  .case-grid { grid-template-columns: repeat(2, 1fr); }
  .voice-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .hero { align-items: flex-end; }
  .node-hero { left: 50%; width: 170vw; top: -6vh; bottom: auto; height: 80vh; }
  .node-hero video.is-on { opacity: .45; }
  .scroll-hint { display: none; }
  .manifesto { padding-left: calc(var(--gutter) + 18px); }
  .feature, .feature-flip { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 0; overflow: clip; }
  .hero-inner { padding-left: calc(var(--gutter) + 18px); }
  .voices { padding-left: calc(var(--gutter) + 18px); }
  .node-feature, .feature-flip .node-feature { position: relative; left: 50%; top: auto; width: 150vw; transform: translateX(-50%); margin-bottom: -8vw; }
  .feature .feature-copy, .feature-flip .feature-copy { grid-column: 1; padding: 0 0 0 18px; }
  .voice-grid { grid-template-columns: 1fr 1fr; }
  .voice { padding: 20px 16px; column-gap: 12px; }
  .voice-eq { width: 38px; height: 38px; }
  .voice-name { font-size: 18px; }
  .cases { padding-left: calc(var(--gutter) + 18px); }
  .case-grid { grid-template-columns: 1fr; row-gap: 40px; }
  .api { grid-template-columns: 1fr; padding-left: calc(var(--gutter) + 18px); }
  .finale-copy { left: var(--gutter); right: var(--gutter); top: auto; bottom: 48px; align-items: center; text-align: center; transform: translateY(30px); }
  .finale.is-revealed .finale-copy { transform: none; }
  .finale .cta-row { justify-content: center; }
  .finale-video::before { background: linear-gradient(to top, rgba(5, 7, 14, .92) 0%, rgba(5, 7, 14, .4) 40%, rgba(5, 7, 14, 0) 60%); }
  .code pre { font-size: 12px; padding: 18px; }
  .stats-grid > div { padding-right: 12px; }
  .stats-grid > div + div { padding-left: 16px; }
  .stats dd { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .hero-glow .orb, .iri, .pulse { animation: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .manifesto-text .w { opacity: 1; }
}
