/* Библиотека примитивов сайта Hookline. Одна схема для всех страниц.
   Подключается из общего head после site.css. Страницы не создают свои карточки,
   таблицы и формы: они используют классы отсюда. Цвета только из style.css. */

/* ---------- заголовок секции ---------- */
.sec-head { max-width: 760px; }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.sec-head.split { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.sec-head.split > div { max-width: 640px; }
.sec-head.split .lead { max-width: 440px; margin: 0; }
.sec-head + * { margin-top: 48px; }
@media (max-width: 760px) { .sec-head.split { flex-direction: column; align-items: flex-start; } .sec-head + * { margin-top: 32px; } }

/* ---------- сетки ---------- */
.grid-2, .grid-3, .grid-4, .grid-5 { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4, .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } }
/* на телефоне сетка превращается в ленту со свайпом */
@media (max-width: 700px) {
  .grid-3.swipe, .grid-4.swipe, .grid-5.swipe { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 -16px; padding: 4px 16px 12px; scroll-padding-inline: 16px; }
  .swipe::-webkit-scrollbar { display: none; }
  .swipe > * { flex: 0 0 min(82%, 320px); scroll-snap-align: start; }
}

/* ---------- карточка ---------- */
.tile { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line-soft); color: var(--ink);
  transition: border-color .24s ease-out, transform .3s var(--ease-enter), background-color .24s; }
