*{
	box-sizing: border-box;
}
body{
	font-family: 'Montserrat', sans-serif;
	line-height: 1.6;
	margin: 0;
	min-height: 100vh;
}

@media screen and (max-width:600px){
	section{
		width: 100%;
	}
}
/* =================================
   MAIN LAYOUT & COMMON
   ==================================== */
.main-content {
  width: 100%;
  padding: 40px 0;
}

/* =================================
   ТИП 1: Текстовые блоки
   ==================================== */
.text-blocks-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  padding: 0 20px;
  margin-bottom: 60px;
}

@media (min-width: 769px) {
  .text-blocks-container {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    padding: 0 5%;
  }
}

.text-block {
  background: #e9eef1;
  padding: 30px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  color: #222222; /* Черный текст */
}

.text-block h2 {
  margin: 0 0 15px 0;
  font-size: 1.6em;
  color: #34495e;
  border-bottom: 3px solid #718daa; /* Акцентная черта */
  padding-bottom: 8px;
  display: inline-block;
}

.text-block p {
  margin: 0;
  line-height: 1.7;
}

/* =================================
   ТИП 2: Hero-блок с фоном
   ==================================== */
.hero-block {
  width: 100%;
  min-height: 450px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Текст прижат вправо */
  margin-bottom: 60px;
  position: relative;
}

/* Легкий градиент слева, чтобы фон не "съедал" текст */
.hero-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.2) 40%, transparent 40%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 50%; /* Текст занимает половину */
  padding: 40px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  border-radius: 6px 0 0 6px;
  color: var(--hero-text-color, #34495e); /* Легко менять через inline-style */
}

.hero-content h2 {
  margin: 0 0 15px 0;
  font-size: 2em;
  color: inherit;
}

.hero-content p {
  margin: 0;
  line-height: 1.7;
}
@media (max-width: 768px) {
  .hero-content {
    width: 100%;
    border-radius: 0;
    background: rgba(0,0,0,0.65); /* На мобильных текст на полупрозрачном фоне */
    color: #ffffff !important;
  }
  .hero-block::before { background: none; }
}
/* =================================
   ГАЛЕРЕЯ ПРОЕКТОВ (СЕТКА)
   ==================================== */
.projects-gallery {
  padding: 40px 20px;
  text-align: center;
}

.projects-gallery h2 {
  margin: 0 auto 30px;
  font-size: 1.6em;
  color: #34495e;
  border-bottom: 3px solid #718daa;
  padding-bottom: 8px;
  display: inline-block;
  text-align: center;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.project-card {
  background: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.card-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.project-card:hover .card-image img {
  transform: scale(1.03);
}

.card-content {
  padding: 18px;
  text-align: left;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-content h3 {
  margin: 0;
  font-size: 1.1em;
  color: #34495e;
  line-height: 1.3;
}

.card-content p {
  margin: 0;
  font-size: 1em; /* Шрифт не уменьшен, как просили */
  color: #444;
  line-height: 1.5;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}
/* =================================
   МОДАЛЬНОЕ ОКНО ПРОЕКТА
   ==================================== */
.project-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 2000;
  padding: 20px;
  cursor: pointer; /* Клик по фону закрывает */
}

.project-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.project-modal {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 850px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  transform: translateY(25px);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: default;
}

.project-modal-overlay.active .project-modal {
  transform: translateY(0);
}

.modal-close {
  position: sticky;
  top: 15px;
  margin-left: calc(100% - 45px);
  background: #f4f7f9;
  border: 1px solid #ddd;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.5em;
  line-height: 1;
  color: #34495e;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #fff;
  color: #d32f2f;
  border-color: #d32f2f;
}

.modal-body {
  padding: 30px;
}

.modal-hero {
  width: 50%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 25px;
  display: block;
}

#modal-title {
  margin: 0 0 20px;
  font-size: 1.6em;
  color: #34495e;
  border-bottom: 3px solid #718daa;
  padding-bottom: 8px;
  display: inline-block;
}

.modal-text {
  color: #444;
  line-height: 1.7;
  font-size: 1em; /* Шрифт не уменьшен */
  margin-bottom: 30px;
}


/* Адаптив модалки */
@media (max-width: 768px) {
  .project-modal-overlay { padding: 10px; }
  .project-modal { max-height: 95vh; border-radius: 6px; }
  .modal-body { padding: 20px; }
  .modal-close { margin-left: calc(100% - 40px); width: 32px; height: 32px; }
}
