/*!
 * avtolux.co — main.css
 * Ванільний CSS3, без фреймворків. Класи — контракт із WIKI/design-system.md.
 * Порядок секцій: токени → reset → типографіка → каркас → примітиви →
 * шапка → підвал → секції сторінок → форма → лайтбокс → утиліти → друк.
 */

/* ==========================================================================
   1. ТОКЕНИ
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Тон бренду — поглиблена палітра старого сайту */
  --ink-900: #0B2731;
  --ink-800: #123542;
  --ink-700: #29434D;
  --ink-500: #5A6B72;
  --ink-400: #7E8D93;
  --ink-300: #B6C2C7;
  --ink-100: #DCE5E9;
  --ink-050: #EFF4F6;

  --brand-700: #00566D;
  --brand-600: #007B9A;
  --brand-500: #00A0C6;
  --brand-400: #00B9E8;
  --brand-200: #A4E6F7;
  --brand-050: #EAF7FB;

  --graphite: #5C5C61;
  --accent: #FFB000;

  --ok: #1B7F4B;
  --warn: #B25E00;
  --error: #B3261E;

  /* Семантичні — перевизначаються в темній темі */
  --surface: #FFFFFF;
  --surface-2: #F6F9FA;
  --surface-3: #EFF4F6;
  --surface-inverse: var(--ink-900);
  --text: var(--ink-800);
  --text-muted: var(--ink-500);
  --heading: var(--ink-900);
  --line: var(--ink-100);
  --link: var(--brand-700);

  /* Простір: 4px-сітка */
  --s-1: .25rem;
  --s-2: .5rem;
  --s-3: .75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;

  /* Радіуси й тіні */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-full: 999px;
  --shadow-1: 0 1px 2px rgb(11 39 49 / .06), 0 1px 3px rgb(11 39 49 / .08);
  --shadow-2: 0 4px 12px rgb(11 39 49 / .08), 0 2px 4px rgb(11 39 49 / .04);
  --shadow-3: 0 12px 32px rgb(11 39 49 / .12), 0 4px 8px rgb(11 39 49 / .06);

  /* Каркас */
  --container: 1200px;
  --measure: 68ch;
  --header-h: 72px;

  --ease: cubic-bezier(.2, .7, .3, 1);
  --dur: .22s;

  /* Типографіка */
  --font-display: 'Play', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  --fs-hero: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);
  --fs-h1: clamp(1.9rem, 1.35rem + 2.2vw, 3rem);
  --fs-h2: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  --fs-h3: clamp(1.2rem, 1.08rem + .5vw, 1.5rem);
  --fs-lead: clamp(1.05rem, 1rem + .35vw, 1.25rem);
  --fs-body: 1.0625rem;
  --fs-small: .9375rem;
  --fs-micro: .8125rem;
}

/*
 * Темна тема: перевизначаємо лише семантичні змінні, тонову шкалу не
 * чіпаємо. Кожна пара нижче перевірена розрахунком контрасту (WCAG AA):
 * --text/--surface ≈ 12.2:1, --text-muted/--surface ≈ 8.6:1,
 * --heading/--surface ≈ 14:1, --link/--surface ≈ 6.8:1.
 * --line піднято до ink-400 (не ink-700), бо ink-700 дає лише ~1.5:1 —
 * недостатньо, щоб межі полів форми лишались помітними в темній темі.
 */
@media (prefers-color-scheme: dark) {
  :root {
    --surface: var(--ink-900);
    --surface-2: var(--ink-800);
    --surface-3: var(--ink-700);
    --surface-inverse: var(--ink-050);
    --text: var(--ink-100);
    --text-muted: var(--ink-300);
    --heading: var(--ink-050);
    --line: var(--ink-400);
    --link: var(--brand-400);
  }
}

/* ==========================================================================
   2. RESET
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Позакадрове мобільне меню зсувається за екран через
     transform:translateX(100%) на position:fixed елементі. Браузери
     враховують геометрію ПІСЛЯ transform у скролюваній області
     документа, тож без цього рядка сторінка отримує зайву горизонтальну
     прокрутку рівно на ширину меню. overflow-y лишається у initial. */
  overflow-x: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

