/* =====================================================================
   ІМПУЛЬС — інженерна лабораторія. Стилі сайту.
   Структура файлу:
     1. Токени і база
     2. Загальні компоненти (контейнер, секції, мітки, кнопки, картки,
        заглушка фото, роздільник-імпульс, іконки)
     3. Шапка, меню-панель, підвал (генеруються js/site.js)
     4. Головна сторінка (index.html)
     5. Внутрішні сторінки — блок для Агента 2 (в кінці файлу)
   Фірмовий стиль: без градієнтів і тіней, помаранчевий лише як акцент,
   кути 12–16 px, лінії однієї товщини зі скругленими кінцями.
   ===================================================================== */

/* ---------- 1. Токени і база ---------- */
:root {
  --orange: #FF5A00;
  --navy: #0F1A24;
  --white: #FFFFFF;
  --orange-dark: #C74400;
  --gray-text: #4A5560;
  --gray-bg: #EEF0F2;

  /* Допоміжні (похідні від фірмових, лише для рамок/приглушеного тексту) */
  --line-on-dark: rgba(255, 255, 255, 0.16);
  --line-on-light: rgba(15, 26, 36, 0.14);
  --muted-on-dark: rgba(255, 255, 255, 0.72);

  --font: "Manrope", system-ui, Arial, sans-serif;

  --container: 1200px;
  --gutter: 24px;
  --radius: 16px;
  --radius-sm: 12px;
  --stroke: 3px;            /* одна товщина ліній інтерфейсу */

  --header-h: 64px;
  --section-pad: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (min-width: 768px) {
  :root { --gutter: 48px; --header-h: 72px; --section-pad: 104px; }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  color: var(--navy);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) { body { font-size: 17px; } }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }

/* Якорі не ховаються під фіксованою шапкою */
[id] { scroll-margin-top: var(--header-h); }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -100px; z-index: 200;
  background: var(--orange); color: var(--navy);
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 16px; }

[hidden] { display: none !important; }

/* ---------- 2. Загальні компоненти ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Секції: чергування фонів */
.section { padding-block: var(--section-pad); position: relative; }
.section--dark  { background: var(--navy);    color: var(--white); }
.section--light { background: var(--white);   color: var(--navy); }
.section--gray  { background: var(--gray-bg); color: var(--navy); }

/* Заголовок секції: мітка + h2 + лід */
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head > * + * { margin-top: 16px; }
.h2, .section-head h2 { font-size: clamp(30px, 4.2vw, 48px); }
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--gray-text); }
.section--dark .lead { color: var(--muted-on-dark); }

/* Мітка: коротка доріжка з вузлом-кільцем + підпис (мотив плати) */
.label {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  padding-left: 14px;
  font-size: 13px; font-weight: 600; line-height: 1.2;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--orange-dark);
}
.label::after {            /* доріжка */
  content: ""; position: absolute; left: 0; top: 50%;
  width: 15px; height: var(--stroke); margin-top: calc(var(--stroke) / -2);
  background: currentColor; border-radius: 2px;
}
.label::before {           /* вузол */
  content: ""; flex: none;
  width: 12px; height: 12px;
  border: var(--stroke) solid currentColor; border-radius: 50%;
}
.section--dark .label, .label--on-dark { color: var(--orange); }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 14px 28px;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 16px; font-weight: 600; letter-spacing: 0.02em;
  line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
/* Головна: помаранчевий фон, темно-синій текст. Одна на екран. */
.btn--primary { background: var(--orange); color: var(--navy); border-color: var(--orange); }
.btn--primary:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.section--dark .btn--primary:hover,
.btn--primary.btn--on-dark:hover { background: var(--white); color: var(--navy); border-color: var(--white); }
/* Другорядна: контурна */
.btn--ghost { background: transparent; color: currentColor; border-color: currentColor; }
.btn--ghost:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.section--dark .btn--ghost:hover { background: var(--white); color: var(--navy); border-color: var(--white); }

