/* ===== Базовые стили ===== */
:root {
  --color-bg: #f8f5f2;
  --color-surface: #ffffff;
  --color-text: #1f1f1f;
  --color-text-muted: #66615c;
  --color-accent: #8a645f;
  --color-accent-hover: #75514d;
  --color-border: #e7dfd8;
  --color-link: #1a5fb4;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --space-unit: 8px;
  --space-xs: calc(var(--space-unit) * 1);
  --space-sm: calc(var(--space-unit) * 2);
  --space-md: calc(var(--space-unit) * 3);
  --space-lg: calc(var(--space-unit) * 4);
  --space-xl: calc(var(--space-unit) * 6);
  --space-2xl: calc(var(--space-unit) * 8);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --max-width: 1120px;
}

/* ===== Ключевые кадры для динамики ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes lineIn {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes lineInCenter {
  from { transform: translateX(-50%) scaleX(0); }
  to { transform: translateX(-50%) scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .hero-content,
  .hero-content p,
  .hero-buttons,
  .section,
  .section.visible h2::after,
  .section.visible .service,
  .section#reviews.visible .reviews-intro,
  .section#reviews.visible .reviews-cta {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body > * {
  max-width: 100%;
}

html::-webkit-scrollbar:horizontal,
body::-webkit-scrollbar:horizontal,
*::-webkit-scrollbar:horizontal {
  height: 0;
}

* {
  box-sizing: border-box;
}

/* Ссылка «Перейти к содержимому» для SEO и доступности (видна при фокусе с клавиатуры) */
.skip-link {
  position: absolute;
  top: 0;
  left: var(--space-md);
  z-index: 1000;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-140%);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.skip-link:focus {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(var(--space-md));
  outline: 2px solid #fff;
  outline-offset: 2px;
}

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

.container {
  width: 92%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ===== Шапка ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--color-border);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 12px 30px rgba(31, 31, 31, 0.08);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  padding: 14px 0 0;
  gap: 10px var(--space-lg);
}

.header-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  max-width: 360px;
}

.header-brand:hover .brand-name {
  color: var(--color-accent);
}

.brand-name {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1.15;
  transition: color 0.2s ease;
}

.header-meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm) var(--space-md);
  font-size: 0.78rem;
  color: var(--color-text);
}

.header-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text);
  white-space: nowrap;
}

.header-meta-item::before {
  content: "";
  width: 14px;
  height: 14px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.header-meta-item-location::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 6.5-9 12-9 12S3 16.5 3 10a9 9 0 1 1 18 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

.header-meta-item-phone::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.86 19.86 0 0 1-8.63-3.07A19.5 19.5 0 0 1 5.15 12.8 19.86 19.86 0 0 1 2.08 4.09 2 2 0 0 1 4.06 2h3a2 2 0 0 1 2 1.72c.12.89.33 1.77.61 2.62a2 2 0 0 1-.45 2.11L8 9.59a16 16 0 0 0 6.41 6.41l1.14-1.22a2 2 0 0 1 2.11-.45c.85.28 1.73.49 2.62.61A2 2 0 0 1 22 16.92Z'/%3E%3C/svg%3E");
}

.header-meta-item-hours::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a645f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 3'/%3E%3C/svg%3E");
}

.header-meta-item-phone,
.header-meta-item-phone:hover,
.header-meta-item-phone:focus,
.header-meta-item-phone:visited {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
}

.header-meta-item-hours {
  color: var(--color-text-muted);
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-column: 1 / -1;
  gap: var(--space-xs) 24px;
  padding: 12px 0 14px;
  border-top: 1px solid var(--color-border);
}