:target {
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}

body {
  min-height: 100vh;
}

img,
picture,
svg,
video {
  max-width: 100%;
  display: block;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration-color: currentColor;
}

table {
  border-collapse: collapse;
}

/* ==========================================================================
   3. БАЗОВА ТИПОГРАФІКА
   ========================================================================== */

@font-face {
  font-family: 'Play';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/play-400-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Play';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/play-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Play';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/play-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Play';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/play-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Play';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/play-700-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Play';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/play-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Play';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/play-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Play';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/play-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html {
  font-family: var(--font-body);
  font-size: 100%;
}

body {
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* Запобіжник від горизонтального переповнення: один задовгий нерозривний
     рядок (слово, e-mail, URL) більше не може розсунути сторінку вшир. */
  overflow-wrap: break-word;
}

/*
 * hyphens:auto — лише для прози (§2 дизайн-системи: UK/RU/DE). Якщо
 * повісити його на body, він успадковується й в інтерактив (пункти меню,
 * кнопки), де перенос дефісом ламає короткі підписи. Тому вмикаємо його
 * точково на текстових абзацах і вимикаємо явно там, де текст не повинен
 * переноситись.
 */
p,
.lead,
.prose {
  hyphens: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--heading);
  line-height: 1.15;
  text-wrap: balance;
  hyphens: none;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p {
  text-wrap: pretty;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--text-muted);
}

a {
  color: var(--link);
}

a:not([class]) {
  text-underline-offset: .15em;
}

small {
  font-size: var(--fs-small);
}

strong { font-weight: 700; }
em { font-style: italic; }

/* ==========================================================================
   4. КАРКАС
   ========================================================================== */

.skip-link {
  position: fixed;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 1000;
  transform: translateY(-150%);
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--brand-500);
  border-radius: var(--r-sm);
  padding: var(--s-3) var(--s-4);
  font-weight: 700;
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

main {
  display: block;
}

/* Фонова текстура старого сайту — делікатно, лише у hero (§ секції). */

/* ==========================================================================
   5. ПРИМІТИВИ
   ========================================================================== */

.container {
  width: min(100% - 2 * var(--s-5), var(--container));
  margin-inline: auto;
}

.section {
  padding-block: clamp(var(--s-7), 6vw, var(--s-9));
}

.section--tint {
  background: var(--surface-2);
}

.section__head {
  max-width: var(--measure);
  margin-bottom: var(--s-7);
}

.section__head > * + * {
  margin-top: var(--s-3);
}

.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: var(--s-4);
}

.prose h2,
.prose h3 {
  margin-top: var(--s-7);
}

.prose ul,
.prose ol {
  padding-left: var(--s-5);
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose a {
  text-decoration: underline;
  text-underline-offset: .15em;
}

.prose strong {
  color: var(--heading);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: var(--s-5);
}

.card--accent {
  position: relative;
  overflow: hidden;
}

.card--accent::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-400), var(--brand-200));
}

.grid {
  display: grid;
  gap: var(--s-5);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  min-width: 44px;
  padding-inline: var(--s-5);
  border-radius: var(--r-full);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: var(--fs-small);
  text-decoration: none;
  white-space: nowrap;
  hyphens: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--brand-600);
  color: #FFFFFF;
}

.btn--primary:hover {
  background: var(--brand-700);
}

/*
 * Друга кнопка hero. Лежить поверх фотографії, тому кольори тут задані
 * жорстко, а не через семантичні змінні: підкладка непередбачувана, і в
 * темній темі «підлаштування під фон» зробило б напис нечитним. Раніше
 * кнопка була прозорою з темним текстом і на світлому фото зникала.
 */
.btn--light {
  background: #fff;
  border-color: #fff;
  color: var(--ink-900);
  box-shadow: var(--shadow-2);
}

.btn--light:hover {
  background: var(--brand-050);
  border-color: var(--brand-050);
  color: var(--brand-700);
}

.btn--accent {
  background: var(--accent);
  color: var(--ink-900);
}

.btn--accent:hover {
  background: var(--brand-400);
}

