/* =====================================================================
   BTG v47 — слой доработок поверх style.css
   1. Типографика: нормальный межбуквенный интервал, компактные заголовки,
      без переносов слов, заголовок в 1–2 строки.
   2. Шапка: ACCA слева у логотипа, кнопка «AI-аудит» на всех страницах.
   3. Главная: шестой узел «AI-решения» в схеме направлений.
   4. Более живые фоновые изображения.
   5. Страница AI-решений, форма заявки, кнопка WhatsApp, страница 404.
   ===================================================================== */

/* ---------- 1. Typography ------------------------------------------- */
html body { text-rendering: optimizeLegibility; font-feature-settings: "kern" 1; }

html body :is(h1, h2, h3) {
  letter-spacing: -0.012em !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  -webkit-hyphens: manual !important;
  hyphens: manual !important;
  text-wrap: balance;
}
html body h1 { line-height: 1.08 !important; }
html body h2 { line-height: 1.12 !important; }
html body h3 { letter-spacing: -0.006em !important; line-height: 1.2 !important; }

/* Home hero */
@media (min-width: 1081px) {
  html body .landing-hero-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 48px; }
  html body .landing-hero-copy { max-width: 860px; }
}
html body .landing-hero h1 { max-width: 860px; font-size: clamp(38px, 3.9vw, 58px) !important; }

/* Page heroes (inner pages, catalogs, articles) */
html body :is(.page-hero h1, .solution-detail-copy h1, .catalog-hero h1, .trust-hero h1,
  .article-page h1, .article-page header h1, .ai-audit-copy h1, .lab-static-content h1,
  .rooms-catalog .catalog-hero h1, .network-catalog .catalog-hero h1, .hero h1,
  .news-admin-head h1, .solutions-renewed h1, .detail-heading h1) {
  font-size: clamp(34px, 3.7vw, 54px) !important;
  max-width: min(100%, 980px) !important;
}

/* Section headings */
html body :is(.section-heading h2, .detail-heading h2, .catalog-heading h2, .industries-heading h2,
  .landing-cta h2, .catalog-cta h2, .split h2, .about-story h2, .team-section h2, .acca-section h2,
  .ai-audit-preview h2, .ai-audit-preview .ai-audit-copy h2, .seo-example h2, .trust-proof-heading h2,
  .trust-approach-heading h2, .catalog-additional-heading h2, .about-renewed h2, .lab-entry-card h2,
  .article-announcement h2, .article-content-section > h2, .article-conclusion h2, .news-feed-content h2,
  .site-light:not(.home-page) .partner-category-heading h2) {
  font-size: clamp(27px, 2.6vw, 40px) !important;
}
html body .section-heading.compact h2 { font-size: clamp(24px, 2.2vw, 32px) !important; }

/* Card headings */
html body :is(.solution-catalog-card h2, .security-service h2, .news-card h2, .solution-directory-card h2) {
  font-size: clamp(22px, 1.9vw, 30px) !important;
}
html body .detail-card h3 { font-size: clamp(20px, 1.7vw, 26px) !important; }
html body .neural-node h3 { font-size: clamp(18px, 1.45vw, 21px) !important; }

@media (max-width: 760px) {
  html body .landing-hero h1,
  html body :is(.page-hero h1, .solution-detail-copy h1, .catalog-hero h1, .trust-hero h1,
    .article-page h1, .article-page header h1, .ai-audit-copy h1, .lab-static-content h1,
    .rooms-catalog .catalog-hero h1, .network-catalog .catalog-hero h1, .hero h1, .detail-heading h1) {
    font-size: clamp(27px, 7.4vw, 34px) !important;
  }
  html body :is(.section-heading h2, .detail-heading h2, .catalog-heading h2, .industries-heading h2,
    .landing-cta h2, .catalog-cta h2, .split h2, .about-story h2, .team-section h2, .acca-section h2,
    .ai-audit-preview h2, .ai-audit-preview .ai-audit-copy h2, .seo-example h2, .trust-proof-heading h2,
    .trust-approach-heading h2, .catalog-additional-heading h2, .about-renewed h2, .lab-entry-card h2,
    .article-announcement h2, .article-content-section > h2, .article-conclusion h2, .news-feed-content h2) {
    font-size: clamp(23px, 6.2vw, 28px) !important;
  }
  html body :is(.solution-catalog-card h2, .security-service h2, .news-card h2, .solution-directory-card h2,
    .detail-card h3, .neural-node h3) { font-size: clamp(19px, 5.2vw, 23px) !important; }
}

