/* ============================================================
   AI CJM – Страница /dev/ (AI-разработка под задачу).
   Перенесена с devtest1 на общие компоненты:
   хедер/футер – site-header.js/site-footer.js (web components),
   форма – /components/_form.html + feedback-form.js (/api/lead),
   logo-cloud – redesign-components.css + logo-marquee.js.
   Здесь только секции страницы. Подключать ПОСЛЕ redesign.css
   и redesign-components.css.
   ============================================================ */

/* --- Semantic tokens (как у edu) --- */
:root {
  --page: var(--bg);
  --surface: var(--bg-card);
  --soft: var(--bg-1);
  --text: var(--ink);
  --muted: var(--ink-2);
  --quiet: var(--ink-3);
  --brand: var(--accent);
  --brand-deep: var(--bg-blue);
  --brand-hover: var(--accent-ink);
  --white: #ffffff;
  --white-72: rgba(255, 255, 255, 0.72);
  --white-16: rgba(255, 255, 255, 0.16);
  --white-10: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --container: min(1376px, calc(100vw - 64px));
  --section-space: clamp(52px, 4.8vw, 76px);
}

/* --- Base --- */
* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* --- Skip link --- */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 12px 16px;
  background: var(--brand-deep);
  color: var(--white);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

/* --- Skip link --- */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 12px 16px;
  background: var(--brand-deep);
  color: var(--white);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

/* --- Hero (edu-style) --- */
.hero {
  display: flex;
  min-height: calc(100vh - 72px);
  border-bottom: 1px solid var(--line);
}
.hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 980px);
  padding: clamp(42px, 4vw, 64px) clamp(32px, 5vw, 78px);
}

