@font-face {
  font-family: 'Spectrashell';
  src: url('/fonts/Spectrashell.ttf') format('truetype');
  font-display: swap;
}

:root {
  --black: #070707;
  --black-soft: #111111;
  --card: #161616;
  --border: #2b2b2b;
  --red: #e0111a;
  --red-dark: #a80d14;
  --red-text: #ff3b44;
  --text: #f4f4f4;
  --text-muted: #b3b3b3;
  --radius: 4px;
  --font-display: 'Spectrashell', 'Anton', 'Arial Narrow', Arial, sans-serif;
  --header-height: 96px;
}

* { box-sizing: border-box; }

/* scroll-behavior: smooth намеренно не используется — конфликтует с JS-пиннингом
   секции комикса и может "подвешивать" анимированный переход по якорным ссылкам */
html { scroll-behavior: auto; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--black);
  color: var(--text);
  line-height: 1.55;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
p { margin: 0 0 12px; color: var(--text-muted); }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: var(--radius);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 14px;
  border: 2px solid var(--red);
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); }
.btn--outline { background: transparent; color: #fff; }
.btn--outline:hover { background: rgba(224,17,26,0.12); }

/* Шапка сайта: закреплена при скролле */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Topbar */
.topbar {
  background: var(--black);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  display: flex;
  align-items: center;
  padding: 10px 24px;
}

/* Логотип: КУРСАЧ (красный, белая обводка) + OFF (белый, ⏻ вместо O), в одну строку */
.logo {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  line-height: 1;
  font-family: var(--font-display);
}
.logo__line {
  display: flex;
  align-items: center;
  gap: 4px;
}
.logo__line--top {
  color: var(--red);
  font-size: 30px;
  letter-spacing: 0.02em;
  -webkit-text-stroke: 1px #fff;
  paint-order: stroke fill;
}
.logo__line--bottom {
  color: #fff;
  font-size: 26px;
  letter-spacing: 0.02em;
}
.logo__power { color: #fff; flex-shrink: 0; width: 1.1em; height: 1.1em; }

/* Navbar (красная полоса) */
.navbar {
  background: var(--red);
}
.navbar__inner {
  display: flex;
  gap: 32px;
  padding: 14px 24px;
}
.navbar__link {
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.04em;
  opacity: 0.95;
}
.navbar__link:hover { opacity: 1; text-decoration: underline; }

/* Hero */
.hero {
  position: relative;
  display: flex;
  align-items: stretch;
  margin-bottom: 32px;
  background:
    radial-gradient(circle at 90% 10%, rgba(224,17,26,0.12), transparent 40%),
    var(--black);
  overflow: hidden;
}
.hero__character {
  flex: 0 0 auto;
  width: 40%;
  max-width: 640px;
  min-width: 280px;
  height: auto;
  align-self: flex-end;
  object-fit: contain;
  object-position: bottom left;
  display: block;
}
.hero__content {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 56px 40px 56px 32px;
}
.hero__eyebrow {
  color: var(--red-text);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 13px;
  margin-bottom: 16px;
}
.hero__title {
  font-family: var(--font-display);
  font-size: 74px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: #fff;
  margin-bottom: 20px;
}
.hero__underline {
  width: 90px;
  height: 8px;
  background: var(--red);
  margin-bottom: 24px;
}
.hero__subtitle {
  font-size: 15px;
  line-height: 1.6;
  max-width: 560px;
  margin-bottom: 28px;
}

/* Inline chat panel in hero */
.chat-panel {
  background: var(--black-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  height: 480px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.chat-panel__header {
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
}
.chat-panel__title { font-weight: 700; font-size: 15px; }
.chat-panel__status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.chat-panel__status .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}
.chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg--bot {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 2px;
}
.msg--user {
  align-self: flex-end;
  background: var(--red);
  color: #fff;
  border-bottom-right-radius: 2px;
}
.msg--error {
  align-self: flex-start;
  background: rgba(224, 17, 26, 0.12);
  border: 1px solid rgba(224,17,26,0.4);
  color: #ff9a9e;
}
.msg--typing { align-self: flex-start; color: var(--text-muted); font-size: 13px; }

.chat-panel__footer {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
}
.chat-panel__form { display: flex; gap: 8px; }
.chat-panel__form input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.chat-panel__form input:focus { border-color: var(--red); }
.chat-panel__form button {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  border: none;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-panel__form button:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-panel__tg-link {
  display: block;
  font-size: 12px;
  color: var(--red-text);
  margin-top: 8px;
  text-align: center;
}

.chat-panel__lead-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.chat-panel__lead-success {
  font-size: 14px;
  color: #4ade80;
  font-weight: 600;
  margin: 0;
  text-align: center;
}
.chat-panel__lead-error {
  font-size: 12px;
  color: #ff9a9e;
  margin: 8px 0 0;
}

/* Comic scroll section — во всю ширину экрана */
.comic {
  position: relative;
  height: 600vh;
  background: var(--black);
}
.comic__sticky {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.comic__slides {
  position: relative;
  width: 100vw;
  height: min(88vh, 900px);
}
.comic-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--black-soft);
  opacity: 0;
  transform: translateX(60px);
  transition: transform 0.6s cubic-bezier(.22,.68,0,1.01), opacity 0.5s ease;
  pointer-events: none;
}
.comic-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.comic-slide img.img-missing { display: none; }
.comic-slide__placeholder {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 32px;
  text-transform: uppercase;
  height: 100%;
  width: 100%;
}
.comic-slide__placeholder span {
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
  color: #666;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.comic-slide.is-missing .comic-slide__placeholder { display: flex; }

.comic-slide.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 2;
}
.comic-slide.is-prev {
  opacity: 0;
  transform: translateX(-60px);
  z-index: 1;
}

.comic__dots {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}
.comic__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background .2s ease, transform .2s ease;
}
.comic__dot.is-active {
  background: var(--red);
  transform: scale(1.3);
}

/* Общие заголовки секций */
.reviews, .faq, .articles { padding: 80px 0; }
.services h2, .reviews h2, .faq h2, .articles h2 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-bottom: 32px;
  text-transform: uppercase;
  color: #fff;
}
.services h2::after, .reviews h2::after, .faq h2::after, .articles h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 5px;
  background: var(--red);
  margin-top: 12px;
}