a.tile { text-decoration: none; }
.tile:hover { border-color: var(--line-strong); }
a.tile:hover, .tile.lift:hover { transform: translateY(-4px); border-color: var(--accent-line); }
.tile.hot { background: linear-gradient(color-mix(in srgb, var(--accent-strong) 16%, var(--panel)), var(--panel)); border-color: var(--accent-line); }
.tile.soft { background: var(--raised); }
.tile h3, .tile h4 { font-size: 18px; font-weight: 500; line-height: 1.25; }
.tile p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.tile .num { position: absolute; top: 22px; right: 24px; color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.tile .foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14px; }
.tile .foot b { color: var(--accent); font-weight: 600; }
.tile-ico { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); transition: background .24s, color .24s; }
.tile-ico svg { width: 18px; height: 18px; }
.tile:hover .tile-ico, .tile.hot .tile-ico { background: var(--accent-strong); color: #fff; }
.tile-row { display: flex; align-items: center; gap: 12px; }
.tile-row h3 { flex: 1; min-width: 0; }
.tile .say { display: block; color: var(--ink-2); font-style: italic; font-size: 15px; line-height: 1.5; quotes: "«" "»"; }
.tile .say::before { content: open-quote; } .tile .say::after { content: close-quote; }

/* ---------- метки и бейджи ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.3;
  color: var(--accent); background: var(--accent-soft); white-space: nowrap; align-self: flex-start; }
.badge.neutral { color: var(--muted); background: var(--chip); }
.badge.soon { color: var(--dim); background: color-mix(in srgb, var(--accent-strong) 5%, transparent); border: 1px dashed var(--line-strong); }
.badge.solid { color: var(--accent-ink); background: var(--accent-strong); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; padding: 4px 8px; }
.badge.example { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.badge.green { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }

/* ---------- фильтры-пилюли ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills button, .pills a { min-height: 0; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink-2);
  background: var(--panel); border: 1px solid var(--line); text-decoration: none; }
.pills button:hover, .pills a:hover { border-color: var(--accent-line); color: var(--ink); transform: none; }
.pills .on, .pills [aria-pressed="true"], .pills [aria-current="true"] { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.pills-wrap { display: grid; gap: 10px; margin-bottom: 28px; }
.pills-wrap > span { color: var(--dim); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- цепочка шагов ---------- */
.flow { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: thin; }
.flow-step { position: relative; flex: 1 1 0; min-width: 160px; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px;
  background: var(--node); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
:root[data-theme="dark"] .flow-step { border-color: #343b47; }
.flow-step.in { background: var(--input-node); border-color: var(--accent-line); }
.flow-step small { color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.flow-step b { font-size: 15px; font-weight: 500; }
.flow-step span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.flow-step + .flow-step { margin-left: 34px; }
.flow-step + .flow-step::before { content: ""; position: absolute; right: 100%; top: 50%; width: 34px; height: 1.5px; background: var(--accent-line); }
.flow-step + .flow-step::after { content: ""; position: absolute; right: calc(100% + 2px); top: 50%; width: 7px; height: 7px; border-radius: 50%; transform: translateY(-50%); background: #93b7df; border: 1px solid #142238; }
@media (max-width: 760px) {
  .flow { flex-direction: column; overflow: visible; }
  .flow-step { min-width: 0; }
  .flow-step + .flow-step { margin: 28px 0 0; }
  .flow-step + .flow-step::before { right: auto; left: 50%; top: auto; bottom: 100%; width: 1.5px; height: 28px; }
  .flow-step + .flow-step::after { right: auto; left: 50%; top: auto; bottom: calc(100% + 2px); transform: translateX(-50%); }
}

/* ---------- образец результата ---------- */
.sample { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.sample-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.sample-h b { color: var(--accent); letter-spacing: normal; font-weight: 600; }
.sample p, .sample li { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.sample ol, .sample ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.sample .best { color: var(--accent); }
.sample-tl { display: grid; gap: 10px; }
.sample-tl div { display: grid; grid-template-columns: 62px 1fr; gap: 10px; }
.sample-tl span { color: var(--accent); font-size: 13px; font-variant-numeric: tabular-nums; }
.sample-wrap { position: relative; padding: clamp(18px, 3vw, 36px); border-radius: 22px; border: 1px solid var(--line);
  background: radial-gradient(60% 80% at 50% 0%, var(--glow), transparent 70%), var(--raised); overflow: hidden; }
.sample-wrap::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(var(--dot) .7px, transparent .8px); background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(transparent, #000 40%, transparent); mask-image: linear-gradient(transparent, #000 40%, transparent); }
.sample-wrap > * { position: relative; }
.sample-wrap .badge { margin-bottom: 14px; }

/* ---------- бриф с копированием ---------- */
.brief-box { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: center; padding: 28px; border-radius: 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-strong) 12%, var(--panel)), var(--panel) 60%); border: 1px solid var(--accent-line); }
.brief-box pre { margin: 0; padding: 18px 20px; border-radius: 14px; background: var(--input-node); border: 1px solid var(--accent-line);
  font: inherit; font-size: 14px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }
.brief-box .brief-actions { display: grid; gap: 10px; }
.brief-box .brief-actions .btn { width: 100%; min-height: 46px; }
.brief-box .hint { color: var(--muted); font-size: 13px; margin: 0; }
@media (max-width: 860px) { .brief-box { grid-template-columns: 1fr; } }

/* ---------- таблица сравнения ---------- */
.cmp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--panel); }
.cmp-table th, .cmp-table td { padding: 16px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.45; }
.cmp-table tr:last-child td, .cmp-table tr:last-child th { border-bottom: 0; }
.cmp-table thead th { font-size: 13px; font-weight: 600; color: var(--ink); background: var(--raised); }
.cmp-table tbody th { font-weight: 500; color: var(--ink-2); width: 22%; }
.cmp-table td { color: var(--muted); }
.cmp-table .us { background: var(--accent-soft); color: var(--ink); font-weight: 500; }
.cmp-table thead .us { background: var(--accent-strong); color: #fff; }
.cmp-table td svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.cmp-table .yes svg { color: var(--green); } .cmp-table .no svg { color: var(--dim); }
.cmp-cards { display: none; }
@media (max-width: 860px) {
  .cmp-table { display: none; }
  .cmp-cards { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 12px; scroll-padding-inline: 16px; }
  .cmp-cards::-webkit-scrollbar { display: none; }
  .cmp-cards .tile { flex: 0 0 min(84%, 320px); scroll-snap-align: start; }
  .cmp-cards .tile dl { margin: 0; display: grid; gap: 10px; }
  .cmp-cards .tile dt { font-size: 12px; color: var(--dim); }
  .cmp-cards .tile dd { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
}
.cmp-note { color: var(--dim); font-size: 12px; margin: 14px 0 0; }

/* ---------- нумерованные шаги (гайды) ---------- */
.steps-num { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.steps-num > li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 18px; align-items: start; padding: 22px 24px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line-soft); }
.steps-num > li::before { counter-increment: s; content: counter(s, decimal-leading-zero); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-strong); color: #fff; font-size: 13px; font-weight: 600; }
.steps-num h3 { font-size: 18px; font-weight: 500; margin-bottom: 6px; }
.steps-num p, .steps-num li li { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0; }
.steps-num ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.steps-num .time { color: var(--dim); font-size: 13px; white-space: nowrap; padding-top: 10px; }
@media (max-width: 600px) { .steps-num > li { grid-template-columns: 44px 1fr; } .steps-num .time { grid-column: 2; padding-top: 0; } }

/* ---------- чеклист ---------- */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.checklist li svg { width: 20px; height: 20px; color: var(--accent); margin-top: 1px; }
.checklist li b { font-weight: 500; color: var(--ink); }

/* ---------- лента обновлений ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; display: grid; gap: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-strong); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline time { display: block; color: var(--dim); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.timeline h3 { font-size: 18px; font-weight: 500; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.timeline p { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0; }

/* ---------- заметка ---------- */
.note { padding: 14px 18px; border-radius: 14px; font-size: 15px; line-height: 1.55; color: var(--ink-2); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.note.warn { background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.note b { color: var(--ink); font-weight: 600; }

/* ---------- модальная форма заявки (общая, логика в site.js) ---------- */
.lead-modal { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 16px; background: #05050799; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lead-modal.open { display: grid; }
.lead-card { width: min(440px, 100%); padding: 28px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: var(--shadow); position: relative; }
.lead-card h3 { font-size: 22px; font-weight: 500; letter-spacing: -.02em; margin-bottom: 6px; }
.lead-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.lead-card label { color: var(--ink-2); font-size: 13px; font-weight: 500; margin: 12px 0 6px; }
.lead-card input, .lead-card textarea { padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.lead-card textarea { min-height: 80px; }
.lead-card .btn { width: 100%; min-height: 46px; margin-top: 18px; border-radius: 12px; }
.lead-card .close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; padding: 0; border-radius: 50%; background: var(--chip); border: 0; }
.lead-card .close svg { width: 14px; height: 14px; }
.lead-card .err { margin: 10px 0 0; min-height: 18px; }
.lead-card .ok { display: none; text-align: center; padding: 20px 0 6px; }
.lead-card .ok .tile-ico { margin: 0 auto 14px; width: 52px; height: 52px; background: var(--green); color: #fff; }
.lead-card.sent form { display: none; } .lead-card.sent .ok { display: block; }
.lead-card .legal { color: var(--dim); font-size: 12px; margin: 10px 0 0; text-align: center; }

/* ---------- промежуточный призыв внутри страницы ---------- */
.cta-inline { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 26px; border-radius: 18px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-strong) 14%, var(--panel)), var(--panel)); border: 1px solid var(--accent-line); }
.cta-inline p { margin: 0; font-size: 16px; color: var(--ink); }
.cta-inline p span { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.cta-inline .btn { flex: none; }
@media (max-width: 640px) { .cta-inline { flex-direction: column; align-items: stretch; text-align: center; } }

/* ---------- кнопка копирования ---------- */
.copy-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 0; padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--chip); border: 0; }
.copy-btn:hover { color: var(--ink); background: var(--hover); transform: none; }
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn.done { color: var(--green); }

/* ---------- дополнения по итогам первой сборки страниц ---------- */
.tile h2 { font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1.2; }
.tile ul, .tile ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tile > .btn { align-self: flex-start; margin-top: auto; }
.stack { display: grid; gap: 14px; }                 /* стопка карточек без колонок */
.stack.tight { gap: 8px; }
.steps-num .time.block { display: block; padding-top: 6px; grid-column: 2; }
.checklist small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.anchor-offset { scroll-margin-top: calc(var(--header-h) + 16px); }
.badge.wrap, .sample-wrap .badge { white-space: normal; }
.checklist.no li svg, .checklist li.no svg { color: var(--dim); }
.sec .sample-wrap + *, .sec .grid-2 + *, .sec .grid-3 + *, .sec .grid-4 + *, .sec .cmp-table + *, .sec .cmp-cards + *, .sec .flow + *, .sec .steps-num + * { margin-top: 28px; }
.sec .cta-inline { margin-top: 36px; }
.flow-step { min-width: 140px; }
.flow-step + .flow-step { margin-left: 26px; }
.flow-step + .flow-step::before { width: 26px; }
@media (max-width: 1100px) and (min-width: 761px) { .flow { flex-wrap: wrap; row-gap: 34px; } .flow-step { flex: 1 1 calc(33% - 26px); } }
.tile > .grid-2, .tile > .grid-3 { align-items: start; }
.tile > .grid-3 .sample { height: auto; }

/* ---------- фото ---------- */
.photo { position: relative; overflow: hidden; border-radius: 18px; background: var(--raised); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo.ratio-16x10 { aspect-ratio: 16 / 10; } .photo.ratio-4x3 { aspect-ratio: 4 / 3; } .photo.ratio-1x1 { aspect-ratio: 1; }
.photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px #ffffff1f; border-radius: inherit; }
.photo .chips-float { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.photo .chips-float span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 10px; font-size: 12px; color: #d4d7df;
  background: #15171de6; border: 1px solid #343b47; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.photo .chips-float span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #93b7df; }
.photo .chips-float span.art { background: #142744e6; border-color: #375888; }
.photo .shade { position: absolute; inset: 0; background: linear-gradient(transparent 45%, #05050799); pointer-events: none; }

/* шапка страницы с фото справа */
.page-hero.with-img .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.page-hero.with-img .photo { transform: rotate(1.5deg); box-shadow: 0 40px 100px -40px var(--glow), var(--shadow); }
.page-hero.with-img .photo .hand { position: absolute; top: -34px; right: 6%; transform: rotate(-4deg); color: var(--dim); }
@media (max-width: 900px) { .page-hero.with-img .wrap { grid-template-columns: 1fr; } .page-hero.with-img .photo { transform: none; max-width: 640px; } }

/* карточка с фото сверху (примеры, отрасли) */
.tile.media { padding: 0; overflow: hidden; }
.tile.media .photo { border-radius: 0; aspect-ratio: 16 / 9; }
.tile.media .photo::after { display: none; }
.tile.media .body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 24px; flex: 1; }
.sec.sec-tight { padding: clamp(28px, 4vw, 48px) 0; }
.case-grid2 { align-items: start; }
.case-grid2 .tile { gap: 8px; } .case-grid2 .tile h3 { font-size: 16px; }
/* финальный призыв с фото-подложкой */
.final.with-img .final-bg { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; }
:root[data-theme="dark"] .final.with-img .final-bg { opacity: .22; }
.final.with-img::before { background: radial-gradient(closest-side, #2f8bff99, #1b3fd055 45%, transparent 72%); }
.final.with-img { background: linear-gradient(color-mix(in srgb, var(--panel) 60%, transparent), var(--panel) 85%); }
.tile .tile-thumb { aspect-ratio: 16 / 9; margin: -24px -24px 6px; border-radius: 18px 18px 0 0; }
.tile .tile-thumb::after { display: none; }
