:root {
  --bg: #ffffff;
  --bg-soft: #faf8f4;
  --card: #ffffff;
  --text: #4a423a;
  --muted: #6f665c;
  --heading: #7d6a4f;
  --line: rgba(125, 106, 79, 0.22);
  --line-soft: rgba(125, 106, 79, 0.12);
  --accent: #8a7658;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

[id] { scroll-margin-top: 90px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.55;
}

img { max-width: 100%; }

.container {
  width: min(1180px, 90%);
  margin: 0 auto;
}

.container.narrow {
  width: min(820px, 90%);
}

/* ---------- Типографика ---------- */

.display-title,
.section-title,
.svc-card h3,
.work-card h3,
.why-item h3,
.stage-item h3,
.team-card h3,
.modal__dialog h3,
.footer-brand {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--heading);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.25;
  margin: 0;
}

.display-title {
  font-size: clamp(1.7rem, 4.4vw, 3rem);
  letter-spacing: 0.025em;
  margin-bottom: 22px;
}

.section-title {
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
  letter-spacing: 0.025em;
  text-align: center;
  margin-bottom: 18px;
}

.section-title_left {
  text-align: left;
}

.section-sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 34px;
}

p { color: var(--muted); margin: 0 0 14px; }

.lead-center {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--heading);
  text-align: center;
  margin: 0 0 28px;
}

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 248, 244, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.header-wrap {
  min-height: 76px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  grid-column: 2;
}

.brand-mark-link {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  line-height: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.brand-text {
  display: grid;
  text-align: center;
  line-height: 1.2;
}

.brand-text strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: var(--heading);
  text-transform: uppercase;
}

.brand-text em {
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.nav-toggle {
  grid-column: 1;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--heading);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.main-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 5% 22px;
  background: rgba(250, 248, 244, 0.99);
  border-bottom: 1px solid var(--line-soft);
}

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

.main-nav a {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--heading);
  text-decoration: none;
  padding: 11px 10px;
}

/* ---------- Первый экран ---------- */

.hero-media {
  height: min(74vh, 660px);
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
  display: block;
}

.hero-caption {
  background: var(--bg-soft);
  text-align: center;
  padding: 46px 0 52px;
}

.hero-lead {
  max-width: 640px;
  margin: 0 auto 12px;
  font-size: 1rem;
}

.hero-caption .btn { margin-top: 18px; }

/* ---------- Секции ---------- */

.section { padding: 70px 0; }
.section-alt { background: var(--bg-soft); }

/* ---------- Почему мы ---------- */

.why-grid {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 40px;
  align-items: start;
}

.why-list {
  display: grid;
  gap: 30px;
}

.why-item h3 {
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.why-item p { margin: 0; font-size: 0.97rem; }

.why-media {
  display: grid;
  gap: 16px;
}

.why-media img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

/* ---------- Слайдеры ---------- */

.slider {
  position: relative;
  width: min(1180px, 90%);
  margin: 0 auto;
}

.slider-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.slider-track::-webkit-scrollbar { display: none; }

.svc-card,
.work-card {
  flex: 0 0 calc((100% - 40px) / 3);
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  text-align: center;
  padding-bottom: 24px;
}

.svc-card img,
.work-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  margin-bottom: 20px;
}

.svc-card h3,
.work-card h3 {
  font-size: clamp(1rem, 2.2vw, 1.625rem);
  padding: 0 20px;
  margin-bottom: 14px;
}

.svc-card p,
.work-card p {
  padding: 0 20px;
  font-size: 1rem;
  line-height: 1.55;
  margin-bottom: 24px;
}

.svc-card .btn {
  margin: auto auto 0;
}

.slider-nav {
  position: absolute;
  top: 130px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--heading);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  transition: background 0.2s ease;
}

.slider-nav:hover { background: #ffffff; }
.slider-nav_prev { left: -18px; }
.slider-nav_next { right: -18px; }

/* Услуги идут вниз; листаются только фотографии внутри каждой услуги. */
#services-home .slider {
  width: min(820px, 90%);
}

#services-home .js-svc-track {
  display: grid;
  gap: clamp(48px, 7vw, 84px);
  overflow: visible;
  scroll-snap-type: none;
  padding-bottom: 0;
}

#services-home .svc-card {
  width: 100%;
  flex: none;
  scroll-snap-align: none;
}

#services-home .svc-card_no-media {
  min-height: 0;
  padding: clamp(34px, 6vw, 58px) 0;
}

#services-home .js-svc-prev,
#services-home .js-svc-next {
  display: none;
}