.header-nav a {
  font-size: 0.76rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.header-nav a:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ===== Секции ===== */
.section {
  padding: var(--space-2xl) 0;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.section.visible h2::after {
  animation: lineIn 0.5s ease-out 0.2s both;
  transform-origin: left;
}

.section-intro.visible h2::after {
  animation: lineInCenter 0.5s ease-out 0.2s both;
  transform-origin: center;
}

.section.visible .service {
  animation: fadeInUp 0.45s ease-out both;
}

.section.visible .service:nth-child(1) { animation-delay: 0.08s; }
.section.visible .service:nth-child(2) { animation-delay: 0.16s; }
.section.visible .service:nth-child(3) { animation-delay: 0.24s; }
.section.visible .service:nth-child(4) { animation-delay: 0.32s; }
.section.visible .service:nth-child(5) { animation-delay: 0.4s; }
.section.visible .service:nth-child(6) { animation-delay: 0.48s; }

.section#reviews.visible .reviews-intro {
  animation: fadeInUp 0.5s ease-out 0.1s both;
}

.section#reviews.visible .reviews-cta {
  animation: fadeInUp 0.5s ease-out 0.25s both;
}

.section-intro {
  background: var(--color-surface);
  text-align: center;
}

.section-intro .history-content {
  max-width: 680px;
  margin: 0 auto;
  text-align: left;
}

.section-intro .history-content p {
  margin-bottom: var(--space-md);
  color: var(--color-text-muted);
}

.section-intro .history-content p:last-child {
  margin-bottom: 0;
}

.section-alt {
  background: var(--color-surface);
}

.section h2 {
  font-size: 1.625rem;
  font-weight: 700;
  margin: 0 0 var(--space-lg);
  color: var(--color-text);
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: var(--space-sm);
}

.section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
}

.section-intro h2::after {
  left: 50%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.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);
}

nav a:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ===== Hero ===== */
.hero {
  min-height: 76vh;
  background: url("png/case-4.jpg") center/cover no-repeat;
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18, 18, 18, 0.76) 0%, rgba(18, 18, 18, 0.56) 42%, rgba(18, 18, 18, 0.18) 100%);
}

.hero-shell {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  min-height: inherit;
}

.hero-content {
  position: relative;
  color: #fff;
  max-width: 680px;
  padding: 96px 0 88px;
  animation: fadeInUp 0.8s ease-out 0.2s both;
  text-align: left;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0 0 var(--space-md);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-content p {
  animation: fadeInUp 0.8s ease-out 0.35s both;
}

.hero-buttons {
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 800;
  margin: 0 0 var(--space-md);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 18px rgba(0,0,0,0.25);
}

.hero-lead {
  font-size: 1.0625rem;
  margin: 0;
  max-width: 600px;
  opacity: 0.96;
  line-height: 1.7;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.hero-points span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.875rem;
  line-height: 1.3;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: flex-start;
  margin-top: var(--space-xl);
}

.hero-buttons .button {
  text-decoration: none;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.button-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.95);
  border-radius: 999px;
}

.button-outline:hover {
  background: #fff;
  color: var(--color-text);
  transform: translateY(-2px);
}

/* Кнопки */
button {
  background: var(--color-accent);
  border: none;
  padding: 14px 22px;
  color: #fff;
  cursor: pointer;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease;
}

button:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

/* ===== О докторе ===== */
.about {
  display: flex;
  gap: var(--space-xl);
  align-items: center;
}

.about-photo {
  flex-shrink: 0;
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.about img {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease;
}

.about-photo img {
  max-width: 400px;
}

.about img:hover {
  transform: scale(1.015);
}

.about-text h2 {
  margin-top: 0;
}

.about-text p {
  margin: 0 0 var(--space-md);
  color: var(--color-text-muted);
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* ===== Услуги ===== */
.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

.service {
  background: var(--color-surface);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}

.service::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(138, 100, 95, 0.95), rgba(138, 100, 95, 0.15));
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.service:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  border-color: rgba(139, 107, 122, 0.25);
}

.service h3 {
  margin: 0 0 var(--space-sm);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text);
}

.service p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ===== Цены ===== */
.price-intro {
  margin: 0 0 var(--space-lg);
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  max-width: 640px;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
  align-items: stretch;
}

.price-block {
  margin-bottom: 0;
  padding: var(--space-lg);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 320px;
  height: 100%;
}