/* Полезная информация */
.articles__note { margin-bottom: 24px; max-width: 640px; }
.articles__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.article-card__image {
  position: relative;
  display: block;
  aspect-ratio: 16/10;
  background: var(--black-soft);
  overflow: hidden;
}
.article-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-card__image img.img-missing { display: none; }
.article-card__placeholder {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 13px;
}
.article-card__image.is-missing .article-card__placeholder { display: flex; }
.article-card__body { padding: 20px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.article-card__body h3 { font-size: 16px; color: #fff; }
.article-card__body p { flex: 1; }
.article-card__link { color: var(--red-text); font-weight: 700; font-size: 14px; }
.article-card__link:hover { text-decoration: underline; }

/* Картинки внутри статьи — обтекание текстом на десктопе */
.article-figure {
  margin: 0 0 20px;
  border-radius: 10px;
  overflow: hidden;
}
/* Белая рамка-подложка — только для статей со светлыми/прозрачными иллюстрациями */
.article-figure--framed {
  background: #fff;
  padding: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.article-figure--framed img { border-radius: 6px; }
.article-figure--left { float: left; width: 300px; margin-right: 28px; }
.article-figure--right { float: right; width: 300px; margin-left: 28px; }
.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}
.article-page { overflow: hidden; } /* очищает float-картинки внутри контейнера статьи */

@media (max-width: 700px) {
  .article-figure--left,
  .article-figure--right {
    float: none;
    width: 100%;
    max-width: none;
    margin: 0 0 20px;
  }
}

/* Наши услуги */
.services__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.service-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.service-card__title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  font-size: 19px;
  margin: 0;
}
.service-card__price {
  font-size: 14px;
  font-weight: 700;
  color: var(--red-text);
}
.service-card__desc { font-size: 13px; margin: 0 0 10px; }
.service-card__cta {
  margin-top: auto;
  padding: 10px 18px;
  font-size: 12px;
  align-self: stretch;
  justify-content: center;
}

/* Reviews — карусель со скроллом и стрелками */
.reviews__note { margin-bottom: 24px; }
.reviews__carousel {
  display: flex;
  align-items: center;
  gap: 16px;
}
.reviews__track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 12px;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
}
.reviews__track::-webkit-scrollbar { display: none; }
.review-item {
  flex: 0 0 auto;
  width: 260px;
  height: 400px;
  scroll-snap-align: start;
  background: var(--black-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 8px;
}
.review-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.reviews__arrow {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.reviews__arrow:hover { background: var(--red-dark); transform: scale(1.06); }

@media (max-width: 560px) {
  .reviews__arrow { width: 36px; height: 36px; }
  .review-item { width: 200px; height: 320px; }
}

/* Лайтбокс — открытый просмотр отзыва на весь экран с перелистыванием */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5,5,5,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(90vw, 720px);
  max-height: 85vh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox__arrow:hover { background: var(--red-dark); }
.lightbox__arrow--prev { left: 16px; }
.lightbox__arrow--next { right: 16px; }

@media (max-width: 560px) {
  .lightbox__arrow { width: 38px; height: 38px; }
  .lightbox__close { top: 12px; right: 12px; }
}

/* FAQ */
.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.faq summary { cursor: pointer; font-weight: 600; color: #fff; }
.faq details p { margin-top: 10px; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 30px 0; background: var(--black-soft); }
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer__links { display: flex; gap: 20px; }
.footer__links a { color: var(--red-text); font-weight: 600; }
.footer__copy { margin: 0; font-size: 13px; }

/* Floating Telegram button */
.floating-telegram {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(224,17,26,0.45);
  z-index: 30;
  transition: transform .15s ease;
}
.floating-telegram:hover { transform: scale(1.08); }

/* Отдельные страницы статей используют упрощённую версию контента */
.article-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 100px;
}
.article-page__back { color: var(--red-text); font-weight: 700; display: inline-block; margin-bottom: 24px; }
.article-page h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  text-transform: uppercase;
  color: #fff;
}

/* Отдельные страницы услуг */
.service-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 100px;
}
.service-page__badge {
  display: inline-block;
  border: 1px solid var(--red);
  color: var(--red-text);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.service-page h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  margin-bottom: 8px;
}
.service-page__price {
  font-size: 18px;
  font-weight: 700;
  color: var(--red-text);
  margin-bottom: 24px;
}
.service-page__desc { font-size: 16px; margin-bottom: 32px; }
.service-page__features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 36px;
}
.service-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  color: var(--text);
}
.service-feature svg { flex-shrink: 0; color: var(--red); }
.service-page__cta-group { display: flex; gap: 16px; }
.service-page__cta { flex: 1; justify-content: center; padding: 18px; }

@media (max-width: 560px) {
  .service-page__features { grid-template-columns: 1fr; }
  .service-page__cta-group { flex-direction: column; }
}

@media (max-width: 900px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .hero { flex-direction: column; }
  .hero__character {
    width: 100%;
    max-width: none;
    min-width: 0;
    align-self: center;
    object-position: center;
    max-height: 320px;
  }
  .hero__content {
    grid-template-columns: 1fr;
    max-width: none;
    padding: 32px 24px 48px;
  }
  .hero__title {
    position: absolute;
    top: 16px;
    right: 16px;
    left: auto;
    font-size: 30px;
    text-align: right;
    margin-bottom: 0;
    z-index: 2;
  }
  .chat-panel { height: 420px; }
  .comic { height: 480vh; }
  .comic__slides { height: 60vh; }
  .articles__grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero__title { font-size: 24px; }
  .navbar__inner { gap: 14px; flex-wrap: wrap; }
}
