/* ==========================================================================
   MSG.Center — страницы /features и /cases
   Подключается вместе с assets/landing/styles.css (общие токены и компоненты).
   ========================================================================== */

.pages-body {
  background: var(--bg);
}
.pages-skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  transform: translateY(-160%);
}
.pages-skip:focus-visible {
  transform: none;
}

/* Хедер/навигация страниц используют .site-header/.container/.brand из styles.css */
.pages-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.pages-nav a {
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.pages-nav a:hover,
.pages-nav a[aria-current="page"] {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}
.pages-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 14px;
}
.pages-burger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}
.pages-burger svg {
  width: 20px;
  height: 20px;
}
.pages-mobile-nav {
  display: none;
  padding: 12px 0 18px;
  border-top: 1px solid var(--line);
}
.pages-mobile-nav.is-open {
  display: block;
}
.pages-mobile-nav a {
  display: block;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
}
.pages-mobile-nav a:hover {
  color: var(--accent);
}

.pages-main {
  position: relative;
  padding-bottom: clamp(48px, 7vw, 84px);
}

/* --------------------------------------------------------------------------
   Hero страниц
   -------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  padding: clamp(44px, 6vw, 74px) 0 clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60% 80% at 8% 0%, rgba(46, 231, 159, 0.12), transparent 60%),
    radial-gradient(50% 70% at 92% 8%, rgba(124, 231, 255, 0.07), transparent 60%);
}
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  color: var(--muted-2);
  font-size: 0.78rem;
  line-height: 1.4;
}
.breadcrumbs a {
  color: var(--muted);
}
.breadcrumbs a:hover {
  color: var(--accent);
}
.breadcrumbs span[aria-current] {
  color: var(--ink-soft);
}
.page-hero .eyebrow {
  margin-bottom: 14px;
}
.page-hero h1 {
  max-width: 940px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.95rem);
  font-weight: 600;
  line-height: 1.17;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.page-hero__lead {
  max-width: 780px;
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 1.1vw, 1.06rem);
  line-height: 1.68;
}
.page-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.3;
}
.meta-chip svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}
.page-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.page-hero__note {
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 0.76rem;
  line-height: 1.5;
}

/* Кейс: метрики в hero */
.case-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}
.case-metric {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 19, 16, 0.8);
}
.case-metric b {
  display: block;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.case-metric span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   Хабы: карточки
   -------------------------------------------------------------------------- */
.pages-section {
  padding: clamp(38px, 5vw, 60px) 0;
}
.pages-section__head {
  max-width: 780px;
  margin-bottom: 24px;
}
.pages-section__head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.pages-section__head p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}
.feature-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.feature-card-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  transition: transform 0.24s var(--ease), border-color 0.24s var(--ease);
}
.feature-card-page:hover {
  transform: translateY(-3px);
  border-color: rgba(77, 242, 176, 0.32);
}
.feature-card-page__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(77, 242, 176, 0.22);
  border-radius: 12px;
  background: rgba(77, 242, 176, 0.1);
  color: var(--accent);
}
.feature-card-page__icon svg {
  width: 19px;
  height: 19px;
}
.feature-card-page h3 {
  margin-top: 16px;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.35;
}
.feature-card-page p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.55;
}
.feature-card-page__link {
  margin-top: auto;
  padding-top: 14px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
}
.case-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.case-card-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  transition: transform 0.24s var(--ease), border-color 0.24s var(--ease);
}
.case-card-page:hover {
  transform: translateY(-3px);
  border-color: rgba(77, 242, 176, 0.34);
}
.case-card-page h3 {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}
.case-card-page p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.55;
}
.case-card-page__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.case-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid rgba(77, 242, 176, 0.26);
  border-radius: 10px;
  background: rgba(77, 242, 176, 0.07);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
}
.case-stat small {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.64rem;
  font-weight: 600;
}
.case-card-page__more {
  margin-top: auto;
  padding-top: 16px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Статья: двухколоночный layout + TOC
   -------------------------------------------------------------------------- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: start;
  padding-top: clamp(30px, 4vw, 44px);
}
.article-toc {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}
.article-toc__title {
  margin-bottom: 10px;
  color: var(--muted-2);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.article-toc ol {
  display: grid;
  gap: 7px;
  counter-reset: toc;
  list-style: none;
}
.article-toc li {
  counter-increment: toc;
  font-size: 0.78rem;
  line-height: 1.4;
}
.article-toc li::before {
  content: counter(toc) ". ";
  color: var(--muted-2);
}
.article-toc a {
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.article-toc a:hover {
  color: var(--accent);
}
.article-body {
  min-width: 0;
  max-width: 860px;
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.75;
}
.article-body > * + * {
  margin-top: 16px;
}
.article-body h2 {
  margin-top: 38px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.18rem, 1.8vw, 1.48rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.article-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.article-body h3 {
  margin-top: 26px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
}
.article-body h4 {
  margin-top: 20px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}
.article-body p {
  color: var(--ink-soft);
}
.article-body strong {
  color: var(--ink);
  font-weight: 700;
}
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(77, 242, 176, 0.4);
  text-underline-offset: 3px;
}
.article-body a:hover {
  color: #adffe0;
}
.article-body ul,
.article-body ol {
  display: grid;
  gap: 8px;
  padding-left: 22px;
  list-style: disc;
}
.article-body ol {
  padding-left: 24px;
  list-style: decimal;
}
.article-body li::marker {
  color: var(--accent);
}
.article-body li > ul,
.article-body li > ol {
  margin-top: 8px;
}
.article-body blockquote {
  padding: 16px 20px;
  border: 1px solid rgba(242, 200, 124, 0.25);
  border-left: 3px solid var(--amber);
  border-radius: 10px;
  background: rgba(242, 200, 124, 0.05);
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.article-body blockquote p + p {
  margin-top: 8px;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.5;
}
.article-body table thead th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}
.article-body table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: top;
}
.article-body table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.article-body code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
}
.article-body pre {
  padding: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
}
.article-body pre code {
  padding: 0;
  border: 0;
  background: none;
}
.article-body hr {
  margin: 28px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Секции-акценты */
.callout--warning {
  padding: 20px 22px;
  border: 1px solid rgba(242, 200, 124, 0.26);
  border-radius: var(--radius);
  background: rgba(242, 200, 124, 0.05);
}
.callout--warning h2 {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: 0 !important;
  color: var(--amber) !important;
}
.guide-section ol {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
  counter-reset: guide;
}
.guide-section ol > li {
  position: relative;
  padding: 12px 16px 12px 50px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  counter-increment: guide;
}
.guide-section ol > li::before {
  content: counter(guide, decimal-leading-zero);
  position: absolute;
  top: 12px;
  left: 14px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
}
.related-section ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-left: 0;
  list-style: none;
}
.related-section li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}
.case-savings {
  padding: 22px;
  border: 1px solid rgba(77, 242, 176, 0.24);
  border-radius: var(--radius);
  background: rgba(77, 242, 176, 0.04);
}
.case-savings h2 {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: 0 !important;
  color: var(--accent) !important;
}
.case-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}
.case-split__card {
  padding: 20px;
  border: 1px solid rgba(77, 242, 176, 0.24);
  border-radius: var(--radius);
  background: rgba(77, 242, 176, 0.05);
}
.case-split__card--human {
  border-color: rgba(242, 200, 124, 0.24);
  background: rgba(242, 200, 124, 0.045);
}
.case-split__card h2 {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: 0 !important;
  font-family: var(--font-body) !important;
  font-size: 1rem !important;
}
.case-split__card ul {
  font-size: 0.88rem;
}

