/* ─────────── Токены (совпадают с приложением NChat) ─────────── */

:root {
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --transition: 140ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-slow: 300ms cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  --accent: #ffffff;
  --accent-rgb: 255, 255, 255;

  /* Серо-графитовая тёмная тема */
  --bg-primary: #141518;
  --bg-secondary: #1b1c20;
  --bg-tertiary: #24252a;
  --bg-hover: #2c2d33;
  --border: #2b2c32;
  --text-primary: #ececee;
  --text-secondary: #a4a6ac;
  --text-muted: #6c6e75;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);

  --maxw: 1080px;
}

/* ─────────── Сброс ─────────── */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─────────── Логотип-куб NC ─────────── */

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: #0e0e0e;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.5px;
  flex: 0 0 auto;
}

.brand-logo-sm { width: 26px; height: 26px; font-size: 11px; }

/* ─────────── Шапка ─────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(20, 21, 24, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 600;
}

.nav a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

.nav a:hover { color: var(--text-primary); }

.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.nav-github:hover { border-color: var(--text-muted); background: var(--bg-hover); }

/* Кнопка-бургер: скрыта на десктопе, появляется на мобильных */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Превращение бургера в крестик при открытом меню */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─────────── Первый экран ─────────── */

.hero {
  position: relative;
  padding: 100px 0 80px;
  overflow: hidden;
}

/* Bloom: мягкое свечение за логотипом-кубом. Радиальный градиент без резких
   границ читается как рассеянный свет. */
/* Bloom за логотипом. Позиция смещается за курсором через --bloom-x/--bloom-y
   (обновляет script.js, свойство translate не конфликтует с transform-центровкой). */
.hero::before {
  content: '';
  position: absolute;
  top: 60px;
  left: 50%;
  width: 420px;
  height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.16) 0%, rgba(var(--accent-rgb), 0.06) 34%, transparent 66%);
  pointer-events: none;
  filter: blur(10px);
  animation: bloomPulse 6s ease-in-out infinite;
  z-index: 0;
  translate: var(--bloom-x, 0px) var(--bloom-y, 0px);
}

@keyframes bloomPulse {
  0%, 100% { opacity: 0.75; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.06); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border-radius: 20px;
  background: #0e0e0e;
  color: #fff;
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -1px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-lg), 0 0 44px rgba(var(--accent-rgb), 0.22);
  animation: riseIn 600ms var(--ease-out) both;
}

.hero-title {
  font-size: clamp(48px, 9vw, 92px);
  font-weight: 700;
  letter-spacing: -1px;
  animation: riseIn 600ms var(--ease-out) both;
}

.hero-lead {
  max-width: 620px;
  margin-top: 20px;
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--text-secondary);
  animation: riseIn 600ms var(--ease-out) 80ms both;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
  justify-content: center;
  animation: riseIn 600ms var(--ease-out) 160ms both;
}

.hero-preview {
  position: relative;
  width: 100%;
  margin-top: 60px;
  perspective: 1200px;
  animation: riseIn 700ms var(--ease-out) 240ms both;
}

/* Bloom за главным скриншотом: свечение шире самой картинки, поэтому
   изображение как будто светится изнутри и отделяется от фона. */
.hero-preview::before {
  content: '';
  position: absolute;
  inset: -8% -4%;
  background: radial-gradient(ellipse at center, rgba(var(--accent-rgb), 0.16) 0%, rgba(var(--accent-rgb), 0.05) 42%, transparent 72%);
  filter: blur(28px);
  z-index: 0;
  pointer-events: none;
}

.hero-preview img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  will-change: transform;
}

/* Плавный возврат наклона при уходе курсора (класс вешает script.js) */
.hero-preview.tilt-settle img {
  transition: transform 500ms var(--ease-out);
}

/* ─────────── Бегущая строка команд ─────────── */

.hero-marquee {
  margin-top: 56px;
  width: 100%;
}

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: inline-flex;
  animation: marqueeScroll 36s linear infinite;
}

