:root {
  --bg-main: #05040b;
  --bg-alt: #0f0d1a;
  --accent: #a56bff;
  --accent-soft: rgba(165, 107, 255, 0.16);
  --text-main: #f7f4ff;
  --text-muted: #b4afc8;
  --border-soft: rgba(255, 255, 255, 0.06);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.5);
  --max-width: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1b1230 0, #05040b 55%);
  color: var(--text-main);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  padding: 80px 0;
}

.section-alt {
  background: radial-gradient(circle at top right, #24163f 0, #05040b 55%);
}

.section-title {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 700;
}

.section-subtitle {
  margin: 0 0 32px;
  max-width: 540px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: linear-gradient(
    to bottom,
    rgba(5, 4, 11, 0.96),
    rgba(5, 4, 11, 0.86),
    rgba(5, 4, 11, 0)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #ffe7ff 0, #a56bff 45%, #20093d 100%);
  box-shadow: 0 0 18px rgba(165, 107, 255, 0.9);
  font-size: 16px;
}

.logo-text {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  color: var(--text-muted);
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
  background: var(--accent-soft);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text-main);
  border-radius: 999px;
}

.hero {
  padding: 56px 0 72px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr);
  align-items: center;
  gap: 32px;
}

.hero-text h1 {
  margin: 0 0 16px;
  font-size: 36px;
  line-height: 1.2;
}

.hero-text p {
  margin: 0 0 24px;
  max-width: 480px;
  color: var(--text-muted);
  line-height: 1.7;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 999px;
  border: none;
  outline: none;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: #0c041b;
  background: radial-gradient(circle at top, #ffd6ff 0, #a56bff 55%, #f4d7ff 100%);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 28px rgba(165, 107, 255, 0.9);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-full {
  width: 100%;
}

.hero-image {
  display: flex;
  justify-content: center;
}

.hero-photo {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 230, 255, 0.18) 0, rgba(126, 75, 255, 0.08) 40%, rgba(5, 4, 11, 0.12) 100%),
    url("images/main.jpg") center/cover no-repeat;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.9);
  position: relative;
  overflow: hidden;
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.5), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.4;
}

.gallery-grid,
.books-grid,
.reviews-grid,
.features-grid,
.editing-grid {
  display: grid;
  gap: 20px;
}

.gallery-grid,
.books-grid,
.reviews-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.features-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 32px;
}

.editing-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-item,
.book-card,
.feature-card,
.before-after-card,
.restore-card,
.review-card,
.contacts-form-wrapper {
  background: rgba(10, 7, 24, 0.96);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.gallery-item,
.book-card {
  overflow: hidden;
  cursor: grab;
}

.gallery-item:active,
.book-card:active {
  cursor: grabbing;
}

.gallery-image,
.book-image {
  display: none;
  width: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.gallery-image {
  height: 220px;
}

.book-image {
  height: 200px;
}

.gallery-image.active,
.book-image.active {
  display: block;
}

.gallery-content,
.book-content {
  padding: 14px 16px 16px;
}

.gallery-content h3,
.book-content h3,
.feature-card h3,
.before-after-card h3,
.restore-content h3 {
  margin: 0 0 8px;
}

.gallery-content p,
.book-content p,
.feature-card p,
.before-after-text,
.restore-content p,
.review-text,
.contacts-note,
.form-hint {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.feature-card {
  padding: 16px 18px 18px;
}

.before-after-card {
  padding: 18px;
}

.before-after {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: ew-resize;
  background: #120d20;
  touch-action: none;
}

.before-after img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.before-after-after {
  clip-path: inset(0 50% 0 0);
}

.before-after-handle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 100%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.before-after-handle::before {
  content: "↔";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(165, 107, 255, 0.95);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.before-after-text {
  margin-top: 12px;
}

.restore-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.restore-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  padding: 16px 18px;
}

.restore-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.review-card {
  padding: 16px 18px;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.review-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at top, #ffe7ff 0, #a56bff 50%, #240c47 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.contacts-container {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 1fr);
  gap: 26px;
  align-items: flex-start;
}

.contacts-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  font-size: 14px;
}

.contacts-list li {
  margin-bottom: 6px;
}

.contacts-list a,
.footer-link {
  color: var(--accent);
  text-decoration: none;
}

.contacts-form-wrapper {
  padding: 18px;
}

.contacts-form h3 {
  margin: 0 0 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.form-row label {
  font-size: 13px;
  color: var(--text-muted);
}

.form-row input,
.form-row textarea {
  padding: 9px 11px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 5, 16, 0.9);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(165, 107, 255, 0.3);
}

.footer {
  padding: 18px 0 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #05040b;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .hero-inner,
  .contacts-container,
  .restore-card {
    grid-template-columns: 1fr;
  }

  .gallery-grid,
  .books-grid,
  .reviews-grid,
  .features-grid,
  .editing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-image {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .header-inner {
    padding-inline: 10px;
  }

  .nav-list {
    position: absolute;
    right: 12px;
    top: 56px;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(7, 5, 16, 0.98);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px;
    box-shadow: var(--shadow-soft);
    min-width: 200px;
    transform-origin: top right;
    transform: scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
  }

  .nav-list.open {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-link {
    width: 100%;
  }

  .hero {
    padding-top: 32px;
  }

  .hero-text h1 {
    font-size: 28px;
  }

  .section {
    padding: 56px 0;
  }

  .gallery-grid,
  .books-grid,
  .reviews-grid,
  .features-grid,
  .editing-grid {
    grid-template-columns: 1fr;
  }

  .before-after {
    height: 260px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
.gallery-item,
.book-card {
  position: relative;
}

.slider-arrow {
  position: absolute;
  top: 95px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: rgba(5, 4, 11, 0.55);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, transform 0.2s ease;
}

.slider-arrow:hover {
  background: rgba(165, 107, 255, 0.9);
}

.slider-arrow-prev {
  left: 10px;
}

.slider-arrow-next {
  right: 10px;
}

@media (max-width: 720px) {
  .slider-arrow {
    width: 42px;
    height: 42px;
    font-size: 28px;
    top: 100px;
  }
}
.restore-carousel {
  position: relative;
}

.restore-slides {
  position: relative;
}

.restore-slide {
  display: none;
}

.restore-slide.active {
  display: block;
}

.restore-arrow {
  position: absolute;
  top: 160px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: rgba(5, 4, 11, 0.55);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, transform 0.2s ease;
}

.restore-arrow:hover {
  background: rgba(165, 107, 255, 0.9);
}

.restore-arrow-prev {
  left: 10px;
}

.restore-arrow-next {
  right: 10px;
}

.restore-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.restore-dot {
  width: 9px;
  height: 9px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.restore-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

@media (max-width: 720px) {
  .restore-arrow {
    width: 42px;
    height: 42px;
    font-size: 28px;
    top: 130px;
  }
}
