/* Зовнішній шрифт для всієї візуальної системи. Та сама родина також
  підключена в HTML, щоб браузер почав завантаження якомога раніше. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* Центральні змінні дизайну. Зміна значення тут узгоджено оновлює пов'язані
  компоненти без пошуку по кожному селектору. */
:root {
  --color-dark: #071118;
  --color-mid: #101820;
  --color-yellow: #f5c542;
  --color-light: #f4f5f7;
  --color-white: #ffffff;
  --color-text: #171b20;
  --color-border: rgba(255, 255, 255, 0.12);
  --color-surface: #edf0f2;
  --color-soft: #dfe5ea;
  --shadow: 0 18px 45px rgba(7, 17, 24, 0.12);
  --container: 1230px;
  --radius: 12px;
}

* {
  /* Залишаємо відступи та рамки всередині заданих розмірів. */
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  /* Робимо переходи за якорями та програмну прокрутку плавними. */
  scroll-behavior: smooth;
}

body {
  /* Базова типографіка, фон і колір тексту для всієї сторінки. */
  font-family: 'Inter', sans-serif;
  background: var(--color-light);
  color: var(--color-text);
  line-height: 1.5;
}

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

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(var(--container), calc(100% - 48px));
  margin: 0 auto;
}

.section {
  padding: 86px 0;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-yellow);
}

h1,
h2,
h3,
h4 {
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

p {
  color: var(--color-text);
}

.site-header {
  /* ------------------------------ Шапка ------------------------------ */
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(7, 17, 24, 0.52);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.site-header.scrolled {
  background: rgba(7, 17, 24, 0.72);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  border-color: rgba(255, 255, 255, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 210px;
}

.brand-logo-wrap {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: transparent;
  border-radius: 10px;
  overflow: visible;
  box-shadow: none;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-text strong {
  font-size: 0.82rem;
  color: var(--color-white);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-text span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 3px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
  margin-right: 18px;
}

.nav-link {
  position: relative;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  padding: 30px 0 26px;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--color-yellow);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.nav-link.active,
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--color-white);
}

.nav-link.active::after,
.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-phone {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-yellow);
  color: var(--color-dark);
  border-color: var(--color-yellow);
}

.btn-secondary {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.55);
}

.btn-light {
  background: var(--color-dark);
  color: var(--color-white);
  border-color: var(--color-dark);
}

.nav-toggle {
    /* Керування меню лише для mobile; на desktop повна навігація залишається
      видимою. */
  display: none;
  background: transparent;
  border: none;
  width: 46px;
  height: 46px;
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 29px; }

.nav-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.nav-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  /* ------------------------------- Hero -------------------------------- */
  position: relative;
  min-height: 520px;
  background: linear-gradient(90deg, rgba(7, 17, 24, 0.74), rgba(7, 17, 24, 0.38)),
    url('../images/header.jpg') center/cover no-repeat;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 28px;
}

.hero-copy {
  max-width: 690px;
  padding-top: 24px;
}

.hero-copy .eyebrow {
  margin-bottom: 20px;
  font-size: 11px;
}