/* Контент дублируется в HTML дважды — бесшовная петля на -50% */
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee-item {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  margin-right: 48px;
  flex: 0 0 auto;
}

.marquee-item b { color: var(--text-secondary); font-weight: 500; }

/* ─────────── Кнопки ─────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

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

.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 0 30px rgba(var(--accent-rgb), 0.28); }
.btn-primary:active { transform: translateY(0) scale(0.97); }

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

.btn-ghost:hover { border-color: var(--text-muted); background: var(--bg-hover); transform: translateY(-2px); }
.btn-ghost:active { transform: translateY(0) scale(0.97); }

.btn-lg { padding: 14px 30px; font-size: 16px; }

/* ─────────── Секции ─────────── */

.section { padding: 80px 0; }

.section-title {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.5px;
  text-align: center;
  margin-bottom: 48px;
}

/* ─────────── Возможности ─────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.feature {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  transition: border-color var(--transition-slow), transform var(--transition-slow), box-shadow var(--transition-slow);
}

.feature:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  transform: translateY(-3px);
  box-shadow: var(--shadow), 0 0 24px rgba(var(--accent-rgb), 0.07);
}

.feature-icon {
  width: 26px;
  height: 26px;
  color: var(--text-primary);
  opacity: 0.9;
  margin-bottom: 14px;
}

.feature h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature p {
  font-size: 14.5px;
  color: var(--text-secondary);
}

/* ─────────── Скачивание ─────────── */

.download-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.download-text {
  max-width: 520px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

/* Короткая фраза над текстом блока: крупная, приглушённая, задаёт настроение. */
.download-tagline {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
  color: var(--text-primary);
}

/* Строка статистики из GitHub Releases API: версия · размер · скачивания */
.download-stats {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-secondary);
}

.download-stats .accent { color: var(--text-primary); font-weight: 700; }

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

/* ─────────── Подвал ─────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

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

.footer-text { font-weight: 700; }

.footer-author {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono, monospace);
}

.footer-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer-link:hover { color: var(--text-primary); }

/* ─────────── Анимации ─────────── */

@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* Появление секций при прокрутке (класс вешает script.js) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
}

/* ─────────── Адаптив ─────────── */

@media (max-width: 640px) {
  .hero { padding: 70px 0 60px; }
  .section { padding: 60px 0; }

  /* Навигация превращается в выпадающее меню за бургером.
     Раньше ссылки просто скрывались — с телефона нельзя было попасть
     в «Возможности» и «Скачать». */
  .nav-toggle { display: flex; }

  .nav {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 24px 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity var(--transition-slow), transform var(--transition-slow);
  }

  .nav.open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .nav a {
    display: block;
    padding: 10px 4px;
  }

  .nav .nav-github {
    justify-content: center;
    margin-top: 8px;
    padding: 10px 14px;
  }

  .footer-inner { flex-wrap: wrap; }
  .footer-author { margin-left: 0; width: 100%; order: 5; }
}

/* ─────────── Подзаголовок секции ─────────── */

.section-lead {
  max-width: 600px;
  margin: -32px auto 40px;
  text-align: center;
  color: var(--text-secondary);
}

/* ─────────── Демо-окно ─────────── */

.demo-window {
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(var(--accent-rgb), 0.05);
  overflow: hidden;
}

.demo-titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.demo-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--bg-hover); }

.demo-title {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}

.demo-body {
  height: 330px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  justify-content: flex-end;
}

.demo-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14.5px;
  line-height: 1.5;
  animation: riseIn 360ms var(--ease-out) both;
}

.demo-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #141518;
  font-weight: 600;
}

.demo-msg.bot {
  align-self: flex-start;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.demo-msg.bot code {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--bg-hover);
}

.demo-tool {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  animation: riseIn 300ms var(--ease-out) both;
}