/* Текстове посилання-дія («Докладніше →») */
.link-more {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; text-decoration: none; color: var(--orange-dark);
}
.link-more:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.section--dark .link-more { color: var(--orange); }

/* Звичайні посилання в тексті */
.text-link { color: var(--orange-dark); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.section--dark .text-link { color: var(--orange); }

/* Картка */
.card {
  border: 1px solid var(--line-on-light);
  border-radius: var(--radius);
  background: var(--white);
  padding: 24px;
}
@media (min-width: 768px) { .card { padding: 32px; } }
.section--gray .card { border-color: transparent; }
.section--dark .card, .card--dark {
  background: transparent; color: var(--white);
  border-color: var(--line-on-dark);
}
.card h3 { font-size: 20px; }
.card p { color: var(--gray-text); }
.section--dark .card p, .card--dark p { color: var(--muted-on-dark); }

/* Іконки */
.icon { width: 24px; height: 24px; flex: none; }
.icon-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Мітка напряму з іконкою (у картках проєктів, на внутрішніх сторінках) */
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; line-height: 1.2;
}
.tag img { width: 24px; height: 24px; }

/* Заглушка фото у фірмовому стилі.
   Щоб замінити на фото: замість <div class="ph">…</div> поставте
   <img class="photo" src="assets/photos/назва.jpg" alt="Опис фото"> */
.ph {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  min-height: 160px; height: 100%;
  border: 1px solid var(--line-on-light);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--navy);
  text-align: center; padding: 16px;
}
.ph svg { width: 40px; height: 40px; }
.ph__caption { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--gray-text); }
.ph--dark, .section--dark .ph { background: transparent; color: var(--white); border-color: var(--line-on-dark); }
.ph--dark .ph__caption, .section--dark .ph .ph__caption { color: var(--muted-on-dark); }
.photo { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }

/* Роздільник: тонка помаранчева лінія з одним імпульсом (assets/logo/pulse.svg) */
.pulse-divider {
  display: flex; align-items: center;
  height: 52px; color: var(--orange);
}
.pulse-divider::before, .pulse-divider::after {
  content: ""; flex: 1 1 auto; height: var(--stroke);
  background: var(--orange); border-radius: 2px;
  transform: translateY(3px); /* базова лінія імпульсу нижче центру файлу */
}
.pulse-divider img { flex: none; width: 66px; height: 52px; margin-inline: -4px; }
.pulse-divider::after { flex-basis: 30%; }

