/* ============================================================
   AI CJM – Главная (разводная) страница.

   Дизайн перенесён со страницы /edu/: канон – edu/BRANDBOOK.md
   и brandbook/system/, реализация-эталон – edu/styles.css.
   Композиция строится на линиях и сетке: белые поверхности,
   разделители --line, глубокие синие блоки для акцентов,
   острые углы, Inter.

   Подключать ПОСЛЕ redesign.css и redesign-components.css.
============================================================ */

/* ------------------------------------------------------------
   Ролевые алиасы поверх токенов redesign.css (как в edu/styles.css)
------------------------------------------------------------ */
: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-40:    rgba(255, 255, 255, 0.4);
  --white-16:    rgba(255, 255, 255, 0.16);
  --shadow:      0 24px 70px rgba(15, 23, 42, 0.12);

  --container:     min(1376px, calc(100vw - 64px));
  --section-space: clamp(52px, 4.8vw, 76px);

  --r-sm: 0; --r-md: 0; --r-lg: 0; --r-xl: 0;
}

/* ------------------------------------------------------------
   База
------------------------------------------------------------ */
html { overflow-x: clip; scroll-behavior: smooth; }
body {
  overflow-x: clip;
  background: var(--page);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.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; }

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

/* ------------------------------------------------------------
   Кнопки
------------------------------------------------------------ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--white);
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.button:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.button--light { background: var(--white); border-color: var(--white); color: var(--brand-deep); }
.button--light:hover { background: var(--soft); border-color: var(--soft); }

.text-link { color: var(--text); font-size: 15px; font-weight: 600; }
.text-link span { margin-left: 9px; color: var(--brand); }
.text-link:hover { color: var(--brand); }

/* ------------------------------------------------------------
   HERO
------------------------------------------------------------ */
.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%, 1020px);
  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-group a { color: var(--muted); }
.proof-group a span { margin-left: 6px; color: var(--brand); }
.proof-group a:hover { color: var(--brand); }
.proof-logos { display: flex; align-items: center; gap: 16px; height: 26px; }
.proof-logos img {
  width: auto;
  max-width: 92px;
  height: 20px;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: left center;
}

.hero h1 {
  max-width: 980px;
  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__lead b { color: var(--text); font-weight: 600; }
.hero__actions { display: flex; align-items: center; gap: 28px; margin-top: 26px; }

.hero__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 760px;
  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; letter-spacing: -0.03em; }
.hero__metrics dd { margin: 3px 0 0; color: var(--quiet); font-size: 12px; }

/* ------------------------------------------------------------
   СЕКЦИИ И ЗАГОЛОВКИ
------------------------------------------------------------ */
main > .section {
  width: var(--container);
  margin: 0 auto;
  padding: var(--section-space) 0;
}
main > .section + .section { border-top: 1px solid var(--line); }

.section-heading { max-width: 880px; margin-bottom: clamp(32px, 3.5vw, 46px); }
.section-heading 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 { max-width: 720px; margin: 22px 0 0; color: var(--muted); font-size: 18px; line-height: 1.55; }
.section-heading p b { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------
   ФОТО-ПОЛОСА (слайдер)
------------------------------------------------------------ */
.photo-band {
  position: relative;
  padding: var(--section-space) max(32px, calc((100vw - 1376px) / 2));
  background: var(--brand-deep);
  color: var(--white);
  border-bottom: 1px solid var(--line);
}
.photo-band__grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(34px, 6vw, 90px); align-items: center; }
.photo-band__copy p { max-width: 520px; margin: 0; font-size: clamp(28px, 2.8vw, 40px); font-weight: 550; letter-spacing: -0.05em; line-height: 1.08; }
.photo-band__copy p b { color: var(--white); font-style: italic; font-weight: 550; }
.ps-stage { position: relative; }
.ps-img { width: 100%; height: clamp(260px, 34vw, 430px); object-fit: cover; box-shadow: var(--shadow); }
.ps-dots { display: flex; gap: 8px; margin-top: 18px; }
.ps-dot { width: 26px; height: 2px; background: var(--white-16); cursor: pointer; transition: background 160ms ease; }
.ps-dot.on { background: var(--white); }

/* ------------------------------------------------------------
   ЭКСПЕРТИЗА – три направления (разводка)
------------------------------------------------------------ */
.ex-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.ex-card {
  display: flex;
  min-height: 470px;
  padding: 26px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ex-card > span { color: var(--brand); font-size: 12px; font-weight: 650; }
.ex-card h3 { margin: 42px 0 14px; font-size: 30px; font-weight: 550; letter-spacing: -0.05em; line-height: 1.06; }
.ex-card > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.ex-card ul { margin: 30px 0; padding: 0; flex: 1; list-style: none; }
.ex-card li { padding: 8px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.45; }
.ex-card li small { color: var(--quiet); }
.ex-card li b { color: var(--text); font-weight: 650; }
.ex-card > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--brand);
  font-size: 13px;
  font-weight: 650;
}
.ex-card > a span { font-size: 16px; }