.price-category {
  margin: 0 0 var(--space-sm);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* Горизонтальная прокрутка блока цен на узких экранах */
.price-table-scroll {
  overflow-x: hidden;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding-right: 0;
  flex: 1;
}

.price-block.is-collapsible .price-table-scroll {
  max-height: 224px;
  mask-image: linear-gradient(to bottom, #000 0 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0 82%, transparent 100%);
}

.price-block.is-expanded .price-table-scroll {
  max-height: 720px;
  mask-image: none;
  -webkit-mask-image: none;
}

.price-toggle {
  margin-top: var(--space-md);
  align-self: flex-start;
  border: 1px solid rgba(138, 100, 95, 0.18);
  background: rgba(138, 100, 95, 0.08);
  color: var(--color-accent);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.price-toggle:hover {
  background: rgba(138, 100, 95, 0.14);
  border-color: rgba(138, 100, 95, 0.28);
  transform: translateY(-1px);
}

.price-table {
  width: 100%;
  min-width: 0;
  max-width: none;
  border-collapse: collapse;
  font-size: 0.9375rem;
  table-layout: fixed;
}

.price-table td {
  padding: var(--space-sm) var(--space-md) var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  word-break: break-word;
}

.price-table td:last-child {
  white-space: nowrap;
  text-align: right;
  color: var(--color-text);
  font-weight: 500;
}

.price-table tr:last-child td {
  border-bottom: 0;
}

.price-note {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-top: var(--space-lg);
}

.price-note a {
  color: var(--color-link);
  text-decoration: none;
}

.price-note a:hover {
  text-decoration: underline;
}

/* ===== Отзывы (ссылка на Яндекс.Карты) ===== */
.reviews-intro {
  margin: 0 0 var(--space-md);
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  max-width: 560px;
}

.reviews-cta {
  margin-bottom: var(--space-md);
}

.btn-reviews-yandex {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: #fc3f1d;
  color: #fff !important;
  text-decoration: none;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 14px rgba(252, 63, 29, 0.35);
}

.btn-reviews-yandex:hover {
  background: #e63818;
  color: #fff;
  transform: translateY(-2px);
}

.btn-reviews-icon {
  font-size: 1.25rem;
}

.reviews-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* Отступ при прокрутке к якорям — секция не уезжает под шапку */
#main,
#history,
#about,
#services,
#works-preview,
#price,
#reviews,
#contacts {
  scroll-margin-top: 100px;
}

/* ===== Блок «Наши работы» (превью) ===== */
.section-works-preview {
  background: var(--color-surface);
}

.works-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.works-preview-header h2 {
  margin: 0;
}

.works-preview-intro {
  max-width: 640px;
  margin: 10px 0 0;
  color: var(--color-text-muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

.works-preview-all {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.works-preview-all:hover {
  color: var(--color-accent);
}

.works-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.works-preview-grid--6 {
  grid-template-columns: repeat(3, 1fr);
}

.works-preview-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.works-preview-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.works-preview-card:hover .works-preview-card-img-wrap img {
  transform: scale(1.04);
}

.works-preview-card-img-wrap {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg);
}

.works-preview-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.works-preview-card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--space-md) var(--space-md) var(--space-sm);
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.25) 50%, transparent);
  color: #fff;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-sm);
}

.works-preview-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.works-preview-card-count {
  font-size: 0.75rem;
  opacity: 0.9;
}

.works-preview-card-name {
  font-size: 1rem;
  font-weight: 700;
}

.works-preview-card-meta {
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.95;
}

.works-preview-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
}

.works-preview-card-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

/* ===== Страница галереи (gallery.html) ===== */
.gallery-page {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.gallery-header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
}

