:root {
  --bg: #f5efe5;
  --surface: rgba(255, 251, 245, 0.9);
  --text: #202420;
  --muted: #5e645d;
  --line: rgba(32, 36, 32, 0.12);
  --accent: #8a1824;
  --accent-strong: #5e1018;
  --accent-soft: rgba(138, 24, 36, 0.1);
  --shadow: 0 22px 60px rgba(52, 38, 24, 0.14);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --container: min(1180px, calc(100vw - 32px));
  --hero-media-width: min(62%, 460px);
  --project-media-width: min(64%, 520px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(138, 24, 36, 0.08), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(56, 74, 58, 0.12), transparent 24%),
    linear-gradient(180deg, #fbf7f1 0%, var(--bg) 50%, #f4ede1 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image: linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.48), transparent 78%);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.wrap { width: var(--container); margin: 0 auto; }
.site-shell { position: relative; overflow: clip; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  backdrop-filter: blur(18px);
  background: rgba(251, 247, 241, 0.82);
  border-bottom: 1px solid rgba(32, 36, 32, 0.08);
}
.header-row, .footer-row, .section-head, .hero-actions, .form-actions, .footer-links { display: flex; }
.header-row { align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; }
.menu-toggle {
  display: none;
  border: 1px solid rgba(32, 36, 32, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  padding: 0;
  font-weight: 700;
}
.menu-toggle-bars {
  display: inline-grid;
  gap: 5px;
}
.menu-toggle-bars span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.header-nav-contacts {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.header-contacts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.brand { display: flex; gap: 16px; align-items: center; min-width: 0; }
.brand-logo {
  width: 108px;
  height: 108px;
  object-fit: contain;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 16px 30px rgba(50, 30, 20, 0.08);
}
.brand-copy strong, .brand-copy span { display: block; }
.brand-copy strong { font-size: 1.02rem; }
.brand-copy span { color: var(--muted); font-size: 0.94rem; }
.main-nav { display: flex; align-items: center; gap: 20px; color: var(--muted); }
.main-nav a, .footer-links a, .button, .gallery-thumb, .gallery-nav, .lightbox-close {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.main-nav a:hover, .footer-links a:hover, .button:hover, .gallery-thumb:hover, .gallery-nav:hover, .lightbox-close:hover { transform: translateY(-1px); }
.header-phone, .button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 122px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  padding: 12px 18px;
  font-weight: 700;
  box-shadow: 0 16px 30px rgba(94, 16, 24, 0.22);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 700;
  border: 1px solid transparent;
}
.button.secondary { background: rgba(255, 255, 255, 0.74); border-color: var(--line); color: var(--text); }
.hero-section, .section-pad { padding: 42px 0; }
.hero-grid, .contact-grid, .project-grid-list { display: grid; gap: 24px; }
.hero-grid { grid-template-columns: 1.02fr 0.98fr; align-items: stretch; }
.contact-grid { grid-template-columns: 1fr; }
.project-grid-list { grid-template-columns: 1fr; }
.section-head-copy { display: grid; gap: 10px; }
.section-head-actions { display: flex; align-items: center; gap: 12px; }
.section-head {
  margin-bottom: 14px;
  padding: 0 2px;
  align-items: center;
  justify-content: space-between;
}
.section-head h2 {
  letter-spacing: -0.015em;
  line-height: 1.12;
}
.hero-copy, .hero-visual, .glass-card, .lightbox-inner {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.hero-copy, .hero-visual, .glass-card { padding: 28px; }
.hero-copy { display: flex; flex-direction: column; gap: 24px; justify-content: center; }
.eyebrow {
  width: fit-content;
  margin: 0;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(32, 36, 32, 0.08);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.eyebrow-dark { background: rgba(138, 24, 36, 0.08); color: var(--accent-strong); }
h1, h2, h3, p { margin: 0; }
.no-wrap { white-space: nowrap; }
h1 { font-size: clamp(2.7rem, 4vw, 4.9rem); line-height: 0.96; letter-spacing: -0.05em; max-width: 12ch; }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.6rem); line-height: 1.04; letter-spacing: -0.03em; }
.hero-lead, .section-head p, .contact-list span, #contactHint, .footer-row p { color: var(--muted); line-height: 1.7; }
.hero-actions, .form-actions { gap: 12px; flex-wrap: wrap; }
.footer-links { gap: 12px; flex-wrap: nowrap; }
.service-pills, .contact-list, .gallery-thumbs { display: grid; gap: 14px; }
.service-pills { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.service-pill, .contact-row {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(32, 36, 32, 0.08);
}
.service-pill { padding: 14px 16px; font-weight: 700; text-align: center; }
.hero-visual { display: grid; gap: 16px; }
.hero-logo-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  padding: 14px;
  align-items: center;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(138, 24, 36, 0.08), rgba(255, 255, 255, 0.78));
}
.hero-logo-card h2 {
  font-size: clamp(1.6rem, 2.1vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  word-break: normal;
}
.hero-partner-copy {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 1.02rem;
  font-weight: 500;
}
.hero-logo { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 24px; background: rgba(255, 255, 255, 0.9); }
.hero-image-card {
  width: var(--hero-media-width);
  margin-inline: auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #ded5ca;
}
.hero-image-card img, .gallery-main img, .lightbox-inner img { width: 100%; height: 100%; object-fit: cover; }
.hero-image-card img {
  object-fit: contain;
  object-position: center;
  background: #ded5ca;
}
.gallery-main img { cursor: zoom-in; }
.project-carousel-card { display: grid; gap: 18px; }
.project-card-head { display: grid; gap: 10px; }
.gallery-main {
  width: var(--project-media-width);
  margin-inline: auto;
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #ded5ca;
}
.gallery-expand-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.9);
  color: #1c211c;
  box-shadow: 0 8px 18px rgba(22, 24, 22, 0.22);
}
.gallery-expand-button:hover { transform: translateY(-1px); }
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: #fff;
  background: rgba(22, 24, 22, 0.7);
}
.gallery-nav.prev { left: 16px; }
.gallery-nav.next { right: 16px; }
.gallery-thumbs {
  width: var(--project-media-width);
  margin-inline: auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.gallery-thumb { padding: 0; border: 2px solid transparent; overflow: hidden; border-radius: 18px; background: #e1d8cb; aspect-ratio: 4 / 3; }
.gallery-thumb.active { border-color: rgba(138, 24, 36, 0.64); box-shadow: 0 10px 24px rgba(138, 24, 36, 0.14); }
.contact-list { margin-top: 20px; }
.contact-row { display: flex; gap: 14px; align-items: flex-start; padding: 16px; }
.contact-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  flex: 0 0 auto;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}
.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.contact-form label { display: grid; gap: 8px; font-weight: 700; }
.contact-form input, .contact-form textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(32, 36, 32, 0.12);
  background: rgba(255, 255, 255, 0.86);
  padding: 12px 14px;
  color: var(--text);
  resize: vertical;
}
.full-width { grid-column: 1 / -1; }
.form-actions { align-items: center; }
.site-footer { padding: 14px 0 48px; }
.footer-row { justify-content: space-between; align-items: flex-start; gap: 16px; color: var(--muted); flex-wrap: nowrap; }
.footer-row > div:first-child { flex: 0 0 auto; }
.footer-links { align-items: center; flex: 0 0 auto; white-space: nowrap; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 22, 20, 0.72);
  backdrop-filter: blur(12px);
}
.lightbox.open { display: flex; }
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 22, 20, 0.6);
  backdrop-filter: blur(12px);
}
.contact-modal.open { display: flex; }
.contact-modal-inner {
  position: relative;
  width: min(760px, calc(100vw - 20px));
}
.contact-form-modal {
  margin-top: 20px;
}
.lightbox-inner { position: relative; width: min(1100px, calc(100vw - 20px)); padding: 14px; }
.lightbox-inner img { max-height: calc(100vh - 60px); object-fit: contain; background: #111614; border-radius: 24px; }
.lightbox-close {
  position: absolute;
  top: 26px;
  right: 26px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  font-size: 1.4rem;
}
.reveal { opacity: 0; transform: translateY(16px); animation: fadeUp 0.7s ease forwards; }
.reveal-delay-1 { animation-delay: 0.08s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1080px) {
  .hero-grid, .contact-grid { grid-template-columns: 1fr; }
  :root {
    --hero-media-width: min(72%, 560px);
    --project-media-width: min(74%, 620px);
  }
}
body.projects-page {
  --project-media-width: min(100%, 920px);
}
body.projects-page .project-grid-list {
  gap: 32px;
}
body.projects-page .project-carousel-card {
  width: min(100%, 1100px);
  margin-inline: auto;
}
@media (max-width: 760px) {
  .header-row {
    position: relative;
    align-items: flex-start;
    padding-right: 56px;
  }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 10px;
    right: 0;
    z-index: 41;
  }
  .menu-toggle.open .menu-toggle-bars span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .menu-toggle.open .menu-toggle-bars span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.open .menu-toggle-bars span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .menu-toggle-bars span {
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform-origin: center;
  }
  .header-nav-contacts {
    width: min(360px, calc(100vw - 24px));
    display: none;
    position: absolute;
    top: 58px;
    right: 0;
    z-index: 160;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(32, 36, 32, 0.12);
    background: rgba(251, 247, 241, 0.98);
    box-shadow: 0 16px 30px rgba(32, 36, 32, 0.12);
    backdrop-filter: blur(10px);
  }
  .header-nav-contacts.open { display: flex; }
  .main-nav,
  .header-contacts {
    width: 100%;
  }
  .main-nav {
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(32, 36, 32, 0.08);
  }
  .header-contacts {
    gap: 8px;
    flex-wrap: wrap;
  }
  .header-contacts { justify-content: flex-start; }
  .section-head {
    align-items: flex-start;
  }
  .section-head-actions {
    width: 100%;
  }
  .section-head-actions .button {
    width: 100%;
  }
}
@media (max-width: 820px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 120;
  }
  .section-head { flex-direction: column; align-items: flex-start; }
  .main-nav { flex-wrap: wrap; }
  .hero-copy, .hero-visual, .glass-card { padding: 20px; }
  .service-pills, .gallery-thumbs, .contact-form { grid-template-columns: 1fr; }
  .hero-logo-card { grid-template-columns: 1fr; }
  .brand { align-items: flex-start; }
  .brand-logo { width: 92px; height: 92px; }
  .hero-logo { max-width: 220px; }
  .header-phone { width: auto; justify-content: center; }
  .hero-image-card,
  .gallery-main,
  .gallery-thumbs {
    width: 100%;
    max-width: 100%;
  }
}