/* pamir.kz — подстраницы разделов + кликабельные блоки на главной.
   Подключать ПОСЛЕ site-fixes.css, до motion.css. Подстраницы собраны из
   компонентов главной (styles.css); здесь только то, чего там нет. */

/* ---------- Главная: блок как ссылка ---------- */
[data-href].is-link { cursor: pointer; }
.block-more {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; padding: 11px 18px 11px 20px;
  border-radius: 999px; border: 1px solid rgba(17,18,15,.2); color: var(--ink);
  font-size: 13px; font-weight: 600; letter-spacing: .02em; line-height: 1;
  transition: background .22s ease, color .22s ease, border-color .22s ease, transform .22s ease;
}
.block-more svg { width: 15px; height: 15px; transition: transform .22s ease; }
[data-href].is-link:hover .block-more, .block-more:hover { background: var(--ink); color: #fff; border-color: var(--ink); transform: translateY(-2px); }
[data-href].is-link:hover .block-more svg { transform: translateX(3px); }
.section-dark .block-more { border-color: rgba(255,255,255,.28); color: #f4f6ef; }
.section-dark[data-href].is-link:hover .block-more, .section-dark .block-more:hover { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.about-directions-block { display: block; }
.about-directions-block .block-more { margin-top: 18px; }

/* ---------- Подстраница: «На главную» в шапке ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px;
  border: 1px solid rgba(17,18,15,.14); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.back-link svg { width: 14px; height: 14px; }
.back-link:hover { background: var(--ink); color: #fff; }
body.is-narrow .back-link { display: none; }
@media (max-width: 1100px) { .back-link { display: none; } }

/* ---------- Подстраница: фото производства в hero ---------- */
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Список тезисов внутри карточек главной ---------- */
.card-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card-list li { position: relative; padding-left: 16px; font-size: 14.5px; line-height: 1.45; color: #58635b; }
.card-list li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.section-dark .card-list li { color: #aeb5aa; }
.section-dark .card-list li::before { background: var(--lime); }
.assort-card .card-list { margin: 0 20px 20px; }
.assort-card p + .card-list { margin-top: -8px; }
/* ---------- Лаборатория: «Какой сценарий выбрать» — карточки, а не список строк.
   Ровно 3 сценария → 3 колонки, без пустого места и без «сироты» в чужой сетке. --- */
.formula-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .formula-options { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .formula-options { grid-template-columns: 1fr; } }
.formula-options > div {
  display: flex; flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 14px;
  padding: 26px 24px; border: 1px solid rgba(17,18,15,.08); border-radius: var(--r-lg, 28px);
  background: var(--paper); box-shadow: var(--sh-1, 0 12px 30px rgba(17,18,15,.05));
}
.formula-options .card-index { width: auto; color: #656a61; }
.formula-options strong { width: auto; font-size: 18px; }
.formula-options .card-list { margin-top: 4px; }
.formula-copy .lead { margin: 0 0 14px; }
.formula-copy .lead:last-of-type { margin-bottom: 26px; }
.platform-card, .cap-card, .process-card { min-height: 0; }
/* длинные тезисы не должны раздувать колонки сетки (1fr = minmax(auto,1fr)) */
.card-grid > *, .assort-grid > *, .about-directions > *, .stats-grid > * { min-width: 0; }
.card-list li, .platform-card p, .cap-card p, .process-card p, .assort-card p, .about-direction p, .formula-options p { overflow-wrap: anywhere; }

/* ---------- Другие разделы: карточки .platform-card ---------- */
.related-section { background: var(--paper); }
.related-grid { grid-template-columns: repeat(3,1fr); }
@media (max-width: 900px) { .related-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px) { .related-grid { grid-template-columns: 1fr; } }
.related-card { color: var(--ink); min-height: 0; }
.related-grid .platform-card::after, .related-grid .platform-card:not(:nth-child(4n))::after { content: none; display: none; }
.related-card:hover { color: var(--ink); }
.related-card strong { margin-top: 0; }

/* ---------- Цифры (главная после «О компании» и подстраницы) ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat { container-type: inline-size; display: flex; flex-direction: column; gap: 10px; padding: 26px 24px; border-radius: 26px; background: var(--paper); border: 1px solid rgba(17,18,15,.08); box-shadow: 0 12px 30px rgba(17,18,15,.05); }
.stat-value {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(40px, 3.4vw, 56px);
  line-height: 1; letter-spacing: -.045em; color: var(--accent);
  display: flex; align-items: baseline; gap: .12em; flex-wrap: wrap;
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1;
}
/* слот под финальное значение: разряды набираются вправо, единица не съезжает.
   min-width ставит stats.js по data-count (в ch), чтобы не дублировать число в разметке. */
.stat-value [data-count] { display: inline-block; text-align: right; }
.stat-value small,
.stat-value span:not([data-count]) { font-size: .34em; font-weight: 500; letter-spacing: 0; color: rgba(17,18,15,.6); }
.stat-value small.plus { align-self: center; font-size: .5em; line-height: 1; color: var(--accent); }
/* cqw, а не vw: размер зависит от реальной ширины карточки, а не всего вьюпорта —
   иначе при узкой колонке (4 карточки в ряд) число не помещается и «единица» переносится.
   28/16/46 подобраны под самую широкую из «длинных» цифр («19 000 л») — проверено на
   реальных ширинах карточки от самой узкой 2- и 4-колоночной раскладки до самой широкой:
   нигде не переносится, при этом ближе по размеру к обычным цифрам, чем было. */
.stat-value.compact { font-size: clamp(28px, 16cqw, 46px); white-space: nowrap; flex-wrap: nowrap; }
/* мобильная раскладка (1 колонка) — карточка почти на всю ширину экрана, места с
   запасом; здесь просто уравниваем с минимумом обычных цифр, а не считаем по cqw —
   иначе по ширине карточки цифра выходит крупнее обычных чисел на той же странице. */
@media (max-width: 520px) { .stat-value.compact { font-size: 40px; } }
.stat-label { font-size: 15px; line-height: 1.45; color: #58635b; }
.stat-label .stat-note { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.4; color: #6c756b; }
.section-dark .stat { background: #161814; border-color: rgba(255,255,255,.09); box-shadow: none; }
.section-dark .stat-value { color: var(--lime); }
.section-dark .stat-value small,
.section-dark .stat-value span:not([data-count]) { color: rgba(244,246,239,.72); }
.section-dark .stat-value small.plus { color: var(--lime); }
.section-dark .stat-label { color: #9aa197; }

/* ---------- Иконки (главная и подстраницы): крупные контурные, без плашки; прорисовка и отклик на hover ---------- */
.big-icons .cap-icon { width: 72px; height: 72px; border-radius: 0; background: none; color: var(--accent); transition: transform .35s cubic-bezier(.2,.8,.2,1), color .3s ease; }
.big-icons .cap-icon svg { width: 64px; height: 64px; stroke-width: 1.35; overflow: visible; }
.big-icons .section-dark .cap-icon { color: var(--lime); }
.big-icons .cap-card-top { align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.big-icons .platform-card strong, .big-icons .cap-card strong, .big-icons .process-card h3 { margin-top: 8px; }
.big-icons .platform-card:hover .cap-icon, .big-icons .cap-card:hover .cap-icon, .big-icons .process-card:hover .cap-icon, .big-icons .about-direction:hover .cap-icon, .big-icons .formula-options > div:hover .cap-icon { transform: translateY(-4px) scale(1.06) rotate(-3deg); }
.big-icons .process-card .cap-card-top { display: flex; }
.big-icons .about-direction { flex-direction: column; }
.about-direction .cap-card-top { width: 100%; }
/* ---------- «Семь шагов» (О компании) ---------- */
.steps-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 30px; }
@media (max-width: 900px) { .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps-grid { grid-template-columns: 1fr; } }
.steps-grid .platform-card::after { content: none; }
@media (min-width: 901px) { .steps-grid .platform-card:not(:nth-child(4n)):not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -20px; width: 12px; height: 12px; border-top: 2px solid rgba(40,85,255,.35); border-right: 2px solid rgba(40,85,255,.35); transform: translateY(-50%) rotate(45deg); } }

/* ---------- Медленное «дыхание» иконок ---------- */
@keyframes icon-float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-2deg); } }
.big-icons .cap-icon svg { animation: icon-float 6s ease-in-out infinite; }
.big-icons .cap-card-top:nth-child(odd) .cap-icon svg, .big-icons .formula-options > div:nth-child(2) .cap-icon svg { animation-delay: -2s; }
.big-icons .card-grid > :nth-child(2n) .cap-icon svg, .big-icons .about-directions > :nth-child(3n) .cap-icon svg { animation-delay: -4s; }
.big-icons .card-grid > :nth-child(3n) .cap-icon svg { animation-duration: 7.5s; }
@media (prefers-reduced-motion: reduce) { .big-icons .cap-icon svg { animation: none; } }


/* =====================================================================
   Правки по дизайн-аудиту (сентябрь 2026). Подключается после styles.css
   и site-fixes.css, поэтому переопределения работают без !important.
   ===================================================================== */

/* --- Шкала радиусов и теней: было 10/12/16/18/22/24/26/28 без правила --- */
:root {
  --r-sm: 12px; --r-md: 20px; --r-lg: 28px; --r-pill: 999px;
  --sh-1: 0 12px 30px rgba(17,18,15,.05);
  --sh-2: 0 22px 44px rgba(17,18,15,.09);
}
.stat, .platform-card, .cap-card, .process-card, .assort-card,
.about-direction, .faq-item, .related-card { border-radius: var(--r-lg); }
.stat, .platform-card, .about-direction { box-shadow: var(--sh-1); }
.platform-card:hover, .about-direction:hover { box-shadow: var(--sh-2); }

/* --- Сетка цифр: ровно 4 карточки, без «сироты» 3+1 --- */
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .stats-grid { grid-template-columns: 1fr; } }

/* --- Кнопки: три ступени (52/15 · 46/14 · 40/13) и один смысл на цвет.
       Синий — только основное действие, поэтому у .btn-dark hover осветляется,
       а не перекрашивается в акцент. --- */
.btn-primary { min-height: 52px; font-size: 15px; }
.block-more, .back-link { min-height: 40px; font-size: 13px; }

/* --- Мелкий текст: нижняя граница 12,5px, трекинг капса уменьшен --- */
.eyebrow { font-size: 12.5px; letter-spacing: .12em; color: #5b6259; }
.footer, .footer-brand, .footer-link, .footer-top { font-size: 12.5px; }

/* --- Заголовки карточек: три ступени вместо 19/21/26 вразнобой --- */
.platform-card strong, .process-card h3, .related-card strong { font-size: clamp(21px, 1.6vw, 24px); }
.cap-card strong, .assort-card strong { font-size: 20px; }

/* --- Форма заявки: подписи читаемые, без капса --- */
.field label { font-size: 13.5px; font-weight: 500; letter-spacing: 0; text-transform: none; }

/* --- Кликабельные блоки главной: фокус на вложенной ссылке виден на всём блоке --- */
[data-href].is-link:focus-within { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--r-md); }
.section-dark[data-href].is-link:focus-within { outline-color: var(--lime); }

/* --- Бегущая строка повёрнута и шире вьюпорта: страховка от горизонтального скролла --- */
html, body { overflow-x: clip; }

/* --- Поля формы: видимый фокус, читаемый placeholder, текст ошибки под полем --- */
.field input, .field textarea { transition: background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.field input::placeholder, .field textarea::placeholder { color: rgba(255,255,255,.62); }
.field input:focus-visible, .field textarea:focus-visible {
  outline: none; background: rgba(255,255,255,.16);
  border-bottom-color: #fff; box-shadow: 0 3px 0 -1px rgba(255,255,255,.45);
}
.field-error { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: #ffd0c8; }

/* =====================================================================
   Финальная полировка: детали, по которым сайт читается как аккуратный.
   ===================================================================== */

/* --- Якоря не должны заезжать под фиксированную шапку --- */
.section[id], section[id], [id].hero { scroll-margin-top: clamp(88px, 11vh, 124px); }

/* --- Единый язык движения: одна кривая, три длительности --- */
:root { --ease: cubic-bezier(.2,.7,.2,1); --dur-1: .18s; --dur-2: .26s; }
.btn, .block-more, .back-link, .footer-top, .lang-btn,
.platform-card, .cap-card, .assort-card, .about-direction, .stat {
  transition-timing-function: var(--ease); transition-duration: var(--dur-2);
}

/* --- Hover только там, где есть курсор: на тач-экранах состояние «залипало» --- */
@media (hover: none) {
  .platform-card:hover, .about-direction:hover, .assort-card:hover,
  .btn-primary:hover, .btn-dark:hover, .block-more:hover, .footer-top:hover { transform: none; }
}

/* --- Фокус на тёмном: синий на почти-чёрном не читается, берём лайм --- */
.section-dark :focus-visible, .footer :focus-visible, .brief-section :focus-visible {
  outline: 2px solid var(--lime); outline-offset: 3px;
}

/* --- Мелочи типографики и выделения --- */
::selection { background: var(--lime); color: var(--ink); }
.section-dark ::selection { background: var(--lime); color: var(--ink); }
p, .lead, .card-list li, .stat-label, .faq-item p { text-wrap: pretty; }
.contact-big, .contacts-info a[href^="tel"] { font-variant-numeric: tabular-nums; }

/* --- Медиа: одна геометрия и мягкая посадка --- */
.assort-photo, .hero-photo, .about-carousel picture img { border-radius: var(--r-md); }
.assort-photo img, .hero-photo { object-position: center; }

/* --- Вертикальный ритм: больше воздуха, но без сложения отступов на стыках.
       Секция целиком — clamp(56-88px, задан в styles.css); у секции, идущей
       сразу за другой, верхний отступ меньше, поэтому шов между блоками
       ~136px, а не 176px. --- */
.section + .section { padding-top: clamp(40px, 3.6vw, 60px); }