/* ---------- 3. Шапка (js/site.js) ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  --hp: 0;                          /* 0 = прозора, 1 = згорнута темна */
  /* фон: на головній --hb задає site.js (суцільний з перших пікселів скролу);
     без нього фон стає суцільним за першу половину переходу, лого проявляється в другій —
     тож лого ніколи не стоїть на напівпрозорому фоні поверх патерну */
  background-color: rgba(15, 26, 36, var(--hb, calc(var(--hp) * 2)));
  color: var(--white);
}
.site-header.is-solid { --hp: 1; }
.site-header__bar {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-header__brand {
  display: flex; align-items: center; flex: none;
  opacity: calc(var(--hp) * 2 - 1);
  transform: translateY(calc((1 - var(--hp)) * 10px));
  visibility: visible;
}
.site-header.is-top .site-header__brand { visibility: hidden; }
.site-header__logo { height: 44px; width: auto; }
.site-header__mark { display: none; height: 34px; width: 34px; }
/* мінімум горизонтального лого — 160 px завширшки: 42 px заввишки дає ~160 px */
@media (max-width: 767px) { .site-header__logo { height: 42px; } }
@media (max-width: 399px) {
  .site-header__logo { display: none; }
  .site-header__mark { display: block; }
}

/* Кластер меню: на прозорій шапці стоїть на власній темній плашці,
   щоб текст не лежав поверх доріжок патерну */
.site-header__nav {
  display: flex; align-items: center; gap: 4px;
  background: var(--navy);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.nav-list { display: none; list-style: none; align-items: center; gap: 2px; }
@media (min-width: 960px) { .nav-list { display: flex; } }
.nav-list a {
  display: block; padding: 10px 12px; border-radius: 8px;
  font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap;
  color: var(--white);
}
.nav-list a:hover { color: var(--orange); }
.nav-list a[aria-current="page"] { color: var(--orange); }

.burger {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 14px 0 12px;
  border: 2px solid var(--line-on-dark); border-radius: 10px;
  background: transparent; color: var(--white); cursor: pointer;
  font-size: 15px; font-weight: 600;
}
.burger:hover { border-color: var(--white); }
.burger__lines { position: relative; width: 20px; height: 14px; }
.burger__lines span {
  position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: currentColor;
}
.burger__lines span:nth-child(1) { top: 0; }
.burger__lines span:nth-child(2) { top: 6px; width: 70%; }
.burger__lines span:nth-child(3) { top: 12px; }
@media (min-width: 960px) { .burger__text { display: none; } .burger { padding: 0 11px; } }

/* Меню-панель */
.menu {
  position: fixed; inset: 0; z-index: 150;
  display: flex; justify-content: flex-end;
}
.menu__backdrop {
  position: absolute; inset: 0; background: rgba(15, 26, 36, 0.6);
  opacity: 0; transition: opacity .25s;
}
.menu__panel {
  position: relative; z-index: 1;
  width: min(420px, 100%); height: 100%;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--navy); color: var(--white);
  border-left: 1px solid var(--line-on-dark);
  padding: 12px var(--gutter) 40px;
  display: flex; flex-direction: column; gap: 32px;
  transform: translateX(24px); opacity: 0;
  transition: transform .3s var(--ease), opacity .25s;
}
@media (min-width: 768px) { .menu__panel { padding-inline: 40px; } }
.menu.is-open .menu__backdrop { opacity: 1; }
.menu.is-open .menu__panel { transform: none; opacity: 1; }
.menu__top { display: flex; align-items: center; justify-content: space-between; min-height: calc(var(--header-h) - 12px); }
.menu__top img { height: 34px; width: 34px; }
.menu__close {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 2px solid var(--line-on-dark); border-radius: 10px; background: transparent;
  color: var(--white); cursor: pointer;
}
.menu__close:hover { border-color: var(--white); }
.menu__group-title {
  font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-on-dark); margin-bottom: 8px;
}
.menu__list { list-style: none; }
.menu__list a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--line-on-dark);
  font-size: 22px; font-weight: 800; text-decoration: none; color: var(--white);
}
.menu__list--small a { font-size: 17px; font-weight: 600; }
.menu__list a:hover, .menu__list a[aria-current="page"] { color: var(--orange); }
.menu__contacts { font-size: 15px; color: var(--muted-on-dark); display: grid; gap: 4px; }
.menu__contacts a { color: var(--white); text-decoration: none; }
.menu__contacts a:hover { color: var(--orange); }
html.menu-open { overflow: hidden; }

/* Внутрішні сторінки: <body data-header="solid"> — шапка одразу темна,
   контент починається під нею */
body[data-header="solid"] { padding-top: var(--header-h); }

