/* ---------- общие стили ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #0a0a0a;
  color: #ffffff;
  overflow-x: hidden;
}

.lightbox-title {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.1em;
  background: rgba(0, 0, 0, 0.5);
  padding: 12px 28px;
  border-radius: 6px;
  text-align: center;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* ----- Video Background ----- */
.video-background {
  position: fixed; top: 0; left: 0; width: 100%; height: 100vh; z-index: 0;
  overflow: hidden; transition: opacity 1.5s ease;
}
.video-background.scrolled { opacity: 0.1; }
.video-slide {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 2s ease-in-out;
}
.video-slide.active { opacity: 1; }
.video-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.3); transition: background 1.5s ease;
}
.video-background.scrolled .video-overlay { background: rgba(0,0,0,0.9); }

/* ----- Navigation ----- */
nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  padding: 40px 64px; display: flex; flex-direction: column;
  align-items: center; gap: 24px; background: transparent;
  transition: all 0.5s ease;
}
nav.scrolled {
  background: rgba(10,10,10,0.95); backdrop-filter: blur(10px);
  padding: 19px 64px; gap: 16px;
}
.nav-left {
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
nav.scrolled .nav-left { flex-direction: row; gap: 48px; }
.logo {
  max-width: 800px; width: 100%; height: auto; display: block;
  transition: opacity 0.3s ease;
}
nav.scrolled .logo { max-width: 260px; }
.logo:hover { opacity: 0.8; }
.nav-links {
  display: flex; gap: 32px; align-items: center; flex-wrap: wrap;
  justify-content: center;
}
.nav-links a {
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  font-weight: 330;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1px; background: #fff;
  transition: width 0.3s ease;
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after { width: 100%; }

/* ----- Hero ----- */
.hero {
  position: relative; z-index: 1; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  align-items: center; text-align: center; opacity: 1;
  transition: opacity 1s ease;
}
.hero.scrolled { opacity: 0; pointer-events: none; }

/* ----- Gallery Sections ----- */
.gallery-section {
  position: relative; z-index: 2; padding: 96px 32px;
  min-height: 80vh; opacity: 0; transform: translateY(100px);
  transition: all 1s ease;
}
.gallery-section.visible { opacity: 1; transform: translateY(0); }
.gallery-section h2 {
  font-family: 'Roboto', sans-serif;
  font-size: 40px; font-weight: 300; letter-spacing: 0.2em;
  text-transform: uppercase; text-align: center;
  margin-bottom: 48px; color: rgba(255,255,255,0.9);
}

/* Masonry Layout */
.masonry-grid {
  column-count: 3; column-gap: 15px; max-width: 1400px;
  margin: 0 auto;
}
.gallery-item {
  break-inside: avoid; margin-bottom: 15px; position: relative;
  overflow: hidden; cursor: pointer; background: #1a1a1a;
}
.gallery-item img {
  width: 100%; height: auto; display: block;
  transition: transform 0.6s ease, opacity 0.6s ease;
  opacity: 0.9;
}
.gallery-item:hover img { transform: scale(1.05); opacity: 1; }

/* ----- Подписи (увеличены отступы) ----- */
.gallery-item-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 15px 20px 15px;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
  opacity: 0; transition: opacity 0.3s ease;
  color: rgba(255, 255, 255, 0.6);
}
.gallery-item:hover .gallery-item-info { opacity: 1; }
.gallery-item-title {
  font-family: 'Roboto', sans-serif;
  font-size: 17px; font-weight: 320; letter-spacing: 0.05em;
  margin-bottom: 4px;
  text-align: left;
}

/* ----- About & Contact ----- */
.about-section, .contact-section {
  position: relative; z-index: 2; padding: 128px 32px;
  min-height: 60vh; opacity: 0; transform: translateY(100px);
  transition: all 1s ease;
}
.about-section.visible, .contact-section.visible {
  opacity: 1; transform: translateY(0);
}
.about-section h2, .contact-section h2 {
  font-family: 'Roboto', sans-serif;
  font-size: 40px; font-weight: 300; letter-spacing: 0.2em;
  text-transform: uppercase; text-align: center;
  margin-bottom: 48px; color: rgba(255,255,255,0.9);
}

/* ----- Contact Form ----- */
.contact-form {
  max-width: 500px; margin: 0 auto; display: flex;
  flex-direction: column; gap: 20px;
}
.contact-form input, .contact-form textarea {
  width: 100%; padding: 14px 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-family: 'Roboto', sans-serif; font-size: 16px;
  transition: border-color 0.3s ease;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: rgba(255,255,255,0.6);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form button {
  padding: 14px 28px; background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff; font-family: 'Roboto', sans-serif;
  font-size: 16px; letter-spacing: 0.15em; text-transform: uppercase;
  cursor: pointer; transition: all 0.3s ease;
}
.contact-form button:hover {
  background: rgba(255,255,255,0.1); border-color: #fff;
}

/* ----- Loading ----- */
.video-loading {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: #0a0a0a; z-index: 2000;
  display: flex; justify-content: center; align-items: center;
  transition: opacity 0.5s ease;
}
.video-loading.hidden { opacity: 0; pointer-events: none; }
.loader {
  width: 40px; height: 40px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Scroll indicator ----- */
.scroll-indicator {
  opacity: 0.6; animation: bounce 2s infinite;
  cursor: pointer; transition: opacity 0.3s ease;
}
.scroll-indicator:hover { opacity: 1; }
@keyframes bounce {
  0%,20%,50%,80%,100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* ----- Lightbox ----- */
.lightbox-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.92);
  z-index: 3000; display: none;
  justify-content: center; align-items: center;
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.lightbox-overlay.active { display: flex; }
.lightbox-content {
  position: relative; max-width: 90%; max-height: 90%;
  display: flex; align-items: center; justify-content: center;
  cursor: default;
}
.lightbox-content img {
  max-width: 100%; max-height: 90vh; object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  border-radius: 4px;
}
.lightbox-close {
  position: absolute; top: 20px; right: 30px;
  font-size: 40px; color: #fff; cursor: pointer;
  transition: 0.2s; z-index: 10;
  background: none; border: none; font-family: inherit;
  line-height: 1;
}
.lightbox-close:hover { transform: scale(1.2); color: #ccc; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 48px; color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.3); border: none;
  padding: 10px 16px; cursor: pointer; transition: 0.2s;
  border-radius: 4px;
  user-select: none;
  z-index: 10;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.1); color: #fff; }
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

/* ----- АДАПТИВНОСТЬ ДЛЯ ПЛАНШЕТОВ (до 768px) ----- */
@media (max-width: 768px) {
  nav { flex-direction: column; gap: 16px; padding: 24px; }
  .nav-left { flex-direction: column; gap: 16px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 13px; letter-spacing: 0.2em; }
  .logo { max-width: 180px; }
  nav.scrolled .logo { max-width: 180px; }

  .gallery-section { padding: 64px 16px; }
  .gallery-section h2 { font-size: 29px; margin-bottom: 32px; }
  .masonry-grid { column-count: 2; column-gap: 10px; }
  .gallery-item { margin-bottom: 10px; }
  .gallery-item-info { padding: 12px 16px; }
  .gallery-item-title { font-size: 15px; }

  .about-section, .contact-section { padding: 80px 16px; }
  .about-section h2, .contact-section h2 { font-size: 29px; margin-bottom: 32px; }

  .lightbox-nav { font-size: 32px; padding: 12px 16px; } /* увеличил зону касания */
  .lightbox-close { top: 16px; right: 16px; font-size: 30px; }
  .lightbox-title {
    font-size: 16px;
    padding: 8px 16px;
    bottom: 24px;
    max-width: 90%;
  }
}

/* ----- АДАПТИВНОСТЬ ДЛЯ МАЛЕНЬКИХ ТЕЛЕФОНОВ (до 480px) ----- */
@media (max-width: 480px) {
  nav { padding: 16px; gap: 12px; }
  nav.scrolled { padding: 12px 16px; }
  .nav-links { gap: 10px; }
  .nav-links a { font-size: 11px; letter-spacing: 0.15em; }
  .logo { max-width: 140px; }
  nav.scrolled .logo { max-width: 140px; }

  .gallery-section { padding: 48px 12px; min-height: 60vh; }
  .gallery-section h2 { font-size: 22px; margin-bottom: 24px; }
  .masonry-grid { column-count: 1; column-gap: 0; }
  .gallery-item { margin-bottom: 8px; }
  .gallery-item-info { padding: 10px 12px; }
  .gallery-item-title { font-size: 13px; }

  .about-section, .contact-section { padding: 48px 12px; }
  .about-section h2, .contact-section h2 { font-size: 22px; margin-bottom: 24px; }
  .about-section p, .contact-section p { font-size: 15px; }

  .contact-form { gap: 12px; }
  .contact-form input, .contact-form textarea { padding: 12px 14px; font-size: 14px; }
  .contact-form button { padding: 12px 20px; font-size: 14px; }

  .lightbox-nav { 
    font-size: 28px; 
    padding: 16px 14px; /* ещё больше зона касания */
    background: rgba(0,0,0,0.5);
  }
  .lightbox-nav.prev { left: 8px; }
  .lightbox-nav.next { right: 8px; }
  .lightbox-close { top: 12px; right: 12px; font-size: 26px; }
  .lightbox-title {
    font-size: 14px;
    padding: 6px 14px;
    bottom: 16px;
    max-width: 90%;
    white-space: normal; /* разрешаем перенос на очень маленьких */
  }
  .lightbox-content img { max-height: 80vh; }

  .scroll-indicator svg { width: 24px; height: 24px; }
}