* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #5a4b3c;
  --primary-dark: #3f3328;
  --secondary-color: #b9853d;
  --accent-color: #7b8a5a;
  --text-color: #3e3b36;
  --light-gray: #f2efe9;
  --dark-gray: #6e665d;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== АНИМАЦИЯ ДЕРЕВЯННЫХ ВОРОТ ===== */
@keyframes gateOpen {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    pointer-events: none;
  }
}

@keyframes gateLeftSlide {
  0% {
    transform: translateX(0) rotateY(0deg);
  }
  100% {
    transform: translateX(-100%) rotateY(-15deg);
  }
}

@keyframes gateRightSlide {
  0% {
    transform: translateX(0) rotateY(0deg);
  }
  100% {
    transform: translateX(100%) rotateY(15deg);
  }
}

.gates-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 9999;
  display: flex;
  overflow: hidden;
  animation: gateOpen 3.5s ease-in-out forwards;
  background: linear-gradient(135deg, #5a4b3c 0%, #3f3328 100%);
  perspective: 1000px;
}

.gate {
  width: 50%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;

  /* БАЗОВЫЙ ЦВЕТ ДЕРЕВА */
  background:
    linear-gradient(
      90deg,
      #6b5a48 0%,
      #745f4c 20%,
      #645242 50%,
      #7a6450 80%,
      #6b5a48 100%
    );

  box-shadow:
    inset -6px 0 12px rgba(0,0,0,0.35),
    inset 2px 0 4px rgba(255,255,255,0.15);

  border-right: 4px solid #3f3328;
}

/* РЕАЛИСТИЧНЫЕ ДОСКИ */
.gate::before {
  content: '';
  position: absolute;
  inset: 0;

  background:
    repeating-linear-gradient(
      0deg,
      rgba(0,0,0,0.35) 0px,
      rgba(0,0,0,0.35) 3px,
      transparent 3px,
      transparent 72px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.08) 0px,
      rgba(255,255,255,0.08) 1px,
      transparent 1px,
      transparent 6px
    );

  mix-blend-mode: multiply;
  pointer-events: none;
}

/* ВОЛОКНА ДЕРЕВА */
.gate::after {
  content: '';
  position: absolute;
  inset: 0;

  background:
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,0.15) 0px,
      rgba(0,0,0,0.15) 1px,
      transparent 1px,
      transparent 18px
    ),
    linear-gradient(
      90deg,
      rgba(255,255,255,0.05),
      rgba(0,0,0,0.15)
    );

  opacity: 0.9;
  pointer-events: none;
}


.gate-left {
  animation: gateLeftSlide 3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  border-left: 3px solid #5a4b3c;
}


.gate-right {
  animation: gateRightSlide 3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  border-right: 3px solid #5a4b3c;
  border-left: none;
}