/* ---------- Підвал ---------- */
.site-footer { background: var(--navy); color: var(--white); padding-top: 72px; border-top: 1px solid var(--line-on-dark); }
.site-footer__grid {
  display: grid; gap: 40px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) {
  .site-footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 48px; }
  .site-footer__grid--3 { grid-template-columns: 1.6fr 1fr 1.3fr; }   /* без групи «Сторінки» */
}
.site-footer__logo { height: 52px; width: auto; }
.site-footer__tagline { margin-top: 16px; max-width: 300px; color: var(--muted-on-dark); font-size: 15px; }
.site-footer h2 {
  font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-on-dark); margin-bottom: 16px;
}
.site-footer ul { list-style: none; display: grid; gap: 8px; }
.site-footer ul.socials { display: flex; }
.site-footer a { text-decoration: none; }
.site-footer__links a:hover, .site-footer__contacts a:hover { color: var(--orange); }
.site-footer__contacts { font-size: 15px; display: grid; gap: 12px; }
.site-footer__contacts li { display: flex; gap: 12px; align-items: flex-start; }
.site-footer__contacts .icon { margin-top: 1px; color: var(--muted-on-dark); }
.site-footer__brand .socials { margin-top: 24px; }
.site-footer__bottom {
  margin-top: 56px; padding-block: 24px 32px;
  border-top: 1px solid var(--line-on-dark);
  display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between;
  font-size: 14px; color: var(--muted-on-dark);
}
.site-footer__bottom a { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.site-footer__bottom a:hover { color: var(--orange); }

/* Соцмережі (рендерить site.js у будь-який [data-socials]) */
.socials { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.socials a {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--line-on-light); border-radius: var(--radius-sm);
  color: var(--navy);
}
.socials a:hover { border-color: currentColor; }
.section--dark .socials a, .site-footer .socials a, .menu .socials a { border-color: var(--line-on-dark); color: var(--white); }
.section--dark .socials a:hover, .site-footer .socials a:hover, .menu .socials a:hover { border-color: var(--white); }

/* Список контактів ([data-contact] заповнюється з SITE.contacts) */
.contact-list { list-style: none; display: grid; gap: 20px; }
.contact-list li { display: flex; gap: 16px; align-items: flex-start; }
.contact-list .icon { width: 28px; height: 28px; margin-top: 2px; }
.contact-list__k { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--gray-text); }
.contact-list__v { font-size: 18px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
a.contact-list__v:hover { color: var(--orange-dark); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 4. Головна сторінка ---------- */

/* Перший екран */
.hero {
  position: relative;
  /* не на всю висоту вікна: знизу видно початок наступної секції, і при прокрутці
     не лишається пів екрана самого патерну */
  min-height: 86vh; min-height: 86svh;
  display: grid; place-items: center;
  padding: calc(var(--header-h) + 24px) var(--gutter) 96px;
  background-color: var(--navy);
  --tile: 380;                      /* ширина плитки патерну, px (читає й site.js) */
  color: var(--white);
  overflow: hidden;
  --p: 0;                           /* прогрес згортання, задає site.js */
}
@media (min-width: 768px) { .hero { --tile: 600; } }
@media (min-width: 1280px) { .hero { --tile: 680; } }

/* Патерн, розкладений site.js (з чистими зонами без обрізаних знаків), — .hero__pattern.
   Запасний варіант без JS: CSS-фон на ::before з маскою — доріжки м'яко сходять
   нанівець навколо лого й підказки скролу (маска — лише прийом рендеру фону). */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("../assets/pattern/pattern-tile.svg");
  background-repeat: repeat;
  background-size: calc(var(--tile) * 1px) auto;
  background-position: center center;
  -webkit-mask-image:
    radial-gradient(ellipse 52% 54% at 50% 48%, transparent 66%, #000 92%),
    radial-gradient(ellipse 160px 64px at 50% 100%, transparent 70%, #000 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(ellipse 52% 54% at 50% 48%, transparent 66%, #000 92%),
    radial-gradient(ellipse 160px 64px at 50% 100%, transparent 70%, #000 100%);
  mask-composite: intersect;
}
@media (max-width: 599px) {
  .hero::before {
    -webkit-mask-image: radial-gradient(ellipse 90% 30% at 50% 48%, transparent 75%, #000 100%), radial-gradient(ellipse 140px 56px at 50% 100%, transparent 70%, #000 100%);
    mask-image: radial-gradient(ellipse 90% 30% at 50% 48%, transparent 75%, #000 100%), radial-gradient(ellipse 140px 56px at 50% 100%, transparent 70%, #000 100%);
  }
}
.hero.has-pattern::before { content: none; }
.hero__pattern { position: absolute; left: 0; top: 0; pointer-events: none; }

/* Чиста зона без доріжок: лого й кнопка. Доріжки прибирає site.js
   (без JS — маска на .hero::before), тож плашка прозора */
.hero__clean {
  position: relative;
  border-radius: var(--radius);
  padding: clamp(28px, 4.5vw, 64px) clamp(20px, 5vw, 80px) clamp(32px, 4.5vw, 64px);
  display: flex; flex-direction: column; align-items: center;
  transform-origin: 50% 0;
  transform: translateY(calc(var(--p) * -64px)) scale(calc(1 - var(--p) * 0.06));
  will-change: transform;
}
/* вміст (лого, рядок, кнопка) гасне лише тоді, коли заходить під шапку (--fade задає site.js) */
.hero__clean > * { opacity: var(--fade, 1); }

/* На вузьких екранах чиста зона — смуга на всю ширину: патерн лише згори й знизу */
@media (max-width: 599px) {
  .hero { padding-inline: 0; }
  .hero__clean { width: 100%; border-radius: 0; padding-inline: 10vw; }
}

/* Блок лого + другий рядок. Ширина задає кегль рядка (container query units). */
.hero__brand {
  width: min(80vw, 760px);
  container-type: inline-size;
}
@media (min-width: 768px) { .hero__brand { width: min(66vw, 600px); } }
/* На широких екранах ширину лого обмежує й висота вікна: тоді перший екран
   вміщається в 86 % висоти і знизу видно початок наступної секції.
   (86vh − 340px) — місце під лого й рядок після відступів і кнопки; × 1.3 — бо блок лого
   з трьома рядками приблизно в 0.77 раза вищий, ніж широкий. */
@media (min-width: 1024px) {
  .hero__brand { width: clamp(320px, min(50vw, calc((86vh - 340px) * 1.3)), 760px); }
  .hero__brand { width: clamp(320px, min(50vw, calc((86svh - 340px) * 1.3)), 760px); }
  .hero { padding-bottom: 72px; }
  .hero__clean { padding-block: 24px 32px; }
}

.hero__logo { width: 100%; height: auto; }

/* «освітньої мануфактури підзамче» — той самий кегль, що й підпис у лого.
   Виміряно з SVG: підпис набрано кеглем 36 одиниць при ширині лого 638.7
   (36 / 638.7 = 5.6365 % ширини лого), лівий край — 24 одиниці (3.7577 %).
   Базова лінія підпису — 289.36 з 321.77 висоти лого. */
.hero__subline {
  margin: 0;
  /* запасний варіант без container query: ширина блоку у vw */
  font-size: calc(min(80vw, 760px) * 0.056365);
  font-size: 5.6365cqw;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.28em;
  color: var(--white);
  text-align: center;
  /* розрядка додає 0.28em після останньої літери — компенсуємо, щоб рядок стояв точно по центру лого */
  padding-left: 0.28em;
  /* лого має порожнє поле знизу (32.4 од. під базовою лінією); підтягуємо рядок,
     щоб інтерліньяж між підписом і цим рядком дорівнював 1.5 кегля
     (21.6 од. від низу лого до базової лінії мінус 40.8 од. від верху рядка до базової) */
  margin-top: -2.86cqw;  /* підібрано вимірюванням базових ліній у Chrome з Manrope */
  /* у підписі в лого проміжок між словами вужчий, ніж звичайний пробіл + розрядка */
  word-spacing: -0.25em;
}
.hero__subline span { display: block; white-space: nowrap; }

.hero__cta { margin-top: clamp(28px, 4vw, 48px); }

/* Підказка скролу — на власній плашці, не на доріжках */
.hero__scroll {
  position: absolute; left: 50%; bottom: 20px;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 12px; border-radius: 999px;
  background: var(--navy);
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--muted-on-dark); text-decoration: none;
  opacity: calc(1 - var(--p) * 3);
}
.hero.has-pattern .hero__scroll { background: transparent; }
.hero__scroll:hover { color: var(--white); }
.hero__scroll svg { width: 16px; height: 16px; animation: nudge 2.4s var(--ease) infinite; }
@keyframes nudge { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(4px); } }

/* Про клуб */
.about__grid { display: grid; gap: 56px; }
@media (min-width: 1024px) { .about__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 80px; align-items: start; } }
.about__text > * + * { margin-top: 20px; }
.about__text h2 { margin-top: 16px; font-size: clamp(30px, 4.2vw, 48px); max-width: 18ch; }
.about__text h2 + p { margin-top: 32px; }
.about__text p { max-width: 64ch; }
.about__text p.about__pulse { font-weight: 600; }

/* Кроки «Ідея → Напрями → Результат»: доріжка з вузлами */
.steps {
  list-style: none;
  border: 1px solid var(--line-on-light);
  border-radius: var(--radius);
  padding: 32px 24px 32px 24px;
}
@media (min-width: 768px) { .steps { padding: 40px 40px 40px 32px; } }
@media (min-width: 1024px) { .steps { position: sticky; top: calc(var(--header-h) + 32px); } }
.step { position: relative; padding-left: 52px; padding-bottom: 36px; }
.step:last-child { padding-bottom: 0; }
/* доріжка */
.step::before {
  content: ""; position: absolute;
  left: 14px; top: 22px; bottom: -6px;
  width: var(--stroke); margin-left: calc(var(--stroke) / -2);
  background: var(--navy); border-radius: 2px;
}
.step:last-child::before { content: none; }
/* вузол */
.step__node {
  position: absolute; left: 14px; top: 4px;
  width: 18px; height: 18px; margin-left: -9px;
  border-radius: 50%;
  border: var(--stroke) solid var(--navy);
  background: var(--white);
}
.step--idea .step__node { background: var(--orange); border-color: var(--orange); width: 22px; height: 22px; margin-left: -11px; top: 2px; }
.step--result .step__node {
  border: 0; border-radius: 0; background: none;
  width: 22px; height: 20px; margin-left: -11px; top: 4px;
}
.step--result .step__node svg { width: 22px; height: 20px; }
.step h3 { font-size: 22px; line-height: 1.2; }
.step p { margin-top: 6px; color: var(--gray-text); }
.step__icons { display: flex; gap: 12px; margin-top: 14px; }
.step__icons img { width: 32px; height: 32px; }

.about__divider { margin-top: 72px; }

/* Напрями */
.directions__grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 480px) { .directions__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px) { .directions__grid { gap: 16px; } }
@media (min-width: 1024px) { .directions__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }
.direction { display: flex; flex-direction: column; gap: 12px; padding: 20px 16px; }
@media (min-width: 768px) { .direction { padding: 32px 28px; gap: 16px; } }
.direction img { width: 48px; height: 48px; margin-bottom: 8px; }
@media (min-width: 768px) { .direction img { width: 56px; height: 56px; margin-bottom: 16px; } }
.direction h3 { font-size: 18px; }
/* Вузькі телефони: одна колонка, іконка ліворуч — назви не рвуться, текст читається */
@media (max-width: 479px) {
  .direction { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px 16px; align-items: start; padding: 20px; }
  .direction img { grid-row: span 2; width: 40px; height: 40px; margin: 0; }
  .direction h3 { align-self: center; min-height: 40px; display: flex; align-items: center; }
}
.nowrap { white-space: nowrap; }
@media (min-width: 768px) { .direction h3 { font-size: 21px; } }
/* чотири в ряд: вужчі картки, кегль назви росте з шириною, щоб «3D-моделювання» стояло в рядок */
@media (min-width: 1024px) { .direction { padding: 32px 24px; } .direction h3 { font-size: clamp(18px, 1.6vw, 21px); } }
@media (min-width: 1280px) { .direction { padding: 32px 28px; } }
.direction p { font-size: 15px; line-height: 1.55; }
@media (min-width: 768px) { .direction p { font-size: 16px; } }

/* Галерея: плитки будує js/site.js зі списку GALLERY (js/gallery.js).
   Телефон: 2 колонки, перша плитка на всю ширину (2×2), далі по дві в ряд.
   Від 768 px: 4 колонки; класи плиток --b (2×2), --w (на 2 колонки), --f (на 4) ставить скрипт. */
.gallery__grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 150px;
  grid-auto-flow: row dense;
}
@media (max-width: 767px) {
  .gallery__grid > :first-child { grid-column: span 2; grid-row: span 2; }
  .gallery__grid > :last-child:nth-child(even) { grid-column: span 2; }
}
.gallery__tile {
  position: relative; display: block; width: 100%; height: 100%; min-width: 0;
  padding: 0; margin: 0; border: 0; border-radius: var(--radius); overflow: hidden;
  background: rgba(15, 26, 36, 0.08); cursor: zoom-in; -webkit-tap-highlight-color: transparent;
}
.gallery__tile img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; }
.gallery__tile::after {      /* рамка при наведенні */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  border: 3px solid transparent; transition: border-color .2s; pointer-events: none;
}
.gallery__tile:hover::after { border-color: var(--white); }
.gallery__tile:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: var(--radius); }
@media (min-width: 768px) {
  .gallery__grid { gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 180px; }
  .gallery__grid > .gallery__tile--b { grid-column: span 2; grid-row: span 2; }
  .gallery__grid > .gallery__tile--w { grid-column: span 2; }
  .gallery__grid > .gallery__tile--f { grid-column: span 4; }
}
@media (min-width: 1024px) { .gallery__grid { gap: 24px; grid-auto-rows: 220px; } }
/* одне фото: одна плитка помірної ширини */
.gallery__grid.gallery__grid--solo { grid-template-columns: minmax(0, 760px); grid-auto-rows: auto; }
.gallery__grid--solo > .gallery__tile { grid-column: auto; grid-row: auto; aspect-ratio: 3 / 2; height: auto; }