/* CTA внизу статьи */
.article-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 36px;
  padding: 24px;
  border: 1px solid rgba(77, 242, 176, 0.26);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(77, 242, 176, 0.13), transparent 55%),
    rgba(255, 255, 255, 0.025);
}
.article-cta h2 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.article-cta p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.55;
}
.article-cta .btn {
  flex: none;
}

/* FAQ на хабе */
.pages-faq {
  display: grid;
  gap: 10px;
  max-width: 900px;
}
.pages-faq details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-bg);
}
.pages-faq details[open] {
  border-color: rgba(77, 242, 176, 0.28);
}
.pages-faq summary {
  padding: 16px 48px 16px 18px;
  position: relative;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
}
.pages-faq summary::-webkit-details-marker {
  display: none;
}
.pages-faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  color: var(--accent);
  font-size: 1.15rem;
  transform: translateY(-50%);
}
.pages-faq details[open] summary::after {
  content: "–";
}
.pages-faq__answer {
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

/* Мобильная версия */
@media (max-width: 1180px) {
  .feature-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .case-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .pages-nav,
  .pages-header-actions {
    display: none;
  }
  .pages-burger {
    display: inline-flex;
    margin-left: auto;
  }
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .article-toc {
    position: static;
    max-height: none;
  }
}
@media (max-width: 760px) {
  .feature-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .case-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .case-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .case-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .related-section ul {
    grid-template-columns: minmax(0, 1fr);
  }
  .article-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 520px) {
  .feature-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-hero h1 {
    font-size: 1.62rem;
  }
  .page-hero__cta .btn {
    width: 100%;
  }
}
