/* Лендинг NeuroboxxAI — палитра Mini App «Полночь» (miniapp/public/theme-palette.js):
   фон #141923, карточка #202735, подложка #1a202c, текст #edf1f8, вторичный #aeb8ca,
   линии #384254, контролы #707e95, выбранное #2d3a52, акцент #adc4f5 (текст на нём #142239).
   Радиусы как в приложении: 10 / 14 / 18. Шрифт — системный, без загрузки. */
:root {
  color-scheme: dark;
  --bg: #141923;
  --paper: #202735;
  --well: #1a202c;
  --text: #edf1f8;
  --muted: #aeb8ca;
  --line: #384254;
  --line-soft: rgba(173, 196, 245, 0.12);
  --control: #707e95;
  --selected: #2d3a52;
  --accent: #adc4f5;
  --accent-hover: #c3d4f8;
  --on-accent: #142239;
  --ok: #8fe0b0;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 28px;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
}

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

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.i {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------------------------------------------------------------- кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font: 600 16px/1.2 var(--font);
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--control);
  background: var(--paper);
  color: var(--text);
}

.btn-sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 15px;
  border-radius: var(--r-sm);
}

.btn-lg {
  min-height: 54px;
  padding: 14px 26px;
  font-size: 17px;
}

.btn-wide {
  width: 100%;
}

/* ---------------------------------------------------------------- шапка */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 25, 35, 0.78);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease);
}

.nav-scrolled {
  border-bottom-color: var(--line-soft);
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font: 650 17px/1 var(--font-display);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  border-radius: 9px;
}

.nav-links {
  display: none;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  transition:
    color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--paper);
}

.nav .btn {
  margin-left: auto;
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }
  .nav-links + .btn {
    margin-left: 8px;
  }
}

@media (max-width: 380px) {
  .nav .btn-sm {
    padding: 8px 12px;
    font-size: 14px;
  }
  .nav .brand span {
    font-size: 16px;
  }
}

@media (max-width: 359px) {
  .nav .brand span {
    display: none;
  }
}

/* ---------------------------------------------------------------- первый экран */
.hero {
  position: relative;
  padding: clamp(36px, 7vw, 96px) 0 clamp(48px, 8vw, 112px);
}

/* первый экран чуть уведён в фиолетовый — в тон знаку N; остальная страница — «Полночь» */
.hero::before {
  content: '';
  position: absolute;
  inset: -64px 0 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 46% at 50% 0%, rgba(118, 76, 214, 0.16), transparent 72%),
    radial-gradient(40% 30% at 50% 4%, rgba(196, 84, 196, 0.06), transparent 70%),
    linear-gradient(to bottom, rgba(70, 48, 130, 0.12), transparent 88%);
}

@media (min-width: 960px) {
  .hero::before {
    background:
      radial-gradient(44% 62% at 76% 34%, rgba(118, 76, 214, 0.17), transparent 72%),
      radial-gradient(26% 36% at 74% 38%, rgba(196, 84, 196, 0.07), transparent 70%),
      linear-gradient(to bottom, rgba(70, 48, 130, 0.12), transparent 88%);
  }
}

.hero-grid {
  display: grid;
  grid-template-areas: 'mark' 'copy' 'mock';
  column-gap: clamp(40px, 6vw, 72px);
  align-items: center;
}

.hero-copy {
  grid-area: copy;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    grid-template-areas: 'copy mark' 'copy mock';
    grid-template-rows: auto auto;
    align-content: center;
  }
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(34px, 5.4vw, 62px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.lead {
  max-width: 34em;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.6;
}

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

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
}

.facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.facts .i {
  width: 18px;
  height: 18px;
  color: var(--ok);
}

@media (max-width: 520px) {
  .actions .btn {
    width: 100%;
  }
  .facts {
    flex-direction: column;
  }
}

/* Знак N (аватар бота): видео в квадрате 760×760, N занимает центр (≈26–74 % по ширине,
   27–73 % по высоте), бесконечность заставки — до ≈8 % от краёв. Края квадрата растворены
   круговой маской, тёмный фон ролика смешан с фоном страницы (screen), за знаком — свечение
   в тонах N: фиолетовый → маджента → персик. Размер задан заранее — вёрстка не прыгает. */