/* Попап галереї (лайтбокс): суцільний темно-синій фон, білі лінійні іконки, помаранчевий лише для фокуса */
html.lightbox-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--navy); color: var(--white);
  overscroll-behavior: contain;
  opacity: 0; transition: opacity .2s;
}
.lightbox.is-open { opacity: 1; }
.lightbox__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; min-height: 72px; }
.lightbox__count { font-size: 16px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted-on-dark); font-variant-numeric: tabular-nums; }
.lightbox.is-single .lightbox__count { visibility: hidden; }
.lightbox__top .lightbox__close { margin-left: auto; }
.lightbox__btn {
  flex: none; width: 48px; height: 48px; display: grid; place-items: center; padding: 0;
  background: transparent; color: var(--white); cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.4); border-radius: var(--radius-sm);
  transition: border-color .2s, background-color .2s;
}
.lightbox__btn:hover { border-color: var(--white); }
.lightbox__btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: var(--radius-sm); }
.lightbox__btn .icon { width: 24px; height: 24px; stroke-width: 2.25; }
.lightbox__main { position: relative; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); padding-inline: 8px; }
.lightbox__stage { position: relative; min-width: 0; min-height: 0; touch-action: pan-y; }
.lightbox__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; border-radius: 0; transition: opacity .2s;
}
.lightbox.is-loading .lightbox__img { opacity: 0.35; }
.lightbox__nav { position: absolute; top: 50%; margin-top: -24px; z-index: 1; background: rgba(15, 26, 36, 0.72); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
.lightbox.is-single .lightbox__nav { display: none; }
.lightbox__caption {
  padding: 16px 24px 24px; margin: 0 auto; max-width: 72ch; text-align: center;
  font-size: 16px; line-height: 1.5; font-weight: 500; color: rgba(255, 255, 255, 0.9);
}
@media (min-width: 768px) {
  .lightbox__top { padding: 16px 24px; }
  .lightbox__main { grid-template-columns: 72px minmax(0, 1fr) 72px; padding-inline: 16px; align-items: stretch; }
  .lightbox__nav { position: static; margin: 0; align-self: center; justify-self: center; background: transparent; }
  .lightbox.is-single .lightbox__main { grid-template-columns: minmax(0, 1fr); }
  .lightbox__caption { font-size: 17px; padding: 20px 24px 28px; }
}

/* Проєкти */
.projects__head { max-width: none; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-end; justify-content: space-between; }
.badge {
  display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px;
  border: 1px solid currentColor; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
}
.section--dark .badge { color: var(--muted-on-dark); border-color: var(--line-on-dark); }
.projects__grid { display: grid; gap: 16px; }
@media (min-width: 640px) {
  .projects__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects__grid > :first-child { grid-column: span 2; }
  .projects__grid > :first-child .ph { aspect-ratio: 21 / 9; }
}
@media (min-width: 1024px) {
  .projects__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .projects__grid > :first-child { grid-column: auto; }
  .projects__grid > :first-child .ph { aspect-ratio: 16 / 10; }
}
.project { display: flex; flex-direction: column; gap: 16px; }
.project .ph { min-height: 0; height: auto; aspect-ratio: 16 / 10; margin-bottom: 8px; border-radius: var(--radius-sm); }
.project h3 { font-size: 21px; }
.project p { flex: 1 1 auto; }
.project__soon { font-size: 15px; font-weight: 600; color: var(--muted-on-dark); }
.project--link { position: relative; }
.project--link:hover { border-color: rgba(255, 255, 255, 0.5); }
/* вся картка клікабельна через посилання-заголовок */
.project--link h3 a { text-decoration: none; }
.project--link h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }

