/* ==========================================================================
   СлайдГрам — лендинг. Палитра и радиусы наследуют мини-приложение
   (frontend/src/styles/global.css) — тёмная тема единственная и намеренная,
   поэтому здесь нет веток под light/prefers-color-scheme.
   ========================================================================== */

:root {
  --bg: #050a1c;
  --bg-2: #0a1636;
  --panel: rgba(255, 255, 255, 0.03);
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-bg-strong: rgba(255, 255, 255, 0.07);
  --card-border: rgba(255, 255, 255, 0.09);
  --accent: #2f6bff;
  --accent-2: #4f8bff;
  --accent-soft: rgba(47, 107, 255, 0.16);
  --violet: #8b6bff;
  --violet-2: #5b2fe0;
  --success: #33c17a;
  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.62);
  --text-tertiary: rgba(255, 255, 255, 0.4);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --font-display: "Unbounded", -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 200;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.wrap--narrow {
  max-width: 760px;
}

.text-balance {
  text-wrap: balance;
}

/* Фоновое свечение — тот же приём, что и --bg-glow в мини-приложении,
   но растянутый на весь скролл лендинга, а не только на один экран. */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 40% at 18% 0%, rgba(139, 107, 255, 0.16) 0%, transparent 60%),
    radial-gradient(70% 50% at 82% 8%, rgba(47, 107, 255, 0.22) 0%, transparent 60%),
    var(--bg);
}

/* ---------- eyebrow / labels ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 18px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
  /* Сплошная, не полупрозрачная заливка — иначе контент под sticky-шапкой
     просвечивает и наезжает на логотип/навигацию (см. baseline-скролл).
     backdrop-filter здесь намеренно не используем — та же причина, что и в
     мини-приложении (frontend/src/styles/global.css): дорого на мобильном GPU. */
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, padding 0.25s ease;
}

.site-header--scrolled {
  border-bottom-color: var(--card-border);
  padding: 12px 0;
}

.site-header__row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}

.brand__logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  gap: 28px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.site-nav a {
  text-decoration: none;
  transition: color 0.15s ease;
}

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

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

/* ---------- buttons ---------- */

.btn {
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: linear-gradient(160deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 10px 30px -12px rgba(47, 107, 255, 0.65);
}

.btn-small {
  padding: 10px 18px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}

.btn-large {
  padding: 17px 26px;
  font-size: 16.5px;
}

/* На узких экранах длинный текст CTA-кнопок ("Создать презентацию в
   Telegram") не помещается в одну строку — из-за глобального white-space:
   nowrap у .btn это раздувало min-content самой кнопки, а вместе с ней и
   всю grid-колонку hero-блока шире доступной ширины (кнопка/эйрбоу/H1
   визуально съезжали вправо, хотя .hero__row технически не скроллился —
   overflow-x:hidden на html просто обрезал лишнее). Разрешаем перенос
   строки и центрируем — на более широких экранах нижняя media-query не
   действует, кнопка остаётся в одну строку как и задумано. */
@media (max-width: 420px) {
  .btn-large {
    white-space: normal;
    text-align: center;
  }
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    transform: translateY(-1px) scale(1.015);
    filter: brightness(1.08);
  }
}

.btn:active {
  transform: scale(0.98);
}

@media (max-width: 620px) {
  .site-header .btn-small {
    padding: 9px 14px;
    font-size: 13px;
  }
}

/* На узких телефонах "лого + название + кнопка" в одну строку впритык —
   без этого текст кнопки вылезал за край экрана (шапка не переносится
   и не скроллится сама по себе). */
@media (max-width: 400px) {
  .site-header__row {
    gap: 10px;
  }
  .brand__logo {
    width: 28px;
    height: 28px;
  }
  .brand__name {
    font-size: 15px;
  }
  .site-header .btn-small {
    padding: 8px 11px;
    font-size: 12px;
  }
}

/* ---------- reveal-on-scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- hero ---------- */

.hero {
  padding: 64px 0 96px;
}

.hero__row {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 56px;
}

/* min-width:0 переопределяет дефолтный min-width:auto grid-элемента — без
   этого широкий по min-content ребёнок (например, не переносящаяся кнопка)
   раздувает саму track шире доступного места в родителе, а не просто
   переполняет свой блок. См. .btn-large выше — там основная причина, тут
   подстраховка на случай другого будущего широкого контента в колонке. */
.hero__copy {
  min-width: 0;
}

@media (max-width: 960px) {
  .hero__row {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }
  .hero .eyebrow {
    margin-left: auto;
    margin-right: auto;
  }
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
}

.hero__subtitle {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 46ch;
  margin: 0 0 34px;
}

@media (max-width: 960px) {
  .hero__subtitle {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }
}