/* ------------------------------------------------------------
   СОБСТВЕННЫЕ ПРОДУКТЫ
------------------------------------------------------------ */
.product { display: grid; grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr); gap: clamp(34px, 5vw, 80px); align-items: center; }
.product + .product { margin-top: clamp(40px, 4vw, 64px); padding-top: clamp(40px, 4vw, 64px); border-top: 1px solid var(--line); }
.product__name { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: 27px; font-weight: 650; letter-spacing: -0.045em; }
.product__name img { width: 34px; height: 34px; flex: 0 0 auto; object-fit: contain; }
.product__name--sovetnik { letter-spacing: 0.02em; font-weight: 700; }
.product p { max-width: 520px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.product > div > a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 650;
}
.product > div > a span { font-size: 16px; }

.sp-mock { border: 1px solid var(--line); background: var(--surface); }
.sp-bar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 650; }
.sp-bar img { width: 20px; height: 20px; object-fit: contain; }
.sp-body { display: flex; min-height: 260px; padding: 22px; flex-direction: column; gap: 12px; }
.sp-msg { display: none; max-width: 78%; padding: 13px 16px; font-size: 14px; line-height: 1.45; opacity: 0; transform: translateY(6px); transition: opacity 220ms ease, transform 220ms ease; }
.sp-msg.show { opacity: 1; transform: none; }
.sp-user { align-self: flex-end; background: var(--brand-deep); color: var(--white); }
.sp-ai { align-self: flex-start; background: var(--soft); color: var(--text); }
.sp-typing { display: none; align-self: flex-start; gap: 5px; padding: 15px 16px; background: var(--soft); }
.sp-typing i { width: 5px; height: 5px; background: var(--quiet); animation: sp-blink 1.1s infinite; }
.sp-typing i:nth-child(2) { animation-delay: 0.18s; }
.sp-typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes sp-blink { 0%, 60%, 100% { opacity: 0.28; } 30% { opacity: 1; } }

.sv-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.sv-cell { width: 100%; height: 190px; object-fit: cover; object-position: top left; background: var(--surface); }
.sv-wide { grid-column: 1 / -1; height: 230px; }

/* ------------------------------------------------------------
   КЕЙСЫ
------------------------------------------------------------ */
.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-height: 300px;
  padding: 26px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.case-card__logo { min-height: 28px; color: var(--text); font-size: 15px; font-weight: 750; letter-spacing: -0.03em; }
.case-card h3 { margin: 28px 0 12px; font-size: 23px; font-weight: 550; letter-spacing: -0.045em; line-height: 1.08; }
.case-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* ------------------------------------------------------------
   КОМАНДА
------------------------------------------------------------ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.tm-card {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.tm-photo { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; overflow: hidden; background: var(--soft); }
.tm-img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.tm-mono { position: absolute; z-index: 0; color: var(--quiet); font-size: 40px; font-weight: 700; letter-spacing: -0.04em; }
.tm-img { position: relative; z-index: 1; }
.tm-body { display: flex; padding: 24px; flex-direction: column; flex: 1; }
.tm-role { margin: 0 0 12px; color: var(--brand); font-size: 12px; font-weight: 650; }
.tm-name { margin: 0 0 6px; font-size: 23px; font-weight: 550; letter-spacing: -0.045em; }
.tm-d { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.tm-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.tm-chev { width: 15px; height: 15px; flex: 0 0 auto; transition: transform 180ms ease; }
.tm-more[aria-expanded="true"] .tm-chev { transform: rotate(180deg); }
.tm-extra { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 220ms ease; }
.tm-extra.open { grid-template-rows: 1fr; }
.tm-extra-in { overflow: hidden; }
.tm-extra ul { margin: 0; padding: 0; list-style: none; }
.tm-extra li { padding: 9px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.45; }
.tm-extra li:first-child { padding-top: 16px; }
.tm-extra a { color: var(--brand); }

/* ------------------------------------------------------------
   АДАПТИВ
------------------------------------------------------------ */
@media (max-width: 1180px) {
  :root { --container: min(100% - 48px, 1120px); }
  .hero__copy { padding-inline: 48px; }
  .hero h1 { font-size: clamp(52px, 6.4vw, 72px); }
  .photo-band { padding-inline: max(24px, calc((100vw - 1120px) / 2)); }
  .ex-grid { grid-template-columns: repeat(2, 1fr); }
  .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --container: calc(100% - 36px); --section-space: 68px; }
  .hero { min-height: auto; }
  .hero__copy { padding: 64px 24px; }
  .hero h1 { font-size: clamp(52px, 12vw, 72px); }
  .photo-band__grid, .product { grid-template-columns: 1fr; gap: 32px; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  :root { --container: calc(100% - 36px); --section-space: 46px; }
  .hero__copy { padding: 48px 18px; }
  .proof-line { gap: 10px 14px; }
  .proof-line > i { display: none; }
  .proof-group { flex-wrap: wrap; white-space: normal; }
  .proof-logos { gap: 14px; height: 22px; }
  .proof-logos img { max-width: 74px; height: 17px; }
  .hero h1 { font-size: 52px; line-height: 0.98; }
  .hero__lead { 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 { font-size: 40px; }
  .section-heading p { font-size: 16px; }
  .ex-grid, .case-grid, .team-grid { grid-template-columns: 1fr; }
  .sv-cell { height: 150px; }
  .sv-wide { height: 180px; }
  .photo-band { padding-inline: 18px; }
}

@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;
  }
}