.demo-tool .st { font-weight: 500; margin-right: 8px; }
.demo-tool .st.run { color: #e8a54b; }
.demo-tool .st.ok { color: #5cc98a; }
.demo-tool .st.ask { color: #6aa7ff; }

.demo-input {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 18px;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
  color: var(--text-primary);
}

.demo-input-text:empty::before { content: 'Напишите сообщение…'; color: var(--text-muted); }

.demo-caret {
  width: 2px;
  height: 18px;
  margin-left: 2px;
  background: var(--text-primary);
  animation: caretBlink 1s steps(1) infinite;
}

@keyframes caretBlink { 50% { opacity: 0; } }

.demo-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.demo-tab {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.demo-tab:hover { color: var(--text-primary); border-color: var(--text-muted); }
.demo-tab[aria-selected="true"] { color: #141518; background: var(--accent); border-color: var(--accent); }

/* ─────────── Безопасность ─────────── */

.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.security-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid #3a3b42;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-primary));
  transition: border-color var(--transition-slow), transform var(--transition-slow);
}

.security-card:hover { border-color: rgba(var(--accent-rgb), 0.35); transform: translateY(-3px); }

.security-badge {
  display: inline-block;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-primary);
}

.security-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; white-space: nowrap; }
.security-card p { font-size: 14.5px; color: var(--text-secondary); }

/* ─────────── Что нового ─────────── */

.changelog-inner { display: flex; flex-direction: column; align-items: center; }

.changelog {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.changelog-fallback { text-align: center; color: var(--text-muted); }

.release {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  overflow: hidden;
}

.release summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

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

.release summary::after {
  content: '+';
  margin-left: auto;
  font-family: var(--font-mono);
  color: var(--text-muted);
  transition: transform var(--transition);
}

.release[open] summary::after { transform: rotate(45deg); }

.release-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-primary);
}

.release-latest {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #141518;
}

.release-date { font-size: 13px; font-weight: 500; color: var(--text-muted); }

.release-body {
  padding: 0 20px 18px;
  font-size: 14.5px;
  color: var(--text-secondary);
}

.release-body h4 {
  margin: 14px 0 6px;
  font-size: 14.5px;
  color: var(--text-primary);
}

.release-body ul { padding-left: 20px; }
.release-body li { margin: 3px 0; }
.release-body strong { color: var(--text-primary); }
.release-body code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--bg-hover);
  color: var(--text-primary);
}

.changelog-all { margin-top: 26px; }

@media (max-width: 640px) {
  .demo-body { height: 360px; padding: 14px; }
  .demo-msg { max-width: 92%; font-size: 14px; }
  .release summary { flex-wrap: wrap; }
}


/* ─────────── FAQ ─────────── */

.faq-section { padding-top: 120px; }

.faq-inner { max-width: 820px; }

.faq-section .section-lead { margin-bottom: 40px; }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  transition: border-color var(--transition-slow), box-shadow var(--transition-slow);
}

.faq-item:hover,
.faq-item[open] {
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: var(--shadow), 0 0 24px rgba(var(--accent-rgb), 0.07);
}

.faq-item summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
}

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

.faq-item summary:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.5);
  outline-offset: 2px;
  border-radius: var(--radius);
}

.faq-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--text-primary);
  opacity: 0.9;
}

.faq-item h3 {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
}

.faq-chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform var(--transition-slow), color var(--transition);
}

.faq-item[open]:not(.is-closing) .faq-chevron {
  transform: rotate(180deg);
  color: var(--text-primary);
}

.faq-answer {
  overflow: hidden;
  transition: height 340ms cubic-bezier(0.22, 1, 0.36, 1), opacity 340ms cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-item p {
  padding: 0 22px 20px 58px;
  font-size: 15px;
  color: var(--text-secondary);
}

.faq-item a,
.faq-cta a:not(.btn) {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.faq-cta {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  color: var(--text-secondary);
}

.nav a[aria-current="page"] { color: var(--text-primary); }

@media (max-width: 600px) {
  .faq-item summary { padding: 16px; gap: 12px; }
  .faq-item p { padding: 0 16px 18px 50px; }
}

/* ─────────── Подвал: ссылки ─────────── */

.footer-inner {
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

.footer-nav {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 4px;
}