/* Петли ворот */
.gate .hinge {
  position: absolute;
  width: 30px;
  height: 12px;
  background: radial-gradient(circle, #c0a080 0%, #8a6a50 100%);
  border-radius: 50%;
  box-shadow: inset -1px -1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(255, 255, 255, 0.2);
  z-index: 5;
}

.gate-left .hinge {
  right: -15px;
}

.gate-right .hinge {
  left: -15px;
}

/* ===== ЗАКРЕПЛЕННЫЙ КОНТАКТ ВИДЖЕТ ===== */
.contact-widget {
  position: fixed;
  right: 20px;
  top: 150px;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  z-index: 100;
  width: 260px;
  transition: all 0.3s ease;
  animation: slideInRight 0.8s ease-out forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.contact-header {
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 12px;
  margin-bottom: 15px;
  text-align: center;
}

.contact-name {
  color: var(--secondary-color);
  font-size: 16px;
  font-weight: 700;
}

.contact-info {
  margin-bottom: 15px;
}

.phone {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.phone i {
  color: var(--primary-color);
  font-size: 18px;
}

.phone a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.3s ease;
}

.phone a:hover {
  color: var(--secondary-color);
}

.messengers {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 15px;
}

.messenger {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  text-decoration: none;
  transition: all 0.3s ease;
  transform-origin: center;
}

.messenger.telegram {
  background: linear-gradient(135deg, #3f7a93 0%, #2f667d 100%);
}

.messenger.telegram:hover {
  transform: scale(1.2) rotate(10deg);
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4);
}

.messenger.vk {
  background: linear-gradient(135deg, #5b6f9a 0%, #4a5f88 100%);
}

.messenger.vk:hover {
  transform: scale(1.2) rotate(-10deg);
  box-shadow: 0 4px 12px rgba(74, 127, 219, 0.4);
}

.messenger.max {
  background: linear-gradient(135deg, #b66a5b 0%, #9f5a4e 100%);
}

.messenger.max:hover {
  transform: scale(1.2) rotate(10deg);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.max-icon {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.call-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.call-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(90, 75, 60, 0.4);
}

.call-btn:active {
  transform: translateY(0);
}

/* ===== HERO СЕКЦИЯ ===== */
.hero-section {
  position: relative;
  height: 100vh;
  min-height: 600px;
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
              url('images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(90, 75, 60, 0.75) 0%, rgba(63, 51, 40, 0.85) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.main-title {
  font-size: 54px;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.main-subtitle {
  font-size: 36px;
  color: var(--secondary-color);
  margin-bottom: 25px;
  font-weight: 600;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.hero-thesis {
  font-size: 18px;
  margin-bottom: 40px;
  opacity: 0.95;
  font-weight: 500;
  letter-spacing: 1px;
}

.cta-btn {
  background: linear-gradient(135deg, var(--secondary-color), #9c6f2e);
  color: white;
  border: none;
  padding: 16px 48px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(185, 133, 61, 0.5);
}

.cta-btn:active {
  transform: translateY(-1px);
}

/* ===== УСЛУГИ ===== */
.services-section {
  padding: 80px 0;
  background: white;
}

.services-section h2 {
  font-size: 42px;
  text-align: center;
  margin-bottom: 60px;
  color: var(--primary-color);
  position: relative;
  padding-bottom: 20px;
}

.services-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--secondary-color);
  border-radius: 2px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

.service-card {
  background: var(--light-gray);
  padding: 40px 30px;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 3px;
  background: var(--secondary-color);
  transition: left 0.3s ease;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.service-card:hover::before {
  left: 0;
}

.service-card i {
  font-size: 48px;
  color: var(--primary-color);
  margin-bottom: 20px;
  display: block;
}

.service-card h3 {
  font-size: 24px;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.service-card p {
  color: var(--dark-gray);
  font-size: 15px;
  line-height: 1.6;
}

.services-description {
  background: linear-gradient(135deg, #f2efe9, #e6dfd6);
  padding: 40px;
  border-radius: 12px;
  border-left: 5px solid var(--primary-color);
}

.services-description h3 {
  color: var(--primary-color);
  font-size: 28px;
  margin-bottom: 15px;
}

.services-description p {
  color: var(--dark-gray);
  font-size: 16px;
  line-height: 1.8;
}

/* ===== ЦЕНЫ ===== */
.prices-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #f4f1ec, #ece6dd);
}

.prices-section h2 {
  font-size: 42px;
  text-align: center;
  margin-bottom: 60px;
  color: var(--primary-color);
  position: relative;
  padding-bottom: 20px;
}

.prices-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--secondary-color);
  border-radius: 2px;
}

.price-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.price-item {
  background: white;
  padding: 40px 30px;
  border-radius: 12px;
  text-align: center;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
}

.price-item:hover {
  transform: translateY(-10px);
  border-color: var(--secondary-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.price-item.featured {
  border-color: var(--secondary-color);
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(243, 156, 18, 0.2);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--secondary-color);
  color: white;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.price-item h3 {
  color: var(--primary-color);
  font-size: 24px;
  margin-bottom: 20px;
}

.price {
  font-size: 42px;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 10px;
}

.price-text {
  color: var(--dark-gray);
  font-size: 14px;
  margin-bottom: 20px;
}

.price-note {
  text-align: center;
  color: var(--dark-gray);
  font-size: 14px;
  font-style: italic;
}

/* ===== ПОРТФОЛИО ===== */
.portfolio-section {
  padding: 80px 0;
  background: white;
}

.portfolio-section h2 {
  font-size: 42px;
  text-align: center;
  margin-bottom: 60px;
  color: var(--primary-color);
  position: relative;
  padding-bottom: 20px;
}

.portfolio-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--secondary-color);
  border-radius: 2px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  height: 280px;
  cursor: pointer;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.portfolio-item:hover img {
  transform: scale(1.1);
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(90, 75, 60, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-overlay p {
  color: white;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

/* ===== КОНТАКТЫ ===== */
.contact-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #5a4b3c, #3f3328);
  color: white;
}

.contact-section h2 {
  font-size: 42px;
  text-align: center;
  margin-bottom: 60px;
  color: var(--secondary-color);
  position: relative;
  padding-bottom: 20px;
}

.contact-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--secondary-color);
  border-radius: 2px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.contact-item {
  text-align: center;
}

.contact-item i {
  font-size: 48px;
  color: var(--secondary-color);
  margin-bottom: 20px;
  display: block;
}

.contact-item h3 {
  font-size: 22px;
  margin-bottom: 15px;
}

.contact-item p {
  font-size: 18px;
  opacity: 0.9;
}

.contact-item a {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.3s ease;
}

.contact-item a:hover {
  opacity: 0.8;
}

/* ===== FOOTER ===== */
.footer {
  background: #2a2420;
  color: white;
  text-align: center;
  padding: 30px 0;
  font-size: 14px;
}

.footer p {
  margin: 5px 0;
  opacity: 0.8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .main-title {
    font-size: 38px;
  }

  .main-subtitle {
    font-size: 26px;
  }

  .hero-thesis {
    font-size: 16px;
  }

  .contact-widget {
    position: relative;
    right: auto;
    top: auto;
    width: calc(100% - 40px);
    margin: 20px auto;
    animation: none;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .price-item.featured {
    transform: scale(1);
  }

  .cta-btn {
    padding: 12px 32px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 28px;
  }

  .main-subtitle {
    font-size: 20px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .services-section h2,
  .prices-section h2,
  .portfolio-section h2,
  .contact-section h2 {
    font-size: 32px;
  }
}