.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: .6;
  cursor: not-allowed;
}

.media {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-3);
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--wide {
  aspect-ratio: 21 / 9;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   6. ШАПКА
   ========================================================================== */

/*
 * backdrop-filter навмисно винесено на ::before, а не поставлено прямо на
 * .site-header: filter/backdrop-filter на елементі створює containing
 * block для його position:fixed нащадків (мобільне .nav). Тоді fixed
 * панель позиціюється відносно шапки, а не вʼюпорта, і її зсунутий за
 * межі екрана стан починає рахуватись у scrollWidth документа —
 * це і була причина горизонтальної прокрутки (дефект №1/№3).
 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgb(255 255 255 / .82);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
}

@media (prefers-color-scheme: dark) {
  .site-header::before {
    background: rgb(11 39 49 / .82);
  }
}

.site-header.is-scrolled {
  border-color: var(--line);
  box-shadow: var(--shadow-1);
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: var(--s-4);
  min-height: var(--header-h);
}

/* min-width:0 знімає авто-мінімум grid-елементів, щоб довгий текст
   усередині (напр. слоган бренду) не розсовував шапку і сторінку вшир. */
.site-header__inner > * {
  min-width: 0;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.1;
  text-decoration: none;
  color: var(--heading);
}

.brand__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  white-space: nowrap;
  hyphens: none;
}

.brand__logo {
  display: block;
  height: 40px;
  width: auto;
}

/* Слоган перевантажує шапку на вузьких екранах (§5 defect) — показуємо
   його другим рядком меншим кеглем лише від контейнера ≥1200px. */
.brand__tagline {
  display: none;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-micro);
  color: var(--text-muted);
  white-space: nowrap;
  hyphens: none;
}

@media (min-width: 75em) {
  .brand__tagline {
    display: block;
  }
}

.nav__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-5);
}

.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  font-size: var(--fs-small);
  text-decoration: none;
  color: var(--text);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  hyphens: none;
}

.nav__link:hover {
  color: var(--brand-600);
}

.nav__link[aria-current='page'] {
  color: var(--brand-700);
  border-color: var(--brand-500);
}

.lang {
  position: relative;
}

.lang__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-height: 44px;
  min-width: 44px;
  padding-inline: var(--s-3);
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: var(--fs-small);
  text-transform: uppercase;
  white-space: nowrap;
  hyphens: none;
}

.lang__toggle::after {
  content: '';
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur) var(--ease);
}

.lang__toggle[aria-expanded='true']::after {
  transform: rotate(-135deg) translateY(2px);
}

.lang__toggle:hover {
  background: var(--surface-2);
}

/*
 * Меню мов приховане, поки кнопка не в стані aria-expanded="true" — керує
 * цим CSS від атрибута кнопки, а не JS: так меню не висить розкритим ні
 * до ініціалізації скрипту, ні за його відсутності.
 */
.lang__menu {
  position: absolute;
  top: calc(100% + var(--s-2));
  right: 0;
  min-width: 10rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  padding: var(--s-2);
  display: none;
  gap: var(--s-1);
}

.lang__toggle[aria-expanded='true'] + .lang__menu {
  display: grid;
}

.lang__item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--s-3);
  border-radius: var(--r-sm);
  white-space: nowrap;
  hyphens: none;
}

.lang__item a {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: var(--text);
}

.lang__item:hover {
  background: var(--surface-2);
}

.lang__item[aria-current='true'] a,
.lang__item[aria-current='page'] a {
  color: var(--brand-700);
  font-weight: 700;
}

/* Бургер: у розмітці кнопка містить три звичайні <span> (смуги) і
   четвертий .visually-hidden з підписом — малюємо іконку саме на них. */
.nav-toggle {
  position: relative;
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
}

