:root {
  --bg: #0e0e10;
  --card: #17171a;
  --text: #f4f4f5;
  --muted: #8b8b93;
  --accent: #c7c7cf;
  --shadow: rgba(0, 0, 0, 0.5);
  --line: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: "Manrope", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

.gallery-page { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Header ---------- */
.gallery-header { text-align: center; padding: 44px 20px 6px; }
.gallery-header__name {
  font-family: "Unbounded", sans-serif;
  font-weight: 200;
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.gallery-header__title {
  margin-top: 8px;
  font-size: clamp(0.7rem, 1.4vw, 0.9rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}

/* ---------- Tabs ---------- */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: clamp(0.72rem, 1.6vw, 0.85rem);
  letter-spacing: 0.04em;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  background: var(--text);
  color: #000;
  font-weight: 500;
}
@media (max-width: 460px) {
  .tab { padding: 9px 14px; }
}

/* ---------- Views ---------- */
.view { display: none; }
.view.is-active { display: block; animation: fadeView 0.4s ease; }
@keyframes fadeView { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Controls (динамичный вид) ---------- */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 6px 20px 22px;
}
.ctrl-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  padding: 9px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.ctrl-btn:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- Slider ---------- */
.gallery-slider { position: relative; display: flex; align-items: center; justify-content: center; padding: 6px 0 40px; }
.gallery-slider__viewport { width: min(100%, 1180px); padding: 0 12px; }
.swiper { padding: 20px 4px 40px; }
.swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}
.float-card {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border: none;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--card);
  box-shadow: 0 24px 60px var(--shadow), 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.float-card:hover {
  transform: scale(1.05);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.7), 0 12px 30px rgba(0, 0, 0, 0.5);
}
.float-card img { width: 100%; height: auto; object-fit: contain; aspect-ratio: 4 / 5; }

.swiper-pagination { position: static !important; margin-top: 14px; }
.swiper-pagination-bullet { background: var(--muted); opacity: 0.5; }
.swiper-pagination-bullet-active { background: var(--text); transform: scale(1.3); }

.nav-arrow {
  position: absolute;
  top: 46%;
  transform: translateY(-50%);
  z-index: 10;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(6px);
}
.nav-arrow svg { width: 22px; height: 22px; }
.nav-arrow:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); }
.nav-arrow--prev { left: clamp(8px, 3vw, 36px); }
.nav-arrow--next { right: clamp(8px, 3vw, 36px); }
.nav-arrow--prev:hover { transform: translateY(-50%) translateX(-3px); }
.nav-arrow--next:hover { transform: translateY(-50%) translateX(3px); }
@media (max-width: 640px) {
  .nav-arrow { display: none; }
}

/* ---------- Статичная галерея ---------- */
.view--grid { padding: 10px 20px 40px; }
.masonry {
  columns: 5 200px;
  column-gap: 18px;
  max-width: 1240px;
  margin: 0 auto;
}
.grid-card {
  display: block;
  width: 100%;
  margin-bottom: 18px;
  border: none;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: var(--card);
  break-inside: avoid;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.grid-card:hover {
  transform: scale(1.05);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.65);
}
.grid-card img { width: 100%; height: auto; object-fit: contain; }
@media (max-width: 1099px) and (min-width: 701px) { .masonry { columns: 3 220px; } }
@media (max-width: 700px) { .masonry { columns: 2 140px; column-gap: 12px; } .grid-card { margin-bottom: 12px; } }

/* ---------- Footer contacts ---------- */
.gallery-footer {
  text-align: center;
  padding: 52px 20px 64px;
  border-top: 1px solid var(--line);
}
.gallery-footer__label {
  color: var(--text);
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 26px;
}
.gallery-footer__contacts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.gallery-footer__item a {
  color: var(--text);
  text-decoration: none;
  font-size: clamp(1.25rem, 3.5vw, 1.7rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  transition: color 0.25s ease;
}
.gallery-footer__item a:hover { color: var(--accent); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 7, 0.92);
  backdrop-filter: blur(8px);
}
.lightbox.is-open { display: flex; }
.lightbox__frame {
  max-width: min(92vw, 900px);
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__frame img {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
  animation: fadeImg 0.3s ease;
}
@keyframes fadeImg { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
.lightbox__close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
}
.lightbox__close svg { width: 20px; height: 20px; }
.lightbox__close:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
}
.lightbox__arrow svg { width: 24px; height: 24px; }
.lightbox__arrow--prev { left: clamp(10px, 4vw, 48px); }
.lightbox__arrow--next { right: clamp(10px, 4vw, 48px); }
.lightbox__arrow:hover { background: rgba(255, 255, 255, 0.2); }
@media (max-width: 640px) {
  .lightbox__arrow { top: auto; bottom: 26px; transform: none; }
  .lightbox__close { top: 14px; right: 14px; }
}
