* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #111;
  color: #eaeaea;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
}

/* ================= HERO ================= */

.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* изображения слайдера */
.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 0;
  pointer-events: none; /* ВАЖНО */
}

.hero-image.active {
  opacity: 1;
}

/* затемнение */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
  pointer-events: none;
}

/* текст по центру */
.hero-content {
  position: relative;
  z-index: 3;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  pointer-events: none;   /* ВАЖНО */
}

.hero-content h1,
.hero-content p {
  pointer-events: auto;
}

/* контролы снизу слева */
.hero-controls {
  position: absolute;
  bottom: 30px;
  left: 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  letter-spacing: 2px;
  z-index: 3;
}

.hero-prev,
.hero-next {
  cursor: pointer;
  position: relative;
  padding: 5px 0;
}

.hero-prev::before,
.hero-next::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 80px;
  height: 1px;
  background: rgba(255,255,255,0.7);
}

.hero-prev::before {
  right: 120%;
}

.hero-next::after {
  left: 120%;
}

.hero-counter {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ================= PORTFOLIO ================= */

.portfolio {
  padding: 120px 0;
}

.portfolio-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 120px;
}

.category {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.category h2 {
  margin-bottom: 15px;
  font-size: 1.4rem;
}

/* ================= MAIN PHOTO ================= */

.main-photo {
  flex: 1;
}

.main-photo img {
  width: 100%;
  height: auto;
  max-height: 55vh;
  object-fit: contain;
  display: block;
  margin-bottom: 12px;
  transition: opacity 0.45s ease, transform 0.3s ease;
  cursor: pointer;
}

.main-photo img.fade {
  opacity: 0;
}

/* ================= THUMBS ================= */

.thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.thumbs img {
  width: 100%;
  height: auto;
  max-height: 70px;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
  cursor: pointer;
}

/* hover только масштаб */
.main-photo img:hover,
.thumbs img:hover {
  transform: scale(1.04);
}

/* активная миниатюра */
.thumbs img.active {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: -2px;
  opacity: 1;
}

.thumbs img:not(.active) {
  opacity: 0.6;
}

/* ================= ABOUT ================= */

.about {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 120px 0;
  align-items: center;
}

.about-photo img {
  width: 100%;
  display: block;
}

.about-text h2 {
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.about-text p {
  margin-bottom: 20px;
  max-width: 500px;
}

.contacts a {
  display: inline-block;
  margin-right: 15px;
  color: #eaeaea;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

.contacts a:hover {
  border-color: #fff;
}

/* ================= FOOTER ================= */

.footer {
  text-align: center;
  padding: 40px;
  font-size: 0.9rem;
  opacity: 0.6;
}

/* ================= LIGHTBOX ================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
}

/* ================= ADAPTIVE ================= */

@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 100px;
  }

  .thumbs {
    grid-template-columns: repeat(3, 1fr);
  }

  .about {
    grid-template-columns: 1fr;
    padding: 100px 20px;
  }
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .portfolio {
    padding: 80px 0;
  }

  .portfolio-grid {
    padding: 0 20px;
    gap: 80px;
  }

  .thumbs {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-photo img {
    max-height: 40vh;
  }
}