.hero-copy h1 {
  color: var(--color-white);
  font-size: clamp(2.5rem, 4vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
  margin-bottom: 18px;
}

.hero-copy h2 {
  color: var(--color-yellow);
  font-size: clamp(2.1rem, 3vw, 3.2rem);
  letter-spacing: -0.06em;
  line-height: 1;
  margin-bottom: 18px;
}

.hero-copy p {
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.05rem;
  max-width: 540px;
  margin-bottom: 28px;
}

.hero-copy .quote {
  margin-top: 8px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.hero-badge {
  position: relative;
  align-self: flex-end;
  align-items: center;
  justify-content: center;
  display: flex;
  min-width: 180px;
  height: 54px;
  padding: 0 26px;
  font-size: 1.05rem;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.9);
  font-style: italic;
  margin-bottom: 40px;
  font-weight: 500;
}

.hero-badge::before {
  content: '“';
  position: absolute;
  left: -20px;
  top: -18px;
  font-size: 2.8rem;
  color: rgba(245, 197, 66, 0.9);
}

.hero-badge::after {
  content: '”';
  position: absolute;
  right: -18px;
  bottom: -16px;
  font-size: 2.8rem;
  color: rgba(245, 197, 66, 0.9);
}

.section-title {
  /* ---------------------- Спільні заголовки секцій ---------------------- */
  margin-bottom: 32px;
}

.section-title .eyebrow {
  color: var(--color-yellow);
  letter-spacing: 0.2em;
  font-size: 11px;
  margin-bottom: 10px;
}

.section-title h2 {
  font-size: clamp(2rem, 2.8vw, 3rem);
  color: var(--color-mid);
  letter-spacing: -0.06em;
}

.services {
  /* ------------------------------ Послуги ------------------------------ */
  background: var(--color-light);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.service-card {
  background: #f6f6f6;
  border: 1px solid rgba(16, 24, 32, 0.05);
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(18, 25, 30, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.service-card:hover,
.service-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 20px 35px rgba(18, 25, 30, 0.1);
}

.service-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.service-card:hover img {
  transform: scale(1.05);
}

.service-card .service-body {
  padding: 18px 18px 20px;
  background: rgba(255, 255, 255, 0.35);
}

.service-card h3 {
  font-size: 1rem;
  line-height: 1.3;
  color: var(--color-mid);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.service-card .accent {
  width: 44px;
  height: 2px;
  background: var(--color-yellow);
  margin-bottom: 14px;
}

.projects {
  /* ---------------------------- Реалізації ---------------------------- */
  background: linear-gradient(180deg, #0f1f2b 0%, #071118 100%);
  color: var(--color-white);
  overflow: hidden;
}

.projects .section-title h2,
.projects .section-title p,
.projects .project-intro p,
.projects .project-intro h2 {
  color: var(--color-white);
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.7fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.project-intro {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  max-width: 360px;
}

.project-intro .eyebrow {
  margin-bottom: 10px;
}

.project-intro h2 {
  font-size: clamp(2rem, 3.4vw, 3.4rem);
  letter-spacing: -0.06em;
  margin-bottom: 20px;
  line-height: 1;
}

.project-intro p {
  color: rgba(255, 255, 255, 0.68);
  max-width: 370px;
  margin-bottom: 28px;
  font-size: 1.02rem;
}

.btn-ghost {
  padding: 0 24px;
  min-height: 44px;
  background: transparent;
  border: 1px solid rgba(245, 197, 66, 0.8);
  color: var(--color-yellow);
  display: inline-flex;
  width: fit-content;
}

.project-gallery {
  /* Велике фото займає дві висоти, а три менші фото формують праву колонку.
     Фіксована висота не дає галереї розтягувати всю секцію. */
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: 12px;
  height: 330px;
}

.gallery-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #dfe6eb;
  min-height: 0;
  border-radius: 0;
  box-shadow: var(--shadow);
}

.gallery-item.large {
  min-height: 0;
}

.gallery-stack .gallery-item:last-child {
  grid-column: 1 / -1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.why-us {
  /* ---------------------------- Переваги ---------------------------- */
  background: #edeef0;
}

.why-header {
  display: grid;
  grid-template-columns: 1.6fr 1.2fr;
  gap: 36px;
  align-items: end;
  margin-bottom: 34px;
}

.why-header .section-title {
  margin-bottom: 0;
}

.why-header .section-title h2 {
  font-size: clamp(2rem, 3vw, 3.2rem);
}

.about-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}

.about-copy p {
  color: rgba(23, 27, 32, 0.72);
  font-size: 1.02rem;
  max-width: 540px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 22px 14px 14px;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(16, 24, 32, 0.06);
}

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--color-yellow);
  border: 1px solid rgba(245, 197, 66, 0.4);
  background: rgba(245, 197, 66, 0.08);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-item h3 {
  font-size: 1.04rem;
  line-height: 1.18;
  color: var(--color-mid);
  letter-spacing: -0.04em;
}

.materials {
  /* ------------------------------ Матеріали ----------------------------- */
  background: #f1f3f4;
}

.materials-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 26px;
}

.materials-header h2 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  color: var(--color-mid);
}

.material-logo-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 18px;
}

.logo-box {
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 116px;
  border: 1px solid rgba(16, 24, 32, 0.05);
  font-weight: 900;
  letter-spacing: -0.08em;
  text-transform: uppercase;
}

.logo-box.profi {
  color: #d9191d;
  font-size: clamp(2rem, 2.6vw, 3rem);
}

.logo-box.baumit {
  color: #0f1d30;
  font-size: clamp(2rem, 2.6vw, 3rem);
}

.logo-box.cemix {
  color: #1a9de9;
  font-size: clamp(2rem, 2.6vw, 3rem);
}

.coverage {
  /* ----------------------------- Карта роботи ---------------------------- */
  background: #f5f5f5;
}

.coverage-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr;
  gap: 32px;
  align-items: center;
}

.coverage-copy h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin-bottom: 12px;
}

.coverage-copy p {
  font-size: 1.03rem;
  color: rgba(23, 27, 32, 0.76);
  margin-bottom: 10px;
}

