/* === Базовая стилизация === */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #fff;
  color: #222;
  line-height: 1.6;
}

a {
  color: #222;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f7f7f7;
  padding: 20px 40px;
  border-bottom: 1px solid #ddd;
}

.logo {
  font-weight: 700;
  font-size: 24px;
  color: #222;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
}

nav a {
  font-weight: 600;
  font-size: 16px;
  color: #222;
  transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
  color: #555;
}

main {
  min-height: 80vh;
}

/* Секции и контейнеры */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 60px 40px;
}

/* Главная страница */
.hero img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.intro h1,
.about h1,
.contact h2,
.preview h2,
.gallery h2 {
  font-size: 32px;
  margin-bottom: 20px;
}

/* Сетка работ */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.artwork img {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.artwork img:hover {
  transform: scale(1.05);
}

/* Кнопки */
.button {
  display: inline-block;
  padding: 12px 24px;
  background-color: #222;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.button:hover {
  background-color: #555;
}

.center-button {
  text-align: center;
  margin-top: 20px;
}

/* Обо мне и Контакты */
.about p,
.contact p,
.contact ul {
  font-size: 16px;
  margin-bottom: 16px;
}

.contact ul {
  padding-left: 20px;
}

.contact ul li {
  margin-bottom: 8px;
}

/* === Страница отдельной работы === */
.single-work {
  padding: 60px 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.single-work .container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.work-image {
  width: 100%;
  max-width: 800px;
  border: 1px solid #ccc;
  padding: 8px;
  background: #f9f9f9;
  margin: 0 auto;
}

.work-info h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

.work-info p {
  margin-bottom: 10px;
}

.work-info .description {
  margin-top: 20px;
}

/* Кнопка "Назад в портфолио" */
.back-button {
  margin-top: 30px;
  text-align: center;
}

.back-button .button {
  display: inline-block;
  padding: 12px 24px;
  background-color: #222;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.back-button .button:hover {
  background-color: #555;
}

/* === Футер === */
footer {
  text-align: center;
  padding: 30px 20px;
  font-size: 14px;
  color: #888;
  border-top: 1px solid #ddd;
  background-color: #f7f7f7;
}

/* === Адаптивность === */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px 20px;
  }

  nav ul {
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
  }

  nav a {
    padding: 10px 0;
    display: block;
    border-bottom: 1px solid #eee;
  }

  .intro, .about, .contact, .preview, .gallery, .single-work {
    padding: 40px 20px;
  }

  .gallery h2,
  .preview h2,
  .about h1,
  .contact h2 {
    font-size: 24px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero img {
    max-height: 50vh;
    object-fit: cover;
  }

  .logo {
    font-size: 20px;
  }

  .center-button {
    margin-top: 20px;
  }
}

@media (max-width: 480px) {
  .preview .button,
  .back-button .button {
    padding: 10px 16px;
    font-size: 14px;
  }

  footer {
    font-size: 12px;
    padding: 20px;
  }
}