/* Контакти: заголовок, лід і форма зворотного зв'язку (одна колонка, зліва, як інші секції) */
.contacts__inner { max-width: 640px; }
.contacts__inner > * + * { margin-top: 20px; }
.contacts__inner h2 { font-size: clamp(30px, 4.2vw, 48px); max-width: 18ch; }
.contacts__inner .lead { max-width: 52ch; }

.form { margin-top: 40px; display: grid; gap: 24px; }
.form__note { font-size: 15px; font-weight: 600; color: var(--gray-text); }
.field__label { display: block; margin-bottom: 8px; font-size: 16px; font-weight: 600; line-height: 1.3; }
.field__input {
  display: block; width: 100%; min-height: 52px; padding: 13px 16px;
  font-family: var(--font); font-size: 16px; font-weight: 500; line-height: 1.5; color: var(--navy);
  background: var(--white); border: 2px solid rgba(15, 26, 36, 0.5); border-radius: var(--radius-sm);
  -webkit-appearance: none; appearance: none;
  transition: border-color .2s;
}
.field__input::placeholder { color: var(--gray-text); opacity: 0.85; }
.field__input--area { min-height: 144px; resize: vertical; }
.field__input:hover { border-color: var(--navy); }
.field__input:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-color: var(--navy); border-radius: var(--radius-sm); }
/* ошибка: не лише колір — товща рамка, значок і текст під полем */
.field.is-invalid .field__input { border-color: var(--orange-dark); border-width: 3px; padding: 12px 15px; }
.field__error {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 8px;
  font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--orange-dark);
}
.field__error::before {
  content: ""; flex: none; width: 20px; height: 20px; margin-top: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C74400' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5.5M12 16.6h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
.form__submit { justify-self: start; min-width: 200px; }
.form__status {
  padding: 16px 20px; background: var(--gray-bg); border-radius: var(--radius-sm);
  font-size: 16px; line-height: 1.55; font-weight: 500;
}
.form__status a { color: var(--orange-dark); font-weight: 600; text-underline-offset: 3px; white-space: nowrap; }
.form__status:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: var(--radius-sm); }
@media (max-width: 479px) { .form__submit { justify-self: stretch; } }

/* ---------- Зменшений рух ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero__clean { transform: none; opacity: 1; }
  .hero__scroll { opacity: 1; }
  .hero__clean > * { opacity: 1; }
  .site-header__brand { transform: none; }
}

/* =====================================================================
   5. ВНУТРІШНІ СТОРІНКИ — блок для Агента 2
   (page-hero, prose, callout, facts, prev/next тощо дописувати нижче)
   ===================================================================== */