.coverage-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-weight: 600;
  color: var(--color-mid);
  margin-top: 16px;
}

.coverage-list span {
  position: relative;
  padding: 0 0 0 12px;
}

.coverage-list span::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--color-yellow);
}

.map-wrap {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(16, 24, 32, 0.08);
  min-height: 270px;
  display: grid;
  place-items: center;
  padding: 24px;
}

.map-image {
  width: 100%;
  max-width: 560px;
  height: auto;
}

.map-pin {
  fill: var(--color-yellow);
  stroke: rgba(23, 27, 32, 0.1);
  stroke-width: 1.5;
}

.contact {
  /* ------------------------------- Контакти ------------------------------- */
  position: relative;
  background: linear-gradient(90deg, rgba(7, 17, 24, 0.78), rgba(7, 17, 24, 0.45)),
    url('../images/backgraund.png') center/cover no-repeat;
  color: var(--color-white);
}

.contact-wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: center;
}

.contact-copy {
  padding-right: 18px;
}

.contact-copy .eyebrow {
  margin-bottom: 8px;
}

.contact-copy h2 {
  color: var(--color-white);
  font-size: clamp(2rem, 3vw, 3.2rem);
  margin-bottom: 16px;
}

.contact-copy p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 18px;
  max-width: 420px;
}

.contact-links {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.contact-item svg {
  width: 20px;
  height: 20px;
  color: var(--color-yellow);
}

.contact-form {
  background: rgba(9, 15, 20, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 22px 18px 18px;
}

.field-group {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.field-group input,
.field-group textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-white);
  border-radius: 8px;
  padding: 14px 14px;
  min-height: 46px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-group textarea {
  min-height: 124px;
  resize: vertical;
}

.field-group input:focus,
.field-group textarea:focus {
  border-color: rgba(245, 197, 66, 0.8);
  box-shadow: 0 0 0 2px rgba(245, 197, 66, 0.1);
}

.field-group input.invalid,
.field-group textarea.invalid {
  border-color: #ff6b6b;
}

.form-error {
  display: none;
  color: #ffb3b3;
  font-size: 0.74rem;
  min-height: 1em;
}

.form-error.visible {
  display: block;
}

.btn-submit {
  width: 100%;
  margin-top: 8px;
  min-height: 50px;
  border: none;
  background: var(--color-yellow);
  color: var(--color-mid);
  border-radius: 10px;
  font-weight: 800;
}

.btn-submit.loading {
  opacity: 0.8;
  pointer-events: none;
}

.form-success {
  display: none;
  margin-top: 12px;
  color: #ccefd3;
  font-weight: 600;
}

.form-success.visible {
  display: block;
}

.form-success.is-error {
  color: #ffb3b3;
}

.privacy-page {
  background: var(--color-light);
  min-height: 100vh;
}

.privacy-content {
  max-width: 900px;
}

.privacy-content h1 {
  color: var(--color-dark);
  font-size: 2.5rem;
  line-height: 1.1;
  margin: 28px 0 12px;
}

.privacy-content h2 {
  color: var(--color-dark);
  font-size: 1.3rem;
  line-height: 1.25;
  margin: 30px 0 10px;
}

.privacy-content p,
.privacy-content li {
  line-height: 1.7;
  margin-bottom: 12px;
}

.privacy-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-back {
  display: inline-block;
  margin-bottom: 24px;
}

.privacy-updated {
  color: rgba(23, 27, 32, 0.7);
  font-size: 0.9rem;
}

.privacy-notice {
  border-left: 4px solid #bb3d2f;
  background: #fff;
  margin-top: 24px;
  padding: 14px 18px;
}

.privacy-modal {
  width: min(860px, calc(100vw - 32px));
  max-width: none;
  max-height: min(88vh, 900px);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(16, 24, 32, 0.16);
  background: var(--color-light);
  color: var(--color-text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.privacy-modal[open] {
  display: flex;
  flex-direction: column;
}

.privacy-modal::backdrop {
  background: rgba(7, 17, 24, 0.76);
  backdrop-filter: blur(3px);
}

.privacy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  background: var(--color-dark);
  color: var(--color-white);
}

.privacy-modal-header h2 {
  color: inherit;
  font-size: 1.1rem;
  line-height: 1.3;
}

.privacy-modal-close {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: var(--color-white);
  font-size: 1.6rem;
  line-height: 1;
}

.privacy-modal-close:hover,
.privacy-modal-close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.privacy-modal-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 28px 30px;
}

.privacy-modal-content .privacy-content {
  width: 100%;
  margin: 0;
  padding: 0;
}

.privacy-modal-content .privacy-content h2:first-of-type {
  margin-top: 12px;
}

.privacy-modal-content:focus-visible {
  outline: 2px solid var(--color-yellow);
  outline-offset: -3px;
}

.site-footer {
  /* ------------------------------- Footer ------------------------------- */
  background: #071118;
  color: rgba(255, 255, 255, 0.8);
  padding-top: 22px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 16px 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-brand .brand-logo-wrap {
  width: 40px;
  height: 40px;
}

.footer-brand .brand-text strong {
  font-size: 0.78rem;
}

.footer-brand .brand-text span {
  font-size: 0.53rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 24px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.72);
}

.footer-socials {
  display: flex;
  gap: 10px;
}

.social-link {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 28px;
  font-size: 0.8rem;
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.6);
}

.legal-links {
  display: flex;
  gap: 22px;
}

.legal-links a {
  color: rgba(255, 255, 255, 0.6);
}

.back-to-top {
  /* -------------------------- Службові елементи -------------------------- */
  position: fixed;
  right: 30px;
  bottom: 26px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-yellow);
  color: var(--color-dark);
  border: none;
  box-shadow: 0 10px 25px rgba(245, 197, 66, 0.32);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  z-index: 998;
}

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