.nav-toggle span:not(.visually-hidden) {
  position: absolute;
  left: 50%;
  top: 15px;
  width: 22px;
  height: 2px;
  background: currentColor;
  transform: translateX(-50%);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.nav-toggle span:not(.visually-hidden):nth-child(2) {
  top: 21px;
}

.nav-toggle span:not(.visually-hidden):nth-child(3) {
  top: 27px;
}

.nav-toggle[aria-expanded='true'] span:not(.visually-hidden):nth-child(1) {
  top: 21px;
  transform: translateX(-50%) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] span:not(.visually-hidden):nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded='true'] span:not(.visually-hidden):nth-child(3) {
  top: 21px;
  transform: translateX(-50%) rotate(-45deg);
}

/* Стан «меню відкрито»: блокуємо прокрутку сторінки під оверлеєм. */
body.nav-open {
  overflow: hidden;
}

@media (max-width: 63.9375em) {
  .nav-toggle {
    display: inline-block;
  }

  /*
   * Позиціюємо панель через right, а не transform:translateX(). Fixed-
   * елемент із transform, зсунутий за межі екрана, все одно враховується
   * у скролюваній області документа (в цьому й полягав дефект №1/№3) —
   * а звичайний inset-офсет коректно виключається з неї.
   */
  .nav {
    position: fixed;
    top: var(--header-h);
    right: -100%;
    bottom: 0;
    width: 100%;
    background: var(--surface);
    padding: var(--s-6) var(--s-5);
    overflow-y: auto;
    transition: right var(--dur) var(--ease);
  }

  body.nav-open .nav {
    right: 0;
  }

  .nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
  }

  .nav__link {
    width: 100%;
    padding-block: var(--s-2);
  }
}

/* ==========================================================================
   7. ПІДВАЛ
   ========================================================================== */

.site-footer {
  background: var(--surface-inverse);
  color: var(--ink-100);
}

.site-footer a {
  color: var(--brand-200);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand-050);
  text-decoration: underline;
}

.site-footer__grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  padding-block: var(--s-8);
}

.site-footer__col {
  display: grid;
  gap: var(--s-3);
  align-content: start;
}

.site-footer__heading {
  color: var(--ink-050);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Друга рубрика в тій самій колонці («Ми в соціальних мережах» після
   реквізитів компанії) — інакше вона зливається з попереднім текстом. */
.site-footer__heading:not(:first-child) {
  margin-top: var(--s-4);
}

.site-footer__col ul {
  display: grid;
  gap: var(--s-2);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-block: var(--s-5);
  border-top: 1px solid rgb(255 255 255 / .12);
  font-size: var(--fs-micro);
  color: var(--ink-300);
}

.to-top {
  position: fixed;
  right: var(--s-5);
  bottom: var(--s-5);
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  background: var(--brand-600);
  color: #FFFFFF;
  box-shadow: var(--shadow-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--brand-700);
}

.to-top::before {
  content: '';
  width: 10px;
  height: 10px;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
  transform: rotate(-45deg) translateY(2px);
}

/* ==========================================================================
   8. СЕКЦІЇ СТОРІНОК
   ========================================================================== */

/* --- home: hero --------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(90vh, 720px);
  color: #FFFFFF;
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgb(11 39 49 / .88) 0%, rgb(11 39 49 / .45) 55%, rgb(11 39 49 / .15) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  padding-block: var(--s-8);
  max-width: var(--measure);
}

.hero__title {
  color: #FFFFFF;
  font-size: var(--fs-hero);
  hyphens: none;
}

.hero__lead {
  margin-top: var(--s-4);
  color: var(--ink-050);
}

.hero__actions {
  margin-top: var(--s-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* --- home: facts --------------------------------------------------------- */

.facts {
  padding-block: var(--s-7);
}

.facts__item {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  color: var(--brand-600);
}

/* --- home: cta-band -------------------------------------------------------- */

.cta-band {
  background-color: var(--surface-inverse);
  color: var(--ink-100);
  text-align: center;
  position: relative;
  background-image: url('../img/bg-pattern-768.jpg');
  background-image: image-set(
    url('../img/bg-pattern-768.avif') type('image/avif') 1x,
    url('../img/bg-pattern-768.webp') type('image/webp') 1x,
    url('../img/bg-pattern-768.jpg') type('image/jpeg') 1x
  );
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: 480px auto;
  background-blend-mode: soft-light;
}

.cta-band__inner > * + * {
  margin-top: var(--s-6);
}

.cta-band__text {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  color: var(--ink-050);
}

/* --- about: certificates ---------------------------------------------------- */

.certificates__item {
  text-align: center;
  padding: var(--s-4);
}

.certificates__image {
  aspect-ratio: 3 / 2;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: var(--r-md);
  margin-bottom: var(--s-3);
}

/* --- services: geo / chip ----------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  font-size: var(--fs-small);
  hyphens: none;
}

.services-grid .grid {
  align-items: start;
}

.check-list {
  display: grid;
  gap: var(--s-3);
}

.check-list li {
  position: relative;
  padding-left: var(--s-6);
}

.check-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .35em;
  width: 16px;
  height: 9px;
  border-left: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg);
}

/* --- fleet ------------------------------------------------------------------ */

.fleet-list__item {
  display: flex;
  align-items: center;
}

.equipment__list {
  display: grid;
  gap: var(--s-3);
}

.equipment__list li {
  position: relative;
  padding-left: var(--s-6);
}

.equipment__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .3em;
  width: 18px;
  height: 18px;
  border-radius: var(--r-full);
  border: 2px solid var(--brand-500);
}

