/* Айлок — общий стиль страниц /description. Фирменные токены совпадают с
   лендингом и /expert (акцент #F95B3D, Geist + Montserrat). Без внешних
   CSS-фреймворков (air-gap-дружелюбно). */

:root {
  --background: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --foreground: #0f172a;
  --ink: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #F95B3D;
  --primary-hover: #e54f35;
  --primary-soft: rgba(249, 91, 61, 0.10);
  --primary-foreground: #ffffff;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --info-foreground: #1e40af;
  --warning-bg: #fff7ed;
  --warning-border: #fed7aa;
  --warning-foreground: #9a3412;
  --ok: #16a34a;
  --radius: 0.625rem;
  --radius-lg: 1rem;
  --maxw: 1120px;
  --maxw-prose: 880px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-family: "Montserrat", "Geist", system-ui, sans-serif; letter-spacing: -0.02em; color: var(--foreground); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.prose { max-width: var(--maxw-prose); }

/* ============ NAV ============ */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.85); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.nav__inner { max-width: var(--maxw); margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: baseline; gap: 9px; font-family: "Montserrat", sans-serif; font-weight: 800; font-size: 20px; color: var(--foreground); }
.brand:hover { text-decoration: none; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); display: inline-block; transform: translateY(-1px); }
.nav__links { display: flex; align-items: center; gap: 22px; }
.nav__links a { color: var(--ink); font-size: 14px; font-weight: 500; }
.nav__links a:hover { color: var(--primary); text-decoration: none; }
.nav__cta { padding: 9px 18px; border-radius: 999px; background: var(--primary); color: var(--primary-foreground) !important; font-weight: 600; font-size: 14px; }
.nav__cta:hover { background: var(--primary-hover); text-decoration: none; }
@media (max-width: 860px) { .nav__links a:not(.nav__cta) { display: none; } }

/* ============ BUTTONS ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 26px; font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1; border-radius: 999px; cursor: pointer; transition: all 140ms ease; border: 1px solid transparent; }
.btn--primary { color: var(--primary-foreground); background: var(--primary); box-shadow: 0 8px 24px rgba(249,91,61,0.22); }
.btn--primary:hover { background: var(--primary-hover); text-decoration: none; }
.btn--ghost { color: var(--foreground); background: transparent; border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ============ HERO (home) ============ */
.hero { padding: 72px 0 56px; }
.hero__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.eyebrow { color: var(--primary); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 14px; }
.hero h1 { font-weight: 800; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; margin: 0 0 18px; }
.hero__lead { color: var(--ink); font-size: 19px; max-width: 36em; margin: 0 0 30px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

.stack { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-md); }
.stack__label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; text-align: center; margin-bottom: 14px; }
.stack__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack__box { background: var(--background); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 12px; text-align: center; }
.stack__box b { display: block; font-family: "Montserrat", sans-serif; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.stack__box span { font-size: 12px; color: var(--muted); }
.stack__base { margin-top: 12px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--ink); background: var(--primary-soft); border: 1px solid var(--warning-border); border-radius: var(--radius); padding: 10px; }

/* ============ TILES (информационные плитки на главной — НЕ кликабельные) ============ */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tile { text-align: center; padding: 26px 20px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.tile h3 { margin: 0 0 4px; }
.tile p { color: var(--muted); }
@media (max-width: 900px) { .tiles { grid-template-columns: 1fr; } }

/* ============ PAGE HERO (detail pages) ============ */
.page-hero { padding: 40px 0 8px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--foreground); }
.page-hero h1 { font-weight: 800; font-size: clamp(30px, 4.6vw, 46px); line-height: 1.05; margin: 0 0 14px; }
.page-hero .lead { color: var(--ink); font-size: 19px; max-width: 44em; margin: 0; }

/* ============ SECTIONS ============ */
section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 760px; margin: 0 auto 44px; text-align: center; }
.section-head.left { margin-left: 0; text-align: left; }
.section-head h2 { font-weight: 700; font-size: clamp(26px, 3.4vw, 36px); margin: 0 0 12px; }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }
h2.block-title { font-weight: 700; font-size: 26px; margin: 0 0 18px; }
h3.sub { font-weight: 600; font-size: 20px; margin: 28px 0 12px; }

/* ============ PROSE ============ */
.prose p { color: var(--ink); font-size: 16px; margin: 0 0 16px; }
.prose ul, .prose ol { color: var(--ink); font-size: 16px; margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--foreground); font-weight: 600; }