.lightbox {
  /* ------------------------------- Lightbox ------------------------------ */
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 14, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1200;
}

.lightbox.visible {
  opacity: 1;
  visibility: visible;
}

.lightbox-inner {
  position: relative;
  max-width: min(92vw, 1040px);
  width: 100%;
}

.lightbox-inner img {
  width: 100%;
  max-height: 82vh;
  object-fit: cover;
  background: #111;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.18);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}

.lightbox-close {
  top: -50px;
  right: 0;
}

.lightbox-nav.prev {
  left: -58px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav.next {
  right: -58px;
  top: 50%;
  transform: translateY(-50%);
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Планшет і невеликий ноутбук: звужуємо колонки, зберігаючи основну
  візуальну ієрархію desktop-композиції. */
@media (max-width: 1100px) {
  .project-layout,
  .coverage-grid,
  .contact-wrap,
  .about-layout,
  .why-header {
    grid-template-columns: 1fr;
  }

  .project-intro {
    max-width: 620px;
  }

  .project-gallery {
    height: 300px;
  }

  .main-nav {
    gap: 20px;
  }
}

/* Вузький планшет: складаємо основні секції вертикально та показуємо
  мобільне меню. */
@media (max-width: 820px) {
  .header-inner {
    min-height: 74px;
  }

  .nav-toggle {
    display: block;
  }

  .header-actions {
    display: none;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 20px;
    right: 20px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(7, 17, 24, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 20px;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
  }

  .main-nav.is-open {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: 12px 0;
  }

  .hero-inner {
    padding-top: 52px;
    align-items: flex-end;
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero-badge {
    display: none;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .material-logo-row {
    grid-template-columns: 1fr;
  }

  .project-gallery {
    grid-template-columns: 1fr;
    height: auto;
  }

  .gallery-stack {
    grid-template-columns: 1fr 1fr;
    min-height: 0;
    grid-template-rows: repeat(2, 140px);
  }

  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-top,
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Телефон: зменшуємо відступи та складаємо елементи керування і галерею,
  щоб сторінка залишалася читабельною без завеликих вертикальних блоків. */
@media (max-width: 520px) {
  .container {
    width: min(var(--container), calc(100% - 28px));
  }

  .section {
    padding: 64px 0;
  }

  .hero {
    min-height: 430px;
  }

  .hero-inner {
    min-height: 430px;
  }

  .hero-copy {
    padding-top: 8px;
  }

  .hero-copy .eyebrow {
    font-size: 10px;
  }

  .hero-copy h1 {
    font-size: 2.8rem;
  }

  .hero-copy h2 {
    font-size: 2.2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .service-grid,
  .feature-grid,
  .gallery-stack {
    grid-template-columns: 1fr;
  }

  .gallery-stack {
    grid-template-rows: repeat(3, 160px);
    gap: 14px;
  }

  .gallery-item.large {
    min-height: 210px;
  }

  .gallery-stack .gallery-item:last-child {
    grid-column: auto;
  }

  .project-intro .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .lightbox-nav.prev {
    left: 10px;
  }

  .lightbox-nav.next {
    right: 10px;
  }

  .brand {
    min-width: auto;
  }

  .brand-text {
    display: none;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .legal-links {
    flex-direction: column;
    gap: 8px;
  }
}