/* --- gallery ----------------------------------------------------------------- */

.gallery__item {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-3);
  position: relative;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur) var(--ease);
}

.gallery__item:hover img {
  transform: scale(1.04);
}

/* --- contacts ------------------------------------------------------------------ */

.contacts-grid {
  align-items: start;
}

.contact-card > * + * {
  margin-top: var(--s-3);
}

.contact-card h3 {
  margin-top: var(--s-5);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}

.contact-card__phones {
  display: grid;
  gap: var(--s-2);
}

.contact-card__phones a {
  font-family: var(--font-display);
  font-size: var(--fs-lead);
  font-weight: 700;
  text-decoration: none;
}

.contact-card__phones a:hover {
  text-decoration: underline;
}

.contact-card__manager {
  font-size: var(--fs-micro);
  color: var(--text-muted);
}

.contact-card a {
  color: var(--link);
}

.contact-card a:hover {
  text-decoration: underline;
}

.map-card {
  position: relative;
}

.map-card__media {
  position: relative;
}

.map-card__reveal {
  position: absolute;
  inset: 0;
  margin: auto;
  width: fit-content;
  height: fit-content;
  min-height: 44px;
  padding-inline: var(--s-5);
  border-radius: var(--r-full);
  background: var(--brand-600);
  color: #FFFFFF;
  font-weight: 700;
  font-size: var(--fs-small);
  white-space: nowrap;
  hyphens: none;
  box-shadow: var(--shadow-2);
}

.map-card__reveal:hover {
  background: var(--brand-700);
}

.map-card__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-card__directions {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
}

.map-card__directions:hover {
  text-decoration: underline;
}

/* --- error page ------------------------------------------------------------------ */

.error-page {
  text-align: center;
  padding-block: var(--s-10);
}

.error-page__code {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(4rem, 3rem + 6vw, 8rem);
  color: var(--brand-200);
  line-height: 1;
}

.error-page h1 {
  margin-top: var(--s-4);
}

.error-page p {
  margin-top: var(--s-3);
  max-width: var(--measure);
  margin-inline: auto;
}

.error-page .btn {
  margin-top: var(--s-6);
}

/* ==========================================================================
   9. ФОРМА
   ========================================================================== */

.form {
  display: grid;
  gap: var(--s-5);
  max-width: var(--measure);
}

.field {
  display: grid;
  gap: var(--s-2);
}

.field label {
  font-weight: 700;
  font-size: var(--fs-small);
}

.field input,
.field textarea,
.field select {
  min-height: 44px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
}

.field textarea {
  min-height: 10rem;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand-500);
}

.field__hint {
  font-size: var(--fs-micro);
  color: var(--text-muted);
}

.field__error {
  font-size: var(--fs-micro);
  color: var(--error);
  display: none;
}

.field [aria-invalid='true'] {
  border-color: var(--error);
}

.field [aria-invalid='true'] ~ .field__error,
.field__error:not(:empty) {
  display: block;
}

