/* =======================================================
   БАЗОВЫЕ НАСТРОЙКИ
======================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #0f0f13;
  --text-main: #e5e7eb;
  --accent: #d946ef;
  --card-bg: rgba(255, 255, 255, 0.04);
  --shadow: 0 12px 30px rgba(217, 70, 239, 0.12);
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

button {
  outline: none;
  border: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =======================================================
   ТИПОГРАФИКА И АКЦЕНТЫ
======================================================= */
h1, h2, h3 {
  font-family: 'Montserrat', sans-serif;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.05;
  margin-bottom: 18px;
}

p {
  color: #b4b7c0;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 16px 28px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 45px rgba(217, 70, 239, 0.28);
}

/* =======================================================
   НАВИГАЦИЯ
======================================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(15, 15, 19, 0.9);
  backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 76px;
}

.logo {
  font-size: 1.4rem;
  color: white;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-btn {
  padding: 12px 24px !important;
  font-size: 0.95rem;
}

/* =======================================================
   HERO-СЕКЦИЯ
======================================================= */
.hero {
  min-height: 90vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg {
  position: fixed;
  top: 50px;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52%;
  z-index: -2;
  pointer-events: none;
  transition: filter 0.5s ease;
}

.blurred {
  outline: none;
  /* filter: blur(10px); */
}

.loaded {
  filter: blur(0px);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 20, 25, 0.68);
  z-index: -1;
}

.hero .container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  border-radius: 24px;
}

.sub-title {
  color: white;
  margin-bottom: 1rem;
}

/* =======================================================
   ПОРТФОЛИО
======================================================= */

/* Заголовки категорий */
.gallery-category-title {
  font-size: clamp(1.3rem, 4vw, 2rem);
  color: white;
  margin-top: 56px;
}

/* Фильтры */
.filter-container {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filters {
  text-align: center;
  margin-bottom: 32px;
}

.filters .filter-btn,
.filter-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #b4b7c0;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.filters .filter-btn:hover,
.filters .filter-btn.active,
.filter-btn:hover,
.filter-btn.active {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
}

/* Сетка портфолио */
.gallery {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.gallery-item {
  display: block;
  overflow: hidden;
  border-radius: 20px;
  position: relative;
  animation: fadeIn 0.6s ease forwards;
}

.gallery-item.hidden {
  display: none;
  animation: none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.5s ease, transform 0.6s ease;
}

.gallery-item:hover img {
  filter: brightness(1.08) contrast(1.05);
  transform: scale(1.08);
}

.gallery figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), transparent);
  padding: 32px 24px;
  font-size: 0.95rem;
  color: #e5e7eb;
}

.gallery figcaption strong {
  color: var(--accent);
}

/* =======================================================
   УСЛУГИ И ОБО СЕКЦИИ
======================================================= */
section {
  padding: 40px 0;
}

.services, .about {
  background: #141419;
}

.services h2 {
  text-align: center;
  margin-bottom: 14px;
  padding-top: 14px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 32px;
}

.service-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 40px 32px;
  transition: transform 0.4s ease;
}

.service-card:hover {
  transform: translateY(-8px);
}

.icon {
  font-size: 2.8rem;
  display: block;
  margin-bottom: 16px;
}

.service-card h3 {
  font-family: 'Montserrat', sans-serif;
  color: white;
  font-size: 1.5rem;
  margin-bottom: 14px;
}

/* =======================================================
   КОНТАКТЫ И FOOTER
======================================================= */
.contact-card {
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.08), transparent);
  border-radius: 32px;
  padding: 64px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

input, textarea {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 18px;
  border-radius: 12px;
  color: white;
  font-family: inherit;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

footer {
  text-align: center;
  padding: 32px 0;
  color: #a1a5b0;
}

footer a {
  color: inherit;
  margin-left: 16px;
  transition: 0.3s;
}

footer a:hover {
  color: white;
}

/* =======================================================
   МОДАЛЬНОЕ ОКНО
======================================================= */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(25, 32, 44, 0.9);
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 95%;
  max-height: 90vh;
}

.modal-content {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 16px;
  margin: 0;
}

.modal-caption {
  margin-top: 20px;
  text-align: center;
  font-size: clamp(1rem, 2vw, 1.4rem);
  color: #eee;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 10px;
  z-index: 10000;
  transition: 0.2s ease;
}

.modal-prev {
  left: 40px;
}

.modal-next {
  right: 40px;
}

.modal-nav:hover {
  transform: translateY(-50%) scale(1.1);
}