/* ============ CARDS ============ */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); transition: transform 160ms ease, box-shadow 160ms ease; }
.card--link { display: block; color: inherit; }
.card--link:hover { text-decoration: none; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card h3 { font-size: 18px; margin: 0 0 8px; }
.card h3 .arrow { color: var(--primary); }
.card p { color: var(--ink); font-size: 14.5px; margin: 0 0 12px; }
.card p:last-child { margin-bottom: 0; }
.icon { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.icon svg { width: 24px; height: 24px; stroke: var(--primary); fill: none; stroke-width: 1.7; }
/* цветовые варианты иконок — чтобы инструменты визуально различались */
.icon--blue { background: rgba(37,99,235,0.12); }   .icon--blue svg { stroke: #2563eb; }
.icon--green { background: rgba(16,163,74,0.12); }   .icon--green svg { stroke: #16a34a; }
.icon--purple { background: rgba(124,58,237,0.12); } .icon--purple svg { stroke: #7c3aed; }
.icon--amber { background: rgba(217,119,6,0.14); }   .icon--amber svg { stroke: #d97706; }
.icon--teal { background: rgba(13,148,136,0.12); }   .icon--teal svg { stroke: #0d9488; }
.icon--pink { background: rgba(219,39,119,0.12); }   .icon--pink svg { stroke: #db2777; }
.icon--indigo { background: rgba(79,70,229,0.12); }  .icon--indigo svg { stroke: #4f46e5; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { font-size: 12px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; }
.alt .card, .alt .flow, .alt .info-card { background: var(--background); }

/* ============ CHECKLIST ============ */
.check { list-style: none; margin: 0; padding: 0; }
.check li { position: relative; padding-left: 30px; margin-bottom: 11px; font-size: 15px; color: var(--ink); }
.check li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background-color: var(--primary-soft); background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 6L5 9L10 3' stroke='%23F95B3D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; }

/* ============ NUMBERED STEPS ============ */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps > li { position: relative; padding: 0 0 18px 52px; }
.steps > li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 38px; bottom: 4px; width: 2px; background: var(--border); }
.steps > li b { font-family: "Montserrat", sans-serif; display: block; margin-bottom: 3px; font-size: 16px; }
.steps > li span { color: var(--ink); font-size: 15px; }

/* ============ FLOW DIAGRAM ============ */
.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.flow__step { flex: 1 1 0; min-width: 92px; background: var(--background); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 10px; text-align: center; font-size: 12.5px; line-height: 1.35; display: flex; flex-direction: column; justify-content: center; }
.alt .flow__step { background: var(--surface); }
.flow__step b { font-family: "Montserrat", sans-serif; font-size: 12.5px; font-weight: 700; }
.flow__step .s { color: var(--muted); font-size: 11.5px; }
.flow__arrow { align-self: center; color: var(--primary); font-weight: 700; }
.flow__note { width: 100%; margin-top: 12px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ============ ROLES (3-col) ============ */
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.role { background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.role--us { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.role h3 { font-size: 17px; margin: 0 0 4px; }
.role .role__tag { font-size: 12px; color: var(--muted); margin: 0 0 16px; }
.role ul { margin: 0; padding-left: 18px; }
.role li { font-size: 14px; color: var(--ink); margin-bottom: 7px; }

/* ============ TABLE ============ */
.tbl { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: top; }
.tbl thead th { background: var(--surface-2); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 12px; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl td .yes { color: var(--warning-foreground); font-weight: 600; }
.tbl td .no { color: var(--primary); font-weight: 600; }
.mono { font-family: "Geist Mono", "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; }

/* ============ INFO-CARD (definition list) ============ */
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; }
.info-card dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; column-gap: 20px; row-gap: 10px; }
.info-card dt { color: var(--muted); font-weight: 500; font-size: 14px; }
.info-card dd { margin: 0; color: var(--ink); font-size: 14px; }

/* ============ STATS ============ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat { text-align: center; padding: 8px; }
.stat b { display: block; font-family: "Montserrat", sans-serif; font-weight: 800; font-size: 36px; color: var(--primary); line-height: 1; margin-bottom: 6px; }
.stat span { color: var(--muted); font-size: 13.5px; }

/* ============ CALLOUTS ============ */
.note { background: var(--warning-bg); border: 1px solid var(--warning-border); border-radius: var(--radius-lg); padding: 18px 22px; color: var(--warning-foreground); font-size: 14.5px; }
.note b { font-weight: 700; }
.note--info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-foreground); }

/* ============ TWO-COL COMPARE ============ */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.compare > div { padding: 22px 24px; }
.compare > div + div { border-left: 1px solid var(--border); }
.compare h4 { margin: 0 0 12px; font-size: 16px; }

/* ============ PILLS ============ */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { font-size: 13px; font-weight: 500; color: var(--ink); background: var(--background); border: 1px solid var(--border-strong); border-radius: 999px; padding: 8px 16px; }
.pill--ok::before { content: "●"; color: var(--ok); font-size: 10px; margin-right: 7px; vertical-align: middle; }

/* ============ READ NEXT ============ */
.readnext { border-top: 1px solid var(--border); }
.readnext .grid { margin-top: 8px; }
.readnext .card h3 { font-size: 16px; }
.readnext .card p { font-size: 13.5px; }

/* ============ FOOTER ============ */
footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer__inner { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.footer__inner .muted { color: var(--muted); font-size: 13px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer__links a { color: var(--ink); font-size: 14px; }

.lead-center { max-width: 720px; margin: 0 auto 14px; text-align: center; color: var(--ink); font-size: 16px; }

/* ============ REVEAL ============ */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.55s ease, transform 0.55s ease; }
.js [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js [data-reveal] { opacity: 1; transform: none; transition: none; } }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .roles, .grid--2, .grid--3, .grid--4, .stats { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .compare { grid-template-columns: 1fr; }
  .compare > div + div { border-left: none; border-top: 1px solid var(--border); }
  section { padding: 48px 0; }
}


/* ============ ИНФО-БЛОКИ vs КАРТОЧКИ-ССЫЛКИ ============
   Кликабельные блоки (.card--link) остаются «коробками». Все НЕ-ссылочные
   блоки-коробки (.tile, .card, .role, .compare) теряют рамку/фон/тень и
   разделяются тонкой линией 1px БЕЗ потери раскладки:
     • десктоп — раскладка в колонки сохраняется, линии идут по сетке
       (вертикальные между колонками, горизонтальные между строками);
     • мобильный (≤900px) — блоки друг под другом, линии горизонтальные.
   Линии рисуются бордерами ячеек со сбросом внешних краёв через :nth-child —
   так сетка остаётся ровной даже при неполной последней строке.
   НЕ трогаем: диаграммы процессов/слоёв (.flow, .flow__step, .stack),
   таблицы данных (.tbl) и цветные сноски-callout (.note) — это не «карточки».
   :has() поддерживается всеми современными браузерами. */
.tile, .card:not(.card--link), .role, .compare > div { border: 0; box-shadow: none; background: transparent; border-radius: 0; transition: none; }
.card:not(.card--link):hover { transform: none; box-shadow: none; }
.compare { border: 0; border-radius: 0; overflow: visible; }

/* gap:0 — чтобы линии-бордеры были непрерывными (отступы дают paddings ячеек) */
.tiles, .roles,
.grid--2:has(> .card:not(.card--link)):not(:has(> .card--link)),
.grid--3:has(> .card:not(.card--link)):not(:has(> .card--link)),
.grid--4:has(> .card:not(.card--link)):not(:has(> .card--link)) { gap: 0; }

/* Общий список «плоских» ячеек для отступов/линий */
.tiles > .tile, .roles > .role, .compare > div,
.grid--2:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card,
.grid--3:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card,
.grid--4:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card { padding: 22px 26px; }

/* ДЕСКТОП (≥901px): колонки + сетка линий */
@media (min-width: 901px) {
  .tiles > .tile, .roles > .role, .compare > div,
  .grid--2:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card,
  .grid--3:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card,
  .grid--4:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card {
    border-top: 1px solid var(--border); border-left: 1px solid var(--border);
  }
  /* первая строка — без верхней линии */
  .tiles > .tile:nth-child(-n+3), .roles > .role:nth-child(-n+3),
  .grid--3:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card:nth-child(-n+3) { border-top: 0; }
  .compare > div:nth-child(-n+2),
  .grid--2:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card:nth-child(-n+2) { border-top: 0; }
  .grid--4:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card:nth-child(-n+4) { border-top: 0; }
  /* первая колонка — без левой линии */
  .tiles > .tile:nth-child(3n+1), .roles > .role:nth-child(3n+1),
  .grid--3:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card:nth-child(3n+1) { border-left: 0; }
  .compare > div:nth-child(2n+1),
  .grid--2:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card:nth-child(2n+1) { border-left: 0; }
  .grid--4:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card:nth-child(4n+1) { border-left: 0; }
}

/* МОБИЛЬНЫЙ (≤900px): одна колонка (стекается существующими media-правилами),
   линии — только горизонтальные между блоками */
@media (max-width: 900px) {
  .tiles > .tile, .roles > .role, .compare > div,
  .grid--2:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card,
  .grid--3:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card,
  .grid--4:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card {
    padding: 20px 0; border-left: 0; border-top: 1px solid var(--border);
  }
  .tiles > .tile:first-child, .roles > .role:first-child, .compare > div:first-child,
  .grid--2:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card:first-child,
  .grid--3:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card:first-child,
  .grid--4:has(> .card:not(.card--link)):not(:has(> .card--link)) > .card:first-child { border-top: 0; }
}