.field--checkbox {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--s-3);
}

.field--checkbox input {
  min-height: 24px;
  min-width: 24px;
  width: 24px;
  height: 24px;
  margin-top: .1em;
  accent-color: var(--brand-600);
}

.field--checkbox label {
  font-weight: 400;
}

/* Honeypot: приховано класом, не інлайновим display:none, щоб просте
   ботне сканування CSS/inline-стилів не виявляло пастку так само легко. */
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form__status {
  padding: var(--s-4);
  border-radius: var(--r-md);
  font-size: var(--fs-small);
  display: none;
}

.form__status:not(:empty) {
  display: block;
}

.form__status--success {
  background: color-mix(in srgb, var(--ok) 12%, var(--surface));
  color: var(--ok);
  border: 1px solid var(--ok);
}

.form__status--error {
  background: color-mix(in srgb, var(--error) 10%, var(--surface));
  color: var(--error);
  border: 1px solid var(--error);
}

.form__required-note {
  font-size: var(--fs-micro);
  color: var(--text-muted);
}

.cf-turnstile {
  margin-block: var(--s-2);
}

/* ==========================================================================
   10. ЛАЙТБОКС
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--ink-900);
  color: #FFFFFF;
}

.lightbox::backdrop {
  background: rgb(11 39 49 / .92);
}

.lightbox__inner {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  height: 100%;
}

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
}

.lightbox__counter {
  font-size: var(--fs-small);
  color: var(--ink-100);
}

.lightbox__close {
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  color: #FFFFFF;
  position: relative;
}

.lightbox__close:hover {
  background: rgb(255 255 255 / .12);
}

.lightbox__close::before,
.lightbox__close::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 2px;
  background: currentColor;
}

.lightbox__close::before { transform: rotate(45deg); }
.lightbox__close::after { transform: rotate(-45deg); }

.lightbox__stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding-inline: var(--s-8);
  padding-bottom: var(--s-6);
}

.lightbox__figure {
  display: grid;
  gap: var(--s-3);
  justify-items: center;
  max-width: 100%;
  max-height: 100%;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 12rem);
  width: auto;
  height: auto;
  border-radius: var(--r-md);
  object-fit: contain;
}

.lightbox__caption {
  font-size: var(--fs-small);
  color: var(--ink-100);
  text-align: center;
  max-width: var(--measure);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: var(--r-full);
  background: rgb(255 255 255 / .1);
  color: #FFFFFF;
}

.lightbox__nav:hover {
  background: rgb(255 255 255 / .2);
}

.lightbox__nav::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border: solid currentColor;
  border-width: 0 3px 3px 0;
}

.lightbox__prev {
  left: var(--s-4);
}

.lightbox__prev::before {
  transform: rotate(135deg) translate(-2px, -2px);
}

.lightbox__next {
  right: var(--s-4);
}

.lightbox__next::before {
  transform: rotate(-45deg) translate(-2px, -2px);
}

/* ==========================================================================
   11. УТИЛІТИ
   ========================================================================== */

/* Підстраховка на випадок керування видимістю через атрибут [hidden]
   (напр. запасний варіант для елементів статусу форми). */
[hidden] {
  display: none;
}

/* ==========================================================================
   12. ФОКУС І ДОСТУПНІСТЬ
   ========================================================================== */

:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 2px;
}

/*
 * Усі переходи в цьому файлі використовують var(--dur), тож досить
 * обнулити саму змінну — без боротьби за специфічність і без !important.
 * html{scroll-behavior:smooth} теж вимикається сам собою: він оголошений
 * лише під @media(prefers-reduced-motion:no-preference).
 */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur: 0s;
  }
}

/* ==========================================================================
   13. ДРУК
   ========================================================================== */

@media print {
  .site-header,
  .to-top,
  .nav-toggle,
  .lang,
  .lightbox,
  .btn,
  .map-card__reveal,
  .gallery__item {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  main a[href]:not([href^='#']):not([href^='javascript'])::after {
    content: ' (' attr(href) ')';
    font-size: .85em;
    color: #333;
  }

  .site-footer {
    background: #fff;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}