.proof-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 13px;
}
.proof-line > i { width: 4px; height: 4px; background: var(--brand); }
.proof-group { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.proof-logos { display: flex; align-items: center; gap: 10px; height: 34px; }
.proof-logo { position: relative; display: block; height: 34px; overflow: hidden; flex: 0 0 auto; }
.proof-logo img { position: absolute; max-width: none; object-fit: contain; }
.proof-logo--sber { width: 34px; }
.proof-logo--sber img { top: 0; left: 0; width: 205px; height: 34px; }
.proof-logo--vtb { width: 68px; }
.proof-logo--vtb img { position: static; width: 68px; height: 24px; }
.proof-faces { display: flex; width: 82px; flex: 0 0 82px; }
.proof-faces img { width: 34px; height: 34px; border: 2px solid var(--page); border-radius: 50%; background: var(--soft); object-fit: cover; }
.proof-faces img + img { margin-left: -10px; }

.hero h1 {
  max-width: 840px;
  margin: 0;
  color: var(--text);
  font-size: clamp(52px, 5vw, 72px);
  font-weight: 520;
  letter-spacing: -0.075em;
  line-height: 0.94;
}
.hero h1 span { display: block; color: var(--brand); font-style: italic; font-weight: 520; }
.hero__lead { max-width: 780px; margin: 22px 0 0; color: var(--muted); font-size: clamp(17px, 1.25vw, 20px); line-height: 1.45; }
.hero__actions { display: flex; align-items: center; gap: 28px; margin-top: 26px; }
.text-link { color: var(--text); font-size: 15px; font-weight: 600; text-decoration: none; }
.text-link span { margin-left: 9px; color: var(--brand); }
.hero__metrics { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 720px; margin: 30px 0 0; border-top: 1px solid var(--line); }
.hero__metrics div { padding: 24px 18px 0 0; }
.hero__metrics div + div { padding-left: 22px; border-left: 1px solid var(--line); }
.hero__metrics dt { color: var(--text); font-size: 20px; font-weight: 700; }
.hero__metrics dd { margin: 3px 0 0; color: var(--quiet); font-size: 12px; }

/* --- Sections (edu-style) --- */
.section { width: var(--container); margin: 0 auto; padding: var(--section-space) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-heading { max-width: 880px; margin-bottom: clamp(32px, 3.5vw, 46px); }
.section-label { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; color: var(--muted); font-size: 13px; font-weight: 600; }
.section-label span { width: 30px; height: 1px; background: var(--brand); }
.section-label--light { color: var(--white-72); }
.section-label--light span { background: var(--white); }
.section-heading h2, .contour h2, .contact h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(40px, 4.2vw, 56px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.02;
}
.section-heading > p:last-child, .section-heading > div > p {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

/* --- Pains (details, border-based) --- */
.pain-list { border-top: 1px solid var(--line); }
.pain-list details { border-bottom: 1px solid var(--line); }
.pain-list summary {
  display: grid;
  grid-template-columns: 42px 1fr 30px;
  gap: 20px;
  align-items: center;
  padding: 26px 0;
  color: var(--text);
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 520;
  letter-spacing: -0.025em;
  cursor: pointer;
  list-style: none;
}
.pain-list summary::-webkit-details-marker { display: none; }
.pain-list summary > span:first-child { color: var(--brand); font-size: 11px; font-weight: 650; }
.pain-list summary > span:last-child {
  color: var(--brand);
  font-size: 28px;
  font-weight: 350;
  transition: transform 180ms ease;
  justify-self: end;
}
.pain-list details[open] summary > span:last-child { transform: rotate(45deg); }
.pain-body {
  max-width: 880px;
  margin: -4px 0 28px;
  display: grid;
  gap: 24px;
}
.pain-body__block { padding: 20px 0; border-top: 1px solid var(--line); }
.pain-body__block > span { display: block; margin-bottom: 10px; color: var(--brand); font-size: 12px; font-weight: 650; }
.pain-body__block p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.pain-body__block p b { color: var(--text); font-weight: 650; }
.pain-cases { display: grid; gap: 12px; padding: 18px 20px; background: var(--soft); border-top: 1px solid var(--line); }
.pain-case { display: grid; grid-template-columns: minmax(62px, 86px) minmax(0, 1fr); gap: 14px; align-items: center; }
.pain-case img { width: auto; max-width: 86px; height: 25px; object-fit: contain; object-position: left center; }
.pain-case > span { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.pain-case strong { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.pain-case small { overflow: hidden; color: var(--quiet); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

/* --- Solution modules (4-col border-based) --- */
.module-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.module-grid article {
  display: flex;
  min-height: 270px;
  padding: 26px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.module-grid article > span { color: var(--brand); font-size: 12px; font-weight: 650; }
.module-icon { display: block; width: 72px; height: 60px; margin: 18px 0 14px; color: var(--brand); flex: 0 0 auto; font-style: normal; }
.module-icon svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.module-grid h3 { margin: 8px 0 12px; font-size: 26px; font-weight: 650; letter-spacing: -0.045em; line-height: 1.08; }
.module-grid p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.module-grid small { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 12px; }
.module-grid .module-card--accent { background: var(--brand-deep); color: var(--white); }
.module-card--accent > span, .module-card--accent p { color: var(--white-72); }
.module-card--accent .module-icon { color: var(--white); }
.module-card--accent a { margin-top: auto; color: var(--white); font-size: 12px; font-weight: 650; text-decoration: none; }

/* --- Cases (4-col border-based) --- */
.case-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.case-card {
  display: flex;
  min-width: 0;
  min-height: 292px;
  padding: 20px;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  transition: background 160ms ease;
}
.case-card:hover { background: var(--soft); }
.case-card__top { display: flex; min-height: 28px; align-items: center; justify-content: space-between; gap: 14px; }
.case-card__logo { width: auto; max-width: 98px; height: 26px; object-fit: contain; object-position: left center; }
.case-card__fallback { display: inline-flex; min-width: 34px; min-height: 26px; align-items: center; color: var(--text); font-size: 12px; font-weight: 750; letter-spacing: -0.03em; }
.case-card__top > span:last-child { max-width: 110px; color: var(--quiet); font-size: 12px; text-align: right; white-space: normal; }
.case-card__body { display: flex; min-height: 0; margin: 31px 0 20px; flex: 1; flex-direction: column; }
.case-card__body small { color: var(--brand); font-size: 12px; font-weight: 650; }
.case-card h3 { display: -webkit-box; margin: 11px 0 12px; overflow: hidden; font-size: clamp(19px, 1.45vw, 23px); font-weight: 540; letter-spacing: -0.045em; line-height: 1.08; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.case-card p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 14px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.case-card__bottom { display: flex; min-height: 48px; padding-top: 14px; align-items: flex-end; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.case-card__bottom > div { display: flex; min-width: 0; align-items: baseline; gap: 7px; }
.case-card__bottom strong { color: var(--brand); font-size: 21px; font-weight: 650; letter-spacing: -0.04em; white-space: nowrap; }
.case-card__bottom span { color: var(--quiet); font-size: 12px; white-space: normal; }
.case-card__bottom i { color: var(--brand); font-size: 16px; font-style: normal; }

/* --- Process (5-col border-based, like method-steps) --- */
.process-steps { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.process-steps li { display: flex; min-height: 280px; padding: 26px; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.process-steps > li > span { color: var(--brand); font-size: 11px; }
.process-steps h3 { min-height: 2.1em; margin: 18px 0 14px; font-size: 23px; font-weight: 550; letter-spacing: -0.04em; line-height: 1.05; }
.process-steps p { margin: 0; color: var(--muted); font-size: 13px; }
.process-steps small { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 10px; }

/* --- Contour / Security (deep-blue, 2-col with diagram) --- */
.contour {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(500px, 1.14fr);
  gap: clamp(56px, 8vw, 130px);
  padding: var(--section-space) max(32px, calc((100vw - 1376px) / 2));
  background: var(--brand-deep);
  color: var(--white);
}
.contour h2 { color: var(--white); }
.contour__copy > p:not(.section-label) { max-width: 680px; margin: 26px 0 0; color: var(--white-72); font-size: 18px; }
.check-list { margin: 42px 0; padding: 0; list-style: none; }
.check-list li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 15px 0; border-top: 1px solid var(--white-16); font-size: 14px; }
.check-list span { color: var(--white-72); font-size: 10px; }
.contour__diagram { align-self: center; }
.diagram-frame { padding: clamp(24px, 3vw, 44px); background: var(--white); color: var(--text); box-shadow: 0 34px 100px rgba(0, 0, 0, 0.24); }
.diagram-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 650; }
.diagram-head i { padding: 7px 9px; background: var(--soft); color: var(--brand); font-size: 9px; font-style: normal; }
.diagram-row { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 20px; padding: 22px; background: var(--soft); border: 1px solid var(--line); }
.diagram-row > span { color: var(--brand); font-size: 10px; font-weight: 700; }
.diagram-row strong { font-size: 15px; font-weight: 600; }
.diagram-row small { color: var(--quiet); font-size: 10px; }
.diagram-row--security { background: var(--brand); border-color: var(--brand); color: var(--white); }
.diagram-row--security > span, .diagram-row--security small { color: var(--white-72); }
.diagram-connector { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 13px 0; color: var(--quiet); font-size: 9px; }
.diagram-connector i { height: 1px; background: var(--line); }
.diagram-systems { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.diagram-systems div { min-height: 90px; padding: 16px; background: var(--surface); border: 1px solid var(--line); }
.diagram-systems span { display: block; margin-bottom: 18px; color: var(--brand); font-size: 9px; }
.diagram-systems strong { font-size: 11px; line-height: 1.3; }
.diagram-result { display: grid; grid-template-columns: 90px 1fr; gap: 20px; margin-top: 14px; padding: 22px; background: var(--brand-deep); color: var(--white); }
.diagram-result span { color: var(--white-72); font-size: 10px; }
.diagram-result strong { max-width: 380px; font-size: 14px; }
.contour__diagram > p { max-width: 680px; margin: 20px 0 0; color: var(--white-72); font-size: 12px; }

/* --- Tech (4-col border-based) --- */
.tech-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tech-grid article { display: flex; min-height: 240px; padding: 26px; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tech-grid article > span { color: var(--brand); font-size: 12px; font-weight: 650; }
.tech-grid h3 { margin: 18px 0 14px; font-size: 23px; font-weight: 550; letter-spacing: -0.04em; line-height: 1.05; }
.tech-grid p { margin: 0; color: var(--muted); font-size: 13px; }

/* --- Reviews (3-col border-based) --- */
.review-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.review-grid article { display: flex; min-height: 310px; padding: 26px; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.review-logo { width: auto; max-width: 112px; height: 32px; object-fit: contain; object-position: left center; }
.review-grid blockquote { margin: 28px 0 0; font-size: 20px; font-weight: 450; letter-spacing: -0.025em; line-height: 1.45; }
.review-grid a { margin-top: auto; padding-top: 28px; border-top: 1px solid var(--line); color: var(--brand); font-size: 10px; font-weight: 650; text-decoration: none; }

/* --- FAQ (details/summary, border-based) --- */
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { display: grid; grid-template-columns: 1fr 30px; gap: 30px; align-items: center; padding: 26px 0; color: var(--text); font-size: clamp(18px, 2vw, 25px); font-weight: 520; letter-spacing: -0.025em; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary span { color: var(--brand); font-size: 28px; font-weight: 350; transition: transform 180ms ease; }
.faq-list details[open] summary span { transform: rotate(45deg); }
.faq-list details p { max-width: 820px; margin: -4px 0 28px; color: var(--muted); font-size: 15px; }

/* --- Scroll anchors --- */
.cases, .process, [data-component="form"] { scroll-margin-top: 72px; }

/* --- Reviews: improved visual --- */
.review-grid article { position: relative; }
.review-grid article::before {
  content: "\201C";
  position: absolute;
  top: 18px;
  right: 26px;
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  color: var(--brand);
  opacity: 0.12;
}

/* --- Responsive: 1180px --- */
@media (max-width: 1180px) {
  :root { --container: min(100% - 48px, 1120px); }
  .site-nav { display: none; }
  .hero h1 { font-size: clamp(52px, 6.4vw, 72px); }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .case-grid { grid-template-columns: repeat(2, 1fr); }
  .process-steps { grid-template-columns: repeat(3, 1fr); }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .contour { grid-template-columns: 1fr 1fr; padding-inline: max(24px, calc((100vw - 1120px) / 2)); }
}

/* --- Responsive: 900px --- */
@media (max-width: 900px) {
  :root { --container: calc(100% - 36px); --section-space: 68px; }
  .hero { min-height: auto; }
  .hero__copy { min-height: auto; padding: 64px 24px; }
  .hero h1 { font-size: clamp(52px, 12vw, 72px); }
  .contour, .contact { grid-template-columns: 1fr; padding-inline: 18px; }
  .process-steps { grid-template-columns: repeat(2, 1fr); }
  .case-grid { grid-template-columns: 1fr 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .review-grid article { min-height: 300px; }
}

/* --- Responsive: 620px --- */
@media (max-width: 620px) {
  :root { --container: calc(100% - 36px); --section-space: 46px; }
  .hero__copy { min-height: auto; padding: 48px 18px; }
  .proof-line { margin-bottom: 22px; }
  .proof-line > i { display: none; }
  .hero h1 { font-size: 52px; line-height: 0.98; }
  .hero__lead { margin-top: 22px; font-size: 17px; }
  .hero__actions { align-items: stretch; flex-direction: column; gap: 14px; }
  .hero__actions .button { width: 100%; }
  .hero__metrics { grid-template-columns: 1fr; margin-top: 32px; }
  .hero__metrics div, .hero__metrics div + div { padding: 13px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .section-heading h2, .contour h2, .contact h2 { font-size: 40px; }
  .section-heading > p:last-child, .section-heading > div > p { font-size: 16px; }
  .contour, .contact { padding-inline: 18px; }
  .contour__diagram { display: none; }
  .process-steps { grid-template-columns: 1fr; }
  .process-steps li { min-height: 260px; }
  .case-grid, .module-grid, .tech-grid { grid-template-columns: 1fr; }
  .review-grid blockquote { font-size: 18px; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