.hero__cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

@media (max-width: 960px) {
  .hero__cta {
    align-items: center;
  }
}

.hero__cta-note {
  font-size: 13.5px;
  color: var(--text-tertiary);
  margin: 0;
}

/* Веер примеров слайдов — "тезис" хиро-блока: сразу видно, что именно
   получает пользователь, без абстрактных иконок. */
.hero__art {
  position: relative;
}

.fan {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  aspect-ratio: 4 / 3.1;
}

.fan__card {
  position: absolute;
  width: 78%;
  /* height:auto обязателен рядом с aspect-ratio: у <img> заданы HTML-атрибуты
     width/height (для CLS) — без явного height:auto браузер использует их
     напрямую как CSS-высоту и игнорирует aspect-ratio, отчего карточка
     растягивалась по высоте и обрезала слайд по бокам. */
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.65);
}

.fan__card--1 {
  left: 0;
  top: 8%;
  transform: rotate(-9deg);
  z-index: 1;
}

.fan__card--2 {
  left: 11%;
  top: 24%;
  transform: rotate(3deg);
  z-index: 2;
  box-shadow: 0 36px 70px -18px rgba(0, 0, 0, 0.75);
}

.fan__card--3 {
  left: 22%;
  top: 40%;
  transform: rotate(13deg);
  z-index: 3;
}

@media (max-width: 960px) {
  .fan {
    max-width: 340px;
  }
}

/* ---------- sections ---------- */

.section {
  padding: 84px 0;
}

.section--muted {
  background: var(--panel);
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
}

.section__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  text-align: center;
}

.section__lede {
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 56ch;
  margin: 0 auto 52px;
}

/* ---------- steps ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 780px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

.steps__item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}

.steps__num {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent-2);
  margin-bottom: 16px;
}

.steps__item h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
}

.steps__item p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

/* ---------- gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 780px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

.gallery__item {
  margin: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .gallery__item:hover {
    transform: translateY(-4px);
    border-color: rgba(90, 140, 255, 0.35);
  }
}

.gallery__item img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.gallery__item figcaption {
  padding: 14px 16px 18px;
  font-size: 14.5px;
  font-weight: 600;
}

.gallery__item figcaption span {
  font-weight: 400;
  color: var(--text-tertiary);
}

/* ---------- features ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 940px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
}

.feature-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 18px;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 700;
  margin: 0 0 8px;
}

.feature-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

/* ---------- faq ---------- */

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

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-item__q {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.faq-item__icon {
  position: relative;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.faq-item__icon::before,
.faq-item__icon::after {
  content: "";
  position: absolute;
  background: var(--text-tertiary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.faq-item__icon::before {
  left: 0;
  top: 8px;
  width: 18px;
  height: 2px;
}

.faq-item__icon::after {
  left: 8px;
  top: 0;
  width: 2px;
  height: 18px;
}

.faq-item--open .faq-item__icon::after {
  transform: rotate(90deg);
  opacity: 0;
}

.faq-item__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.faq-item__a p {
  overflow: hidden;
  margin: 0;
  padding: 0 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.faq-item--open .faq-item__a {
  grid-template-rows: 1fr;
}

.faq-item--open .faq-item__a p {
  padding-bottom: 18px;
}

.faq-agreement {
  text-align: center;
  margin: 32px 0 0;
  font-size: 13.5px;
}

.faq-agreement a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- cta band ---------- */

.cta-band {
  padding-top: 40px;
}

.cta-band__inner {
  background: linear-gradient(160deg, rgba(47, 107, 255, 0.22), rgba(10, 22, 54, 0.5));
  border: 1px solid rgba(90, 140, 255, 0.25);
  border-radius: var(--radius-xl);
  padding: 56px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cta-band__title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 700;
  margin: 0;
}

.cta-band__subtitle {
  font-size: 15.5px;
  color: var(--text-secondary);
  margin: 0 0 8px;
  max-width: 46ch;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 32px 0 calc(32px + 64px);
}

.site-footer__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 28px;
}

.brand--footer .brand__name {
  font-size: 15px;
}

.site-footer__links {
  display: flex;
  gap: 22px;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-right: auto;
}

.site-footer__links a {
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--text);
}

.site-footer__copy {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

@media (max-width: 620px) {
  .site-footer__row {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-footer__links {
    margin-right: 0;
  }
}

/* ---------- mobile floating CTA ---------- */

.mobile-cta {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: none;
  text-align: center;
  padding: 15px;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--accent-2), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 12px 32px -10px rgba(47, 107, 255, 0.7);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

@media (max-width: 860px) {
  .mobile-cta {
    display: block;
    pointer-events: none;
  }
  .mobile-cta--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .site-footer {
    padding-bottom: 96px;
  }
}