/* Accessibility mode keeps its own larger scale */
html.accessible-mode[data-accessible-theme] body h1 { font-size: clamp(2.1rem, 5vw, 3.6rem) !important; }

/* ---------- 2. Header ------------------------------------------------ */
.topbar .brand-group { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; min-width: 0; }
.topbar .brand-group .acca-header-badge { margin: 0; }

.topbar .ai-audit-header-link {
  display: inline-flex; flex: none; align-items: center; gap: 7px;
  height: 44px; padding: 0 14px; border-radius: 13px;
  border: 1px solid rgba(18, 102, 211, .35);
  background: linear-gradient(135deg, #0f5fc7 0%, #2b8af0 55%, #11b3c9 100%);
  color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .01em; white-space: nowrap;
  box-shadow: 0 8px 20px rgba(18, 102, 211, .22);
  transition: transform .25s ease, box-shadow .25s ease;
}
.topbar .ai-audit-header-link svg { width: 18px; height: 18px; flex: none; }
.topbar .ai-audit-header-link:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(18, 102, 211, .3); }
.topbar .ai-audit-header-link:focus-visible { outline: 3px solid #1266d3; outline-offset: 3px; }
.topbar .ai-audit-header-link[aria-current="page"] { box-shadow: inset 0 -3px 0 rgba(255, 255, 255, .75), 0 8px 20px rgba(18, 102, 211, .22); }
html.accessible-mode .topbar .ai-audit-header-link {
  background: var(--accessible-surface, #fff) !important; color: var(--accessible-text, #000) !important;
  border: 2px solid var(--accessible-border, #000) !important; box-shadow: none !important;
}

/* Desktop: keep one header row with the new button */
.topbar .nav-cta { white-space: nowrap; }
.topbar .nav-link { white-space: nowrap; }
@media (min-width: 1181px) {
  .topbar .shell.navrow { width: min(1600px, calc(100% - 48px)); }
  .topbar .top-actions { flex: 0 0 auto !important; flex-wrap: nowrap !important; }
  .topbar .nav { flex: 1 1 auto; min-width: 0; justify-content: center; }
}
@media (max-width: 1800px) and (min-width: 1181px) {
  .topbar .lab-header-link { min-width: 44px !important; width: 44px; padding: 0 !important; gap: 0 !important; }
  .topbar .lab-header-link .btg-lab-wordmark { display: none !important; }
  .topbar .navrow { gap: 14px; }
  .topbar .top-actions { gap: 8px; }
}
@media (max-width: 1640px) and (min-width: 1181px) {
  .topbar .nav-cta { display: none; }
}
@media (max-width: 1400px) and (min-width: 1181px) {
  .topbar .nav { gap: 0; }
  .topbar .nav .nav-link { padding-left: 4px; padding-right: 4px; font-size: 12.5px; }
  .topbar .logo { width: 116px; }
  .topbar .ai-audit-header-link { padding: 0 12px; }
}
@media (max-width: 760px) {
  .topbar .brand-group { gap: 8px; }
  .topbar .ai-audit-header-link { width: 44px; height: 44px; padding: 0; justify-content: center; gap: 0; }
  .topbar .ai-audit-header-link span { display: none; }
  .topbar .ai-audit-header-link svg { width: 21px; height: 21px; }
}
/* Phones: one tidy header row. Language links move into the mobile menu. */
.mobile-menu .mobile-lang { display: none; }
@media (max-width: 600px) {
  .topbar .top-actions .language-switcher,
  .topbar .top-actions .lab-header-link { display: none !important; }
  .topbar .top-actions { flex-wrap: nowrap !important; max-width: none !important; gap: 6px !important; }
  .topbar .navrow { height: 70px !important; min-height: 70px !important; padding: 0 !important; }
  .topbar .brand .logo { width: 104px; height: auto; }
  .topbar .brand-group .acca-header-badge { width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
  .mobile-menu .mobile-lang { display: inline-flex; margin: 14px 0 6px; }
  .mobile-menu .mobile-lang a { min-width: 52px; min-height: 44px; display: grid; place-items: center; }
}

/* ---------- 3. Home: six-node solution graphic ---------------------- */
@media (min-width: 901px) {
  .neural-ecosystem.has-six { min-height: 840px; }
  .neural-ecosystem.has-six .neural-top { left: 50%; top: 18px; right: auto; bottom: auto; transform: translateX(-50%); }
  .neural-ecosystem.has-six .neural-right-top { right: 24px; top: 150px; bottom: auto; }
  .neural-ecosystem.has-six .neural-right-bottom { right: 24px; bottom: 150px; top: auto; }
  .neural-ecosystem.has-six .neural-bottom { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); }
  .neural-ecosystem.has-six .neural-left-bottom { left: 24px; bottom: 150px; top: auto; }
  .neural-ecosystem.has-six .neural-left-top { left: 24px; top: 150px; bottom: auto; }
  .neural-ecosystem.has-six .neural-node { width: 286px; }
  .neural-ecosystem.has-six .neural-node p { font-size: 14px; }
}
@media (min-width: 901px) and (max-width: 1080px) {
  .neural-ecosystem.has-six .neural-node { width: 230px; }
  .neural-ecosystem.has-six .neural-core { width: 230px; height: 230px; }
}
@media (max-width: 900px) {
  .neural-ecosystem.has-six .neural-bottom { position: relative; left: auto; right: auto; top: auto; bottom: auto; width: auto; min-height: 174px; transform: none !important; }
}
.neural-node.neural-ai > span b { background: linear-gradient(135deg, #1266d3, #11b3c9); color: #fff; }

/* ---------- 4. Livelier background visuals -------------------------- */
@keyframes btgDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-1.5%, -1%, 0) scale(1.05); }
}
html body .catalog-hero-visual,
html body .trust-hero-visual { opacity: 1 !important; filter: saturate(1.18) contrast(1.06) !important; }
html body .kazakhstan-map-visual { opacity: .78 !important; filter: saturate(1.15) contrast(1.04) !important; }
html body :is(.catalog-hero-visual, .trust-hero-visual, .kazakhstan-map-visual) img {
  animation: btgDrift 26s ease-in-out infinite alternate;
  will-change: transform;
}
html body .visual-topic-card img { filter: saturate(1.18) contrast(1.05); transition: transform 1.1s cubic-bezier(.22, 1, .36, 1), filter .5s; }
html body .visual-topic-card:hover img { transform: scale(1.05); filter: saturate(1.3) contrast(1.08); }
html body .project-niche-card::before {
  background-image: linear-gradient(180deg, rgba(5, 22, 45, 0) 15%, rgba(5, 22, 45, .86)), var(--case-image) !important;
  filter: saturate(1.2);
}

/* Home hero: full-width photo background + AI chip */
.home-page .landing-hero {
  background:
    linear-gradient(90deg, #fff 0%, rgba(255,255,255,.97) 30%, rgba(255,255,255,.72) 46%, rgba(255,255,255,.18) 64%, rgba(255,255,255,0) 80%),
    linear-gradient(180deg, rgba(255,255,255,0) 72%, rgba(255,255,255,.9) 100%),
    url('assets/visuals/solutions-ecosystem-light.webp') right center / cover no-repeat !important;
}
.home-page .landing-hero::before { opacity: .5; }
.home-page .hero-system { min-height: 520px; }
.home-page .hero-brand-mark {
  position: relative; z-index: 1; width: 320px; padding: 22px 26px; border-radius: 28px;
  background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px rgba(10,49,109,.18);
}
.home-page .hero-system .system-chip { z-index: 2; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@media (min-width: 761px) {
  .home-page .hero-system .chip-a { top: 72px; left: 0; }
  .home-page .hero-system .chip-b { top: 112px; right: 0; }
  .home-page .hero-system .chip-c { bottom: 112px; left: -2%; }
  .home-page .hero-system .chip-d { bottom: 64px; right: 2%; }
  .home-page .hero-system .chip-ai { top: 0; left: 50%; transform: translateX(-50%); }
}
.home-page .hero-system .chip-ai {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 22px; font-size: 16px; font-weight: 800; color: #fff !important;
  border: 0; background: linear-gradient(135deg, #0f5fc7 0%, #2b8af0 55%, #11b3c9 100%);
  box-shadow: 0 16px 34px rgba(18,102,211,.35);
  transition: box-shadow .25s ease, filter .25s ease;
}
.home-page .hero-system .chip-ai svg { width: 20px; height: 20px; flex: none; }
.home-page .hero-system .chip-ai:hover { filter: brightness(1.08); box-shadow: 0 20px 40px rgba(18,102,211,.45); }
.home-page .hero-system .chip-ai:focus-visible { outline: 3px solid #0e2240; outline-offset: 3px; }
@media (max-width: 1080px) {
  .home-page .landing-hero {
    background:
      linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.88) 45%, rgba(255,255,255,.45) 75%, rgba(255,255,255,.85) 100%),
      url('assets/visuals/solutions-ecosystem-light-1200.webp') center bottom / cover no-repeat !important;
  }
}
@media (max-width: 760px) {
  .home-page .landing-hero {
    background:
      linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.86) 55%, rgba(255,255,255,.55) 100%),
      url('assets/visuals/solutions-ecosystem-light-960.webp') 70% bottom / cover no-repeat !important;
  }
  .home-page .hero-system { min-height: 0; }
  .home-page .hero-brand-mark { width: min(250px, 74vw); padding: 14px 18px; }
  .home-page .hero-system .chip-ai { grid-column: 1 / -1; justify-content: center; order: -1; font-size: 15px; }
}
html.accessible-mode .home-page .landing-hero { background: var(--accessible-surface, #fff) !important; }
html.accessible-mode .home-page .hero-system .chip-ai { background: var(--accessible-surface, #fff) !important; color: var(--accessible-text, #000) !important; border: 2px solid var(--accessible-border, #000); box-shadow: none; }
@media (max-width: 760px) {
  html body .catalog-hero-visual, html body .trust-hero-visual { opacity: .9 !important; }
  html body .kazakhstan-map-visual { opacity: .35 !important; }
}
@media (prefers-reduced-motion: reduce) {
  html body :is(.catalog-hero-visual, .trust-hero-visual, .kazakhstan-map-visual) img { animation: none; }
}

/* ---------- 5a. AI solutions page ----------------------------------- */
.ai-page .ai-hero-visual { position: relative; min-height: 410px; border-radius: 42px; overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #1d6fe0 0, #0b3e8c 45%, #061a3a 100%);
  box-shadow: 0 30px 70px rgba(10, 49, 109, .22); }
.ai-page .ai-hero-visual svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ai-page .ai-hero-visual .ai-flow { stroke-dasharray: 6 10; animation: aiFlow 2.8s linear infinite; }
.ai-page .ai-hero-visual .ai-core { animation: aiPulse 4s ease-in-out infinite; transform-origin: 260px 205px; }
@keyframes aiFlow { to { stroke-dashoffset: -64; } }
@keyframes aiPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .ai-page .ai-hero-visual .ai-flow, .ai-page .ai-hero-visual .ai-core { animation: none; } }
@media (max-width: 760px) { .ai-page .ai-hero-visual { min-height: 260px; border-radius: 26px; } }

.ai-page .solution-detail-copy .ai-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ai-page .pill-link-plain { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 6px;
  color: #10243d; font-weight: 800; border-bottom: 2px solid rgba(18, 102, 211, .35); }
.ai-page .pill-link-plain:hover { color: #1266d3; border-color: #1266d3; }

.ai-page .ai-intro { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.ai-page .ai-intro p { font-size: 1.06rem; line-height: 1.75; color: #33475f; margin: 0 0 1rem; }
.ai-page .ai-dir-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 32px; }
.ai-page .ai-dir-grid article { padding: 24px 22px; border: 1px solid var(--detail-line, #d8e5f2); border-radius: 20px; background: #fff;
  box-shadow: 0 13px 34px rgba(10, 49, 109, .05); }
.ai-page .ai-dir-grid article span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #1266d3, #11b3c9); color: #fff; font-size: 13px; font-weight: 900; }
.ai-page .ai-dir-grid h3 { margin: 18px 0 10px; font-size: 19px !important; color: #10243d; }
.ai-page .ai-dir-grid p { margin: 0; font-size: 15px; line-height: 1.55; color: #40566f; }
.ai-page .ai-dir-note { margin-top: 22px; max-width: 900px; color: #40566f; font-size: 1.02rem; line-height: 1.7; }
@media (max-width: 1180px) { .ai-page .ai-dir-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .ai-page .ai-intro { grid-template-columns: 1fr; }
  .ai-page .ai-dir-grid { grid-template-columns: 1fr; }
}

.ai-page .ai-cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 30px; }
.ai-page .ai-cards-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 30px; }
.ai-page :is(.ai-cards-3, .ai-cards-2) article { padding: 28px; border: 1px solid var(--detail-line, #d8e5f2); border-radius: 22px; background: #fff;
  box-shadow: 0 13px 34px rgba(10, 49, 109, .05); }
.ai-page :is(.ai-cards-3, .ai-cards-2) h3 { margin: 0 0 12px; font-size: clamp(20px, 1.6vw, 24px) !important; color: #10243d; }
.ai-page :is(.ai-cards-3, .ai-cards-2) p { margin: 0; color: #40566f; font-size: 15.5px; line-height: 1.65; }
@media (max-width: 980px) { .ai-page .ai-cards-3, .ai-page .ai-cards-2 { grid-template-columns: 1fr; } }

.ai-page .ai-control { margin-top: 26px; padding: 28px; border-radius: 22px; background: #0d2547; color: #e6eef8; }
.ai-page .ai-control h3 { margin: 0 0 16px; color: #fff; font-size: 22px !important; }
.ai-page .ai-control ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; margin: 0; padding: 0; list-style: none; }
.ai-page .ai-control li { position: relative; padding-left: 22px; line-height: 1.55; font-size: 15px; }
.ai-page .ai-control li::before { content: ''; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: #39c3d6; }
@media (max-width: 760px) { .ai-page .ai-control ul { grid-template-columns: 1fr; } }

.ai-page .ai-pak-note { margin-top: 20px; color: #40566f; line-height: 1.7; max-width: 980px; }
.ai-page .ai-results ul { margin: 0 0 1.2rem; padding: 0; list-style: none; display: grid; gap: 10px; }
.ai-page .ai-results li { position: relative; padding-left: 24px; line-height: 1.6; }
.ai-page .ai-results li::before { content: '✓'; position: absolute; left: 0; color: #39c3d6; font-weight: 900; }
.ai-page .process-grid.ai-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .ai-page .process-grid.ai-steps { grid-template-columns: 1fr; } }

/* Solutions catalog card for AI */
.solution-catalog-card.ai { grid-column: 1 / -1; background: linear-gradient(135deg, #e9f2ff 0%, #e4f8fb 100%); }
@media (min-width: 901px) {
  .solution-catalog-card.ai ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
}

/* ---------- 5b. Contact form ---------------------------------------- */
.contact-form .hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.contact-form .consent { grid-column: 1 / -1; display: flex !important; align-items: flex-start; gap: 10px !important; font-weight: 500 !important; font-size: 13.5px !important; line-height: 1.5; }
.contact-form .consent input { width: 18px !important; height: 18px; margin-top: 2px; flex: none; padding: 0 !important; accent-color: #1266d3; }
.contact-form .form-status.is-ok { color: #12804a !important; font-weight: 700; }
.contact-form .form-status.is-error { color: #b42318 !important; font-weight: 700; }
.contact-form button[disabled] { opacity: .6; cursor: progress; }

/* ---------- 5c. WhatsApp button ------------------------------------- */
.btg-whatsapp { position: fixed; z-index: 60; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 18px 0 14px; border-radius: 26px;
  background: #1fa855; color: #fff; font-weight: 800; font-size: 14px; box-shadow: 0 12px 28px rgba(16, 90, 48, .3);
  transition: transform .25s ease; }
.btg-whatsapp:hover { transform: translateY(-2px); }
.btg-whatsapp:focus-visible { outline: 3px solid #0d5c2e; outline-offset: 3px; }
.btg-whatsapp svg { width: 24px; height: 24px; }
@media (max-width: 760px) { .btg-whatsapp { width: 52px; padding: 0; justify-content: center; } .btg-whatsapp span { display: none; } }
@media print { .btg-whatsapp { display: none; } }

/* ---------- 5d. 404 ---------------------------------------------------- */
.not-found { padding: clamp(60px, 10vw, 140px) 0; }
.not-found .code { font-size: clamp(72px, 12vw, 150px); font-weight: 800; line-height: 1; color: #1266d3; letter-spacing: -0.02em; }
.not-found nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.not-found nav a { padding: 12px 16px; border: 1px solid #cadbea; border-radius: 12px; background: #fff; font-weight: 700; color: #10243d; }
.not-found nav a:hover { border-color: #1266d3; color: #1266d3; }
.ai-page .ai-section-lead { max-width: 920px; margin: 14px 0 0; color: #40566f; font-size: 1.05rem; line-height: 1.7; }
@media (max-width: 1280px) and (min-width: 1181px) {
  .topbar .ai-audit-header-link { width: 44px; padding: 0; justify-content: center; gap: 0; }
  .topbar .ai-audit-header-link span { display: none; }
}