.hero-mark {
  --mark: 216px;
  grid-area: mark;
  justify-self: center;
  position: relative;
  width: var(--mark);
  height: var(--mark);
  /* прозрачное кольцо вокруг знака заходит на отступы, чтобы знак не удлинял экран */
  margin: calc(var(--mark) * -0.2) 0 calc(var(--mark) * -0.14);
  pointer-events: none;
}

.hero-mark::before {
  content: '';
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgba(120, 70, 220, 0.3) 22%,
    rgba(176, 66, 190, 0.17) 48%,
    rgba(255, 146, 118, 0.06) 70%,
    transparent 100%
  );
}

.mark-media {
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(closest-side, #000 64%, rgba(0, 0, 0, 0.55) 80%, transparent 98%);
  mask-image: radial-gradient(closest-side, #000 64%, rgba(0, 0, 0, 0.55) 80%, transparent 98%);
}

.mark-media > img,
.mark-media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

/* состояния (класс на .hero-mark ставит landing.js):
   без класса — статичная N; is-video — заставка пошла (событие playing) и проявляется поверх
   статичной N, та прячется уже под ней; is-under — петля готова под заставкой;
   is-loop — петля на экране (заставка гаснет за 0,2 с поверх идентичного кадра) */
.mark-still {
  transition: opacity 0.4s var(--ease);
  animation: mark-in 0.5s var(--ease) 0.35s both;
}

.mark-video {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.6s var(--ease),
    visibility 0s linear 0.6s;
}

.is-video .mark-still {
  opacity: 0;
  animation: none;
  transition: opacity 0s linear 0.35s;
}

.is-video .mark-intro {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.35s var(--ease),
    visibility 0s;
}

.is-under .mark-loop {
  opacity: 1;
  visibility: visible;
  /* с задержкой: заставка над петлёй к этому времени уже полностью проявилась */
  transition:
    opacity 0s linear 0.4s,
    visibility 0s linear 0.4s;
}

.is-loop .mark-loop {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.6s var(--ease),
    visibility 0s;
}

.is-loop .mark-intro {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s linear,
    visibility 0s linear 0.2s;
}

@keyframes mark-in {
  from {
    opacity: 0;
  }
}

@media (max-width: 359px), (max-height: 640px) {
  .hero-mark {
    --mark: 168px;
  }
}

@media (min-width: 521px) and (min-height: 641px) {
  .hero-mark {
    --mark: 280px;
  }
}

@media (min-width: 960px) {
  .hero-mark {
    --mark: min(420px, 38vw);
    justify-self: end;
    margin: 0;
  }
}

.mock {
  grid-area: mock;
  justify-self: center;
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  margin-top: clamp(40px, 6vw, 56px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(32, 39, 53, 0.9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(4, 7, 14, 0.55);
  font-size: 14px;
}

@media (min-width: 960px) {
  /* карточка заходит только на растворённый низ квадрата — ниже N и бесконечности */
  .mock {
    justify-self: start;
    margin-top: calc(min(420px, 38vw) * -0.25);
  }
}

.mock-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mock-head img {
  border-radius: 8px;
}

.mock-name {
  font-weight: 650;
}

.mock-tag {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.mock-seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--well);
}

.mock-seg span {
  padding: 7px 0;
  border-radius: var(--r-sm);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.mock-seg .on {
  background: var(--selected);
  color: var(--text);
  font-weight: 600;
}

.mock-model {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-weight: 600;
}

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

.mock-prompt {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--control);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--text);
  line-height: 1.45;
}

.mock-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.mock-chips span {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.mock-run {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--on-accent);
  text-align: center;
  font-weight: 650;
}

/* ---------------------------------------------------------------- секции */
.section {
  padding: clamp(56px, 8vw, 104px) 0;
  border-top: 1px solid var(--line-soft);
}

.section h2 {
  max-width: 22em;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.section-lead {
  max-width: 40em;
  margin-top: 16px;
  color: var(--muted);
  font-size: 17px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
}

/* возможности */
.features {
  display: grid;
  gap: 16px;
  margin-top: 40px;
}

@media (min-width: 720px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.feature {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  transition:
    border-color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.feature:hover {
  border-color: var(--control);
  transform: translateY(-2px);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--selected);
  color: var(--accent);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature h3 {
  margin-top: 18px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.feature > p {
  margin-top: 6px;
  color: var(--muted);
}

.models {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 0;
  padding: 20px 0 0;
  list-style: none;
}

.models li {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--well);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.aside-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 15px;
}

/* шаги */
.steps {
  display: grid;
  gap: 16px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

@media (min-width: 820px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.step {
  position: relative;
  padding: 24px 24px 26px;
  border-top: 1px solid var(--line);
}

.step-n {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--control);
  border-radius: 50%;
  color: var(--accent);
  font: 650 15px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.step h3 {
  margin-top: 18px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.step p {
  margin-top: 8px;
  color: var(--muted);
}

/* цены */
.prices-grid {
  display: grid;
  gap: 40px;
  align-items: start;
}

@media (min-width: 960px) {
  .prices-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
  }
}

.principles {
  display: grid;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.principles li {
  padding-left: 18px;
  border-left: 2px solid var(--selected);
}

.principles strong {
  color: var(--text);
  font-weight: 600;
}

.price-card {
  padding: 8px clamp(16px, 3vw, 28px) 20px;
}

.price-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.price-model {
  display: grid;
  gap: 2px;
  font-weight: 600;
}

.price-caption {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.price-value {
  flex: none;
  font: 650 20px/1.2 var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.price-from {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.price-empty {
  padding: 20px 0;
  color: var(--muted);
}

.price-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

/* пополнение */
.topup {
  display: grid;
  gap: 32px;
  padding: clamp(22px, 4vw, 48px);
  border-radius: var(--r-xl);
  background:
    radial-gradient(70% 120% at 100% 0, rgba(173, 196, 245, 0.08), transparent 60%),
    var(--paper);
}

@media (min-width: 960px) {
  .topup {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: end;
    gap: 56px;
  }
}

.badge {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 500;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.chip {
  min-width: 96px;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid var(--control);
  border-radius: var(--r-md);
  background: var(--well);
  color: var(--text);
  font: 600 16px/1 var(--font);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.chip:hover {
  border-color: var(--accent);
}

.chip[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--selected);
  box-shadow: inset 0 0 0 1px var(--accent);
}

@media (max-width: 520px) {
  .chips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .chip {
    min-width: 0;
    padding: 10px 6px;
  }
}

.calc {
  margin-top: 24px;
}

.calc-title {
  color: var(--muted);
  font-size: 14px;
}

.calc-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 17px;
}

.calc-list strong {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.calc-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.topup-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* вопросы */
.faq-wrap {
  display: grid;
  gap: 32px;
}

@media (min-width: 960px) {
  .faq-wrap {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 64px;
  }
}

.faq {
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  position: relative;
  padding: 20px 44px 20px 0;
  font-size: 17px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

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

.faq summary::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -2px;
}

.faq summary:hover {
  color: var(--accent);
}

.faq details p {
  max-width: 40em;
  padding: 0 0 22px;
  color: var(--muted);
}

/* финальный призыв */
.cta-section {
  border-top: 0;
  padding-top: 0;
}

.cta {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: clamp(32px, 6vw, 64px) var(--gutter);
  text-align: center;
  border-radius: var(--r-xl);
}

.cta img {
  border-radius: 16px;
}

.cta p {
  max-width: 30em;
  color: var(--muted);
}

.cta .btn {
  margin-top: 8px;
}

/* подвал */
.footer {
  padding: 48px 0 28px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 15px;
}

.footer-grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 820px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand p {
  max-width: 22em;
  margin-top: 12px;
}

.footer-title {
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 600;
}

.footer ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer a:not(.brand) {
  color: var(--muted);
  text-decoration: none;
}

.footer a:not(.brand):hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 36px;
  font-size: 13px;
}

.footer-bottom span {
  display: block;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .mark-video {
    display: none;
  }
}