.service-gallery {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.service-gallery__track {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: auto;
}

.service-gallery__track::-webkit-scrollbar { display: none; }

.service-gallery__track img,
.svc-card .service-gallery__track img {
  flex: 0 0 100%;
  width: 100%;
  height: clamp(260px, 48vw, 460px);
  object-fit: cover;
  display: block;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.service-gallery__nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 56px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  background: rgba(255, 255, 255, 0.82);
  color: var(--heading);
  font-family: var(--serif);
  font-size: 2.25rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.service-gallery__nav_prev { left: 0; }
.service-gallery__nav_next { right: 0; }

/* ---------- Сетки на внутренних страницах ---------- */

.svc-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 26px;
}

.svc-grid .svc-card,
.gallery-grid .work-card {
  flex: none;
}

.page-head {
  text-align: center;
  margin-bottom: 8px;
}

/* ---------- Цены ---------- */

.price-photo { margin-bottom: 26px; }

.price-photo img {
  width: 100%;
  height: clamp(240px, 42vw, 420px);
  object-fit: cover;
  display: block;
}

.price-copy { text-align: center; }

.price-copy ul {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  color: var(--muted);
}

.price-copy li { margin-bottom: 6px; }
.price-copy li::before { content: "• "; color: var(--accent); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

/* ---------- Этапы работ ---------- */

.stages-grid {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: 40px;
  align-items: start;
  margin-top: 26px;
}

.stages-list { display: grid; gap: 26px; }

.stage-item h3 {
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.stage-item p { margin: 0; font-size: 0.94rem; }

.stages-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stages-media img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
}

.stages-media img:last-child {
  grid-column: 1 / -1;
  height: 300px;
}

/* ---------- Сотрудники ---------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  max-width: 760px;
  margin: 0 auto;
}

.team-card {
  background: transparent;
  border: 0;
  text-align: left;
}

.team-card__photo {
  height: 330px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--bg-soft);
}

.team-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.team-card h3 {
  font-size: 1.08rem;
  letter-spacing: 0.02em;
  margin: 20px 0 8px;
}

.team-card p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--accent);
}

/* ---------- Контакты и формы ---------- */

.contact-points {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  text-align: center;
  color: var(--muted);
}

.contact-points li { margin-bottom: 6px; }
.contact-points li::before { content: "• "; color: var(--accent); }

.contact-form {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--card);
  padding: 30px;
  max-width: 560px;
  margin: 0 auto;
}

.contact-form label,
.popup-form label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea,
.popup-form input,
.popup-form textarea {
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  font-size: 0.97rem;
}

.contact-form input:focus,
.contact-form textarea:focus,
.popup-form input:focus,
.popup-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form .btn,
.popup-form .btn {
  display: flex;
  margin: 6px auto 0;
}

.form-message {
  min-height: 20px;
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.9rem;
}

/* ---------- Кнопки ---------- */

.btn {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 13px 34px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--heading);
}

.btn-outline:hover {
  background: rgba(138, 118, 88, 0.1);
  border-color: var(--accent);
  color: var(--heading);
}

/* ---------- Подвал ---------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  background: var(--bg-soft);
  padding: 40px 0;
}

.footer-wrap { text-align: center; }

.footer-brand {
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.footer-meta { font-size: 0.88rem; margin: 4px 0; }

.footer-phone {
  display: inline-block;
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--heading);
  text-decoration: none;
  margin: 10px 0;
}

/* ---------- Плавающие кнопки ---------- */

.floating-phone {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: grid;
  gap: 2px;
  text-align: center;
  color: var(--heading);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 11px 24px;
  cursor: pointer;
  transition: background 0.25s ease;
}

.floating-phone:hover { background: rgba(255, 255, 255, 0.92); }
.floating-phone span { font-size: 0.72rem; color: var(--muted); }
.floating-phone strong { font-size: 0.98rem; font-weight: 500; }

.mobile-actions { display: none; }

/* ---------- Модальное окно ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
}

.modal.is-open { display: block; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(48, 42, 35, 0.55);
  backdrop-filter: blur(3px);
}

.modal__dialog {
  position: relative;
  width: min(500px, calc(100% - 28px));
  margin: 7vh auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 30px;
  text-align: center;
  animation: modalIn 0.25s ease;
}

.modal__dialog h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.modal__close {
  position: absolute;
  right: 14px;
  top: 10px;
  font-size: 1.6rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.popup-form { display: grid; gap: 4px; text-align: left; }

@keyframes modalIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------- Появление ---------- */

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

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

/* ---------- Планшет ---------- */

@media (max-width: 1024px) {
  .svc-card,
  .work-card { flex: 0 0 calc((100% - 20px) / 2); }
  .svc-grid,
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .slider-nav_prev { left: -10px; }
  .slider-nav_next { right: -10px; }
}

/* ---------- Мобильные ---------- */

@media (max-width: 760px) {
  .section { padding: 64px 0; }

  #services-home .js-svc-track { gap: 52px; }

  #services-home .svc-card_no-media {
    padding: 38px 0;
  }

  .svc-card p,
  .work-card p {
    font-size: 16px;
    line-height: 25px;
  }

  .why-grid,
  .stages-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .why-media { grid-template-columns: 1fr 1fr; }
  .why-media img { height: 200px; }

  .stages-media { grid-template-columns: 1fr 1fr; }
  .stages-media img { height: 175px; }
  .stages-media img:last-child { height: 240px; }

  .section-title_left { text-align: center; }

  .svc-card,
  .work-card { flex: 0 0 86%; }

  .svc-card img,
  .work-card img { height: 240px; }

  .slider-nav { display: none; }

  .svc-grid,
  .gallery-grid { grid-template-columns: 1fr; }

  .team-grid {
    grid-template-columns: 1fr 1fr;
    max-width: none;
    gap: 12px;
  }

  .team-card__photo {
    height: 210px;
    border-radius: 12px;
  }

  .team-card h3 {
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    margin: 12px 0 5px;
  }

  .team-card p { font-size: 0.82rem; }

  .contact-form { padding: 22px; }

  .hero-media { height: 52vh; }
  .hero-caption { padding: 34px 0 40px; }

  .floating-phone { display: none; }

  .mobile-actions {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 80;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .mobile-actions__btn {
    text-align: center;
    text-decoration: none;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    padding: 13px 10px;
    border-radius: 999px;
    color: var(--heading);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
    border: 1px solid var(--accent);
  }

  body { padding-bottom: 74px; }
}