.close {
  position: absolute;
  top: 50px;
  right: 35px;
  color: #f7fafc;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

.close:hover, .close:focus {
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

/* =======================================================
   КАРУСЕЛЬ / SLIDER3D
======================================================= */
.slider3d {
  position: relative;
  width: 420px;
  user-select: none;
  align-self: center;
  margin-top: 75px;
}

.viewport {
  perspective: 1200px;
  overflow: visible;
  height: 240px;
}

.viewport:active {
  cursor: grabbing;
}

.track {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.slide {
  position: absolute;
  max-width: 460px;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #9333ea);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: bold;
  transform-style: preserve-3d;
  transition:
    transform 0.6s cubic-bezier(.2, .8, .2, 1),
    filter 0.6s,
    opacity 0.6s;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.nav {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 28px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  border-radius: 8px;
  z-index: 99;
}

.prev {
  left: -80%;
}

.next {
  right: -80%;
}

.nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* =======================================================
   АНИМАЦИИ
======================================================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* =======================================================
   АДАПТИВНОСТЬ
======================================================= */
@media (max-width: 968px) {
  .portfolio-category .carousel-track img {
    min-width: 300px;
    max-width: 300px;
  }
}

@media (max-width: 768px) {
  .nav-links, .hero-sub, footer a {
    display: none;
  }

  .modal-content {
    animation: none;
  }

  .modal-caption {
    display: none;
  }

  .close {
    display: none;
  }

  .portfolio-category .carousel-wrapper {
    gap: 5px;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .portfolio-category .carousel-track img {
    min-width: 100%;
    max-width: 100%;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .portfolio-category .carousel-track img {
    min-width: 100%;
  }
}

/* =======================================================
   ОБЩИЕ СТИЛИ СЕКЦИИ И БЛОКИ
======================================================= */
.section-title {
  text-align: center;
  margin-bottom: 16px;
}

.section-subtitle {
  text-align: center;
  margin: 0 auto 60px;
}

.portfolio-category {
  display: flex;
  flex-direction: column;
  margin-bottom: 220px;
}

.portfolio-category header h3 {
  margin: 0 0 10px;
}


/* ================= MOBILE FIX ================= */

@media (max-width: 768px) {

  /* ===== HERO ===== */
  .hero {
    min-height: 70vh;
    padding-top: 80px;
  }

  .hero .container {
    padding: 1.5rem;
    text-align: center;
  }

  h1 {
    font-size: clamp(2rem, 7vw, 2.8rem);
  }

  .sub-title {
    font-size: 0.95rem;
  }

  /* ===== NAV ===== */
  .navbar .container {
    height: 64px;
  }

  .logo {
    font-size: 1.1rem;
  }

  /* ===== SECTIONS ===== */
  section {
    padding: 50px 0;
  }

  .services-grid {
    gap: 20px;
  }

  .service-card {
    padding: 28px 20px;
  }

  /* ===== CONTACT ===== */
  .contact-card {
    padding: 32px 20px;
  }

  /* ===== PORTFOLIO CATEGORY ===== */
  .portfolio-category {
    margin-bottom: 40px;
  }

  /* ===== SLIDER ===== */
  .slider3d {
    width: 100%;
    margin-top: 30px;
    display: flex;
    justify-content: center;
  }

  .viewport {
    width: 100%;
    max-width: 340px;
    height: 220px;
    perspective: 700px;
    overflow: visible;
  }

  .track {
    height: 100%;
  }

  .slide {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 180px;
    border-radius: 12px;
  }

  /* кнопки */
  .nav {
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
  }

  .prev {
    left: -10px;
  }

  .next {
    right: -10px;
  }

  /* ===== MODAL ===== */
  .modal-content {
    max-height: 70vh;
  }

  .modal-nav {
    font-size: 34px;
  }

}

@media (max-width: 480px) {

  /* .slider3d {
    max-width: 280px;
  }

  .viewport {
    height: 180px;
  }

  .slide {
    max-width: 240px;
  } */

  .portfolio-category header h3 {
    font-size: 1.2rem;
  }

}


.consent-modal {
  display: none;
  position: fixed;
  inset: 0;
  /* padding: 24px; */
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  color: black !important;

  p {
    color: black !important;
  }
}

.consent-modal-wrapper {
  margin: auto;
  width: 90%;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: #fff;
  margin: 5vh auto;
  padding: 32px;
  max-height: 90vh;
  position: relative;
}

.consent-modal-content {
  position: relative;
  height: 100%;
  width: 100%;
  overflow-y: auto;
}

.consent-modal-close {
  position: absolute;
  top: 4px;
  right: 12px;
  font-size: 32px;
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
}

.consent-modal-body h3 {
  margin-top: 20px;
}

.consent-checkbox a {
  color: #0066ff;
  text-decoration: underline;
  cursor: pointer;
}

.consent-modal-footer {
  display: flex;
  justify-items: center;
  align-items: center;
  flex-direction: column;

  button {
    padding: 8px 24px;
    font-size: 16px;
  }
}


.preview {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.preview-item {
  position: relative;
  width: 120px;
  height: 120px;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.preview-item button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: red;
  color: #fff;
  cursor: pointer;
}

.input-file {
  position: relative;
  display: inline-block;
}

.input-file-btn {
  position: relative;
  display: inline-block;
  cursor: pointer;
  outline: none;
  text-decoration: none;
  font-size: 14px;
  vertical-align: middle;
  color: rgb(255 255 255);
  text-align: center;
  border-radius: 4px;
  background-color: #419152;
  line-height: 22px;
  height: 40px;
  padding: 10px 20px;
  box-sizing: border-box;
  border: none;
  margin: 0;
  transition: background-color 0.2s;
}

.input-file-text {
  padding: 0 10px;
  line-height: 40px;
  display: inline-block;
}

.input-file input[type=file] {
  position: absolute;
  z-index: -1;
  opacity: 0;
  display: block;
  width: 0;
  height: 0;
}

/* Focus */
.input-file input[type=file]:focus+.input-file-btn {
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}

/* Hover/active */
.input-file:hover .input-file-btn {
  background-color: #59be6e;
}

.input-file:active .input-file-btn {
  background-color: #2E703A;
}

/* Disabled */
.input-file input[type=file]:disabled+.input-file-btn {
  background-color: #eee;
}