.gallery-intro {
  max-width: 760px;
  margin: 0 0 var(--space-xl);
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.gallery-back {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.gallery-back:hover {
  color: var(--color-accent);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.gallery-case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
}

.gallery-item {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg);
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-item--video video {
  object-fit: contain;
  background: var(--color-bg);
}

.gallery-item figcaption {
  padding: var(--space-md);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ===== Страница кейса ===== */
.case-page {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.case-breadcrumbs {
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.case-breadcrumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.case-breadcrumbs a:hover {
  color: var(--color-accent);
}

.case-header {
  margin-bottom: var(--space-xl);
}

.case-header h1 {
  margin: 0 0 var(--space-sm);
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.case-header p {
  max-width: 760px;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1rem;
}

.case-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 340px;
  gap: var(--space-xl);
  align-items: start;
}

.case-thumbs {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.case-thumb {
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.case-thumb:hover,
.case-thumb.is-active {
  border-color: rgba(138, 100, 95, 0.4);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.case-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.case-main {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
}

.case-main img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.case-main figcaption {
  padding: var(--space-md);
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.case-panel {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.case-panel h2 {
  margin: 0 0 var(--space-md);
  font-size: 1.125rem;
}

.case-panel p {
  margin: 0 0 var(--space-md);
  color: var(--color-text-muted);
}

.case-panel p:last-of-type {
  margin-bottom: 0;
}

.case-badge {
  display: inline-flex;
  margin-bottom: var(--space-md);
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(138, 100, 95, 0.1);
  color: var(--color-accent);
  font-size: 0.8125rem;
  font-weight: 600;
}

.case-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.case-actions .btn-contact-primary,
.case-actions .btn-contact-secondary,
.case-actions .btn-route {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.case-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-xl);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
}

.case-back:hover {
  color: var(--color-accent);
}

/* ===== Контакты ===== */
.section-contacts .contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: stretch;
  max-width: 980px;
  margin: 0 auto;
}

.contacts-label {
  margin: 0 0 var(--space-xs);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.contacts-title {
  margin: 0 0 var(--space-md);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.section-contacts .contacts-title::after {
  display: none;
}

.contacts-desc {
  margin: 0 0 var(--space-md);
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.contacts-meta {
  margin: 0 0 var(--space-lg);
  font-size: 0.9375rem;
  color: var(--color-text);
}

.contacts-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.btn-contact-primary,
.btn-contact-secondary,
.btn-route {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-contact-primary {
  background: var(--color-accent);
  border: 2px solid var(--color-accent);
  color: #fff;
}

.btn-contact-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn-contact-secondary,
.btn-route {
  border: 2px solid var(--color-link);
  background: transparent;
  color: var(--color-link);
}

.btn-contact-secondary:hover,
.btn-route:hover {
  background: var(--color-link);
  color: #fff;
  transform: translateY(-1px);
}

/* Страница «Спасибо» после отправки формы */
.thank-you-section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}
.thank-you-card {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}
.thank-you-title {
  margin: 0 0 var(--space-md);
  font-size: 1.5rem;
  color: var(--color-text);
}
.thank-you-text {
  margin: 0 0 var(--space-lg);
  color: var(--color-text-muted);
  line-height: 1.6;
}
.thank-you-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.contacts-form-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
}

.contacts-form-card--yandex .yandex-form-iframe {
  display: block;
  min-height: 380px;
  border-radius: var(--radius-sm);
}

.request-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: none;
}

.request-form .form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: -6px;
}

.form-required {
  color: var(--color-accent);
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.form-checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.form-submit {
  margin-top: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.form-submit:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: none;
}

input,
textarea {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 112px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(139, 107, 122, 0.15);
}

.form-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0;
  line-height: 1.5;
}

.form-note code {
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75em;
}

/* ===== Карта (на всю ширину) ===== */
.map-section {
  padding: 0;
  background: #fff;
}

.map-wrap {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.map-wrap--full {
  margin-top: 0;
  padding-top: var(--space-xl);
  border-top: 0;
  width: 100%;
  max-width: none;
  background: #fff;
}

.map-wrap--full .map-title.container {
  width: 92%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--space-md);
  margin-bottom: var(--space-md);
  text-align: center;
}

.map-wrap--full .map-container {
  width: 100%;
  border-radius: 0;
  box-shadow: none;
}

.map-wrap--full .map-container iframe {
  height: 420px;
  border-radius: 0;
}

.map-wrap--full .map-caption.container {
  width: 92%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding: var(--space-md) var(--space-md) var(--space-xl);
}

.map-title {
  margin: 0 0 var(--space-md);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
}

.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #fff;
}

.map-container iframe {
  display: block;
  width: 100%;
  height: 400px;
  border: 0;
  border-radius: var(--radius-lg);
}

.map-caption {
  margin: var(--space-sm) 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.map-caption a {
  color: var(--color-link);
  text-decoration: none;
}

.map-caption a:hover {
  text-decoration: underline;
}

/* ===== Подвал ===== */
footer {
  padding: var(--space-lg) 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

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

.footer-copy {
  margin: 0 0 var(--space-xs);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.footer-policy {
  margin: 0;
  font-size: 0.875rem;
}

.footer-policy a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-policy a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* ===== Адаптив ===== */
@media (max-width: 900px) {
  .header-inner {
    display: flex;
    padding: var(--space-md) 0;
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .nav-toggle {
    display: flex;
    order: 3;
    margin-left: auto;
  }

  .nav-menu {
    display: none;
    flex: none;
    margin-right: 0;
    margin-left: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-xs);
    order: 5;
  }

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

  .header-brand {
    order: 1;
    max-width: none;
    width: 100%;
  }

  .header-meta {
    order: 2;
    width: 100%;
    gap: var(--space-xs) var(--space-md);
  }

  .nav-menu a {
    padding: var(--space-md) var(--space-md);
    margin: 0 calc(-1 * var(--space-md));
    border-radius: 0;
  }

  .hero {
    min-height: auto;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-buttons .button,
  .hero-buttons button {
    width: 100%;
    max-width: 280px;
    min-height: 48px;
  }
}

@media (max-width: 1100px) {
  .services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .price-grid {
    grid-template-columns: 1fr;
  }

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

  .case-layout {
    grid-template-columns: 140px minmax(0, 1fr);
  }

  .case-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 800px) {
  .section {
    padding: var(--space-xl) 0;
  }

  .hero-content {
    padding: 72px 0 64px;
  }

  .hero-points {
    flex-direction: column;
    align-items: flex-start;
  }

  .works-preview-grid {
    grid-template-columns: 1fr;
  }

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

  .about {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .about img {
    max-width: 100%;
  }

  .services {
    grid-template-columns: 1fr;
  }

  .reviews {
    flex-direction: column;
  }

  .review {
    min-width: 0;
  }

  .section-contacts .contacts-grid {
    grid-template-columns: 1fr;
  }

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

  .case-layout {
    grid-template-columns: 1fr;
  }

  .case-thumbs {
    flex-direction: row;
  }

  .case-thumb {
    flex: 1;
  }

  .map-container iframe,
  .map-wrap--full .map-container iframe {
    height: 320px;
  }
}

@media (max-width: 480px) {
  .container {
    width: 96%;
    padding: 0 var(--space-sm);
  }

  .brand-name {
    font-size: 0.96rem;
  }

  .header-meta {
    font-size: 0.75rem;
  }

  .header-nav {
    gap: 0;
  }

  .section h2 {
    font-size: 1.375rem;
  }

  .price-table td {
    padding: var(--space-xs) var(--space-sm) var(--space-xs) 0;
    font-size: 0.875rem;
  }
}

/* Очень узкие экраны (например 320–360px) */
@media (max-width: 360px) {
  body {
    font-size: 15px;
  }

  .container {
    width: 94%;
    padding: 0 var(--space-xs);
  }

  .hero h1 {
    font-size: 1.375rem;
  }

  .hero-buttons .button,
  .hero-buttons button {
    max-width: 100%;
  }

  .map-wrap--full .map-caption.container,
  .map-wrap--full .map-title.container {
    width: 94%;
    padding-left: var(--space-xs);
    padding-right: var(--space-xs);
  }
}

