:root {
  --lp-bg-soft: #f6efe7;
  --lp-primary: #0d6efd;
  --lp-primary-hover: #fff;
  --lp-text: #2f2a25;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  color: var(--lp-text);
  padding: 12px 2.5%; /* небольшой внутренний отступ для всей страницы */
}

.bg-soft { background: var(--lp-bg-soft); }

.btn {
  --bs-btn-padding-y: 0.75rem;
}

.btn-primary {
  --bs-btn-bg: var(--lp-primary);
  --bs-btn-border-color: var(--lp-primary);
}

/* Hero */
.hero { min-height: 700px; }
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(105%) contrast(102%);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.25) 40%, rgba(0, 0, 0, 0.9) 100%);
}

/* Before / After */
.ba-wrapper { max-width: 960px; margin: 0 auto; }
.ba-media { position: relative; border-radius: 12px; overflow: hidden; background: #000; }
.ba-media img, .ba-media video { display: block; width: 100%; height: auto; }
.ba-before { display: block; }
.ba-after { position: absolute; inset: 0; width: 50%; pointer-events: none; }
.ba-after video { width: 100%; height: 100%; object-fit: cover; }
.ba-range {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  width: 60%; margin: 0 auto;
}

/* Upload */
.upload-zone {
  border: 2px dashed rgba(0,0,0,0.1);
  border-radius: 12px;
  background: #fff;
}
.upload-zone.dragover {
  border-color: var(--lp-primary);
  background: #fff8f0;
}

/* Upload: preview list */
.upload-selected { display: block; }
.upload-item { border: 0; }
.upload-thumb {
  width: 112px;
  height: 112px;
  object-fit: cover;
  flex: 0 0 112px;
  background: #f2f2f2;
}
.quick-presets .btn { padding: 4px 10px; }
.quick-presets .btn:hover,
.quick-presets .btn:focus {
  background: var(--lp-primary);
  border-color: var(--lp-primary);
  color: #fff;
}
.price { font-weight: 600; }

/* Inline contacts inside preview card */
.upload-preview-contacts .form-text { font-size: .875rem; }

/* Add more button */
.btn-outline-dashed {
  border: 2px dashed rgba(0,0,0,0.2);
  background: transparent;
  color: inherit;
  border-radius: 12px;
}
.btn-outline-dashed:hover {
  background: #fff;
}

.feature { background: #fff; border-radius: 12px; border: 1px solid rgba(0,0,0,0.05); }

/* Footer */
footer .nav-link { color: inherit; opacity: 0.8; }
footer .nav-link:hover { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .feature { transition: transform .2s ease, box-shadow .2s ease; }
  .feature:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
}


/* Microcopy under hero CTA */
.microcopy { max-width: 720px; }

/* Portfolio table */
.portfolio-table th, .portfolio-table td { vertical-align: middle; }
.portfolio-table th { white-space: nowrap; }
.portfolio-table td:first-child { width: 28%; }
.portfolio-table td:nth-child(2) { width: 32%; }
.portfolio-table td:nth-child(3) { width: 40%; }


/* Gallery grid (masonry-like) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 6px; /* базовая высота строки для расчёта спанов: меньше — точнее */
  gap: 12px;
}
.gallery-item {
  display: block;
  margin: 0; /* сброс стандартных отступов figure */
  break-inside: avoid;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
}

/* Галерея: видео-оверлей и подпись */
.gallery-card {
  position: relative;
}
.gallery-card .media {
  position: relative;
  height: 100%;
}

.gallery-card .media img {
  width: 100%;
  height: auto;
  display: block;
  height: 100%;
  object-fit: cover;
}

.gallery-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.gallery-card:hover video { opacity: 1; }

.gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.45) 60%, rgba(0,0,0,0.65) 100%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.gallery-caption .title { font-weight: 600; font-size: 14px; line-height: 1.2; }
.gallery-caption .cta {
  background: #fff;
  color: #000;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
}

@media (max-width: 1200px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

#add-more:hover {
  border-color: rgba(0,0,0,0.2) !important;
}

/* Upload: mobile layout — image and prompt full width stacked */
@media (max-width: 768px) {
  .upload-item {
    flex-direction: column;
    align-items: stretch; /* override bootstrap align-items-start for full-width children */
  }
  .upload-thumb {
    width: 100%;
    height: auto;
    flex: 0 0 auto;
  }
  /* Gallery simple mode: add vertical spacing between photos */
  .gallery-grid[data-mode="simple"] .gallery-item { margin-bottom: 12px; }
}